:root {
  --bg: #0a0d14;
  --bg-2: #0e121c;
  --surface: #121826;
  --surface-2: #161d2e;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #e7ecf5;
  --muted: #8b95ab;
  --faint: #5c6680;
  --accent: #6aa6ff;
  --accent-2: #4fe0c4;
  --pos: #46d193;
  --neg: #fb7185;
  --warn: #fbbf24;
  --serif: "Newsreader", Georgia, "Songti SC", serif;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  --maxw: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 620px at 86% -12%, rgba(106, 166, 255, .11), transparent 62%),
    radial-gradient(900px 520px at 0 8%, rgba(79, 224, 196, .065), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.wrap { width: min(var(--maxw), calc(100% - 56px)); margin: 0 auto; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 20, .74);
  backdrop-filter: blur(14px);
}
.nav-inner { height: 62px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.brand span { color: var(--accent); }
.navlinks { display: flex; gap: 28px; color: var(--muted); font-size: 14px; }
.navlinks a:hover { color: var(--text); }

.hero { padding: 94px 0 62px; }
.kicker {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.hero h1, .chapter h2, .about h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0;
}
.hero h1 {
  max-width: 14ch;
  font-size: clamp(42px, 6.4vw, 84px);
  line-height: 1.02;
}
.hero em { color: var(--accent); font-style: italic; }
.lede { max-width: 56ch; margin: 26px 0 0; color: var(--muted); font-size: 18px; }
.updated { margin: 18px 0 0; color: var(--faint); font-family: var(--mono); font-size: 12.5px; }

.bignums {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 62px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}
.bignum {
  min-height: 190px;
  padding: 24px 22px 18px;
  background: var(--bg-2);
}
.bignum .label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12.5px; }
.bignum .value { margin-top: 13px; font-family: var(--mono); font-size: 39px; font-weight: 600; line-height: 1; }
.bignum .unit { margin-left: 5px; color: var(--muted); font-size: 15px; font-weight: 500; }
.bignum .period { margin-top: 10px; color: var(--faint); font-family: var(--mono); font-size: 12px; }
.spark { width: 100%; height: 38px; margin-top: 16px; display: block; }

.band { padding: 78px 0; border-top: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.section-head p { max-width: 34ch; margin: 0; color: var(--faint); font-size: 13px; text-align: right; }
.seg-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(106, 166, 255, .06);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.seg-tag i { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }

.chapter-no { color: var(--accent); font-family: var(--mono); font-size: 14px; letter-spacing: .1em; }
.chapter h2, .about h2 { margin-top: 14px; max-width: 18ch; font-size: clamp(32px, 4.4vw, 54px); line-height: 1.06; }
.judgment {
  max-width: 62ch;
  margin: 20px 0 34px;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
  color: var(--text);
  font-size: 18px;
}
.chart-card, .detail-main, .graph-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
}
.chart-card { padding: 26px 26px 18px; }
.chart-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.chart-title h3 { margin: 0; font-size: 15px; }
.chart-title span { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.line-chart { width: 100%; height: 310px; margin-top: 8px; display: block; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.legend span::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 3px;
  margin-right: 7px;
  border-radius: 2px;
  background: var(--legend-color);
  vertical-align: middle;
}
.callouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.callout {
  min-height: 104px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.callout .k { color: var(--muted); font-size: 12.5px; }
.callout .v { margin-top: 6px; font-family: var(--mono); font-size: 24px; font-weight: 600; }
.more-link { display: inline-flex; margin-top: 28px; color: var(--accent); font-size: 14px; font-weight: 600; }

.toolbar { display: grid; gap: 12px; margin-bottom: 26px; }
.search {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  max-width: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--faint);
  overflow: hidden;
}
.search span { padding-left: 14px; font-size: 13px; }
.search input {
  min-width: 0;
  height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
.filters { display: flex; gap: 9px; flex-wrap: wrap; }
.chip {
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.on { border-color: var(--accent); background: var(--accent); color: #08111f; font-weight: 700; }

.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 172px;
  gap: 16px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 16px 40px -24px rgba(0, 0, 0, .9); }
.card.big, .card.wide { grid-column: span 2; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-name { max-width: 78%; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.badge {
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
}
.badge.high, .badge.derived { border-color: rgba(70, 209, 147, .42); background: rgba(70, 209, 147, .08); color: var(--pos); }
.badge.medium { border-color: rgba(251, 191, 36, .42); background: rgba(251, 191, 36, .08); color: var(--warn); }
.card-value { font-family: var(--mono); font-size: 30px; font-weight: 600; line-height: 1.05; }
.card-value .unit { margin-left: 3px; color: var(--muted); font-size: 14px; font-weight: 500; }
.card-meta, .card-foot { color: var(--faint); font-family: var(--mono); font-size: 11.5px; }
.card .spark { position: absolute; left: 0; right: 0; bottom: 35px; height: 38px; margin: 0; opacity: .92; }
.empty { border-style: dashed; }
.empty .card-value { color: var(--faint); font-family: var(--sans); font-size: 15px; line-height: 1.5; }

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .9fr);
  gap: 18px;
}
.detail-main { padding: 26px; }
.detail-main h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 32px; font-weight: 500; }
.detail-sub { margin: 0 0 18px; color: var(--muted); }
.side { display: grid; gap: 14px; align-content: start; }
.infobox {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  background: var(--surface);
}
.infobox .label { color: var(--faint); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.infobox .body { margin-top: 7px; font-size: 14px; }
.infobox a { color: var(--accent); }
.related { display: flex; flex-direction: column; gap: 6px; }

.graph-shell { position: relative; overflow: hidden; padding: 10px; background: radial-gradient(720px 420px at 50% 40%, rgba(106, 166, 255, .07), transparent 70%), var(--bg-2); }
#graph-svg { width: 100%; height: 520px; display: block; }
#graph-note {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  color: var(--faint);
  font-size: 12px;
  pointer-events: none;
}
.graph-list { display: none; margin-top: 16px; gap: 12px; }
.graph-list-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: var(--surface);
}
.graph-list-section h3 { margin: 0 0 10px; font-size: 14px; }
.graph-list-section div { display: grid; gap: 8px; }
.graph-list-section button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--bg-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.graph-list-section button:hover { border-color: var(--accent); }
.graph-list-section small {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.about-grid { display: grid; grid-template-columns: .95fr 1.25fr; gap: 48px; align-items: start; }
.about p { max-width: 56ch; color: var(--muted); font-size: 17px; }
.method-cards { display: grid; gap: 14px; }
.method-cards article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}
.method-cards h3 { margin: 0 0 5px; font-size: 16px; }
.method-cards p { margin: 0; color: var(--muted); font-size: 14px; }

.footer { border-top: 1px solid var(--line); padding: 40px 0 58px; color: var(--muted); font-size: 13px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }

@media (max-width: 960px) {
  .bignums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail, .about-grid { grid-template-columns: 1fr; }
  .callouts { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .wrap { width: min(100% - 32px, var(--maxw)); }
  .navlinks { display: none; }
  .hero { padding-top: 66px; }
  .bignums, .bento { grid-template-columns: 1fr; }
  .card.big, .card.wide { grid-column: span 1; }
  .section-head { display: block; }
  .section-head p { margin-top: 12px; text-align: left; }
  .chart-title { display: block; }
  #graph-svg { height: 620px; }
  .graph-shell { display: none; }
  .graph-list { display: grid; }
}
