:root {
  color-scheme: light;
  --paper: #f6f5ef;
  --surface: #fffefa;
  --surface-soft: #eeeee5;
  --ink: #1b302a;
  --muted: #617069;
  --green: #174c3c;
  --green-dark: #0f352b;
  --green-soft: #e5eee5;
  --accent: #aa552c;
  --accent-soft: #faeddf;
  --line: #d8ded2;
  --warning: #80561f;
  --warning-soft: #fff5df;
  --radius: 16px;
  --radius-small: 9px;
  --shadow: 0 5px 22px rgb(31 50 37 / 5%);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 102px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.8 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
::selection { color: var(--green-dark); background: #dae6cc; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 4px; overflow-wrap: anywhere; }
a:hover { color: var(--accent); }
a, button, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, blockquote, figure { margin-top: 0; }
h1, h2, h3, h4 { color: var(--green-dark); font-weight: 700; line-height: 1.45; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.4vw, 3.65rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.4rem, 2.3vw, 1.95rem); letter-spacing: -.025em; }
h3 { font-size: 1.16rem; letter-spacing: -.015em; }
h4 { font-size: 1rem; }
p { margin-bottom: 1em; }
ul, ol { padding-left: 1.35em; }
li + li { margin-top: .38em; }
hr { margin: 2.2rem 0; border: 0; border-top: 1px solid var(--line); }
small { font-size: .83em; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .88em; }
code { padding: .12em .35em; border-radius: 4px; background: var(--surface-soft); overflow-wrap: anywhere; }
pre { margin: 1.4rem 0; padding: 1.15rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); overflow-x: auto; line-height: 1.7; }
pre code { padding: 0; background: transparent; overflow-wrap: normal; }
blockquote { margin-left: 0; padding: .6rem 1.25rem; border-left: 3px solid var(--green); color: var(--muted); background: var(--green-soft); }
blockquote p:last-child { margin-bottom: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 78px;
  padding: .8rem max(24px, calc((100vw - 1392px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgb(246 245 239 / 97%);
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--green-dark); font-weight: 750; letter-spacing: -.025em; line-height: 1.4; text-decoration: none; }
.brand small, .brand span { display: block; }
.brand small { color: var(--muted); font-size: .69rem; font-weight: 500; letter-spacing: .14em; }
.brand::before { content: ""; flex: 0 0 12px; width: 12px; height: 24px; border: 2px solid var(--green); border-radius: 10px 10px 2px 2px; background: linear-gradient(to top, var(--green) 48%, transparent 48%); }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; }
.nav a { padding: .4rem .8rem; border-radius: 7px; font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav a.active, .nav a[aria-current="page"] { color: var(--green-dark); background: var(--green-soft); }
.nav .active { box-shadow: inset 0 -2px 0 var(--green); }

.layout { display: grid; grid-template-columns: 225px minmax(0, 1fr); align-items: start; gap: clamp(28px, 4vw, 60px); width: min(1440px, 100%); margin: 0 auto; padding: 40px 24px 64px; }
.sidebar { position: sticky; top: 108px; max-height: calc(100vh - 138px); padding: 8px 18px 16px 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; font-size: .86rem; }
.sidebar h2, .sidebar h3 { margin: 1.5rem 0 .6rem; font-size: .76rem; color: var(--muted); letter-spacing: .08em; }
.sidebar h2:first-child, .sidebar h3:first-child { margin-top: 0; }
.sidebar p { color: var(--muted); font-size: .79rem; }
.sidebar a { display: block; padding: .44rem .7rem; border-radius: 6px; color: var(--muted); line-height: 1.6; text-decoration: none; }
.sidebar a:hover, .sidebar a.active, .sidebar a[aria-current] { color: var(--green-dark); background: var(--green-soft); }
.sidebar ul, .sidebar ol { margin: 0; padding: 0; list-style: none; }
.sidebar li + li { margin-top: .2rem; }
.sidebar .nav { display: block; }
.sidebar .nav a { white-space: normal; font-size: inherit; }
.main { min-width: 0; }
body > .main, .container { width: min(1440px, calc(100% - 48px)); margin-right: auto; margin-left: auto; }
body > .main { padding: 44px 0 64px; }
.eyebrow { display: block; margin-bottom: 1rem; color: var(--accent); font-size: .73rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.hero { position: relative; margin-bottom: 2.6rem; padding: 1.1rem 0 2.2rem; border-bottom: 1px solid var(--line); }
.hero h1 { max-width: 20em; margin-bottom: 1.1rem; }
.hero .lead { max-width: 68ch; }
.lead { color: #506359; font-size: clamp(1.04rem, 1.6vw, 1.18rem); line-height: 1.9; }
.muted { color: var(--muted); }
.hero > :last-child { margin-bottom: 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 12px; margin: 1.8rem 0 0; }
.metric { padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); }
.metric strong { display: block; color: var(--green); font-size: clamp(1.55rem, 2.7vw, 2.15rem); line-height: 1.3; font-variant-numeric: tabular-nums; }
.metric span, .metric small { display: block; margin-top: .25rem; color: var(--muted); font-size: .8rem; }
.section { margin: 0 0 3.25rem; scroll-margin-top: 102px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .6rem 1.5rem; margin-bottom: 1.1rem; }
.section-head h2, .section-head h3, .section-head p { margin: 0; }
.section-head > p, .section-head > .muted { font-size: .85rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; align-items: stretch; }
.card { min-width: 0; padding: clamp(20px, 2.2vw, 28px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card h2 { font-size: 1.5rem; }
.card h3 { margin: .65rem 0 .7rem; }
.card p { font-size: .94rem; }
.card > :last-child { margin-bottom: 0; }
.card p, .card li, .card dd, .card summary { overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.card-meta .badge { margin: 0; }
.card > a:first-child, .card h2 a, .card h3 a { text-decoration: none; }
a.card, a.step { display: block; color: inherit; text-decoration: none; }
a.card:hover h2, a.card:hover h3, a.step:hover h3 { color: var(--accent); }
.card:hover { border-color: #b9c9b9; }
.hero-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.badge.track { color: #1f4f7a; background: #e6eef6; }
.priority-reason { margin: .2rem 0 .8rem; color: var(--muted); font-size: .82rem; line-height: 1.7; }
.priority-reason strong { color: var(--accent); font-weight: 650; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 8px 16px; margin: 0 0 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface-soft); font-size: .84rem; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; }
.facts dd { margin: 0; color: var(--ink); }
.sources.chips { gap: .45rem .5rem; }
.sources.chips a { padding: .2rem .7rem; border: 1px solid #c7d6c1; border-radius: 999px; color: var(--green-dark); background: var(--surface); font-weight: 600; text-decoration: none; }
.sources.chips a:hover { border-color: var(--accent); color: var(--accent); }
.paper-card { display: flex; flex-direction: column; }
.paper-card .sources { margin-top: auto; padding-top: .9rem; }
.paper-card .button { align-self: flex-start; }
.paper-card h3 { line-height: 1.5; overflow-wrap: anywhere; }
.paper-card .muted { font-size: .83rem; }
.badge, .priority, .score { display: inline-flex; align-items: center; gap: .3em; padding: .17rem .58rem; border: 1px solid transparent; border-radius: 5px; font-size: .73rem; font-weight: 650; line-height: 1.65; vertical-align: middle; }
.badge { margin: 0 .25rem .3rem 0; color: var(--green); background: var(--green-soft); }
.priority { color: var(--accent); background: var(--accent-soft); }
.score { color: var(--green-dark); border-color: #c7d6c1; background: #eef4e7; font-variant-numeric: tabular-nums; white-space: nowrap; }
.callout, .warning { margin: 1.35rem 0; padding: 1.15rem 1.35rem; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 0 var(--radius-small) var(--radius-small) 0; background: var(--green-soft); font-size: .94rem; }
.warning { color: #60491f; border-color: #e6d3aa; border-left-color: #aa7529; background: var(--warning-soft); }
.callout p:last-child, .warning p:last-child { margin-bottom: 0; }
.callout strong { color: var(--green-dark); }
.warning strong { color: var(--warning); }
.comparison { padding: 1.2rem 1.4rem; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-small) var(--radius-small) 0; background: var(--accent-soft); }
.comparison > :last-child { margin-bottom: 0; }

.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: 1.5rem 0 1rem; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface-soft); }
.toolbar label { display: grid; gap: .25rem; color: var(--muted); font-size: .75rem; font-weight: 600; }
.toolbar label:has([data-search]) { flex: 1 1 250px; }
.toolbar input, .toolbar select { min-height: 43px; padding: .5rem .75rem; border: 1px solid #bdc8bb; border-radius: 6px; color: var(--ink); background: var(--surface); font-size: .88rem; line-height: 1.5; }
.toolbar input { flex: 1 1 260px; min-width: min(230px, 100%); }
.toolbar input::placeholder { color: #778279; }
.toolbar select { max-width: 100%; padding-right: 1.8rem; }
.toolbar input:hover, .toolbar select:hover { border-color: var(--green); }
.toolbar [data-result-count] { margin: 0; align-self: center; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.empty-state { margin: 1.5rem 0; padding: 2.4rem 1.2rem; border: 1px dashed #b5c4b0; border-radius: var(--radius-small); color: var(--muted); background: var(--surface); text-align: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; padding: .55rem 1rem; border: 1px solid var(--green); border-radius: 7px; color: var(--surface); background: var(--green); font-size: .86rem; font-weight: 650; line-height: 1.5; text-decoration: none; cursor: pointer; }
.button:hover { color: #fff; border-color: var(--green-dark); background: var(--green-dark); }
.button.secondary { color: var(--green); border-color: var(--line); background: var(--surface); }
.button.secondary:hover { border-color: var(--green); background: var(--green-soft); }

.prose { max-width: 80em; font-size: 1rem; line-height: 1.95; overflow-wrap: anywhere; }
.prose h2 { margin: 2.5rem 0 1rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: 1.55rem; }
.prose h3 { margin: 1.9rem 0 .7rem; }
.prose h4 { margin: 1.4rem 0 .5rem; }
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose li { padding-left: .12em; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.15em; }
.prose strong { font-weight: 700; }
.prose .table-wrap { max-width: 100%; }
.report-header { margin-bottom: 2rem; padding: 1rem 0 1.8rem; border-bottom: 1px solid var(--line); }
.report-header h1 { margin-bottom: 1rem; font-size: clamp(1.85rem, 3.5vw, 2.85rem); letter-spacing: -.035em; }
.report-header .lead { max-width: 75ch; }
.report-header .sources { margin-top: 1rem; }
.report-header > :last-child { margin-bottom: 0; }
.table-wrap { margin: 1.25rem 0; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); overflow-x: auto; scrollbar-width: thin; }
.data-table, .prose table { width: 100%; border-collapse: collapse; color: var(--ink); font-size: .86rem; line-height: 1.75; text-align: left; }
.data-table th, .data-table td, .prose th, .prose td { min-width: 110px; padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.data-table th, .prose th { color: var(--green-dark); background: var(--surface-soft); font-size: .79rem; font-weight: 700; }
.data-table tbody tr:last-child td, .prose tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #f7f9f2; }
.data-table td:first-child { font-weight: 600; }
.data-table caption { padding: .8rem 1rem; color: var(--muted); font-size: .82rem; text-align: left; }
.data-table.compact { font-size: .8rem; line-height: 1.6; }
.data-table.compact th, .data-table.compact td { min-width: 150px; padding: .6rem .75rem; }
.data-table.compact td:first-child, .data-table.compact th:first-child { min-width: 170px; }
.data-table.sticky-first th:first-child, .data-table.sticky-first td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.data-table.sticky-first thead th:first-child { background: var(--surface-soft); }
.data-table td .muted, .data-table td small, .data-table th small { display: block; margin-top: .15rem; font-weight: 400; }
.decision { display: inline-block; padding: .05rem .5rem; border-radius: 5px; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.decision.d-deep { color: var(--green-dark); background: #dfeedd; }
.decision.d-index { color: #1f4f7a; background: #e6eef6; }
.decision.d-extend { color: var(--warning); background: var(--warning-soft); }
.decision.d-out { color: var(--muted); background: var(--surface-soft); }
.sources { display: flex; align-items: baseline; flex-wrap: wrap; gap: .45rem 1rem; margin: 1rem 0 0; color: var(--muted); font-size: .8rem; line-height: 1.8; }
ul.sources, ol.sources { display: block; padding-left: 1.25em; }
.sources a { text-decoration-color: #afbcad; }
.sources a:hover { text-decoration-color: var(--accent); }
.reading-path { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); gap: 14px; margin: 1.5rem 0; }
.step { padding: 1.2rem 1.25rem; border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: 0 0 var(--radius-small) var(--radius-small); background: var(--surface); }
.step h3 { margin-bottom: .6rem; font-size: 1.02rem; }
.step p { margin-bottom: 0; color: var(--muted); font-size: .86rem; }
.step .eyebrow { margin-bottom: .5rem; font-size: .7rem; }
.footer { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 1.35rem 0 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; line-height: 1.8; }
.footer p:last-child { margin-bottom: 0; }
details { margin: 1rem 0; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); }
summary { padding: .85rem 1rem; color: var(--green-dark); font-weight: 650; cursor: pointer; }
details[open] > summary { border-bottom: 1px solid var(--line); }
details > :not(summary) { margin: 1rem; }
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 100; padding: .65rem 1rem; color: #fff; background: var(--green); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

@media (prefers-reduced-motion: no-preference) {
  a, button, input, select, .card { transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease; }
}

@media (min-width: 1550px) {
  .layout { gap: 64px; }
}

@media (max-width: 1050px) {
  .layout { grid-template-columns: 185px minmax(0, 1fr); gap: 28px; }
  .sidebar { padding-right: 0; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
}

@media (max-width: 800px) {
  html { scroll-padding-top: 128px; }
  .topbar { flex-wrap: wrap; gap: .55rem 1rem; min-height: 74px; padding: .8rem 20px; }
  .brand { font-size: .96rem; }
  .nav { gap: .12rem; }
  .nav a { padding: .35rem .65rem; font-size: .81rem; }
  .layout { display: block; padding: 24px 20px 44px; }
  .sidebar { position: static; max-height: none; margin-bottom: 26px; padding: 0 0 18px; border-bottom: 1px solid var(--line); overflow: visible; }
  .sidebar nav, .sidebar .nav { display: flex; flex-wrap: wrap; gap: .25rem .35rem; }
  .sidebar h2, .sidebar h3 { margin: .7rem 0 .45rem; }
  .sidebar a { padding: .25rem .55rem; }
  .sidebar p { display: none; }
  .hero { margin-bottom: 2rem; padding-top: .5rem; }
  .hero h1 { letter-spacing: -.035em; }
  .section { margin-bottom: 2.6rem; scroll-margin-top: 128px; }
  body > .main, .container, .footer { width: calc(100% - 40px); }
  body > .main { padding-top: 28px; }
  .prose { max-width: none; }
  .report-header { padding-top: .25rem; }
}

@media (max-width: 500px) {
  body { font-size: 15px; }
  .topbar { padding-right: 16px; padding-left: 16px; }
  .topbar .nav { width: 100%; }
  .layout { padding-right: 16px; padding-left: 16px; }
  body > .main, .container, .footer { width: calc(100% - 32px); }
  h1 { font-size: 2rem; }
  .hero h1 { max-width: 100%; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { padding: .85rem; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .card { padding: 20px; border-radius: 12px; }
  .toolbar { padding: 12px; }
  .toolbar > input, .toolbar > label:has([data-search]) { flex-basis: 100%; width: 100%; }
  .toolbar > label, .toolbar > select { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .toolbar label select { width: 100%; }
  .toolbar [data-result-count] { width: 100%; }
  .callout, .warning, .comparison { padding: 1rem; }
  .sources { gap: .35rem .8rem; }
  .data-table th, .data-table td, .prose th, .prose td { min-width: 88px; padding: .7rem .8rem; }
  .data-table.compact th, .data-table.compact td { min-width: 130px; }
  .reading-path { gap: 10px; }
  .step { padding: 1rem; }
  .prose { font-size: .97rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  @page { margin: 16mm 14mm; }
  :root { --paper: #fff; --surface: #fff; --surface-soft: #f2f2ef; --ink: #17251f; --line: #c5cbc3; }
  html { scroll-behavior: auto; }
  body { background: #fff; font-size: 10pt; line-height: 1.7; }
  .topbar, .sidebar, .toolbar, .skip-link, [data-print], .empty-state { display: none !important; }
  .layout, body > .main, .container, .footer { display: block; width: 100%; max-width: none; margin: 0; padding: 0; }
  .main, .prose { max-width: none; }
  h1 { font-size: 25pt; }
  h2 { font-size: 17pt; }
  h3 { font-size: 12pt; }
  h1, h2, h3, h4, summary { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  .hero, .report-header { margin-bottom: 18pt; padding: 0 0 12pt; }
  .section { margin-bottom: 20pt; }
  .grid, .reading-path { display: block; }
  .card, .step { margin: 0 0 12pt; padding: 13pt; box-shadow: none; }
  .card, .step, .callout, .warning, .metric { break-inside: avoid; }
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8pt; }
  .metric { padding: 8pt; }
  .metric strong { font-size: 20pt; }
  .badge, .priority, .score { border: 1px solid #aaa; }
  .table-wrap { overflow: visible; border-radius: 0; }
  .data-table, .prose table { font-size: 8.5pt; }
  .data-table th, .data-table td, .prose th, .prose td { min-width: 0; padding: 6pt; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  a { color: var(--green-dark); text-decoration: underline; }
  .sources a[href^="http"]::after { content: " (" attr(href) ")"; color: #555; font-size: 7.5pt; overflow-wrap: anywhere; }
  .button { min-height: 0; padding: 0; border: 0; color: var(--green); background: transparent; text-decoration: underline; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .footer { margin-top: 20pt; padding-top: 10pt; font-size: 8pt; }
}
.benchmark-card h4 { margin: 1.3rem 0 .5rem; }
.benchmark-card .facts { margin-top: .4rem; }
