/* ── 人类历史时间轴 ─────────────────────────────────────────── */
:root {
  --bg: #0b0d11;
  --bg2: #101319;
  --bg3: #151922;
  --panel: #0f1218;
  --line: rgba(255, 255, 255, .075);
  --line2: rgba(255, 255, 255, .14);
  --fg: #eae6dd;
  --muted: #8d929d;
  --faint: #5d6370;
  --gold: #d8a94e;
  --gold-dim: rgba(216, 169, 78, .16);
  --label-w: 188px;
  --track-w: 1200px;
  --panel-w: 356px;
  --row-h: 30px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(216, 169, 78, .08), transparent 62%),
    radial-gradient(900px 600px at 92% 110%, rgba(64, 112, 180, .07), transparent 60%);
  z-index: 0;
}
button { font-family: inherit; }
::selection { background: rgba(216, 169, 78, .28); }

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
}

/* ── top bar ─────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 17, .7);
}
.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 27px;
  letter-spacing: .06em;
  line-height: 1;
  white-space: nowrap;
}
.brand h1 .dot { color: var(--gold); margin: 0 6px; font-weight: 400; }
.brand .sub {
  margin: 7px 0 0;
  font-size: 9.5px;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.brand .sub .dash { color: var(--gold); margin: 0 5px; letter-spacing: 0; }

.tools { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 11px;
  min-width: 286px;
  border: 1px solid var(--line2);
  border-radius: 7px;
  background: rgba(255, 255, 255, .025);
  transition: border-color .15s, background .15s;
}
.search:focus-within { border-color: rgba(216, 169, 78, .55); background: rgba(216, 169, 78, .04); }
.search svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 1.6; flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font-size: 12px;
  font-family: inherit;
}
.search input::placeholder { color: var(--faint); }
.search-meta {
  font-size: 10px;
  color: var(--gold);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.zoombox { display: flex; align-items: center; height: 34px; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; background: rgba(255, 255, 255, .025); }
.zoombox button {
  height: 100%;
  min-width: 34px;
  padding: 0 9px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: color .12s, background .12s;
}
.zoombox button:first-child { border-left: 0; font-size: 16px; }
.zoombox button:last-child { font-size: 11px; letter-spacing: .06em; }
.zoombox button:hover { color: var(--fg); background: rgba(255, 255, 255, .05); }

/* ── toolbar ─────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 17, .55);
  overflow: hidden;
}
.chips, .presets {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar, .presets::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 25px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.chip .cdot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(255, 255, 255, .04); }
.chip:hover { color: var(--fg); background: rgba(255, 255, 255, .04); }
.chip[aria-pressed="true"] { color: var(--fg); border-color: var(--line2); background: rgba(255, 255, 255, .05); }
.chip[aria-pressed="false"] { opacity: .42; }
.chip[aria-pressed="false"] .cdot { background: var(--faint); }
.presets { gap: 2px; }
.preset {
  flex: none;
  height: 25px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s, background .12s, border-color .12s;
}
.preset:hover { color: var(--fg); background: rgba(255, 255, 255, .04); }
.preset.active { color: var(--gold); border-color: rgba(216, 169, 78, .32); background: rgba(216, 169, 78, .07); }

/* ── stage / timeline ────────────────────────────────────── */
.mid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  min-height: 0;
  min-width: 0;
}
.stage { position: relative; min-width: 0; min-height: 0; }
.scroller {
  position: relative;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
  scrollbar-width: thin;
}
.scroller::-webkit-scrollbar { width: 9px; height: 9px; }
.scroller::-webkit-scrollbar-track { background: transparent; }
.scroller::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .13);
  border: 2px solid var(--bg);
  border-radius: 6px;
}
.scroller::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .24); }
.scroller.dragging { cursor: grabbing; }
.scroller.dragging * { cursor: grabbing !important; }

.axis {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  width: calc(var(--label-w) + var(--track-w));
  height: 96px;
  background: rgba(12, 14, 19, .94);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line2);
  box-shadow: 0 12px 24px -18px rgba(0, 0, 0, .9);
}
.axis-label {
  position: sticky;
  left: 0;
  z-index: 40;
  flex: 0 0 var(--label-w);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 0 12px 10px;
  background: linear-gradient(180deg, #0d1015, #0b0d11);
  border-right: 1px solid var(--line2);
}
.axis-title { font-size: 10px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.axis-hint { font-size: 9px; color: var(--faint); letter-spacing: .02em; }
.axis-track {
  position: relative;
  flex: 0 0 var(--track-w);
  width: var(--track-w);
  height: 100%;
}
.events { position: absolute; left: 0; right: 0; top: 6px; height: 52px; }
.ev {
  position: absolute;
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  height: 12px;
  font-size: 9.5px;
  line-height: 12px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: transparent;
  font-family: inherit;
  transform: translateX(-3px);
  z-index: 1;
}
.ev .pin {
  flex: none;
  width: 5px;
  height: 5px;
  margin-top: 4px;
  border-radius: 1px;
  background: var(--gold);
  opacity: .75;
  transform: rotate(45deg);
}
.ev:hover { color: var(--fg); z-index: 2; }
.ev:hover .pin { opacity: 1; box-shadow: 0 0 8px var(--gold); }
.ev.flip { transform: translateX(calc(-100% + 3px)); flex-direction: row-reverse; }
.ev.p1 { color: #cfa458; }
.ev.p1 .pin { background: var(--gold); opacity: 1; }
.ticks { position: absolute; left: 0; right: 0; bottom: 20px; height: 16px; }
.tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: .01em;
}
.tick.minor { color: var(--faint); font-size: 9px; }
.tick.edge-l { transform: none; }
.tick.edge-r { transform: translateX(-100%); }
.eras { position: absolute; left: 0; right: 0; bottom: 0; height: 17px; border-top: 1px solid var(--line); }
.era {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, .018);
  font-size: 8.5px;
  color: var(--faint);
  letter-spacing: .04em;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  align-items: center;
  padding: 0 7px;
}
.era:nth-child(even) { background: rgba(255, 255, 255, .035); }
.era b { font-weight: 500; color: var(--muted); margin-right: 4px; }
.era .era-note { color: var(--faint); opacity: .75; }

/* ── rows ────────────────────────────────────────────────── */
.rows { padding-bottom: 40px; }
.row {
  display: flex;
  width: calc(var(--label-w) + var(--track-w));
  height: var(--row-h);
  position: relative;
}
.row:hover { background: rgba(255, 255, 255, .022); }
.row.dim { opacity: .17; }
.row.dim:hover { opacity: .32; }
.row-label {
  position: sticky;
  left: 0;
  z-index: 12;
  flex: 0 0 var(--label-w);
  width: var(--label-w);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--bg);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
.row:hover .row-label { background: #0d1015; }
.row-label .edot {
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c);
  opacity: .85;
}
.row-label .names { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.row-label .zh {
  font-size: 12px;
  color: #d8d4cb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-label .en {
  font-size: 8.5px;
  color: var(--faint);
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.row.selected .row-label { background: #131720; box-shadow: inset 2px 0 0 var(--gold); }
.row.selected .row-label .zh { color: var(--fg); }
.row-track {
  position: relative;
  flex: 0 0 var(--track-w);
  width: var(--track-w);
  height: 100%;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, .048) 1px, transparent 1px);
  background-size: var(--grid-step, 100px) 100%;
  background-position: var(--grid-off, 0) 0;
}
.seg {
  position: absolute;
  top: 8px;
  height: 14px;
  min-width: 2px;
  border-radius: 2.5px;
  background: var(--c);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
  opacity: .9;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: filter .12s, opacity .12s, box-shadow .12s;
}
.seg:hover { filter: brightness(1.28) saturate(1.06); opacity: 1; z-index: 5; }
.seg .seg-t {
  display: none;
  padding: 0 5px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  color: rgba(9, 10, 14, .82);
  white-space: nowrap;
  letter-spacing: .01em;
  pointer-events: none;
}
.seg.wide .seg-t { display: block; }
.seg.short {
  min-width: 6px;
  border-radius: 1.5px;
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .34), 0 0 8px rgba(255, 255, 255, .07);
}
.seg.short .seg-t { display: none; }
.seg.active {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .95), 0 0 14px var(--c);
  opacity: 1;
  z-index: 6;
}
.seg.hit { outline: 1.5px dashed rgba(255, 255, 255, .72); outline-offset: 1px; z-index: 4; }
.seg.flash { animation: flash 1.4s ease-out; }
@keyframes flash {
  0% { box-shadow: 0 0 0 2px #fff, 0 0 22px var(--c); filter: brightness(1.5); }
  100% { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .95), 0 0 14px var(--c); }
}

