:root {
  color-scheme: light;
  --ink: #152640;
  --muted: #536477;
  --teal: #006670;
  --line: #dce5ec;
  --paper: #fff;
  --wash: #f2f6f8;
  --gutter: clamp(1.1rem, 5vw, 4.25rem);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font: 1rem/1.75 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
a { color: var(--teal); text-underline-offset: .2em; }
a:hover { color: #003e49; }
a:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid #007a82; outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -6rem; padding: .6rem; background: white; z-index: 5; }
.skip:focus { top: .5rem; }

.hero { background: #102940; color: white; border-bottom: 4px solid #48b7ad; }
.hero-inner { max-width: 1320px; margin: auto; padding: clamp(2rem, 5vw, 4.5rem) var(--gutter); }
.hero h1 { margin: 0; max-width: 25ch; font-size: clamp(1.9rem, 5vw, 4rem); line-height: 1.2; text-wrap: balance; }
.intro { max-width: 49rem; margin: 1rem 0 0; color: #dbe9f2; }
.site-nav { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin-bottom: 1.5rem; }
.site-nav a { color: #bce1df; font-size: .87rem; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: white; text-decoration: underline; }

.overview, .framework, .layout { max-width: 1320px; margin: auto; padding: 2rem var(--gutter) 4rem; }
.research-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.research-map a {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  height: 100%;
  min-height: 10.5rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-top: 3px solid #007a82;
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
}
.research-map a:hover { border-color: #007a82; background: #eef8f7; }
.research-map strong { font-size: 1.12rem; line-height: 1.45; }
.research-map span { color: var(--muted); font-size: .9rem; }
.research-map .card-arrow { margin-top: auto; color: var(--teal); font-size: 1.2rem; }

.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.75rem); }
.chapter-nav { position: sticky; top: 1.5rem; align-self: start; padding: .6rem 0; }
.chapter-nav h2 { margin: 0 0 .7rem; font-size: 1rem; }
.chapter-nav ol { margin: 0; padding-left: 1.35rem; color: var(--muted); }
.chapter-nav li { padding: .2rem 0; }
.chapter-nav a { color: var(--ink); font-size: .88rem; text-decoration: none; }
.chapter-nav a:hover, .chapter-nav a[aria-current] { color: var(--teal); text-decoration: underline; }
.framework { max-width: 1020px; }
.framework-status { margin: 0 0 .8rem; color: var(--muted); font-size: .9rem; }
main { min-width: 0; }
section {
  padding: clamp(1.05rem, 3.5vw, 2.6rem);
  margin: 0 0 1.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
section h2 { margin: 0 0 1rem; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.35; }
section h3 { margin: 1.8rem 0 .55rem; font-size: 1.18rem; line-height: 1.45; }
section p { margin: .8rem 0; }
section ul, .workflow { padding-left: 1.4rem; }
section li + li { margin-top: .65rem; }
.layers dt { font-weight: 700; margin-top: .8rem; }
.layers dd { margin: .15rem 0 0; }

figure { margin: 1.15rem 0; background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
figure img { display: block; width: 100%; height: auto; }
figure a { display: block; }
.chart-scroll, .table-scroll { overflow-x: auto; }
.comparison img { min-width: 660px; }
.comparison figcaption { padding: .65rem .85rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; line-height: 1.55; }
.comparison figcaption a { display: inline-block; margin-left: .35rem; }
.table-scroll { margin: 1.1rem 0 1.35rem; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; min-width: 35rem; border-collapse: collapse; font-size: .94rem; line-height: 1.6; }
th, td { padding: .72rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: #e8f1f4; color: #163746; }
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:last-child td { border-bottom: 0; }
td[style*="right"], th[style*="right"] { white-space: nowrap; font-variant-numeric: tabular-nums; }
td a { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .research-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .layout { display: block; padding-top: 1rem; }
  .chapter-nav { position: static; padding: 1rem; margin-bottom: 1rem; background: white; border: 1px solid var(--line); border-radius: 8px; }
  .chapter-nav ol { columns: 2; column-gap: 1.6rem; }
  .chapter-nav li { break-inside: avoid; }
}
@media (max-width: 460px) {
  .research-map a { min-height: 9rem; padding: .9rem; }
  .research-map strong { font-size: 1rem; }
  .chapter-nav ol { columns: 1; }
}
@media print {
  body, .hero { background: white; color: #111; }
  .hero { border: 0; }
  .intro { color: #111; }
  .hero-inner, .layout, .framework { display: block; padding: 0; }
  nav, .skip { display: none; }
  section { border: 0; padding: 0; margin: 1.2rem 0; }
  h2, h3 { break-after: avoid; }
  figure { break-inside: avoid; }
  .table-scroll, .chart-scroll { overflow: visible; }
  table, .comparison img { min-width: 0; }
  table { font-size: .78rem; }
  tr { break-inside: avoid; }
  td, th { padding: .35rem; }
}
