:root {
  --bg: #0f1419;
  --bg-soft: #161c23;
  --card: #1b222b;
  --card-hi: #212a35;
  --line: #2c3744;
  --text: #e6edf3;
  --text-dim: #9aa8b8;
  --text-faint: #6b7a8c;
  --accent: #4da3ff;
  --accent-soft: rgba(77, 163, 255, 0.12);
  --warn: #f0a847;
  --warn-soft: rgba(240, 168, 71, 0.12);
  --danger: #ef7a73;
  --danger-soft: rgba(239, 122, 115, 0.12);
  --ok: #5fd4a0;
  --ok-soft: rgba(95, 212, 160, 0.12);
  --radius: 10px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */

.topbar {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #131a22, var(--bg));
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 20px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-size: 19px; font-weight: 650; letter-spacing: 0.02em; }
.brand-en { font-size: 12px; color: var(--text-faint); letter-spacing: 0.14em; text-transform: uppercase; }
.brand-tag { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }

.case-head { padding: 26px 0 8px; }

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  background: var(--bg-soft);
  white-space: nowrap;
}
.badge.preset { color: var(--accent); border-color: rgba(77,163,255,.4); background: var(--accent-soft); }
.badge.gap { color: var(--warn); border-color: rgba(240,168,71,.4); background: var(--warn-soft); }

.kicker {
  margin: 0 0 4px; font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-faint);
}

h1.case-title {
  font-size: 25px;
  line-height: 1.4;
  margin: 0 0 14px;
  font-weight: 650;
}

/* 首屏两个方案速览 */
.opt-peek { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; margin: 0 0 14px; }
.peek {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 11px 13px;
  display: flex; flex-direction: column; gap: 3px;
}
.peek .pn { font-size: 11px; letter-spacing: .1em; color: var(--text-faint); text-transform: uppercase; }
.peek b { font-size: 14.5px; font-weight: 620; }
.peek span:last-child { font-size: 12.5px; color: var(--text-dim); }

.case-meta { font-size: 13px; color: var(--text-dim); }
.case-meta b { color: var(--text); font-weight: 600; }

/* ---------- flow nav ---------- */

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 6px;
  padding-bottom: 2px;
}
.flow a {
  flex: 1 1 200px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--bg-soft);
  color: var(--text);
}
.flow a:hover { border-color: var(--accent); text-decoration: none; }
.flow .n { font-size: 11px; color: var(--text-faint); letter-spacing: .1em; }
.flow .t { font-size: 14px; font-weight: 600; }
.flow .d { font-size: 12px; color: var(--text-dim); }

/* ---------- sections ---------- */

section { padding: 34px 0 10px; }
.sec-head { border-top: 1px solid var(--line); padding-top: 22px; margin-bottom: 6px; }
.sec-num { font-size: 11.5px; letter-spacing: .14em; color: var(--text-faint); text-transform: uppercase; }
h2 { font-size: 20px; margin: 4px 0 6px; font-weight: 650; }
.sec-lead { color: var(--text-dim); font-size: 14px; margin: 0 0 18px; max-width: 760px; }

h3 { font-size: 15.5px; margin: 24px 0 10px; font-weight: 620; }

/* ---------- evidence ---------- */

.col-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 620; margin: 20px 0 10px;
}
.col-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.col-head.noise .dot { background: var(--accent); }
.col-head.missed .dot { background: var(--warn); }
.col-head.key .dot { background: var(--ok); }
.col-head .cnt { font-size: 12px; color: var(--text-faint); font-weight: 400; }

.why-primary {
  font-size: 13px; color: var(--text-dim); margin: 0 0 12px;
  border-left: 2px solid var(--ok); padding-left: 11px; max-width: 880px;
}

/* 折叠区块 */
details.concepts, details.more-ev {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft); padding: 12px 15px; margin: 18px 0;
}
details.more-ev.unver { border-color: rgba(240,168,71,.35); background: var(--warn-soft); }
details > summary {
  cursor: pointer; font-size: 13.5px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 10px; list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: '▸'; color: var(--text-faint); font-size: 11px; transition: transform .15s;
}
details[open] > summary::before { content: '▾'; }
details > summary:hover { color: var(--accent); }
.hint-inline { font-size: 12px; color: var(--text-faint); font-weight: 400; }