.group-row { height: 32px; }
.group-row .row-label {
  gap: 8px;
  background: #090b0f;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: default;
}
.group-row:hover .row-label { background: #090b0f; }
.group-row .gname {
  font-size: 9.5px;
  letter-spacing: .18em;
  color: var(--c);
  text-transform: uppercase;
  font-weight: 500;
}
.group-row .gcount {
  font-size: 9px;
  color: var(--faint);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.group-row .row-track {
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), rgba(255, 255, 255, .005));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.group-row.dim { opacity: .4; }

/* ── panel ───────────────────────────────────────────────── */
.panel {
  position: relative;
  min-height: 0;
  overflow: auto;
  background: var(--panel);
  border-left: 1px solid var(--line2);
  padding: 22px 20px 40px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 4px; }
.panel-close {
  display: none;
  position: sticky;
  top: 0;
  float: right;
  z-index: 3;
  width: 28px;
  height: 28px;
  margin: -8px -8px 0 8px;
  border: 1px solid var(--line2);
  border-radius: 50%;
  background: var(--bg3);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.panel-close:hover { color: var(--fg); }

.p-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.p-eyebrow .cdot { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--gold)); }
.p-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: .02em;
}
.p-sub {
  margin: 4px 0 0;
  font-size: 10px;
  color: var(--faint);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.p-range {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.p-range .dur { font-size: 10px; color: var(--faint); letter-spacing: .04em; }
.p-note {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: #b9b5ac;
}
.p-divider { height: 1px; background: var(--line); margin: 18px 0 14px; }
.p-h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 20px 0 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}
.p-h4 span { font-size: 9.5px; color: var(--faint); letter-spacing: .02em; text-transform: none; }

.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.plist li button {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 6px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.plist li button:hover { background: rgba(255, 255, 255, .04); color: var(--fg); }
.plist li button .pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #bdb9b0; }
.plist li button .py { font-size: 9.5px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plist li button.cur { background: var(--gold-dim); color: var(--fg); }
.plist li button.cur .pn { color: var(--fg); }
.plist li button.cur .py { color: var(--gold); }

.contemp { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.contemp button {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.contemp button:hover { background: rgba(255, 255, 255, .04); }
.contemp .cdot { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.contemp .cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c5c1b8; }
.contemp .cn em { font-style: normal; color: var(--faint); }
.contemp .cy { font-size: 9px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.contemp .more { padding: 5px 7px; font-size: 9.5px; color: var(--faint); }

.p-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.p-events button {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  padding: 6px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  color: #c5c1b8;
}
.p-events button:hover { background: rgba(255, 255, 255, .04); }
.p-events .pey { color: var(--gold); font-size: 9.5px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.p-events .pen { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.locate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  height: 27px;
  padding: 0 10px;
  border: 1px solid var(--line2);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}
.locate:hover { color: var(--fg); border-color: var(--gold); }

.lede {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  color: #cbc6bc;
  margin: 2px 0 18px;
}
.lede em { color: var(--gold); font-style: normal; }
.guide { list-style: none; counter-reset: g; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.guide li {
  counter-increment: g;
  position: relative;
  padding-left: 24px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.guide li::before {
  content: counter(g, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 8.5px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.guide b { color: #cbc6bc; font-weight: 500; }
.statgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 20px 0 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--line);
}
.stat { background: var(--panel); padding: 10px 11px; }
.stat .v { font-size: 19px; font-family: var(--mono); color: var(--fg); letter-spacing: -.02em; }
.stat .v small { font-size: 10px; color: var(--faint); margin-left: 2px; }
.stat .l { font-size: 9px; color: var(--faint); letter-spacing: .08em; margin-top: 3px; }
.era-list { display: flex; flex-direction: column; gap: 0; margin-top: 4px; }
.era-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  font-size: 10px;
  color: var(--faint);
}
.era-row:last-child { border-bottom: 0; }
.era-row .ey { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 9px; }
.era-row .en2 { color: #b5b1a8; }
.era-row .en2 small { color: var(--faint); margin-left: 4px; }
.panel-foot {
  margin-top: 22px;
  font-size: 9px;
  line-height: 1.7;
  color: var(--faint);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ── footer / minimap ────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 47px;
  padding: 0 24px;
  border-top: 1px solid var(--line2);
  background: rgba(10, 12, 16, .85);
}
.mm-wrap { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.mm-label { font-size: 8.5px; letter-spacing: .16em; color: var(--faint); flex: none; text-transform: uppercase; }
.minimap {
  position: relative;
  flex: 1;
  height: 24px;
  min-width: 80px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .02);
  overflow: hidden;
  cursor: pointer;
}
.mm-eras { position: absolute; inset: 0; display: flex; opacity: .5; }
.mm-eras div { height: 100%; border-left: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.mm-eras div:nth-child(even) { background: rgba(255, 255, 255, .06); }
.mm-events { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; }
.mm-events i { position: absolute; top: 50%; width: 1px; height: 7px; margin-top: -3px; background: rgba(216, 169, 78, .5); }
.mm-window {
  position: absolute;
  top: -1px;
  bottom: -1px;
  min-width: 4px;
  border: 1px solid var(--gold);
  border-radius: 3px;
  background: rgba(216, 169, 78, .16);
  cursor: grab;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}
.mm-window:active { cursor: grabbing; }
.view-range {
  flex: none;
  font-size: 9.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
  min-width: 150px;
  text-align: right;
}
.foot-note { flex: none; font-size: 9px; color: var(--faint); letter-spacing: .04em; }

/* ── tooltip ─────────────────────────────────────────────── */
.tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  max-width: 300px;
  padding: 8px 10px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: rgba(17, 20, 27, .97);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  font-size: 11px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .1s, transform .1s;
}
.tooltip.on { opacity: 1; transform: none; }
.tooltip .tt-h { display: flex; align-items: center; gap: 6px; color: var(--fg); font-weight: 500; }
.tooltip .tt-h i { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--gold)); }
.tooltip .tt-r { color: var(--gold); font-size: 10px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.tooltip .tt-d { color: var(--muted); font-size: 10px; margin-top: 4px; }
.tooltip .tt-e { color: var(--faint); font-size: 9px; margin-top: 3px; }

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 1180px) {
  :root { --panel-w: 320px; }
  .foot-note { display: none; }
}
@media (max-width: 1000px) {
  .mid { grid-template-columns: 1fr; }
  .panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    width: min(390px, 92vw);
    border-left: 1px solid var(--line2);
    transform: translateX(102%);
    transition: transform .22s ease;
    box-shadow: -20px 0 60px rgba(0, 0, 0, .55);
  }
  .panel.open { transform: none; }
  .panel-close { display: block; }
  .view-range { display: none; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; align-items: stretch; gap: 10px; padding: 14px 14px 10px; }
  .brand h1 { font-size: 22px; }
  .brand .sub { font-size: 8px; letter-spacing: .14em; }
  .tools { width: 100%; }
  .search { flex: 1; min-width: 0; }
  .toolbar { padding: 8px 12px; gap: 10px; }
  .presets { display: none; }
  .footer { padding: 0 14px; gap: 10px; height: 42px; }
  .mm-label { display: none; }
  .panel { width: 100%; }
  :root { --label-w: 146px; }
  .row-label .en { display: none; }
  .axis-hint { display: none; }
}

/* ── map launcher ─────────────────────────────────────────── */
.map-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line2);
  border-radius: 7px;
  background: rgba(255, 255, 255, .025);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.map-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.map-btn:hover { color: var(--gold); border-color: rgba(216, 169, 78, .45); background: rgba(216, 169, 78, .06); }

/* ── world map modal ──────────────────────────────────────── */
.mapmodal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s ease, visibility .2s;
}
.mapmodal.open { visibility: visible; opacity: 1; }
.map-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 9, .74);
  backdrop-filter: blur(9px) saturate(.9);
}
.mapdialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1240px, 94vw);
  height: min(720px, 88vh);
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: #0c0f14;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  overflow: hidden;
  transform: translateY(10px) scale(.995);
  transition: transform .2s ease;
}
.mapmodal.open .mapdialog { transform: none; }
.map-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .022), transparent);
}
.map-head .p-eyebrow { margin-bottom: 5px; }
.map-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: .03em;
  line-height: 1.1;
}
.map-head p { margin: 6px 0 0; font-size: 10.5px; color: var(--muted); letter-spacing: .02em; }
.map-head-tools { display: flex; align-items: center; gap: 12px; }
.map-stepper { display: flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.map-stepper button {
  height: 32px;
  min-width: 42px;
  padding: 0 8px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.map-stepper button:first-child { border-left: 0; }
.map-stepper button:hover { color: var(--gold); background: rgba(255, 255, 255, .04); }
.mapclose {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line2);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.mapclose:hover { color: var(--fg); border-color: var(--fg); }
.map-main { display: grid; grid-template-columns: minmax(0, 1fr) 336px; min-height: 0; flex: 1; }
.map-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px 10px 30px;
  background:
    radial-gradient(700px 400px at 46% 42%, rgba(64, 96, 140, .12), transparent 70%),
    radial-gradient(500px 320px at 72% 72%, rgba(216, 169, 78, .045), transparent 70%);
  overflow: hidden;
}
#worldmap { width: 100%; height: 100%; min-height: 0; }
#landPath { color: #202b38; stroke: rgba(225, 232, 244, .28); stroke-width: .6; }
#grat line { stroke: rgba(255, 255, 255, .06); stroke-width: .5; }
.map-caption {
  position: absolute;
  left: 16px;
  bottom: 10px;
  font-size: 9px;
  color: var(--faint);
  letter-spacing: .02em;
}
.mdot { cursor: pointer; }
.mdot .halo { fill: none; stroke: var(--c); stroke-width: 1; opacity: .35; }
.mdot .core { fill: var(--c); stroke: #0a0c10; stroke-width: 1; transition: r .12s; }
.mdot text {
  display: none;
  fill: var(--fg);
  stroke: #080a0e;
  stroke-width: 3.2px;
  paint-order: stroke;
  font-size: 12px;
  font-family: var(--sans);
  letter-spacing: .02em;
}
.mdot:hover .core { r: 5.8px; }
.mdot:hover .halo { opacity: .7; r: 9px; }
.mdot:hover text, .mdot.sel text { display: block; }
.mdot.sel .core { stroke: #fff; stroke-width: 1.6; }
.mdot.sel .halo { opacity: .95; r: 10px; stroke-width: 1.4; }
.map-side {
  min-height: 0;
  overflow: auto;
  padding: 16px 16px 24px;
  border-left: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.map-side::-webkit-scrollbar { width: 7px; }
.map-side::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 4px; }
.map-slider { width: 100%; accent-color: var(--gold); height: 18px; cursor: pointer; }
.map-jumps { display: flex; flex-wrap: wrap; gap: 4px; margin: 9px 0 16px; }
.map-jumps button {
  height: 21px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .02);
  color: var(--faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.map-jumps button:hover, .map-jumps button.cur { color: var(--gold); border-color: rgba(216, 169, 78, .4); }
.map-focus { margin-bottom: 6px; }
.map-focus .mf-card {
  padding: 11px 12px;
  border: 1px solid rgba(216, 169, 78, .22);
  border-radius: 6px;
  background: rgba(216, 169, 78, .055);
}
.map-focus .mf-eyebrow { font-size: 8.5px; letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }
.map-focus .mf-name { margin-top: 4px; font-family: var(--serif); font-size: 19px; color: var(--fg); line-height: 1.2; }
.map-focus .mf-name em { font-style: normal; font-family: var(--sans); font-size: 10px; color: var(--muted); margin-left: 6px; }
.map-focus .mf-range { margin-top: 4px; font-size: 10px; color: var(--gold); font-variant-numeric: tabular-nums; }
.map-focus .mf-note { margin: 7px 0 0; font-size: 10.5px; line-height: 1.6; color: var(--muted); }
.map-focus .mf-actions { display: flex; gap: 6px; margin-top: 9px; }
.map-focus .mf-actions button {
  height: 25px;
  padding: 0 8px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
}
.map-focus .mf-actions button:hover { color: var(--fg); border-color: var(--gold); }
.map-focus .mf-empty { padding: 10px 2px; font-size: 10.5px; line-height: 1.65; color: var(--faint); }
.map-list-h { margin-top: 14px; }
.map-list { display: flex; flex-direction: column; gap: 1px; }
.map-list button {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 5px 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.map-list button:hover { background: rgba(255, 255, 255, .045); }
.map-list button.sel { background: rgba(216, 169, 78, .08); }
.map-list .cdot { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.map-list .mn { font-size: 10.5px; color: #c5c1b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-list .mn em { font-style: normal; color: var(--faint); }
.map-list .my { font-size: 8.5px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.map-empty { padding: 14px 2px; font-size: 10.5px; color: var(--faint); }

/* timeline map-year cursor */
.rows { position: relative; }
.year-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 11;
  display: none;
  border-left: 1px dashed rgba(216, 169, 78, .5);
  pointer-events: none;
}
.year-cursor.on { display: block; }
.year-cursor span {
  position: absolute;
  top: 38px;
  left: 3px;
  padding: 1px 4px;
  border: 1px solid rgba(216, 169, 78, .3);
  border-radius: 3px;
  background: rgba(11, 13, 17, .9);
  color: var(--gold);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 1000px) {
  .mapdialog { width: 100vw; height: 100dvh; border-radius: 0; }
  .map-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 40%); }
  .map-side { border-left: 0; border-top: 1px solid var(--line); }
  .map-stage { padding-bottom: 24px; }
  .map-head { padding: 14px 16px 10px; }
  .map-head h2 { font-size: 23px; }
  .map-stepper button { min-width: 36px; font-size: 9px; }
}
@media (max-width: 760px) {
  .map-btn { display: none; }
  .map-head-tools .map-stepper { display: none; }
}

.p-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.p-actions .locate { margin-top: 0; }

/* ── narrative & references ───────────────────────────────── */
.p-note.about { margin-top: 10px; color: #a8a49b; }
.story {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.story li {
  position: relative;
  padding-left: 15px;
  font-size: 12px;
  line-height: 1.72;
  color: #b8b4aa;
}
.story li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: .8;
}
.story li b { color: var(--fg); font-weight: 500; }
.src {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, .07);
}
.src-k {
  display: block;
  font-size: 8.5px;
  letter-spacing: .13em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.src-list { display: flex; flex-wrap: wrap; gap: 5px 10px; }
.src-list a {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.src-list a:hover { color: var(--gold); border-bottom-color: rgba(216, 169, 78, .5); }
.src-list a i {
  font-style: normal;
  font-size: 8px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ── map refinements ──────────────────────────────────────── */
.map-year-input {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  color: var(--faint);
  font-size: 9px;
}
.map-year-input input {
  width: 64px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.map-year-input input::-webkit-outer-spin-button,
.map-year-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.map-legend {
  position: absolute;
  left: 14px;
  bottom: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  max-width: calc(100% - 240px);
  pointer-events: none;
}
.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8.5px;
  color: var(--faint);
  letter-spacing: .03em;
}
.map-legend i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c);
}
.map-caption { left: auto; right: 14px; text-align: right; }
@media (max-width: 1000px) {
  .map-legend { display: none; }
  .map-caption { left: 14px; right: auto; }
}
@media (max-width: 760px) {
  .map-year-input { display: none; }
}

.src-note { margin-top: 6px; font-size: 8.5px; line-height: 1.5; color: var(--faint); }

@media (max-width: 760px) {
  .toolbar { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
  .chips { width: 100%; }
  .presets { display: flex; width: 100%; }
  .map-btn { display: inline-flex; width: 34px; padding: 0; justify-content: center; font-size: 0; gap: 0; flex: none; }
  .map-btn svg { width: 15px; height: 15px; }
  .search { min-width: 0; }
  .map-head { gap: 8px; }
  .map-head-copy { min-width: 0; }
  .map-head h2 { white-space: nowrap; }
}

.topbar, .toolbar, .tools { min-width: 0; }

@media (min-width: 761px) and (max-width: 980px) {
  .topbar { flex-wrap: wrap; align-items: stretch; }
  .tools { width: 100%; }
  .search { flex: 1; min-width: 0; }
}

@media (max-width: 900px) {
  .toolbar { flex-wrap: wrap; row-gap: 6px; }
  .chips, .presets { width: 100%; }
}

.ev.hit { color: #fff; z-index: 3; }
.ev.hit .pin { background: #fff; opacity: 1; box-shadow: 0 0 8px rgba(255, 255, 255, .8); }
.map-region {
  padding: 9px 6px 3px;
  font-size: 8px;
  letter-spacing: .16em;
  color: var(--faint);
  text-transform: uppercase;
  border-top: 1px solid rgba(255, 255, 255, .05);
  margin-top: 4px;
}
.map-region:first-child { border-top: 0; margin-top: 0; padding-top: 2px; }

.axis-hint-mobile { display: none; font-size: 8.5px; color: var(--faint); }
@media (max-width: 760px) {
  .axis-hint-mobile { display: block; }
}

/* map layout: two columns on tablets, stacked only on phones */
@media (min-width: 761px) and (max-width: 1000px) {
  .map-main { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr); }
  .map-side { border-left: 1px solid var(--line); border-top: 0; }
  .map-head { padding: 14px 16px 10px; }
}
@media (max-width: 760px) {
  .map-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 42%) minmax(0, 58%); }
  .map-side { border-left: 0; border-top: 1px solid var(--line); }
  .mdot .core { r: 6px; }
  .mdot .halo { r: 10px; }
  .mdot text { font-size: 15px; }
}

@media (min-width: 761px) and (max-width: 1000px) {
  .map-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 42%) minmax(0, 58%); }
  .map-side { border-left: 0; border-top: 1px solid var(--line); }
}

/* ── readability pass ────────────────────────────────────── */
:root {
  --label-w: 200px;
  --row-h: 34px;
  --panel-w: 388px;
}
.brand h1 { font-size: 31px; }
.brand .sub { font-size: 10.5px; }
.topbar { padding: 20px 24px 14px; }
.search { height: 38px; min-width: 300px; padding: 0 12px; }
.search input { font-size: 13.5px; }
.search-meta { font-size: 11px; }
.search svg { width: 15px; height: 15px; }
.zoombox { height: 38px; }
.zoombox button { min-width: 38px; padding: 0 10px; font-size: 14px; }
.zoombox button:last-child { font-size: 12px; }
.map-btn { height: 38px; padding: 0 12px; font-size: 12px; }
.map-btn svg { width: 15px; height: 15px; }
.toolbar { padding: 10px 24px; }
.chip, .preset { height: 28px; padding: 0 10px; font-size: 12px; }
.chip { gap: 7px; }

.axis { height: 110px; }
.axis-label { padding: 0 14px 12px; gap: 5px; }
.axis-title { font-size: 11px; }
.axis-hint { font-size: 10px; }
.axis-hint-mobile { font-size: 9.5px; }
.events { top: 6px; height: 58px; }
.ev { height: 13px; line-height: 13px; font-size: 10.5px; gap: 5px; }
.ev .pin { width: 6px; height: 6px; margin-top: 4px; }
.ticks { bottom: 24px; height: 18px; }
.tick { font-size: 11px; }
.eras { height: 20px; }
.era { font-size: 9.5px; padding: 0 8px; }

.row { height: 34px; }
.group-row { height: 35px; }
.row-label { padding: 0 14px; gap: 9px; }
.row-label .zh { font-size: 14px; }
.row-label .en { font-size: 10px; margin-top: 1px; }
.row-label .edot { width: 6px; height: 6px; }
.group-row .gname { font-size: 11px; }
.group-row .gcount { font-size: 10px; }
.seg { top: 9px; height: 16px; }
.seg .seg-t { font-size: 11px; padding: 0 6px; }
.seg.short { min-width: 7px; }
.year-cursor span { top: 40px; font-size: 9.5px; padding: 2px 5px; }

.panel { padding: 24px 22px 44px; }
.p-eyebrow { font-size: 10.5px; margin-bottom: 9px; }
.p-title { font-size: 28px; }
.p-sub { font-size: 11px; letter-spacing: .12em; }
.p-range { font-size: 14px; margin-top: 15px; }
.p-range .dur { font-size: 11px; }
.p-note { font-size: 14px; line-height: 1.75; }
.story li { font-size: 14px; line-height: 1.75; padding-left: 16px; }
.story li::before { top: 9px; width: 5px; height: 5px; }
.p-h4 { font-size: 11.5px; margin: 22px 0 9px; }
.p-h4 span { font-size: 10px; }
.plist li button { font-size: 13px; padding: 8px 8px; }
.plist li button .py { font-size: 10.5px; }
.contemp button { font-size: 13px; padding: 8px 8px; }
.contemp .cy { font-size: 10px; }
.contemp .more { font-size: 10.5px; }
.p-events button { font-size: 13px; padding: 8px 8px; grid-template-columns: 62px minmax(0, 1fr); }
.p-events .pey { font-size: 10.5px; }
.src-k { font-size: 9.5px; margin-bottom: 7px; }
.src-list a { font-size: 12px; }
.src-note { font-size: 9.5px; }
.locate { height: 30px; font-size: 11.5px; padding: 0 11px; }
.guide li { font-size: 13px; padding-left: 26px; line-height: 1.7; }
.lede { font-size: 17px; }
.stat .v { font-size: 22px; }
.stat .l { font-size: 10px; }
.stat { padding: 12px 12px; }
.era-row { font-size: 11.5px; padding: 6px 0; }
.era-row .ey { font-size: 10px; }
.panel-foot { font-size: 10px; line-height: 1.7; }

.footer { height: 52px; padding: 0 24px; }
.minimap { height: 27px; }
.mm-label { font-size: 9px; }
.view-range { font-size: 10.5px; }
.foot-note { font-size: 10px; }

.tooltip { font-size: 12.5px; padding: 9px 11px; }
.tooltip .tt-h { font-size: 12.5px; }
.tooltip .tt-r { font-size: 11px; }
.tooltip .tt-d { font-size: 11.5px; }
.tooltip .tt-e { font-size: 10.5px; }

.map-head { padding: 22px 26px 16px; }
.map-head h2 { font-size: 34px; }
.map-head p { font-size: 11px; }
.map-head .p-eyebrow { font-size: 10px; }
.map-side { padding: 18px 18px 26px; }
.map-main { grid-template-columns: minmax(0, 1fr) 360px; }
.map-slider { height: 20px; }
.map-jumps button { height: 24px; font-size: 10px; padding: 0 7px; }
.map-focus .mf-name { font-size: 21px; }
.map-focus .mf-name em { font-size: 11px; }
.map-focus .mf-range { font-size: 11px; }
.map-focus .mf-note { font-size: 12px; }
.map-focus .mf-actions button { height: 28px; font-size: 10.5px; padding: 0 9px; }
.map-focus .mf-empty { font-size: 11.5px; }
.map-list button { padding: 7px 7px; }
.map-list .mn { font-size: 12px; }
.map-list .my { font-size: 9.5px; }
.map-region { font-size: 9px; padding-top: 10px; }
.map-year-input { height: 38px; }
.map-year-input input { width: 72px; font-size: 12px; }
.map-stepper button { height: 38px; min-width: 48px; font-size: 11px; }
.mapclose { width: 36px; height: 36px; font-size: 20px; }
.map-caption { font-size: 9.5px; }
.map-legend span { font-size: 9.5px; }
.map-legend i { width: 5px; height: 5px; }
.map-list-h { margin-top: 16px; }
.mdot text { font-size: 13px; stroke-width: 3.4px; }

@media (max-width: 1180px) {
  :root { --panel-w: 340px; --label-w: 188px; }
  .brand h1 { font-size: 27px; }
  .search { min-width: 250px; }
  .tools { gap: 8px; }
  .mid { grid-template-columns: minmax(0, 1fr) var(--panel-w); }
}
@media (max-width: 1000px) {
  .panel { width: min(410px, 94vw); }
  .mid { grid-template-columns: minmax(0, 1fr); }
  .map-head h2 { font-size: 28px; }
  .map-head { padding: 16px 18px 12px; }
  .map-side { padding: 16px; }
  .map-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 42%) minmax(0, 58%); }
  .map-side { border-left: 0; border-top: 1px solid var(--line); }
  .map-list .mn { font-size: 12.5px; }
}
@media (max-width: 900px) {
  .brand h1 { font-size: 26px; }
  .toolbar { padding: 9px 16px; }
  .chip, .preset { height: 28px; font-size: 12px; }
}
@media (max-width: 760px) {
  :root { --label-w: 160px; --row-h: 34px; }
  .topbar { padding: 16px 14px 12px; }
  .brand h1 { font-size: 24px; }
  .brand .sub { font-size: 8.5px; }
  .search { height: 36px; min-width: 0; }
  .search input { font-size: 12px; }
  .zoombox { height: 36px; }
  .zoombox button { min-width: 34px; font-size: 13px; }
  .map-btn { height: 36px; width: 36px; }
  .row-label .zh { font-size: 13.5px; }
  .row-label .en { display: none; }
  .row-label { padding: 0 11px; }
  .axis { height: 110px; }
  .axis-title { font-size: 10.5px; }
  .axis-hint { display: none; }
  .axis-hint-mobile { display: block; font-size: 9px; }
  .map-head h2 { font-size: 24px; }
  .map-head p { font-size: 10px; }
  .map-head { padding: 14px 14px 10px; }
  .map-side { padding: 14px; }
  .mdot text { font-size: 16px; }
  .panel { width: 100%; }
  .p-title { font-size: 26px; }
  .p-note, .story li { font-size: 13.5px; }
  .footer { height: 48px; padding: 0 14px; }
  .foot-note { display: none; }
}

/* ── structured rise / fall arcs ─────────────────────────── */
.arc {
  list-style: none;
  margin: 0;
  padding: 0;
}
.arc li {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, .07);
}
.arc li:last-child { border-bottom: 0; padding-bottom: 2px; }
.arc-k {
  padding-top: 3px;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--gold);
  white-space: nowrap;
}
.arc p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: #c6c2b9;
}
@media (max-width: 760px) {
  .arc li { grid-template-columns: 46px minmax(0, 1fr); gap: 10px; }
  .arc p { font-size: 13.5px; }
}

