* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

header h1 {
  color: #2c3e50;
  font-size: 2rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #555;
}

.btn-ghost {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background-color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.btn-ghost:hover {
  background-color: #f0f0f0;
}

/* 登录区域 */
.login-section {
  max-width: 360px;
  margin: 60px auto 0;
  padding: 24px 28px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.login-section .form-group {
  margin-bottom: 16px;
}

.login-section label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #555;
}

.login-section input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
}

.login-section input:focus {
  outline: none;
  border-color: #3498db;
}

.login-section #loginBtn {
  width: 100%;
  margin-top: 10px;
  padding: 10px 0;
  border-radius: 6px;
  border: none;
  background-color: #3498db;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.login-section #loginBtn:hover {
  background-color: #2980b9;
}

.login-tip {
  margin-top: 10px;
  font-size: 12px;
  color: #e74c3c;
}

/* 桶管理 */
.bucket-section {
  margin-bottom: 24px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 16px 20px;
}

.bucket-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.bucket-row:last-child {
  margin-bottom: 0;
}

#bucketSelect {
  min-width: 160px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
}

.bucket-visibility {
  margin-left: 8px;
  font-size: 12px;
  color: #666;
}

.bucket-current-actions label,
.bucket-create label {
  font-size: 14px;
  color: #555;
}

.bucket-current-actions button,
.bucket-create button {
  margin-left: 8px;
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  background-color: #3498db;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.bucket-current-actions button:hover,
.bucket-create button:hover {
  background-color: #2980b9;
}

.bucket-create {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bucket-create input[type="text"] {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
  min-width: 260px;
}

.bucket-create input[type="text"]:focus {
  outline: none;
  border-color: #3498db;
}

/* 账户设置 */
.account-section {
  margin-bottom: 24px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 16px 20px;
}

.account-section h2 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #2c3e50;
}

.account-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.form-group-inline {
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.form-group-inline label {
  font-size: 14px;
  margin-bottom: 4px;
  color: #555;
}

.form-group-inline input {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
}

.form-group-inline input:focus {
  outline: none;
  border-color: #3498db;
}

.btn-primary {
  padding: 8px 14px;
  border-radius: 4px;
  border: none;
  background-color: #3498db;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.change-password-tip {
  font-size: 12px;
  color: #e67e22;
}

/* 上传区域 */
.upload-section {
  margin-bottom: 30px;
}

.upload-area {
  border: 2px dashed #ccc;
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #fff;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: #3498db;
  background-color: #ecf5ff;
}

.upload-icon {
  font-size: 48px;
  color: #3498db;
  margin-bottom: 10px;
}

.upload-area p {
  color: #666;
}

.upload-progress {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 20px;
  background-color: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3498db, #2ecc71);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  min-width: 50px;
  font-weight: bold;
  color: #3498db;
}

/* 搜索区域 */
.search-section {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-section input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}

.search-section input:focus {
  outline: none;
  border-color: #3498db;
}

.search-section button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

#searchBtn {
  background-color: #3498db;
  color: white;
}

#searchBtn:hover {
  background-color: #2980b9;
}

#refreshBtn {
  background-color: #95a5a6;
  color: white;
}

#refreshBtn:hover {
  background-color: #7f8c8d;
}

/* 文件表格 */
.files-section {
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.files-table {
  width: 100%;
  border-collapse: collapse;
}

.files-table th,
.files-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.files-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #2c3e50;
}

.files-table tr:hover {
  background-color: #f8f9fa;
}

.files-table .loading,
.files-table .empty {
  text-align: center;
  color: #999;
  padding: 40px;
}

.file-name {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  gap: 8px;
}

.file-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.btn-download {
  background-color: #2ecc71;
  color: white;
}

.btn-download:hover {
  background-color: #27ae60;
}

.btn-copy {
  background-color: #9b59b6;
  color: white;
}

.btn-copy:hover {
  background-color: #8e44ad;
}

.btn-delete {
  background-color: #e74c3c;
  color: white;
}

.btn-delete:hover {
  background-color: #c0392b;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background-color: #fff;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination span {
  color: #666;
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 10px;
  max-width: 400px;
  width: 90%;
}

.modal-content h3 {
  margin-bottom: 15px;
  color: #2c3e50;
}

.modal-content p {
  margin-bottom: 20px;
  color: #666;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.btn-cancel {
  background-color: #95a5a6;
  color: white;
}

.btn-cancel:hover {
  background-color: #7f8c8d;
}

.btn-danger {
  background-color: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

/* 全局提示组件 */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
}

.toast-content {
  padding: 10px 18px;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.86);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  max-width: 80vw;
  word-break: break-all;
}

.toast-success {
  background-color: #27ae60;
}

.toast-error {
  background-color: #e74c3c;
}

.toast-info {
  background-color: rgba(0, 0, 0, 0.86);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 40px;
  color: #999;
  font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
  .search-section {
    flex-wrap: wrap;
  }

  .search-section input {
    width: 100%;
  }

  .files-table th,
  .files-table td {
    padding: 10px;
    font-size: 14px;
  }

  .file-actions {
    flex-direction: column;
  }
}