/* 三概念 */
.concept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.concept { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 13px 14px; }
.concept.confidence { border-top: 3px solid var(--accent); }
.concept.severity { border-top: 3px solid var(--warn); }
.concept.false_positive { border-top: 3px solid var(--danger); }
.concept h4 { margin: 0 0 6px; font-size: 14.5px; }
.concept .def { font-size: 13px; color: var(--text); margin: 0 0 9px; }
.concept dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12.5px; margin: 0 0 9px; }
.concept dt { color: var(--text-faint); white-space: nowrap; }
.concept dd { margin: 0; color: var(--text-dim); }

/* 概念标签 */
.ctag {
  font-size: 11px; padding: 2px 7px; border-radius: 5px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--bg-soft); cursor: help;
}
.ctag.confidence { color: var(--accent); border-color: rgba(77,163,255,.4); }
.ctag.severity { color: var(--warn); border-color: rgba(240,168,71,.4); }
.ctag.false_positive { color: var(--danger); border-color: rgba(239,122,115,.4); }
.ctag.mixed { color: var(--text-dim); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }

.ev {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 14px 15px;
  display: flex; flex-direction: column; gap: 9px;
}
.ev.reduce_noise { border-left-color: var(--accent); }
.ev.may_hide_useful { border-left-color: var(--warn); }
.ev.unverified { border-left-color: var(--text-faint); opacity: .92; }
.ev.primary { border-left-width: 4px; background: var(--card-hi); }
.ev:target { background: var(--card-hi); box-shadow: 0 0 0 2px var(--accent-soft); }

.pin {
  font-size: 10.5px; padding: 1px 6px; border-radius: 4px;
  color: var(--ok); border: 1px solid rgba(95,212,160,.5); background: var(--ok-soft);
}

.ev-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ev-id {
  font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-faint); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
.ev-plat { font-size: 11.5px; color: var(--text-dim); }

.ev-title { font-size: 13.5px; font-weight: 600; line-height: 1.45; }

.quote {
  font-size: 13px; color: var(--text); background: var(--bg-soft);
  border-left: 2px solid var(--line); border-radius: 0 6px 6px 0;
  padding: 9px 11px; margin: 0;
}
.quote .zh { display: block; color: var(--text-dim); font-size: 12.5px; margin-top: 7px; }
.quote-mode { font-size: 11px; color: var(--text-faint); margin-top: 6px; }

.ev-fields { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12.5px; }
.ev-fields dt { color: var(--text-faint); }
.ev-fields dd { margin: 0; color: var(--text-dim); }
.unconfirmed { color: var(--warn); }

.ev-note { font-size: 12.5px; color: var(--text-dim); border-top: 1px dashed var(--line); padding-top: 8px; }
.ev-note.warn-note { color: var(--warn); border-top-color: rgba(240,168,71,.4); }
.ev-note.ok-note { color: var(--ok); border-top-color: rgba(95,212,160,.3); }

.basis-note {
  font-size: 12.5px; color: var(--text-dim); margin-top: 7px;
  border-left: 2px solid var(--warn); padding-left: 9px;
}

