:root {
  --paper: #f3efe6;
  --ink: #1a1714;
  --muted: #6b645b;
  --card: #fffcf7;
  --line: #e4dccf;
  --navy: #16324f;
  --navy-deep: #102033;
  --gold: #b0893e;
  --up: #c0392b;
  --down: #1e7a4a;
  --info: #1f4e79;
  --shadow: 0 10px 30px rgba(16, 32, 51, 0.06);
  --radius: 14px;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC",
    "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(176, 137, 62, 0.08), transparent 55%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  background: linear-gradient(180deg, var(--navy-deep) 0%, #15283f 100%);
  color: #f6f1e7;
  padding: 36px 0 32px;
  border-bottom: 3px solid var(--gold);
}
.header-inner { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; }
.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  color: #d7c39a;
}
h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 40px); font-weight: 650; letter-spacing: 0.04em; }
.lede { margin: 0; max-width: 72ch; color: #d9d3c8; font-size: 15px; }
.header-meta { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(215,195,154,0.35);
  color: #f6f1e7;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.chip.quiet { color: #c8c0b3; border-color: rgba(255,255,255,0.12); }

main { padding: 28px 0 80px; }
.intro { font-size: 15.5px; color: #2a2622; max-width: 95ch; margin: 0 0 10px; }
.sources { font-size: 13px; color: var(--muted); margin: 0 0 22px; }
.sources a { color: var(--info); text-underline-offset: 3px; }

.callout {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.callout.danger { border-left-color: var(--up); }
.callout-lead { margin: 0 0 6px; font-weight: 650; font-size: 17px; }
.callout p:last-child { margin: 0; color: #3a3530; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.metric {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
  min-height: 118px;
}
.metric .value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.metric .label { margin-top: 6px; font-size: 13px; color: var(--muted); }
.metric .detail { margin-top: 4px; font-size: 12.5px; color: #514c46; }
.metric.up .value { color: var(--up); }
.metric.down .value { color: var(--down); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 10px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: 0.02em; }
.caption { margin: 0; color: var(--muted); font-size: 13px; max-width: 78ch; }

.range-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.range-switch button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.range-switch button[aria-pressed="true"] {
  background: var(--navy);
  color: #f6f1e7;
  border-color: var(--navy);
}

.chart { width: 100%; height: 380px; }
.chart-bars { height: 620px; }

.table-wrap { overflow-x: auto; margin: 12px 0 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.data th, table.data td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
table.data th { font-weight: 600; color: #3f3a34; background: #faf6ef; position: sticky; top: 0; }
table.data .num, table.data th.num { text-align: right; }
table.data tbody tr:hover { background: #f7f1e6; }
.pos { color: var(--up); }
.neg { color: var(--down); }

.method-body p { margin: 0 0 12px; color: #2f2b27; font-size: 14.5px; }
.method-body a { color: var(--info); }

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  border: 0;
  background: var(--navy);
  color: #f6f1e7;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16,32,51,0.25);
  z-index: 20;
}

@media (max-width: 980px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .header-inner, .panel-head { flex-direction: column; }
  .header-meta { align-items: flex-start; }
  .chart { height: 300px; }
  .chart-bars { height: 700px; }
}
@media (max-width: 640px) {
  .metrics { grid-template-columns: 1fr; }
  .metric .value { font-size: 24px; }
}

.site-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.site-nav a {
  color: #f6f1e7;
  text-decoration: none;
  border: 1px solid rgba(215,195,154,0.35);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
}
.site-nav a:hover { border-color: #d7c39a; background: rgba(255,255,255,0.06); }
.site-nav a[aria-current="page"] {
  background: rgba(255,255,255,0.12);
  border-color: #d7c39a;
  color: #f6f1e7;
}
