:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8a919c;
  --line: #e4e7ec;
  --primary: #2f6bff;
  --primary-dark: #2455cc;
  --green: #16a34a;
  --blue: #2563eb;
  --amber: #d97706;
  --red: #dc2626;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* 口令门 */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.gate-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 40px 32px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.gate-card h1 { margin: 0 0 4px; font-size: 22px; }
.gate-sub { color: var(--muted); margin: 0 0 20px; }
.gate input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 12px;
}

/* 顶部导航 */
.topbar {
  display: flex;
  gap: 8px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-btn {
  border: none;
  background: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  color: var(--muted);
}
.nav-btn.active { background: #eaf0ff; color: var(--primary); font-weight: 600; }
.nav-btn.right { margin-left: auto; color: var(--red); }

/* 布局 */
.view { max-width: 860px; margin: 0 auto; padding: 20px 16px 60px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.field-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.field-row label { font-weight: 600; white-space: nowrap; }
select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}

/* 上传区 */
.drop-zone {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone.dragover { border-color: var(--primary); background: #f0f5ff; }
.drop-zone p { margin: 0; }
.drop-zone .hint, .hint { color: var(--muted); font-size: 13px; }

.file-list { list-style: none; margin: 12px 0; padding: 0; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
}
.file-list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .status { color: var(--muted); font-size: 13px; white-space: nowrap; }
.file-list .status.ok { color: var(--green); }
.file-list .status.err { color: var(--red); }
.file-list .remove {
  border: none;
  background: none;
  color: var(--red);
  cursor: pointer;
  font-size: 16px;
}

/* 按钮 */
.btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 15px;
  cursor: pointer;
}
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.btn.primary:hover { background: var(--primary-dark); }
.btn.wide { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.row-between { display: flex; align-items: center; justify-content: space-between; }
.row-between h2 { margin: 0; font-size: 18px; }

/* 报告卡片 */
.report-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.report-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.score-circle {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.score-circle .num { font-size: 28px; font-weight: 700; line-height: 1.1; }
.score-circle .band { font-size: 11px; opacity: 0.95; }
.score-band-green { background: var(--green); }
.score-band-blue { background: var(--blue); }
.score-band-amber { background: var(--amber); }
.score-band-red { background: var(--red); }
.report-title { flex: 1; min-width: 200px; }
.report-title .file { font-weight: 700; font-size: 16px; word-break: break-all; }
.report-title .meta { color: var(--muted); font-size: 13px; }
.summary { margin: 12px 0; padding: 10px 12px; background: #f8f9fb; border-radius: 8px; }

details { margin-top: 10px; }
summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  padding: 4px 0;
}

table.dim-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.dim-table th, .dim-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  font-size: 13px;
  text-align: left;
  vertical-align: top;
}
.dim-table th { background: #f8f9fb; white-space: nowrap; }

.flag { color: var(--red); font-size: 14px; margin: 4px 0; }
.flag .evi { color: var(--muted); }

.question {
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}
.question .q { font-weight: 700; margin-bottom: 6px; }
.q-field { font-size: 14px; margin: 4px 0; }
.q-field b { color: var(--muted); font-weight: 600; margin-right: 4px; }
.copy-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px;
}
.copy-line .text { flex: 1; font-size: 14px; }

/* 反馈 */
.feedback-box { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.feedback-box .opts { display: flex; gap: 16px; margin: 8px 0; }
.feedback-box textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-size: 14px;
  font-family: inherit;
}

/* 历史表 */
.history-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.history-table th, .history-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  font-size: 14px;
  text-align: left;
}
.history-table tr.clickable { cursor: pointer; }
.history-table tr.clickable:hover { background: #f8f9fb; }
.history-table .ops { white-space: nowrap; }
.history-table .ops button { margin-right: 4px; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
}

.error-text { color: var(--red); }
.error-banner {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--red);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  font-size: 14px;
}

/* 返回 */
.back-btn { margin-bottom: 12px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2329;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 100;
}

@media (max-width: 600px) {
  .view { padding: 12px 10px 40px; }
  .panel { padding: 14px; }
  .history-table { font-size: 12px; }
  .history-table th, .history-table td { padding: 6px 4px; }
}
