/* Base reset — the Artifact shell used to provide these. */
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

:root {
  --ground: #f2f3f0;
  --surface: #fcfcfb;
  --ink: #121619;
  --ink-2: #454c50;
  --muted: #646b6e;
  --rule: #dde0dc;
  --grid: #e5e7e3;
  --axis: #c3c6c1;
  --accent: #0e5d70;
  --accent-wash: #e2edef;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --on-series-1: #ffffff;
  --on-series-2: #121619;
  --on-series-3: #121619;
  --on-series-4: #121619;
  --div-pos: #2a78d6;
  --div-neg: #e34948;
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5;
  --seq-5: #256abf; --seq-6: #184f95; --seq-7: #0d366b;
  --on-seq-1: #0b0b0b; --on-seq-2: #0b0b0b; --on-seq-3: #0b0b0b; --on-seq-4: #ffffff;
  --on-seq-5: #ffffff; --on-seq-6: #ffffff; --on-seq-7: #ffffff;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #101314;
    --surface: #1a1a19;
    --ink: #f0f2f1;
    --ink-2: #bcc3c5;
    --muted: #8d9496;
    --rule: #2e3131;
    --grid: #2a2c2b;
    --axis: #474a49;
    --accent: #63b4c8;
    --accent-wash: #16282c;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --on-series-1: #121619;
    --div-pos: #3987e5;
    --seq-1: #0d366b; --seq-2: #184f95; --seq-3: #256abf; --seq-4: #3987e5;
    --seq-5: #6da7ec; --seq-6: #9ec5f4; --seq-7: #cde2fb;
    --on-seq-1: #ffffff; --on-seq-2: #ffffff; --on-seq-3: #ffffff; --on-seq-4: #ffffff;
    --on-seq-5: #0b0b0b; --on-seq-6: #0b0b0b; --on-seq-7: #0b0b0b;
    --div-neg: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #101314;
  --surface: #1a1a19;
  --ink: #f0f2f1;
  --ink-2: #bcc3c5;
  --muted: #8d9496;
  --rule: #2e3131;
  --grid: #2a2c2b;
  --axis: #474a49;
  --accent: #63b4c8;
  --accent-wash: #16282c;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --on-series-1: #121619;
  --div-pos: #3987e5;
  --div-neg: #e66767;
  --seq-1: #0d366b; --seq-2: #184f95; --seq-3: #256abf; --seq-4: #3987e5;
  --seq-5: #6da7ec; --seq-6: #9ec5f4; --seq-7: #cde2fb;
  --on-seq-1: #ffffff; --on-seq-2: #ffffff; --on-seq-3: #ffffff; --on-seq-4: #ffffff;
  --on-seq-5: #0b0b0b; --on-seq-6: #0b0b0b; --on-seq-7: #0b0b0b;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
strong { font-weight: 600; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding-inline: 24px;
  padding-block: 44px 80px;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 56px;
}
main { min-width: 0; max-width: 760px; }

.toc {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 28px);
  align-self: start;
  font-size: 13px;
  line-height: 1.5;
  padding-top: 6px;
}
.toc-h { font-size: 12px; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a {
  display: block;
  padding: 4px 0 4px 10px;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  text-decoration: none;
}
.toc a:hover { color: var(--ink); border-left-color: var(--axis); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); }

.kicker { font-size: 13px; letter-spacing: .06em; color: var(--muted); margin: 0; }
h1 {
  font-weight: 700;
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1.22;
  letter-spacing: .01em;
  margin: 10px 0 16px;
  text-wrap: balance;
}
.dek { font-size: 17px; color: var(--ink-2); margin: 0; max-width: 42em; }
.meta { font-size: 13px; color: var(--muted); margin: 14px 0 0; }