.arc p { font-size: 14px; }
@media (max-width: 760px) {
  .arc li { grid-template-columns: 54px minmax(0, 1fr); }
  .arc-k { font-size: 9.5px; letter-spacing: .08em; }
}

.tick { font-size: 12px; }
.seg .seg-t { font-size: 11.5px; }
.arc-k { font-size: 10.5px; }
@media (max-width: 760px) {
  .arc-k { font-size: 10px; }
}

.axis { height: 112px; }
.events { height: 60px; }
.ev { height: 14px; line-height: 14px; font-size: 11.5px; }
.ticks { bottom: 24px; }

@media (max-width: 760px) {
  .brand .sub { font-size: 9.5px; }
  .axis-hint-mobile { font-size: 9.5px; }
  .p-note, .story li { font-size: 14px; }
}

.map-focus .mf-eyebrow { font-size: 9.5px; }
.map-list .my { font-size: 10px; }
.map-region { font-size: 9.5px; }

@media (max-width: 1100px) and (min-width: 761px) {
  .toolbar { flex-wrap: wrap; row-gap: 6px; }
  .chips, .presets { width: 100%; }
}

/* ── resizable right panel ───────────────────────────────── */
.panel {
  padding: 0;
  overflow: hidden;
  position: relative;
}
.panel-scroll {
  height: 100%;
  overflow: auto;
  padding: 24px 22px 44px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.panel-scroll::-webkit-scrollbar { width: 8px; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 4px; }
.panel-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 9px;
  z-index: 60;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}
