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

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --primary: #5b6af0;
  --primary-hover: #4a58d4;
  --primary-light: #f0f1ff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --success: #10b981;
  --success-light: #f0fdf6;
  --danger: #ef4444;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1440px; margin: 0 auto; padding: 36px 24px 60px; }

/* ---- 头部 ---- */
.header { text-align: center; margin-bottom: 28px; }
.header h1 { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.header p { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

/* ---- 卡片 ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 20px;
}

/* ---- 上传框 ---- */
.upload-boxes { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.upload-box {
  flex: 1; min-width: 220px; max-width: 300px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px 18px 18px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--bg);
  user-select: none; -webkit-user-select: none;
}
.upload-box:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-box.uploaded { border-style: solid; border-color: var(--success); background: var(--success-light); }
.upload-box.drag-hover { border-color: var(--primary); background: var(--primary-light); transform: scale(1.015); }

.box-icon { margin-bottom: 8px; color: var(--text-muted); transition: color 0.18s; }
.upload-box:hover .box-icon { color: var(--primary); }
.upload-box.uploaded .box-icon { color: var(--success); }

.box-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.box-title { font-size: 14px; font-weight: 600; color: var(--text); }

.help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--border); color: var(--text-muted);
  font-size: 11px; font-weight: 700; cursor: pointer;
  transition: all 0.15s; line-height: 1;
}
.help-icon:hover { background: var(--primary); color: #fff; }

.box-format { font-size: 11px; color: var(--text-muted); background: var(--border-light); padding: 2px 10px; border-radius: 99px; margin-top: 4px; }
.box-status { font-size: 13px; color: var(--text-muted); margin-top: 12px; }
.upload-box.uploaded .box-status { color: var(--success); font-weight: 500; }
.box-filename { font-size: 11px; color: var(--text-secondary); word-break: break-all; margin-top: 2px; max-width: 100%; line-height: 1.3; }

/* ---- 按钮 ---- */
.actions { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 24px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 32px; font-size: 14px; font-weight: 600;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.18s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: var(--shadow-md); }
.btn-primary:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; box-shadow: none; }

.btn-download {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 22px; font-size: 13px; font-weight: 600;
  border: none; border-radius: var(--radius-sm);
  background: var(--success); color: #fff; cursor: pointer;
  transition: all 0.18s;
}
.btn-download:hover { background: #059669; box-shadow: var(--shadow); }

.btn-sm {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; font-size: 12px; font-weight: 500;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.15s;
}
.btn-sm-primary { background: var(--primary); color: #fff; }
.btn-sm-primary:hover { background: var(--primary-hover); }
.btn-sm-danger { background: transparent; color: var(--danger); border: 1px solid var(--border); }
.btn-sm-danger:hover { background: #fef2f2; border-color: var(--danger); }

/* ---- 状态文本 ---- */
.status-text { text-align: center; margin-top: 12px; font-size: 13px; }
.status-text.info    { color: var(--primary); }
.status-text.success { color: var(--success); }
.status-text.error   { color: var(--danger); }

/* ---- 历史记录 ---- */
.history-header { margin-bottom: 14px; }
.history-header h2 { font-size: 16px; font-weight: 600; color: var(--text); }
.history-list { display: flex; flex-direction: column; gap: 10px; }

.history-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  flex-wrap: wrap;
}
.history-time { font-size: 12px; color: var(--text-muted); min-width: 120px; }
.history-files { flex: 1; font-size: 12px; color: var(--text-secondary); min-width: 200px; }
.history-files span { display: inline-block; margin-right: 12px; white-space: nowrap; }
.history-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---- 结果 ---- */
.result-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.result-header h2 { font-size: 16px; font-weight: 600; color: var(--text); }
.result-count { color: var(--text-muted); font-weight: 400; font-size: 13px; }

/* ---- 表格 ---- */
.table-wrapper { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
thead { background: #f9fafb; }
th { padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--border); color: var(--text-secondary); font-weight: 600; font-size: 12px; }
td { padding: 9px 14px; border-bottom: 1px solid var(--border-light); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--primary-light); }
td:first-child { font-weight: 500; }

th:first-child, td:first-child { position: sticky; left: 0; z-index: 1; }
td:first-child { background: var(--card); }
th:first-child { background: #f9fafb; z-index: 2; }
tr:hover td:first-child { background: var(--primary-light); }

/* ---- 帮助弹窗 ---- */
.help-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 1000; align-items: center; justify-content: center; }
.help-overlay.show { display: flex; }
.help-dialog { background: var(--card); border-radius: var(--radius-lg); width: 420px; max-width: 90vw; max-height: 70vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.help-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.help-title { font-size: 15px; font-weight: 600; }
.help-close { font-size: 20px; cursor: pointer; color: var(--text-muted); line-height: 1; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); transition: all 0.15s; }
.help-close:hover { background: var(--border-light); color: var(--text); }
.help-body { padding: 18px 20px; font-size: 13px; line-height: 1.8; color: var(--text-secondary); }
.help-body strong { color: var(--text); }
.help-body p { margin-bottom: 6px; }

.footer { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 8px; }
