:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --ink: #14181f;
  --muted: #5d6673;
  --faint: #8a929d;
  --line: #e3e0d6;
  --rail: #10151d;
  --rail-ink: #c9d1dc;
  --rail-active: #ffffff;
  --accent: #0b46a8;
  --accent-soft: #e6eefb;
  --pos: #16794a;
  --pos-soft: #e3f3ea;
  --neg: #b3261e;
  --neg-soft: #fbe9e7;
  --warn: #a45a06;
  --warn-soft: #fbf0dc;
  --radius: 10px;
  --num: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161a21;
    --surface-2: #1b2029;
    --ink: #e7eaee;
    --muted: #9aa4b1;
    --faint: #6f7986;
    --line: #272d37;
    --rail: #0a0d12;
    --accent: #7eabff;
    --accent-soft: #17253d;
    --pos: #4fc48c;
    --pos-soft: #13291f;
    --neg: #ff8078;
    --neg-soft: #33181a;
    --warn: #e5a650;
    --warn-soft: #30230f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.boot { padding: 48px; color: var(--muted); }

/* ── 整体布局：左边目录，右边正文 ── */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.rail { border-right: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 12px 16px; display: flex; flex-direction: column; }
.railtop { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.railbody { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.navbtn { display: none; }
.brand { display: block; padding: 0 10px 14px; text-decoration: none; color: inherit; }
.brand b { display: block; font-size: 16.5px; letter-spacing: 0.01em; }
.brand span { font-size: 12px; color: var(--faint); }
.jumpwrap { position: relative; margin: 0 4px 12px; }
.jump { font-size: 13.5px !important; padding: 6px 10px !important; }
.jumplist { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); padding: 4px; }
.jumplist a { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 14px; }
.jumplist a:hover, .jumplist a:first-child { background: var(--accent-soft); }
.jumplist p { padding: 6px 8px; }
.k { font-size: 11.5px; color: var(--faint); flex: none; }
.toc { display: flex; flex-direction: column; gap: 1px; }
.toc a { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 14.5px; line-height: 1.45; }
.toc a:hover { background: var(--line); color: var(--ink); }
.toc a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.toc a.ch.open { color: var(--ink); font-weight: 600; }
.toc .no { width: 16px; flex: none; text-align: right; font-size: 12px; color: var(--faint); }
.toc .grow { flex: 1; }
.toc .tick { font-size: 11px; color: var(--faint); }
.toc .sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 25px; padding-left: 8px; border-left: 1px solid var(--line); }
.toc .sub a { font-size: 13.5px; padding: 4px 8px; }
.toc.tools { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.toc.tools a { font-size: 13.5px; padding: 5px 10px; justify-content: space-between; }
.toc .grp { font-size: 11.5px; color: var(--faint); letter-spacing: 0.08em; padding: 0 10px 4px; }
.toc .count { background: #d9822b; color: #fff; border-radius: 99px; font-size: 11.5px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.rail-foot { margin-top: auto; padding: 16px 10px 0; font-size: 12px; color: var(--faint); line-height: 1.6; }
.rail-foot button { background: none; border: 0; color: var(--muted); padding: 0; cursor: pointer; text-decoration: underline; font-size: 12px; }
.main { padding: 26px 30px 60px; min-width: 0; max-width: 1480px; }
.main.read { max-width: 820px; width: 100%; margin: 0 auto; padding: 30px 36px 90px; font-size: 16px; line-height: 1.8; }

/* ── 手册正文 ── */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--faint); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.dochead { margin-bottom: 22px; }
.dochead h1 { font-size: 30px; line-height: 1.3; letter-spacing: -0.015em; }
.eyebrow { font-size: 13px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; min-height: 0; }
.eyebrow:empty { display: none; }
.lead { font-size: 18px; line-height: 1.7; color: var(--muted); margin-top: 6px; }
.lead.ink { color: var(--ink); margin: 0 0 8px; }
.figure { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.figure b { font-size: 40px; line-height: 1.15; letter-spacing: -0.03em; }
.sub { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.sec { margin-top: 34px; }
.sec > h2 { font-size: 19px; line-height: 1.4; margin-bottom: 10px; }
.sec h3 { font-size: 14px; color: var(--muted); font-weight: 600; margin: 16px 0 4px; }
.sec > p + p { margin-top: 8px; }
.plain { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px 16px; margin: 4px 0 8px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 4px; }
a.xl { color: inherit; text-decoration: underline dotted var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: pointer; }
a.xl:hover, a.xl:focus-visible { color: var(--accent); text-decoration-style: solid; }
.tip { position: fixed; z-index: 70; max-width: min(340px, calc(100vw - 16px)); background: var(--ink); color: var(--bg); font-size: 13.5px; line-height: 1.6; padding: 8px 12px; border-radius: 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); pointer-events: none; }
.tip[hidden] { display: none; }

.rows { border-top: 1px solid var(--line); }
.rowl { display: flex; align-items: center; gap: 14px; padding: 13px 6px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.rowl:hover { background: var(--surface); }
.rowl:hover .chev { color: var(--accent); transform: translateX(2px); }
.rowl .no { width: 22px; flex: none; text-align: right; color: var(--faint); font-size: 14px; }
.rowl .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rowl .body b { font-weight: 600; line-height: 1.5; }
.rowl .body .sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rowl .val { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; max-width: 46%; }
.rowl .val b { font-size: 16px; }
.rowl .chip { flex: none; }
.chev { flex: none; color: var(--faint); font-size: 20px; line-height: 1; transition: transform 0.12s; }
.mbar { display: block; width: 84px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.mbar i { display: block; height: 100%; border-radius: 3px; }
.mbar .s { background: var(--pos); }
.mbar .r { background: var(--neg); margin-left: auto; }
.morebtn { margin-top: 6px; padding-left: 0; }

.verdict { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; margin-bottom: 14px; }
.verdict .big { font-size: 24px; line-height: 1.45; font-weight: 700; letter-spacing: -0.01em; margin: 2px 0 14px; font-family: var(--sans); }
.verdict .big.num { font-family: var(--num); font-size: 44px; margin-bottom: 6px; }
.reads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.reads a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.reads a:hover { border-color: var(--accent); }
.reads b { font-size: 24px; line-height: 1.3; }
.reads .sub { display: flex; align-items: center; gap: 6px; }
.notice { display: flex; align-items: center; gap: 12px; background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: 11px 16px; text-decoration: none; margin-bottom: 14px; }
.notice .sub { color: inherit; opacity: 0.85; flex: 1; }
.notice .chev { color: inherit; }

.tri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 8px; }
.tri > div { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface); }
.tri b { font-size: 20px; line-height: 1.4; }
.evgroup + .evgroup { margin-top: 6px; }
.main.read .ev { font-size: 15px; line-height: 1.7; }
.addrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.addform { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; display: grid; gap: 12px; }
.rel { display: flex; flex-wrap: wrap; gap: 8px; }
.rel a { display: inline-flex; align-items: baseline; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 13px; text-decoration: none; color: var(--ink); font-size: 14.5px; }
.rel a:hover { border-color: var(--accent); color: var(--accent); }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 14px; }
.pager a:hover { border-color: var(--accent); }
.pager .next { text-align: right; }
.pager b { font-weight: 600; line-height: 1.5; }

.sharebar { display: flex; gap: 2px; height: 56px; }
.sharebar a { min-width: 64px; display: flex; flex-direction: column; justify-content: center; padding: 0 12px; text-decoration: none; color: #fff; line-height: 1.35; overflow: hidden; }
.sharebar a:first-child { border-radius: 6px 0 0 6px; }
.sharebar a:last-child { border-radius: 0 6px 6px 0; }
.sharebar b { font-size: 14px; white-space: nowrap; }
.sharebar span { font-size: 13px; opacity: 0.92; }
.sharebar .p0 { background: #0b46a8; }
.sharebar .p1 { background: #2f6fd6; }
.sharebar .p2 { background: #5b6b83; }
.fold { border-bottom: 1px solid var(--line); }
.fold:first-of-type { border-top: 1px solid var(--line); }
.fold summary { display: flex; gap: 12px; align-items: baseline; padding: 11px 6px; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary:hover { background: var(--surface); }
.fold summary .when, .cal .when { flex: none; width: 70px; color: var(--faint); font-size: 13px; }
.fold summary .ttl { flex: 1; font-weight: 600; line-height: 1.55; }
.fold[open] summary .ttl { color: var(--accent); }
.foldbody { padding: 2px 6px 16px 88px; display: grid; gap: 8px; font-size: 15px; }
.cal { display: flex; gap: 12px; align-items: baseline; padding: 11px 6px; border-bottom: 1px solid var(--line); }
.cal .when { width: 132px; }
.cal > div { flex: 1; min-width: 0; }
.cal b { font-weight: 600; }
.steps3 { margin: 0; padding-left: 22px; display: grid; gap: 12px; }
.plaintable th { background: none; position: static; }
.main.read .chart { height: 240px; }
.main.read .fact { grid-template-columns: 64px minmax(0, 1fr); font-size: 15px; line-height: 1.7; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; line-height: 1.3; letter-spacing: -0.01em; }
.page-head p { color: var(--muted); margin-top: 2px; max-width: 70ch; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.cols-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-model { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); }
.tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card h2 { font-size: 16px; line-height: 1.5; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card > h2 { margin-bottom: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.empty { color: var(--muted); padding: 14px 0; }

/* ── 控件 ── */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 13px; cursor: pointer; font-size: 14px; line-height: 1.4; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
a.btn { display: inline-block; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0b1220; } }
.btn.sm { padding: 3px 9px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: none; color: var(--accent); }
.btn.danger { color: var(--neg); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="text"], input[type="number"], input[type="password"], input[type="url"], input[type="date"], select, textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
label.field { display: block; font-size: 13px; color: var(--muted); }
label.field > span { display: block; margin-bottom: 4px; }
label.field > span.between { display: flex; justify-content: space-between; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row > .grow { flex: 1 1 180px; min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-size: 13.5px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg button.on { color: #0b1220; } }

.chip { display: inline-block; border-radius: 99px; padding: 0 8px; font-size: 12px; line-height: 20px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.pos { background: var(--pos-soft); color: var(--pos); border-color: transparent; }
.chip.neg { background: var(--neg-soft); color: var(--neg); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.dots { letter-spacing: 1px; color: var(--accent); font-size: 11px; white-space: nowrap; }
.dots i { font-style: normal; color: var(--line); }

/* ── 首页 ── */
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.tile .v { font: 600 24px/1.3 var(--num); margin-top: 4px; letter-spacing: -0.02em; }
.tile .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.up { color: var(--pos); }
.down { color: var(--neg); }
.banner { border-radius: var(--radius); padding: 11px 16px; background: var(--warn-soft); color: var(--warn); margin-bottom: 16px; font-size: 14px; }
.banner.info { background: var(--accent-soft); color: var(--accent); }

.todo-group + .todo-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.todo-group h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.item { padding: 9px 0; border-top: 1px dashed var(--line); }
.item:first-of-type { border-top: 0; padding-top: 2px; }
.item .t { font-weight: 550; }
.item .s { color: var(--muted); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.item .a { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; align-items: center; }

.hbar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 52px; gap: 10px; align-items: center; font-size: 13.5px; padding: 3px 0; }
.hbar .track { height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; position: relative; overflow: hidden; }
.hbar .track::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--faint); }
.hbar .fill { position: absolute; top: 0; bottom: 0; }
.hbar .fill.p { left: 50%; background: var(--pos); }
.hbar .fill.n { right: 50%; background: var(--neg); }
.hbar .n { text-align: right; font-family: var(--num); font-weight: 600; }
.big { font: 700 34px/1.15 var(--num); letter-spacing: -0.03em; }

.fact { padding: 9px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
.fact:first-child { border-top: 0; }
.fact .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: center; font-size: 12.5px; color: var(--muted); }
.fact p { overflow-wrap: anywhere; }

/* ── 表格 ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
td.r, th.r { text-align: right; }
td.n { font-family: var(--num); white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
tr.expand td { background: var(--surface-2); }

/* ── 假设与仓位 ── */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { border: 0; background: var(--surface-2); width: 26px; height: 28px; cursor: pointer; font-size: 15px; }
.stepper span { min-width: 74px; text-align: center; font-size: 13px; padding: 0 6px; font-weight: 600; }
.stepper.dirty { border-color: var(--warn); }
.sc-2, .sc-1 { color: var(--neg); }
.sc1, .sc2 { color: var(--pos); }
.mini { display: inline-flex; gap: 3px; align-items: flex-end; height: 18px; }
.mini i { display: block; width: 7px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: 0.85; min-height: 1px; }
.contrib { display: flex; align-items: center; gap: 6px; justify-content: flex-end; font-family: var(--num); }
.contrib .bar { width: 64px; height: 8px; background: var(--surface-2); border-radius: 4px; position: relative; overflow: hidden; border: 1px solid var(--line); }
.contrib .bar i { position: absolute; top: 0; bottom: 0; }
.steps { counter-reset: s; display: grid; gap: 8px; }
.steps > div { counter-increment: s; padding-left: 30px; position: relative; font-size: 14px; }
.steps > div::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 12px/20px var(--num); text-align: center; }
.split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.split > div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.split .v { font: 600 22px/1.3 var(--num); }
.ev { padding: 7px 0 7px 12px; border-left: 3px solid var(--line); margin: 6px 0; font-size: 14px; }
.ev.support { border-color: var(--pos); }
.ev.against { border-color: var(--neg); }

/* ── 优势与风险 ── */
.bf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bf-stat { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); min-width: 0; }
.bf-stat .k { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.bf-stat .k i, .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.bf-stat.risk .k i, .sw.r { background: var(--neg); }
.bf-stat.strength .k i, .sw.s { background: var(--pos); }
.bf-stat.net .k i { background: var(--ink); width: 3px; border-radius: 1px; }
.bf-stat .v { font-size: 28px; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
.bf-stat.net { background: var(--surface); border-color: var(--faint); }
.sw.range { background: var(--surface-2); border: 1px dashed var(--faint); }
h2 > .sw { margin-right: 8px; }
.bf-tug { display: flex; gap: 2px; height: 26px; margin-top: 12px; }
.bf-tug > div { min-width: 68px; white-space: nowrap; display: flex; align-items: center; padding: 0 8px; color: #fff; font: 600 12.5px/1 var(--num); }
.bf-tug .r { background: var(--neg); border-radius: 4px 0 0 4px; }
.bf-tug .s { background: var(--pos); border-radius: 0 4px 4px 0; justify-content: flex-end; }
.bf-tug > div:only-child { border-radius: 4px; }
@media (prefers-color-scheme: dark) { .bf-tug > div { color: #0b1220; } }

.bf-row, .bf-hrow, .bf-axis-head { display: grid; grid-template-columns: minmax(150px, 0.9fr) minmax(0, 2fr) 62px; gap: 12px; align-items: center; }
.bf-hrow, .bf-axis-head:has(+ .bf-hrow) { grid-template-columns: 112px minmax(0, 1fr) 74px; }
.bf-row, .bf-hrow { width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 7px 6px; cursor: pointer; border-radius: 0; }
.bf-row:hover, .bf-hrow:hover { background: var(--surface-2); }
.bf-row:focus-visible, .bf-hrow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bf-hrow.on { background: var(--accent-soft); }
.bf-row .l, .bf-hrow .l { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.bf-row .l b { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.bf-row .n, .bf-hrow .n { text-align: right; font-weight: 600; font-size: 14px; white-space: nowrap; }
.bf-track { position: relative; display: block; height: 20px; }
.bf-track::before { content: ""; position: absolute; left: 50%; top: -7px; bottom: -7px; width: 1px; background: var(--faint); }
.bf-track i { position: absolute; top: 3px; bottom: 3px; display: block; }
.bf-track .range { top: 0; bottom: 0; background: var(--surface-2); border: 1px dashed var(--faint); border-radius: 4px; opacity: 0.8; }
.bf-track .fill.s { left: calc(50% + 1px); background: var(--pos); border-radius: 0 4px 4px 0; }
.bf-track .fill.r { right: calc(50% + 0px); background: var(--neg); border-radius: 4px 0 0 4px; }
.bf-track .net { top: -3px; bottom: -3px; width: 3px; margin-left: -1px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface); }
.bf-hrow.on .bf-track .net { box-shadow: 0 0 0 2px var(--accent-soft); }
.bf-axis-head { font-size: 12px; color: var(--faint); padding: 0 6px 4px; }
.bf-axis-head > div { display: flex; justify-content: space-between; font-family: var(--num); }
.bf-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.bf-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bf-lead { margin-top: 12px; border-top: 1px solid var(--line); }
.bf-leadrow { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 8px 6px; cursor: pointer; }
.bf-leadrow:last-child { border-bottom: 0; }
.bf-leadrow:hover { background: var(--surface-2); }
.bf-leadrow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bf-leadrow > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.bf-leadrow b { font-weight: 600; overflow-wrap: anywhere; }
.bf-leadrow .num { font-weight: 600; }
.bf-side.strength { border-top: 3px solid var(--pos); }
.bf-side.risk { border-top: 3px solid var(--neg); }
.bf-ev { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.bf-evbar { display: inline-flex; gap: 2px; width: 90px; height: 6px; }
.bf-evbar i { display: block; border-radius: 3px; min-width: 3px; }
.bf-evbar .s { background: var(--pos); }
.bf-evbar .r { background: var(--neg); }

/* ── 关联图谱 ── */
.lane { display: grid; grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1.1fr) 30px minmax(0, 1fr); gap: 8px; align-items: stretch; }
.lane .arrow { display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 20px; }
.col-title { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; margin-bottom: 8px; }
.ent { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.ent:hover { border-color: var(--accent); }
.ent b { font-size: 14.5px; }
.ent .l { font-size: 13px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ent .f { font-size: 12px; color: var(--faint); margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ent.core { background: var(--accent-soft); border-color: transparent; }
.ent.suggested { border-style: dashed; border-color: var(--warn); }

/* ── 时间线 ── */
.tl { max-height: 640px; overflow-y: auto; padding-right: 6px; }
.tl button { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 12px; margin-bottom: 8px; cursor: pointer; }
.tl button.on { border-color: var(--accent); background: var(--accent-soft); }
.tl button.crisis { border-left-color: var(--neg); }
.tl button.success { border-left-color: var(--pos); }
.tl button.controversy { border-left-color: var(--warn); }
.detail h3 { font-size: 18px; line-height: 1.4; }
.detail h4 { font-size: 12.5px; color: var(--muted); margin: 14px 0 3px; letter-spacing: 0.04em; }
.chart { position: relative; height: 300px; }

/* ── 抽屉、提示、登录 ── */
.drawer { position: fixed; inset: 0; background: rgba(10, 14, 20, 0.45); z-index: 40; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer .panel { width: min(680px, 100%); background: var(--bg); height: 100%; overflow-y: auto; padding: 22px 24px 40px; box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18); }
.drawer .panel > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.drawer h2 { font-size: 20px; line-height: 1.35; }
pre.raw { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 12.5px/1.6 var(--num); max-height: 320px; overflow-y: auto; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--rail); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); }
.toast.err { background: var(--neg); }
.toast[hidden] { display: none; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 14px; }
.login h1 { font-size: 22px; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ── 窄屏 ── */
@media (max-width: 1080px) {
  .cols-2, .cols-even, .cols-3, .cols-model { grid-template-columns: minmax(0, 1fr); }
  .lane { grid-template-columns: minmax(0, 1fr); }
  .lane .arrow { transform: rotate(90deg); height: 22px; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: sticky; top: 0; z-index: 30; height: auto; max-height: 100vh; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .brand span { display: none; }
  .navbtn { display: inline-block; }
  .railbody { display: none; padding-top: 12px; }
  .rail.open .railbody { display: flex; }
  .main.read { padding: 20px 18px 70px; font-size: 15.5px; }
  .dochead h1 { font-size: 25px; }
  .lead { font-size: 16.5px; }
  .verdict { padding: 16px 16px; }
  .verdict .big { font-size: 20px; }
  .reads b { font-size: 19px; }
  .reads a { padding: 8px 10px; }
  .rowl { gap: 10px; }
  .rowl .val { max-width: 40%; }
  .foldbody { padding-left: 6px; }
  .fold summary .when { width: 58px; }
  .cal { flex-wrap: wrap; }
  .cal .when { width: 100%; }
  .pager b { font-size: 14.5px; }
  .main { padding: 18px 16px 60px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .hbar { grid-template-columns: 84px minmax(0, 1fr) 46px; }
  .bf-row { grid-template-columns: minmax(0, 1fr) 62px; row-gap: 6px; }
  .bf-row .l { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
  .bf-axis-head:has(+ .bf-rows) { grid-template-columns: minmax(0, 1fr) 62px; }
  .bf-axis-head:has(+ .bf-rows) > span:first-child { display: none; }
  .bf-hrow, .bf-axis-head:has(+ .bf-hrow) { grid-template-columns: 52px minmax(0, 1fr) 72px; gap: 8px; }
  .bf-hrow .l .small { display: none; }
  .bf-stat .v { font-size: 22px; }
}