.panel-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 1px;
  background: var(--line2);
  transition: background .12s, width .12s;
}
.panel-resizer:hover::after,
.panel-resizer:focus-visible::after,
.panel.resizing .panel-resizer::after {
  background: var(--gold);
  width: 2px;
}
.panel-resizer:focus-visible { outline: 0; }
body.panel-resizing, body.panel-resizing * { cursor: col-resize !important; user-select: none !important; }

/* ── immersive reader ────────────────────────────────────── */
.reader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity .22s ease, visibility .22s;
}
.reader.open { visibility: visible; opacity: 1; }
.reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 9, .84);
  backdrop-filter: blur(11px) saturate(.9);
}
.reader-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1180px, 94vw);
  height: min(920px, 92vh);
  background: #0b0e13;
  border: 1px solid var(--line2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7);
  transform: translateY(14px) scale(.995);
  transition: transform .22s ease;
}
.reader.open .reader-shell { transform: none; }
.reader-head {
  flex: none;
  padding: 26px 38px 0;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .028), transparent);
}
.reader-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.reader-eyebrow {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.reader-eyebrow .cdot { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--gold)); }
.reader-head-actions { display: flex; align-items: center; gap: 6px; }
.reader-nav, .reader-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line2);
  border-radius: 50%;
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.reader-close { font-size: 20px; }
.reader-nav:hover, .reader-close:hover { color: var(--fg); border-color: var(--fg); }
.reader-nav:disabled { opacity: .25; cursor: default; }
.reader-title {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: .02em;
}
.reader-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.reader-tabs {
  display: flex;
  gap: 2px;
  margin-top: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.reader-tabs::-webkit-scrollbar { display: none; }
.reader-tab {
  flex: none;
  height: 40px;
  padding: 0 15px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.reader-tab:hover { color: var(--fg); }
.reader-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.reader-tab span { font-size: 10px; color: var(--faint); margin-left: 6px; font-variant-numeric: tabular-nums; }
.reader-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 38px 48px 64px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .16) transparent;
}
.reader-body::-webkit-scrollbar { width: 9px; }
.reader-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .13); border-radius: 5px; }
.reader-column { max-width: 860px; margin: 0 auto; }
.reader-lead {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.75;
  color: #ddd8cd;
}
.reader-context {
  margin: 0 0 34px;
  padding-left: 18px;
  border-left: 2px solid rgba(216, 169, 78, .38);
  font-size: 15px;
  line-height: 1.95;
  color: #b7b3a9;
}
.reader-h3 {
  margin: 34px 0 14px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: .02em;
}
.reader-h3:first-child { margin-top: 0; }
.reader-arc { list-style: none; margin: 0; padding: 0; }
.reader-arc li {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.reader-arc li:first-child { border-top: 0; padding-top: 4px; }
.reader-arc-k {
  padding-top: 5px;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--gold);
  white-space: nowrap;
}
.reader-arc p { margin: 0; font-size: 17px; line-height: 1.95; color: #cfcbc1; }
.reader-notes {
  list-style: none;
  counter-reset: rnote;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.reader-notes li {
  counter-increment: rnote;
  position: relative;
  padding-left: 44px;
  font-size: 17px;
  line-height: 1.95;
  color: #cfcbc1;
}
.reader-notes li::before {
  content: counter(rnote, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 4px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--gold);
}
.reader-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--line);
}
.reader-fact { background: #0d1016; padding: 14px 16px; }
.reader-fact .v { font-family: var(--mono); font-size: 19px; color: var(--fg); }
.reader-fact .v small { font-size: 10px; color: var(--faint); margin-left: 2px; }
.reader-fact .l { margin-top: 3px; font-size: 9.5px; letter-spacing: .08em; color: var(--faint); }

.reader-world { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; }
.reader-world-group h4 {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
}
.reader-world button {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #cbc7bd;
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.reader-world button:hover { background: rgba(255, 255, 255, .045); }
.reader-world .cdot { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.reader-world .rn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-world .rn em { font-style: normal; color: var(--faint); }
.reader-world .rd { font-size: 10px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }

.reader-events { list-style: none; margin: 0; padding: 0; }
.reader-events li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.reader-events li:first-child { border-top: 0; }
.reader-events .ry { color: var(--gold); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 4px; }
.reader-events .rt { font-size: 16px; color: #d5d1c7; }
.reader-events .rd2 { margin-top: 4px; font-size: 13.5px; line-height: 1.7; color: var(--muted); }
.reader-refs { display: flex; flex-direction: column; gap: 10px; }
.reader-refs a {
  color: #cfcbc1;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  width: fit-content;
}
.reader-refs a:hover { color: var(--gold); border-bottom-color: rgba(216, 169, 78, .5); }
.reader-refs .rn2 { font-size: 12px; color: var(--faint); margin-left: 6px; }
.reader-empty { font-size: 15px; line-height: 1.9; color: var(--muted); }
.reader-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 38px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .018);
}
.reader-foot .rhint { font-size: 10px; letter-spacing: .05em; color: var(--faint); }
.reader-foot .ractions { display: flex; gap: 8px; }
.reader-foot button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line2);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}
.reader-foot button:hover { color: var(--fg); border-color: var(--gold); }
.reader-foot button.primary { color: var(--gold); border-color: rgba(216, 169, 78, .45); background: rgba(216, 169, 78, .06); }