/* 方案对照的两条带 */
.band { border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.band.reduce { background: var(--accent-soft); border: 1px solid rgba(77,163,255,.28); }
.band.miss { background: var(--warn-soft); border: 1px solid rgba(240,168,71,.28); }
.band-h { font-size: 12px; font-weight: 620; letter-spacing: .03em; margin-bottom: 4px; }
.band.reduce .band-h { color: var(--accent); }
.band.miss .band-h { color: var(--warn); }
.band p { margin: 0 0 7px; font-size: 13px; color: var(--text); }

details.opt-more { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
details.opt-more > summary { font-size: 12.5px; color: var(--text-dim); }

.gap-status {
  font-size: 10.5px; padding: 1px 7px; border-radius: 999px; margin-left: 8px;
  font-weight: 400; vertical-align: middle;
}
.gap-status.open { color: var(--warn); border: 1px solid rgba(240,168,71,.5); background: rgba(240,168,71,.12); }
.gap-status.partial { color: var(--ok); border: 1px solid rgba(95,212,160,.5); background: rgba(95,212,160,.12); }

.closes {
  font-size: 10.5px; padding: 1px 7px; border-radius: 999px; margin-left: 8px;
  color: var(--accent); border: 1px solid rgba(77,163,255,.45); background: var(--accent-soft);
  font-weight: 400; vertical-align: middle;
}
.ev-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; padding-top: 4px; }

.tag {
  font-size: 11px; padding: 2px 7px; border-radius: 5px;
  border: 1px solid var(--line); color: var(--text-dim); background: var(--bg-soft);
}
.tag.type { color: var(--text); }
.tag.indep { color: var(--ok); border-color: rgba(95,212,160,.35); background: var(--ok-soft); }
.tag.dep { color: var(--danger); border-color: rgba(239,122,115,.35); background: var(--danger-soft); }
.src-link { font-size: 12px; margin-left: auto; }

/* ---------- claims ---------- */

.claim {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 13px 15px; margin-bottom: 10px;
}
.claim-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.claim-text { font-size: 14px; font-weight: 560; flex: 1 1 320px; }
.claim-ev { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; align-items: center; }
.claim-ev .lbl { font-size: 12px; color: var(--text-faint); }

.basis { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.basis.sample { color: var(--ok); background: var(--ok-soft); border: 1px solid rgba(95,212,160,.35); }
.basis.inference { color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(77,163,255,.35); }
.basis.hypothesis { color: var(--warn); background: var(--warn-soft); border: 1px solid rgba(240,168,71,.35); }

.ev-chip {
  font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line);
  color: var(--accent); background: var(--bg-soft); cursor: pointer;
}
.ev-chip:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- gaps ---------- */

.gap {
  border: 1px solid rgba(240,168,71,.35); background: var(--warn-soft);
  border-radius: var(--radius); padding: 13px 15px; margin-bottom: 10px;
}
.gap h4 { margin: 0 0 6px; font-size: 14px; color: var(--warn); }
.gap p { margin: 0 0 6px; font-size: 13px; color: var(--text-dim); }
.gap .impact { color: var(--text); }

/* ---------- tension ---------- */

.costs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.cost { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 15px; }
.cost.a { border-top: 3px solid var(--accent); }
.cost.b { border-top: 3px solid var(--warn); }
.cost h4 { margin: 0 0 8px; font-size: 15px; }
.cost dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; margin: 0; }
.cost dt { color: var(--text-faint); white-space: nowrap; }
.cost dd { margin: 0; color: var(--text-dim); }

.tension-note {
  margin-top: 12px; padding: 12px 15px; font-size: 13.5px;
  border: 1px dashed var(--line); border-radius: var(--radius); color: var(--text-dim);
}
.tension-note b { color: var(--text); }

/* ---------- options ---------- */

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.opt { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 15px; }
.opt h4 { margin: 0 0 4px; font-size: 15.5px; }
.opt .mech { font-size: 13px; color: var(--text-dim); margin: 0 0 12px; }
.opt .grp { font-size: 12px; color: var(--text-faint); margin: 12px 0 6px; letter-spacing: .04em; }
.opt ul { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.opt li { font-size: 13px; color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; }
.opt li .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- decision ---------- */

.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; margin-bottom: 18px; }

button.choice {
  text-align: left; cursor: pointer; font: inherit; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 15px 16px;
  transition: border-color .15s, background .15s;
}
button.choice:hover { border-color: var(--accent); background: var(--card-hi); }
button.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
button.choice .ct { font-size: 15px; font-weight: 620; display: block; margin-bottom: 4px; }
button.choice .cd { font-size: 12.5px; color: var(--text-dim); }

.result {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 0; overflow: hidden;
}
.result-head {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--bg-soft);
}
.result-head h4 { margin: 0; font-size: 14.5px; flex: 1 1 auto; }
.result-body { padding: 16px; }

.hint { color: var(--text-faint); font-size: 13.5px; padding: 18px 16px; }

