/* Catnip FP8 Outlier Statistics —— 样式表
 * 配色与圆角等统一在 :root 的自定义属性里，改主题优先改那里。
 * 末尾 .nav-home 是返回主报告的导航链接。
 */

:root {
  --ink: #132337;
  --muted: #5b6979;
  --paper: #f5f3ed;
  --surface: #fffdf9;
  --surface-2: #edf3f2;
  --navy: #173b5f;
  --blue: #235789;
  --teal: #007f86;
  --teal-dark: #006268;
  --amber: #dc9a2f;
  --red: #c94e5f;
  --purple: #6848a5;
  --green: #3e8f6d;
  --line: #d7dedc;
  --good-bg: #e7f4ef;
  --warn-bg: #fff4d9;
  --bad-bg: #fbeaec;
  --shadow: 0 18px 60px rgba(27, 49, 69, .09);
  --radius: 18px;
  --page: min(1200px, calc(100% - 36px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 4%, rgba(0, 127, 134, .12), transparent 26rem),
    radial-gradient(circle at 3% 18%, rgba(220, 154, 47, .1), transparent 23rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--teal-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.16; letter-spacing: -.025em; }
h1 { margin: 0; max-width: 1050px; font-size: clamp(2.6rem, 7vw, 5.5rem); }
h2 { margin: 0 0 16px; font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { margin: 0 0 12px; font-size: clamp(1.2rem, 2vw, 1.58rem); }
h4 { margin: 0 0 8px; font-size: 1rem; }
p { margin: 0 0 1em; }
strong { color: var(--navy); }
code, .mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .91em;
  overflow-wrap: anywhere;
}
code { padding: .1em .36em; border-radius: 5px; background: #edf0ef; }

.progress { position: fixed; z-index: 110; inset: 0 auto auto 0; width: 0; height: 4px; background: linear-gradient(90deg, var(--amber), var(--teal)); }
.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgba(19, 35, 55, .09);
  background: rgba(245, 243, 237, .92);
  backdrop-filter: blur(16px);
}
.topbar-inner { width: var(--page); min-height: 64px; margin: auto; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 850; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--navy); box-shadow: inset -8px -8px 0 rgba(0,127,134,.58); font-size: 12px; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 8px 10px; border-radius: 999px; color: var(--muted); font-size: .84rem; text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav a.active { color: white; background: var(--navy); }

.hero { width: var(--page); margin: auto; padding: clamp(72px, 10vw, 140px) 0 55px; }
.eyebrow, .section-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--teal-dark); font-size: .77rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before, .section-kicker::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: var(--amber); }
.hero h1 em { color: var(--teal); font-style: normal; }
.hero-lead { max-width: 900px; margin: 28px 0 30px; color: #405167; font-size: clamp(1.08rem, 2vw, 1.34rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--navy); border-radius: 999px; color: var(--navy); font-weight: 760; text-decoration: none; transition: .16s ease; }
.button.primary { color: white; background: var(--navy); }
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(23,59,95,.15); }

.verdict {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 1px;
  margin-top: 58px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}
.verdict article { min-height: 165px; padding: 24px; background: var(--surface); }
.verdict small { display: block; margin-bottom: 6px; color: var(--muted); font-weight: 760; }
.verdict b { display: block; margin-bottom: 7px; color: var(--navy); font-size: 1.25rem; line-height: 1.25; }
.verdict span { color: var(--muted); font-size: .9rem; }
.verdict article:first-child { background: var(--good-bg); }

main { width: var(--page); margin: auto; }
.section { padding: clamp(66px, 9vw, 108px) 0; border-top: 1px solid rgba(19,35,55,.11); }
.section-intro { max-width: 850px; margin-bottom: 32px; color: var(--muted); font-size: 1.05rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric { min-height: 160px; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,253,249,.86); }
.metric .value { color: var(--navy); font-size: clamp(1.65rem, 3vw, 2.4rem); font-weight: 900; line-height: 1.05; }
.metric .unit { color: var(--teal-dark); font-size: .78rem; font-weight: 850; text-transform: uppercase; }
.metric p { margin: 13px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.48; }