@media (max-width: 1000px) {
  .panel-resizer { display: none; }
  .reader-shell { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .reader-head { padding: 16px 18px 0; }
  .reader-title { font-size: 32px; margin-top: 10px; }
  .reader-meta { font-size: 12px; }
  .reader-tabs { margin-top: 14px; }
  .reader-tab { height: 38px; padding: 0 12px; font-size: 12.5px; }
  .reader-body { padding: 24px 20px 48px; }
  .reader-lead { font-size: 18px; }
  .reader-context { font-size: 14px; }
  .reader-arc li { grid-template-columns: 78px minmax(0, 1fr); gap: 16px; padding: 16px 0; }
  .reader-arc p, .reader-notes li, .reader-world button { font-size: 15px; }
  .reader-h3 { font-size: 21px; }
  .reader-facts { grid-template-columns: 1fr 1fr; }
  .reader-world { grid-template-columns: 1fr; gap: 18px; }
  .reader-foot { padding: 10px 18px; }
  .reader-foot .rhint { display: none; }
}

/* ── reader media: charts, map, cta ──────────────────────── */
.p-actions .reader-cta {
  color: var(--gold);
  border-color: rgba(216, 169, 78, .5);
  background: rgba(216, 169, 78, .07);
}
.p-actions .reader-cta:hover { background: rgba(216, 169, 78, .14); }

.reader-range-chart { margin: 0 0 10px; }
.rrc-track {
  position: relative;
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
  overflow: hidden;
}
.rrc-era {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, .045);
  border-left: 1px solid rgba(255, 255, 255, .09);
}
.rrc-mark {
  position: absolute;
  top: 4px;
  bottom: 4px;
  min-width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #e5bd65, var(--gold));
  box-shadow: 0 0 10px rgba(216, 169, 78, .5);
}
.rrc-scale {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 7px;
  font-size: 9.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.reader-note { margin: 8px 0 0; font-size: 10.5px; line-height: 1.6; color: var(--faint); }

.reader-chart { display: flex; flex-direction: column; gap: 9px; margin: 4px 0 10px; }
.rc-row {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(80px, 1fr) 56px;
  align-items: center;
  gap: 12px;
}
.rc-name {
  font-size: 12.5px;
  color: #bdb9b0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-name em { font-style: normal; color: var(--faint); margin-left: 5px; font-size: 10.5px; }
.rc-row.self .rc-name { color: var(--gold); }
.rc-track { height: 12px; border-radius: 3px; background: rgba(255, 255, 255, .035); overflow: hidden; }
.rc-track i { display: block; height: 100%; border-radius: 3px; opacity: .9; }
.rc-row.self .rc-track i { opacity: 1; box-shadow: 0 0 10px rgba(216, 169, 78, .35); }
.rc-val { font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }

.reader-map {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(600px 320px at 46% 42%, rgba(64, 96, 140, .12), transparent 70%),
    #0a0d12;
  overflow: hidden;
}
.reader-map svg { display: block; width: 100%; height: auto; }
.reader-land { fill: #1b2530; stroke: rgba(225, 232, 244, .18); stroke-width: .6; }
.reader-map-label {
  fill: var(--fg);
  stroke: #07090d;
  stroke-width: 3.4px;
  paint-order: stroke;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .02em;
}
.reader-map-caption {
  padding: 8px 12px 10px;
  font-size: 9.5px;
  color: var(--faint);
  border-top: 1px solid var(--line);
}
.reader-map-actions { display: flex; gap: 8px; margin-top: 12px; }
.reader-map-actions button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line2);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}
.reader-map-actions button:hover { color: var(--gold); border-color: rgba(216, 169, 78, .5); }
.reader-world-group h4 span { color: var(--faint); font-size: 9px; margin-left: 4px; }

@media (max-width: 760px) {
  .rc-row { grid-template-columns: minmax(112px, 1fr) minmax(60px, 1.2fr) 48px; gap: 8px; }
  .rc-name { font-size: 11.5px; }
  .rc-name em { display: none; }
  .rrc-scale { font-size: 8.5px; }
}

.panel-resizer::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 5px;
  height: 38px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--faint) 0 1px, transparent 1px 6px);
  opacity: .4;
  transition: opacity .12s;
}
.panel-resizer:hover::before,
.panel-resizer:focus-visible::before { opacity: .9; }
@media (max-width: 1000px) { .panel-resizer::before { display: none; } }

