:root {
  /* Nudge 设计变量（appearance / radius / spacing / typography / motion） */
  --site-bg: #f4f6f9;
  --site-fg: #1f2937;
  --site-accent: #0e7490;
  --site-on-accent: #ffffff;
  --site-surface: #ffffff;
  --site-muted: #6b7280;
  --site-border: #e5e7eb;
  --site-font: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  --site-radius: 12px;
  --site-space: 1;
  --site-type: 1;
  --site-motion: 1;

  --bg: var(--site-bg);
  --card: var(--site-surface);
  --ink: var(--site-fg);
  --muted: var(--site-muted);
  --accent: var(--site-accent);
  --accent2: #155e75;
  --ok: #16a34a;
  --bad: #dc2626;
  --warn: #d97706;
  --line: var(--site-border);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--site-font);
  background: var(--bg); color: var(--ink); min-height: 100vh;
  font-size: calc(15px * var(--site-type, 1));
}
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; background: linear-gradient(120deg, #164e63, #0e7490);
  color: #fff;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo { font-size: 30px; }
header h1 { font-size: 20px; }
.sub { font-size: 12px; opacity: .85; }
.health { font-size: 12px; text-align: right; line-height: 1.6; opacity: .95; }
.health .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot.on { background: #4ade80; } .dot.off { background: #fbbf24; }

.tabs { display: flex; gap: 4px; padding: 10px 24px 0; background: var(--card); border-bottom: 1px solid var(--line); }
.tab {
  border: none; background: none; padding: 10px 18px; font-size: 15px; cursor: pointer;
  border-bottom: 3px solid transparent; color: var(--muted);
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

main { padding: 20px 24px; max-width: 1200px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--site-radius);
  padding: calc(18px * var(--site-space, 1)); margin-bottom: calc(16px * var(--site-space, 1)); box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h2 { font-size: 16px; margin-bottom: 12px; color: var(--accent2); }

.dropzone {
  border: 2px dashed #94a3b8; border-radius: var(--site-radius); padding: 28px; text-align: center;
  color: var(--muted); cursor: pointer; transition: border-color calc(150ms * var(--site-motion, 1)), background calc(150ms * var(--site-motion, 1)); margin-bottom: 12px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #ecfeff; }
.dropzone img { max-width: 100%; max-height: 220px; border-radius: 6px; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.form label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
input, select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
  background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid #a5f3fc; border-color: var(--accent); }

button.primary {
  background: var(--accent); color: var(--site-on-accent); border: none; border-radius: var(--site-radius);
  padding: 11px 22px; font-size: 15px; cursor: pointer; font-weight: 600;
  transition: background calc(150ms * var(--site-motion, 1));
}
button.primary:hover { background: var(--accent2); }
button.primary:disabled { background: #94a3b8; cursor: not-allowed; }

.status { margin-top: 10px; font-size: 13px; color: var(--muted); min-height: 18px; }
.status.err { color: var(--bad); }
.empty { color: var(--muted); padding: 40px 0; text-align: center; font-size: 14px; }

.verdict { font-size: 17px; font-weight: 700; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.verdict.pass { background: #f0fdf4; color: var(--ok); }
.verdict.fail { background: #fef2f2; color: var(--bad); }
#annotated { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 12px; }

table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini th, table.mini td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.mini th { color: var(--muted); font-weight: 600; background: #f8fafc; }
.tag { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.tag.pass { background: #dcfce7; color: var(--ok); }
.tag.fail { background: #fee2e2; color: var(--bad); }
.thumb { height: 34px; border-radius: 4px; cursor: pointer; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; text-align: center;
}
.kpi span { font-size: 30px; font-weight: 700; color: var(--accent2); display: block; }
.kpi.warn span { color: var(--warn); }
.kpi label { font-size: 13px; color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 86px; align-items: center; gap: 8px; font-size: 13px; }
.bar-track { background: #f1f5f9; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #0e7490, #22d3ee); border-radius: 6px; }
.bar-fill.red { background: linear-gradient(90deg, #b91c1c, #f87171); }
.bar-val { color: var(--muted); text-align: right; }

.trend { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.trend .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; min-width: 0; }
.trend .stack { width: 70%; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; }
.trend .good { background: #67e8f9; } .trend .badseg { background: #f87171; }
.trend .lbl { font-size: 10px; color: var(--muted); white-space: nowrap; transform: scale(.9); }

.review-controls { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.review-controls label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
.report-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

.markdown { line-height: 1.75; font-size: 14.5px; }
.markdown h1 { font-size: 20px; margin: 14px 0 8px; color: var(--accent2); }
.markdown h2 { font-size: 17px; margin: 16px 0 8px; color: var(--accent2); border-left: 4px solid var(--accent); padding-left: 8px; }
.markdown h3 { font-size: 15px; margin: 12px 0 6px; }
.markdown p { margin: 6px 0; }
.markdown ul, .markdown ol { padding-left: 22px; margin: 6px 0; }
.markdown blockquote { border-left: 3px solid var(--warn); background: #fffbeb; padding: 8px 12px; margin: 8px 0; color: #92400e; border-radius: 0 6px 6px 0; }
.markdown table { border-collapse: collapse; margin: 8px 0; width: 100%; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 6px 10px; font-size: 13px; }
.markdown th { background: #f8fafc; }
.markdown code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.markdown hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }

/* 记录详情弹窗 */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--card); border-radius: var(--site-radius); padding: 22px; max-width: 640px; width: 100%; max-height: 88vh; overflow: auto; position: relative; }
.modal-box h2 { font-size: 16px; color: var(--accent2); margin-bottom: 12px; }
.modal-box img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 12px; }
.modal-close { position: absolute; top: 12px; right: 12px; border: none; background: #f1f5f9; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 14px; color: var(--muted); }
.linkbtn { border: none; background: none; color: var(--accent); cursor: pointer; font-size: 13px; text-decoration: underline; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
/* 方案说明 */
#about { margin-bottom: 16px; }
#about summary { cursor: pointer; font-weight: 600; color: var(--accent, #0e7490); }
.about-body { margin-top: 10px; font-size: 13px; line-height: 1.85; color: #334155; }
.about-body p { margin: 6px 0; }
