/* 商户资料上传系统 - 样式 */

/* 基础重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: #f0f2f5;
  color: #333;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== 头部 ===== */
.header {
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  color: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.header-left h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== 按钮 ===== */
.btn {
  padding: 8px 20px;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
  transition: all 0.3s;
}

.btn:hover {
  background: rgba(255,255,255,0.3);
}

.btn-login {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

.btn-login:hover {
  background: rgba(255,255,255,0.35);
}

.btn-primary {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
}

.btn-primary:hover {
  background: #40a9ff;
  border-color: #40a9ff;
}

.btn-primary:disabled {
  background: #91caff;
  cursor: not-allowed;
}

.btn-reset {
  background: #fff;
  color: #595959;
  border-color: #d9d9d9;
}

.btn-reset:hover {
  border-color: #ff4d4f;
  color: #ff4d4f;
}

.btn-danger {
  color: #ff4d4f;
  border-color: #ff4d4f;
}

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

/* ===== 主容器 ===== */
.main-container {
  max-width: 800px;
  margin: 24px auto;
  padding: 0 16px;
}

/* ===== 上传表单 ===== */
.upload-form {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #1890ff;
  padding: 16px 0 12px;
  border-bottom: 2px solid #e6f7ff;
  margin-bottom: 20px;
  margin-top: 8px;
}

.section-title:first-child {
  margin-top: 0;
}

.supplement-note {
  font-size: 13px;
  color: #faad14;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 6px;
  padding: 8px 16px;
  margin-bottom: 20px;
}

/* ===== 表单组 ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #262626;
  margin-bottom: 8px;
}

.required {
  color: #ff4d4f;
  margin-left: 2px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  outline: none;
  transition: all 0.3s;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #1890ff;
  box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.form-group select {
  cursor: pointer;
  appearance: auto;
}

/* ===== 图片上传区域 ===== */
.upload-area {
  width: 100%;
  min-height: 160px;
  border: 2px dashed #d9d9d9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  overflow: hidden;
  position: relative;
  background: #fafafa;
}

.upload-area:hover {
  border-color: #1890ff;
  background: #e6f7ff;
}

.upload-area.has-image {
  border-style: solid;
  border-color: #52c41a;
  background: #f6ffed;
}

.upload-placeholder {
  text-align: center;
  color: #bfbfbf;
}

.upload-icon {
  font-size: 36px;
  font-weight: 300;
  color: #d9d9d9;
  margin-bottom: 8px;
  line-height: 1;
}

.upload-placeholder p {
  font-size: 13px;
  color: #bfbfbf;
}

.upload-preview {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

/* ===== 上传状态指示器 ===== */
.upload-status {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  backdrop-filter: blur(4px);
}

.status-uploading {
  background: rgba(24, 144, 255, 0.9);
  color: #fff;
}

.status-success {
  background: rgba(82, 196, 26, 0.9);
  color: #fff;
}

.status-error {
  background: rgba(255, 77, 79, 0.9);
  color: #fff;
}

.status-pending {
  background: rgba(250, 173, 20, 0.9);
  color: #fff;
}

/* ===== 表单操作按钮 ===== */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f0f0f0;
}

.btn-submit {
  flex: 1;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
}

/* ===== 上传进度 ===== */
.upload-progress {
  margin-top: 20px;
  padding: 16px;
  background: #e6f7ff;
  border-radius: 8px;
  border: 1px solid #91d5ff;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #bae7ff;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1890ff, #096dd9);
  border-radius: 4px;
  transition: width 0.3s;
  width: 0%;
}

.progress-text {
  font-size: 13px;
  color: #1890ff;
  text-align: center;
}

/* ===== 管理员面板 ===== */
.admin-panel {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* 面包屑 */
.breadcrumb {
  padding: 12px 0;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 12px;
}

.breadcrumb-item {
  color: #1890ff;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.3s;
}

.breadcrumb-item:hover {
  background: #e6f7ff;
}

.breadcrumb-sep {
  color: #bfbfbf;
  margin: 0 4px;
}

/* 统计 */
.stats {
  padding: 8px 0;
  font-size: 13px;
  color: #8c8c8c;
  margin-bottom: 12px;
}

/* 文件列表容器 */
.file-container {
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  overflow: hidden;
}

.file-list-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
  font-weight: 600;
  color: #8c8c8c;
}

.col-icon { width: 40px; flex-shrink: 0; }
.col-name { flex: 1; min-width: 0; }
.col-size { width: 100px; text-align: right; flex-shrink: 0; padding-right: 16px; }
.col-date { width: 160px; text-align: right; flex-shrink: 0; padding-right: 16px; }
.col-actions { width: 200px; text-align: right; flex-shrink: 0; }

.file-list {
  min-height: 60px;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background 0.2s;
}

.file-item:hover {
  background: #f0f5ff;
}

.file-item:last-child {
  border-bottom: none;
}

.file-icon {
  width: 40px;
  flex-shrink: 0;
  font-size: 20px;
  text-align: center;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 500;
  color: #262626;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-path {
  font-size: 11px;
  color: #bfbfbf;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
  margin-top: 2px;
}

.file-item:hover .file-path {
  display: block;
}

.file-size {
  width: 100px;
  text-align: right;
  flex-shrink: 0;
  font-size: 13px;
  color: #8c8c8c;
  padding-right: 16px;
}

.file-date {
  width: 160px;
  text-align: right;
  flex-shrink: 0;
  font-size: 13px;
  color: #8c8c8c;
  padding-right: 16px;
}

.file-actions {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.2s;
}

.file-item:hover .file-actions {
  opacity: 1;
}

.action-btn {
  padding: 4px 10px;
  border: 1px solid #d9d9d9;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #595959;
  transition: all 0.2s;
}

.action-btn:hover {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
}

/* 加载状态 */
.loading {
  display: none;
  text-align: center;
  padding: 40px 20px;
  color: #8c8c8c;
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #f0f0f0;
  border-top-color: #1890ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
  display: none;
  text-align: center;
  padding: 60px 20px;
  color: #bfbfbf;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.toast {
  padding: 12px 20px;
  background: #333;
  color: #fff;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  min-width: 200px;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }

/* ===== 模态框 ===== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-inner {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #8c8c8c;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: #595959;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px 20px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.form-error {
  color: #ff4d4f;
  font-size: 13px;
  min-height: 20px;
}

/* ===== 预览弹窗 ===== */
.preview-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.preview-overlay.active {
  display: flex;
}

.preview-content {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.preview-header span {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #8c8c8c;
  cursor: pointer;
}

.preview-body {
  padding: 16px;
  flex: 1;
  overflow: auto;
  text-align: center;
}

.preview-body img {
  max-width: 100%;
  max-height: 70vh;
}

.preview-footer {
  padding: 12px 16px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.preview-footer .btn {
  color: #595959;
  border-color: #d9d9d9;
  background: #fff;
}

.preview-footer .btn:hover {
  color: #1890ff;
  border-color: #1890ff;
}

/* ===== 页脚 ===== */
.footer {
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: #bfbfbf;
  margin-top: 40px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }

  .header-left h1 {
    font-size: 16px;
  }

  .main-container {
    margin: 12px auto;
    padding: 0 8px;
  }

  .upload-form {
    padding: 16px;
  }

  .section-title {
    font-size: 16px;
  }

  .upload-area {
    min-height: 120px;
  }

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

  .btn-submit {
    width: 100%;
  }

  .file-list-header {
    display: none;
  }

  .file-item {
    flex-wrap: wrap;
    padding: 12px;
  }

  .file-size, .file-date {
    width: auto;
    text-align: left;
    padding: 0;
    margin-left: 52px;
    margin-top: 4px;
  }

  .file-actions {
    width: 100%;
    margin-top: 8px;
    justify-content: flex-start;
    margin-left: 52px;
    opacity: 1;
  }

  .col-actions { width: auto; }
  .col-size { display: none; }
  .col-date { display: none; }
}