/* ── reader long-form dossier ────────────────────────────── */
.reader-dek {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.7;
  color: #ded9ce;
}
.reader-toc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 22px;
  margin: 0 0 36px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.reader-toc button {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 5px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.reader-toc button span {
  flex: none;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--gold);
}
.reader-toc button:hover { color: var(--fg); background: rgba(255, 255, 255, .04); }
.reader-section { scroll-margin-top: 18px; margin-bottom: 40px; }
.reader-section:last-child { margin-bottom: 10px; }
.reader-section .reader-h3 { display: flex; align-items: baseline; gap: 12px; }
.rsec-n {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: .08em;
}
.reader-section p {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 2.02;
  color: #cfcbc1;
}
.reader-section p:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .reader-dek { font-size: 19px; }
  .reader-toc { grid-template-columns: 1fr; gap: 2px; }
  .reader-toc button { font-size: 12px; }
  .reader-section p { font-size: 15.5px; line-height: 1.95; }
  .reader-section { margin-bottom: 32px; }
}

@media (max-width: 1000px) {
  .panel { position: fixed; }
  .re-region-en { display: none; }
  .re-region-cn { display: inline; }
  .reader-section p { font-size: 16px; }
  .reader-notes li { font-size: 16px; }
}
.re-region-cn { display: none; }