.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  margin: 30px 0 0;
}
.kpi { background: var(--surface); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi-l { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.kpi-v { font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.kpi-v small { font-size: 14px; font-weight: 500; color: var(--ink-2); margin-left: 4px; letter-spacing: 0; }
.kpi-d { font-size: 13px; color: var(--ink); line-height: 1.45; }
.kpi-p { font-size: 12px; color: var(--muted); line-height: 1.45; }

.verdict {
  margin: 28px 0 0;
  padding: 22px 24px 8px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.verdict h2 { font-size: 21px; margin: 0 0 12px; }
.verdict ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.verdict li { padding-left: 16px; position: relative; }
.verdict li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.verdict p.fine { font-size: 13px; color: var(--muted); margin: 16px 0 12px; }

section { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--rule); scroll-margin-top: 20px; }
h2 {
  font-weight: 700;
  font-size: 27px;
  line-height: 1.35;
  margin: 0 0 8px;
  text-wrap: balance;
}
.thesis { font-size: 17px; color: var(--ink-2); margin: 0 0 20px; }
h3 { font-size: 17px; font-weight: 600; line-height: 1.5; margin: 30px 0 8px; }
p { margin: 0 0 14px; }
ul.pts { margin: 0 0 16px; padding-left: 1.2em; }
ul.pts li { margin: 0 0 8px; }
ul.pts li::marker { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.src { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 6px 0 0; }
.src a { color: var(--muted); }
.note {
  font-size: 14px;
  color: var(--ink-2);
  background: var(--accent-wash);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 18px 0;
}

figure.chart {
  margin: 22px 0 26px;
  padding: 16px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
figure.chart figcaption { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.chart-title { font-size: 15px; font-weight: 600; line-height: 1.45; }
.chart-sub { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin: 0 0 8px; line-height: 1.4; }
.lg-i { display: inline-flex; align-items: center; gap: 6px; }
.lg-sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.lg-ln { width: 14px; height: 2px; border-radius: 1px; flex: none; }
.plot { position: relative; outline: none; border-radius: 6px; }
.plot:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.chart-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.tbl-btn {
  font: inherit;
  font-size: 12.5px;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
}
.tbl-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.tbl-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.tbl-wrap { overflow-x: auto; margin-top: 10px; }
table.dt { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; line-height: 1.5; }
table.dt th, table.dt td { padding: 5px 10px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
table.dt th:first-child { text-align: left; font-weight: 500; }
table.dt thead th { color: var(--ink-2); font-weight: 600; }
table.dt td.note { text-align: left; white-space: normal; color: var(--ink-2); }

.viz { display: block; overflow: visible; touch-action: pan-y; }
.viz .gr { stroke: var(--grid); stroke-width: 1; }
.viz .ax { stroke: var(--axis); stroke-width: 1; }
.viz .tk { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz .dl { fill: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz .rl { fill: var(--ink-2); font-size: 13px; }
.viz .il { font-size: 11px; font-weight: 600; pointer-events: none; font-variant-numeric: tabular-nums; }
.viz .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .area { opacity: .1; }
.viz .dot { stroke: var(--surface); stroke-width: 2; }
.viz .xh { stroke: var(--axis); stroke-width: 1; }
.viz .ref { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 3; opacity: .75; }
.viz .rt { fill: var(--ink-2); font-size: 11px; }
.viz .hit { fill: transparent; }
.viz .mk { transition: opacity .15s ease; }
.viz .mk.dim { opacity: .42; }
.tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .10);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
  line-height: 1.55;
  min-width: 112px;
  max-width: 260px;
}
.tip-h { color: var(--ink-2); margin-bottom: 3px; }
.tip-r { display: flex; align-items: center; gap: 7px; }
.tip-r b { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip-r span { color: var(--ink-2); }
.tip-k { width: 10px; height: 3px; border-radius: 2px; flex: none; }
.tip-n { color: var(--ink-2); font-size: 12px; margin-top: 4px; line-height: 1.5; }

.tbl { overflow-x: auto; margin: 16px 0 24px; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.6; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--rule); }
.tbl thead th { font-size: 13px; color: var(--ink-2); font-weight: 600; border-bottom-color: var(--axis); white-space: nowrap; }
.tbl td.nowrap, .tbl th.nowrap { white-space: nowrap; }

ol.refs { font-size: 13px; color: var(--ink-2); line-height: 1.6; padding-left: 1.6em; margin: 0; display: grid; gap: 6px; }
ol.refs a { word-break: break-all; }
footer.end { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }

@media (max-width: 980px) {
  .page { grid-template-columns: minmax(0, 1fr); gap: 0; padding-inline: 16px; padding-block: 28px 64px; }
  .toc { display: none; }
  main { max-width: none; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-v { font-size: 24px; }
  h2 { font-size: 23px; }
  figure.chart { padding: 14px 12px 10px; }
  .verdict { padding: 18px 16px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .viz .mk { transition: none; }
}

/* ---- shenhuo additions ---- */
.formula {
  font-size: 15px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 4px 0 16px;
  font-variant-numeric: tabular-nums;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.tbl .r, .tbl th.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr.sum td { font-weight: 600; border-top: 1px solid var(--axis); }
.tbl-cap { caption-side: top; text-align: left; font-size: 13px; color: var(--ink-2); padding: 0 0 6px; }
table.dt th.tbl-sub { text-align: left; color: var(--ink-2); font-weight: 600; padding-top: 12px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend.lg-scale { gap: 0 2px; align-items: center; }
.legend.lg-scale > span { margin: 0 6px; }
.legend.lg-scale .lg-sw { width: 18px; border-radius: 0; }
.viz .fit { stroke-width: 1.5; opacity: .5; }
.viz .hm-mark { fill: var(--ink); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.seg { display: inline-flex; gap: 0; margin: 0 0 10px; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.seg button, .presets button {
  font: inherit; font-size: 12.5px; line-height: 1.4; color: var(--ink-2);
  background: var(--surface); border: 0; padding: 5px 10px; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"], .presets button[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
.seg button:focus-visible, .presets button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.calc { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 16px; margin: 18px 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.presets button { border: 1px solid var(--rule); border-radius: 999px; padding: 4px 11px; }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.sliders { display: grid; gap: 10px; }
.sl { display: grid; gap: 2px; font-size: 13.5px; }
.sl-h { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); }
.sl output { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sl input[type="range"] { width: 100%; margin: 4px 0; accent-color: var(--accent); }
.results { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.res-main { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.res-l { font-size: 13px; color: var(--ink-2); }
.res-v b { font-size: 40px; font-weight: 650; line-height: 1.15; letter-spacing: -.01em; }
.res-v small { font-size: 15px; color: var(--ink-2); margin-left: 6px; }
.res-d { font-size: 13px; color: var(--ink-2); }
.res-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 0; }
.res-kv div { display: flex; flex-direction: column; }
.res-kv dt { font-size: 12.5px; color: var(--muted); }
.res-kv dd { margin: 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.parts { display: grid; gap: 6px; font-size: 13px; }
.part { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) 4.2em; align-items: center; gap: 8px; color: var(--ink-2); }
.part b { text-align: right; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.part .bar { height: 10px; background: var(--grid); border-radius: 3px; overflow: hidden; }
.part .bar i { display: block; height: 100%; background: var(--div-pos); border-radius: 0 3px 3px 0; transition: width .15s ease; }
.part .bar i.neg { background: var(--div-neg); }
.results .fine { font-size: 12.5px; color: var(--muted); margin: 0; }

@media (max-width: 720px) {
  .calc-grid { grid-template-columns: minmax(0, 1fr); }
  .calc { padding: 14px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .part .bar i { transition: none; }
}
.page-404 { grid-template-columns: minmax(0, 1fr); }

.skip { position:absolute; left:16px; top:-80px; background:var(--surface); padding:8px 12px; z-index:10; }
.skip:focus { top:8px; }
.formula { overflow-wrap:anywhere; }