button.btn {
  font: inherit; font-size: 12.5px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg-soft); color: var(--text); padding: 5px 12px;
}
button.btn:hover { border-color: var(--accent); }
button.btn.primary { border-color: rgba(77,163,255,.5); background: var(--accent-soft); color: var(--accent); }

pre.task {
  margin: 0; padding: 14px; max-height: 420px; overflow: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; color: var(--text);
}
pre.task::selection, pre.task *::selection { background: rgba(77,163,255,.35); }
pre.task:focus { outline: 2px solid var(--accent-soft); }

.state-ok { color: var(--ok); }
.state-warn { color: var(--warn); }

.task-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: var(--bg-soft); }
.task-item h5 { margin: 0 0 6px; font-size: 13.5px; }
.task-item p { margin: 0 0 6px; font-size: 13px; color: var(--text-dim); }
.task-item .out { font-size: 12.5px; color: var(--text-faint); }
.task-item .out b { color: var(--text-dim); font-weight: 600; }

/* ---------- live entry ---------- */

.live {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 16px;
}
.live-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.live-top h4 { margin: 0; font-size: 15px; }
.gate-off { font-size: 12px; color: var(--warn); border: 1px solid rgba(240,168,71,.4); background: var(--warn-soft); border-radius: 999px; padding: 2px 9px; }

table.probe { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 10px; }
table.probe th, table.probe td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
table.probe th { background: var(--bg-soft); color: var(--text-dim); font-weight: 600; white-space: nowrap; }
table.probe td { color: var(--text-dim); }
.v-pass { color: var(--ok); }
.v-fail { color: var(--danger); }
.v-part { color: var(--warn); }

.live-form { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 14px; }
.live-form label { display: block; font-size: 12.5px; color: var(--text-dim); margin: 10px 0 4px; }
.live-form input, .live-form textarea {
  width: 100%; font: inherit; font-size: 13px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px;
}
.live-form input:disabled, .live-form textarea:disabled { opacity: .5; cursor: not-allowed; }
.live-form fieldset[disabled] { opacity: .6; }
.q-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.live-health { font-size: 12px; margin-left: auto; }

.pipeline {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  font-size: 12.5px; color: var(--text-dim);
  border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px;
}
.pipeline b { color: var(--text); font-size: 12.5px; }
.pipeline span {
  padding: 1px 8px; border-radius: 5px;
  background: var(--bg-soft); border: 1px solid var(--line);
}

.ev.live-ev { border-left-style: dashed; }
.live-note { font-size: 12.5px; color: var(--text-faint); margin-top: 10px; }

/* ---------- footer / errors ---------- */

footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 0 40px; color: var(--text-faint); font-size: 12.5px; }
footer p { margin: 0 0 6px; }

.fatal {
  margin: 40px auto; max-width: 620px; border: 1px solid rgba(239,122,115,.4);
  background: var(--danger-soft); border-radius: var(--radius); padding: 18px;
}
.fatal h2 { margin: 0 0 8px; font-size: 16px; color: var(--danger); }
.fatal p { margin: 0 0 6px; font-size: 13.5px; color: var(--text-dim); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- narrow screens ---------- */

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .wrap, .topbar-inner { padding-left: 14px; padding-right: 14px; }
  h1.case-title { font-size: 21px; }
  h2 { font-size: 18px; }
  .cards, .costs, .options, .choice-row, .opt-peek, .concept-grid, .q-row { grid-template-columns: 1fr; }
  .live-health { margin-left: 0; width: 100%; }
  .flow a { flex: 1 1 100%; }
  .ev-fields { grid-template-columns: 1fr; gap: 1px; }
  .ev-fields dt { margin-top: 5px; }
  .cost dl, .concept dl { grid-template-columns: 1fr; }
  .cost dt, .concept dt { margin-top: 5px; }
  table.probe { display: block; overflow-x: auto; white-space: nowrap; }
  pre.task { font-size: 12px; max-height: 320px; }
  .src-link { margin-left: 0; }
  details.concepts, details.more-ev { padding: 11px 12px; }
}