@media (max-width: 1000px) {
  .re-region-cn { display: inline; }
  .re-region-en { display: none; }
}

@media (max-width: 760px) {
  .reader-tabs { flex-wrap: wrap; overflow: visible; row-gap: 2px; }
  .reader-tab { height: 34px; padding: 0 10px; font-size: 12px; }
}

.long-teaser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 3px 10px;
  align-items: center;
  width: 100%;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(216, 169, 78, .32);
  border-radius: 6px;
  background: rgba(216, 169, 78, .055);
  text-align: left;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.long-teaser:hover { background: rgba(216, 169, 78, .1); border-color: rgba(216, 169, 78, .55); }
.lt-k { font-size: 10px; letter-spacing: .12em; color: var(--gold); }
.lt-t { font-size: 11px; line-height: 1.5; color: var(--muted); }
.lt-arrow { grid-column: 2; grid-row: 1 / 3; font-size: 18px; color: var(--gold); }

/* ── wider reader layout with chapter rail ───────────────── */
.reader-shell {
  width: min(1520px, 96vw);
  height: min(940px, 92vh);
}
.reader-body {
  padding: 34px 44px 60px;
}
.reader-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 920px);
  gap: 44px;
  justify-content: center;
  max-width: 1240px;
  margin: 0 auto;
  align-items: start;
}
.reader-rail {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 6px 22px 20px 0;
  border-right: 1px solid var(--line);
}
.rr-kicker {
  font-size: 9.5px;
  letter-spacing: .16em;
  color: var(--gold);
  text-transform: uppercase;
}
.rr-title {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.3;
  color: var(--fg);
}
.rr-meta {
  margin-top: 4px;
  font-size: 10px;
  color: var(--faint);
  letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
}
.rr-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 18px;
}
.rr-toc button {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 5px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}
.rr-toc button span {
  flex: none;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--faint);
}
.rr-toc button:hover { color: var(--fg); background: rgba(255, 255, 255, .04); }
.rr-toc button.active { color: var(--gold); background: rgba(216, 169, 78, .06); }
.rr-toc button.active span { color: var(--gold); }
.rr-foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  line-height: 1.6;
  color: var(--faint);
}
.reader-article {
  max-width: 920px;
  width: 100%;
  margin: 0;
}
.reader-toc-mobile { display: none; }
.reader-progress {
  flex: none;
  height: 2px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}