.plain-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 30px 0; }
.plain-card { padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.plain-card .tag { display: inline-flex; padding: 6px 9px; border-radius: 999px; color: white; background: var(--teal); font-size: .72rem; font-weight: 850; }
.plain-card h3 { margin-top: 13px; }
.plain-card p { color: var(--muted); }

.callout { margin: 28px 0; padding: 22px 24px; border: 1px solid #e3d29e; border-left: 5px solid var(--amber); border-radius: 12px; background: #fff8e7; }
.callout.good { border-color: #b8dcd0; border-left-color: var(--green); background: var(--good-bg); }
.callout.bad { border-color: #ecc3ca; border-left-color: var(--red); background: var(--bad-bg); }
.callout h3 { font-size: 1rem; letter-spacing: 0; }
.callout p:last-child { margin-bottom: 0; }

.stat-guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 25px 0; }
.stat-guide article { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stat-guide b { display: block; margin-bottom: 6px; font-size: 1.08rem; }
.stat-guide p { margin: 0; color: var(--muted); font-size: .88rem; }

.visual-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
figure { margin: 26px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.visual-grid figure { margin: 0; }
.chart-open { width: 100%; padding: 0; border: 0; background: white; cursor: zoom-in; }
.chart-open img { display: block; width: 100%; height: auto; }
figcaption { padding: 16px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .87rem; background: #fcfbf8; }
figcaption b { color: var(--navy); }

.step-list { position: relative; margin-top: 38px; }
.step-list::before { content: ""; position: absolute; left: 29px; top: 22px; bottom: 20px; width: 2px; background: linear-gradient(var(--amber), var(--teal), var(--navy)); }
.step { position: relative; display: grid; grid-template-columns: 60px minmax(0,1fr); gap: 24px; margin-bottom: 30px; }
.step-no { position: sticky; top: 82px; width: 60px; height: 60px; display: grid; place-items: center; border: 4px solid var(--paper); border-radius: 50%; color: white; background: var(--navy); font-weight: 900; box-shadow: 0 0 0 1px var(--line); }
.step-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.step-head { padding: 28px 30px 20px; }
.step-meta { color: var(--teal-dark); font-size: .76rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.step-summary { max-width: 880px; color: var(--muted); }
.step-body { padding: 28px 30px 32px; border-top: 1px solid var(--line); }
.adr-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.adr { padding: 21px 23px; background: #fbfaf6; }
.adr b { display: block; margin-bottom: 5px; color: var(--teal-dark); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.adr p { margin: 0; color: var(--muted); font-size: .9rem; }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.formula { padding: 20px; overflow-x: auto; border-radius: 12px; color: white; background: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 1.1rem; text-align: center; }
.stat-list { margin: 0; padding: 0; list-style: none; }
.stat-list li { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stat-list li:last-child { border-bottom: 0; }
.stat-list span { color: var(--muted); }
.stat-list b { text-align: right; font-variant-numeric: tabular-nums; }

.table-wrap { margin: 22px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .89rem; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--navy); background: #edf2f0; font-size: .75rem; letter-spacing: .045em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: #f8faf8; }
.risk-table td:first-child { min-width: 330px; font-family: "SFMono-Regular", Consolas, monospace; font-size: .79rem; overflow-wrap: anywhere; }

.badge { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: .72rem; font-weight: 850; white-space: nowrap; }
.badge.strong { color: #075d4e; background: #dff2ea; }
.badge.none { color: #7c3440; background: #f9e3e7; }
.badge.medium { color: #72500a; background: #ffedc7; }
.badge.boundary { color: #4d5970; background: #e9edf3; }

.decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.decision { padding: 24px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.decision.accept { border-top: 5px solid var(--green); }
.decision.reject { border-top: 5px solid var(--red); }
.decision ul { margin-bottom: 0; padding-left: 20px; color: var(--muted); }

.lane-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; }
.lane { padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.lane b { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 12px; border-radius: 50%; color: white; background: var(--teal); }
.lane p { margin: 0; color: var(--muted); font-size: .85rem; }

details { margin-top: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
summary { padding: 15px 18px; color: var(--navy); font-weight: 800; cursor: pointer; }
details > div { padding: 0 18px 18px; color: var(--muted); }

footer { width: var(--page); margin: auto; padding: 42px 0 70px; border-top: 1px solid rgba(19,35,55,.11); color: var(--muted); font-size: .87rem; }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 13px; align-items: flex-start; }

dialog { width: min(97vw, 1700px); max-height: 95vh; padding: 0; overflow: auto; border: 0; border-radius: 16px; background: white; box-shadow: 0 30px 100px rgba(8,25,40,.36); }
dialog::backdrop { background: rgba(12,27,42,.74); backdrop-filter: blur(5px); }
dialog img { display: block; width: 100%; }
.dialog-bar { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 14px 18px; color: var(--muted); }
.dialog-bar button { border: 0; border-radius: 999px; padding: 8px 11px; background: #edf0ef; cursor: pointer; }
.back-top { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--navy); text-decoration: none; box-shadow: 0 10px 30px rgba(23,59,95,.2); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .18s ease; }
.back-top.visible { opacity: 1; transform: none; pointer-events: auto; }

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .verdict, .stat-guide { grid-template-columns: 1fr; }
  .lane-grid { grid-template-columns: repeat(3,1fr); }
  .adr-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --page: min(100% - 24px, 1200px); }
  .topbar-inner { display: block; padding: 9px 0 7px; }
  .brand { margin-bottom: 5px; }
  .nav { margin-left: 0; }
  .nav a { padding: 6px 9px; font-size: .77rem; }
  .metric-grid, .plain-grid, .visual-grid, .split-2, .decision-grid { grid-template-columns: 1fr; }
  .lane-grid { grid-template-columns: 1fr; }
  .step-list::before { left: 21px; }
  .step { grid-template-columns: 43px minmax(0,1fr); gap: 9px; }
  .step-no { width: 43px; height: 43px; top: 108px; border-width: 3px; }
  .step-head, .step-body { padding: 22px 18px; }
  .risk-table td:first-child { min-width: 240px; }
  .footer-grid { display: block; }
  h1 { font-size: clamp(2.4rem, 14vw, 4rem); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *,*::before,*::after { transition-duration: .001ms !important; } }
@media print { .topbar,.progress,.hero-actions,.back-top { display: none !important; } body { background: white; } .step,figure,.card { break-inside: avoid; } .step-no { position: static; } .step-panel,.card { box-shadow: none; } }

/* ---- 返回主报告 ---- */
.nav .nav-home {
  font-weight: 700;
  color: var(--teal, #118a80);
  border-right: 1px solid var(--line, #d8dedc);
  padding-right: 12px;
  margin-right: 4px;
}
.nav .nav-home span { padding-right: 2px; }
