:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e2e4e8;
  --accent: #b23c2e;
  --serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- 报头 masthead ---------- */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead .wrap { padding-top: 46px; padding-bottom: 30px; }
.masthead .rule { width: 44px; height: 3px; background: var(--accent); margin-bottom: 18px; }
.masthead h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 4.6vw, 44px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .01em;
  margin: 0;
}

/* ---------- 年份控制条 ---------- */
.controlbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 20px;
  background: rgba(247, 247, 248, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.controlbar > *:first-child { margin-left: auto; margin-right: auto; }
.controlbar .controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.controlbar label { font-size: 13px; color: var(--muted); }
#year-slider { width: 260px; }
#year-label {
  min-width: 64px; font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums; text-align: center;
}
#play-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 6px; padding: 7px 18px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: border-color .2s, color .2s, transform .15s;
}
#play-btn:hover { border-color: var(--accent); color: var(--accent); }
#play-btn:active { transform: translateY(1px); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--fill, 0%), var(--line) var(--fill, 0%));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,.15); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent); cursor: pointer;
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 999px; background: var(--line); }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
#play-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 关键指标网格（表格化单元格） ---------- */
.cards {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
  background: var(--surface); margin: 28px 0 0;
}
.card { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px; }
.card-label { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.card-value {
  font-size: 26px; font-weight: 650; margin-top: 8px;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}

/* ---------- 章节 ---------- */
.section { padding: 38px 0 0; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.section-index {
  font-size: 12px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; letter-spacing: .1em;
}
.section-head h2 { font-size: 21px; font-weight: 650; margin: 0; letter-spacing: .01em; }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--line); align-self: center; margin-left: 4px; }
.chart { width: 100%; height: 420px; }
.chart--tall { height: 520px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 44px; }
.grid-2 .section:last-child { padding-left: 0; }

/* ---------- 页脚 ---------- */
footer.colophon {
  max-width: 1180px; margin: 44px auto 0; padding: 22px 20px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; line-height: 1.9;
}
footer.colophon a { color: var(--accent); text-decoration: none; }
footer.colophon a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .grid-2 .section { padding-top: 38px; }
}
@media (max-width: 720px) {
  #year-slider { width: 150px; }
  .controlbar > *:first-child { margin-left: 0; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .chart { height: 340px; }
  .chart--tall { height: 420px; }
  .masthead .wrap { padding-top: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