.reader-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(216, 169, 78, .5);
  transition: width .08s linear;
}
.reader-section { scroll-margin-top: 20px; }

@media (max-width: 1280px) {
  .reader-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 32px; }
  .rr-toc button { font-size: 11px; }
}
@media (max-width: 1100px) {
  .reader-layout { display: block; }
  .reader-rail { display: none; }
  .reader-toc-mobile { display: grid; }
  .reader-body { padding: 28px 28px 52px; }
}

@media (max-width: 1000px) {
  .reader-shell { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .reader-body { padding: 24px 20px 48px; }
}

.reader-toc-mobile-wrap {
  display: none;
  margin: 0 0 28px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.reader-toc-mobile-wrap summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--gold);
  cursor: pointer;
  list-style: none;
}
.reader-toc-mobile-wrap summary::-webkit-details-marker { display: none; }
.reader-toc-mobile-wrap summary::after { content: "展开"; font-size: 9px; color: var(--faint); letter-spacing: .1em; }
.reader-toc-mobile-wrap[open] summary::after { content: "收起"; }
.reader-toc-mobile-wrap .reader-toc { margin: 10px 0 0; padding: 0; border: 0; }
@media (max-width: 1100px) {
  .reader-toc-mobile-wrap { display: block; }
}

.reader-layout {
  grid-template-columns: 220px minmax(0, 960px);
  max-width: 1280px;
}
.reader-article { max-width: 960px; }
@media (max-width: 1280px) {
  .reader-layout { grid-template-columns: 190px minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .reader-layout { display: block; }
}

/* ── Wikipedia excerpt reader ────────────────────────────── */
.wiki-reader { max-width: 960px; }
.reader-wiki-text { margin-top: 8px; }
.reader-wiki-text p {
  margin: 0 0 17px;
  font-size: 17px;
  line-height: 1.98;
  color: #cfcbc1;
}
.reader-wiki-h {
  margin: 30px 0 12px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: .02em;
}
.wiki-source {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
}
.wiki-source a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.wiki-source a:hover { border-bottom-color: rgba(216, 169, 78, .5); }
.wiki-teaser { border-color: rgba(216, 169, 78, .2); background: rgba(216, 169, 78, .035); }
@media (max-width: 760px) {
  .reader-wiki-text p { font-size: 15.5px; line-height: 1.95; }
  .reader-wiki-h { font-size: 20px; }
  .wiki-source { font-size: 10.5px; }
}

html { overflow: hidden; }

@media (max-width: 1000px) {
  .reader-shell { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .reader-body { padding: 20px 16px 44px; }
}

/* ── final reader: larger surface, header actions ─────────── */
.reader-shell {
  width: min(1720px, 98vw);
  height: min(980px, 96vh);
}
.reader-head { padding: 20px 32px 0; }
.reader-title { margin-top: 10px; font-size: clamp(34px, 3.4vw, 46px); }
.reader-meta { margin-top: 8px; }
.reader-tabs { margin-top: 16px; }
.reader-body { padding: 26px 36px 40px; }
.reader-layout {
  grid-template-columns: 200px minmax(0, 1060px);
  gap: 32px;
  max-width: 1440px;
}
.reader-article, .wiki-reader { max-width: 1060px; }
.reader-foot { display: none; }
.reader-action {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line2);
  border-radius: 17px;
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  font-family: inherit;
  font-size: 10.5px;
  letter-spacing: .03em;
  cursor: pointer;
}
.reader-action:hover { color: var(--fg); border-color: var(--gold); }
@media (max-width: 1280px) {
  .reader-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 26px; }
}
@media (max-width: 1100px) {
  .reader-layout { display: block; }
  .reader-rail { display: none; }
  .reader-body { padding: 24px 28px 44px; }
  .reader-article, .wiki-reader { max-width: 1100px; margin: 0 auto; }
}
@media (max-width: 1000px) {
  .reader-shell { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .reader-head { padding: 16px 18px 0; }
  .reader-title { margin-top: 8px; font-size: 32px; }
  .reader-tabs { margin-top: 12px; }
  .reader-body { padding: 20px 16px 44px; }
  .reader-action { display: none; }
  .reader-foot { display: flex; padding: 10px 18px; }
  .reader-foot .rhint { display: none; }
}

/* compact reader header: title + meta share a row */
.reader-head { padding: 14px 32px 0; }
.reader-titlerow {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 18px;
  margin-top: 2px;
}
.reader-title {
  margin: 0;
  font-size: clamp(32px, 3vw, 40px);
  line-height: 1.05;
}
.reader-meta { margin-top: 0; font-size: 12.5px; }
.reader-tabs { margin-top: 10px; }
.reader-tab { height: 36px; }
.reader-body { padding-top: 20px; padding-bottom: 32px; }
@media (max-width: 1000px) {
  .reader-head { padding: 12px 18px 0; }
  .reader-titlerow { display: block; margin-top: 4px; }
  .reader-title { margin: 0; font-size: 30px; }
  .reader-meta { margin-top: 5px; font-size: 12px; }
  .reader-tabs { margin-top: 10px; }
  .reader-body { padding-top: 18px; padding-bottom: 40px; }
}

@media (max-width: 1000px) and (min-width: 761px) {
  .reader-foot { display: none; }
  .reader-action { display: block; }
}
@media (max-width: 760px) {
  .reader-foot { display: flex; }
  .reader-action { display: none; }
}

@media (max-width: 760px) {
  .reader-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    row-gap: 0;
  }
  .reader-tab { height: 36px; }
}
