/* 华夏世系 —— 宣纸底 + 各朝传统色。只用系统字体，不加载任何外部资源。
   每页的主色由 <body style="--accent:…"> 注入（见 build.py theme_style）。 */

:root {
  --bg: #f7f3ec;
  --bg-deep: #efe7da;
  --surface: #fffdf9;
  --ink: #1f1b17;
  --ink-2: #554c43;
  --ink-3: #8a8075;
  --line: #e7dece;
  --line-2: #d5c8b3;
  --accent: #b4372a;
  --accent-soft: #f4e4dc;
  --accent-mid: #d79a8e;
  --accent-deep: #872920;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px -14px rgba(60, 40, 20, .28);
  --serif: "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN",
           "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 16px/1.8 var(--sans); color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); margin: 0; font-weight: 700; }
p { margin: 0; }
ol, ul, dl, dd { margin: 0; padding: 0; list-style: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 247, 241, .97);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-seal {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px;
  background: var(--accent); color: #fff; font: 900 17px/1 var(--serif);
}
.brand-name { font: 700 18px/1 var(--serif); letter-spacing: .14em; }
.sections { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.sections::-webkit-scrollbar { display: none; }
.sections a {
  position: relative; padding: 6px 12px; font-size: 14.5px; color: var(--ink-2); white-space: nowrap;
  transition: color .2s;
}
.sections a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 1px;
  background: var(--accent); transform: scaleX(0); transition: transform .25s;
}
.sections a:hover, .sections a.on { color: var(--ink); }
.sections a.on::after { transform: scaleX(1); }

.picker { position: relative; margin-left: auto; }
.picker summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-size: 14px;
  border: 1px solid var(--line-2); background: var(--surface);
}
.picker summary::-webkit-details-marker { display: none; }
.picker summary span { font-size: 10px; color: var(--ink-3); transition: transform .2s; }
.picker[open] summary span { transform: rotate(180deg); }
.picker-panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: min(480px, calc(100vw - 32px));
  padding: 10px 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 24px 48px -16px rgba(40, 25, 10, .35);
}
.pk-row { display: grid; grid-template-columns: 5.6em 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.pk-row:first-child { border-top: 0; }
.pk-row b { font: 700 13px/30px var(--serif); color: var(--ink-3); letter-spacing: .1em; }
.pk-row div { display: flex; flex-wrap: wrap; gap: 4px; }
.pk-row a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px 2px 8px; border-radius: 6px; font: 15px/26px var(--serif);
}
.pk-row a::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.pk-row a:hover { background: var(--bg); }
.pk-row a[aria-current] { background: var(--c); color: #fff; }
.pk-row a[aria-current]::before { background: #fff; }

.language-switch { display: inline-flex; flex: none; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); }
.language-switch a { display: block; padding: 3px 9px; border-radius: 999px; font-size: 12px; line-height: 1.6; white-space: nowrap; }
.language-switch a[aria-current] { background: var(--ink); color: #fff; }
.translation-note { max-width: 58em; margin: 10px auto 0; line-height: 1.7; }
.translation-note a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- 页首（朝代 / 帝王） */

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 32px;
  margin: 28px 0 0; padding: 48px 48px 44px;
  border-radius: 20px;
  background:
    radial-gradient(900px 300px at 0% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
}
.hero-mark {
  position: absolute; z-index: -1; right: 150px; bottom: -110px;
  font: 900 340px/1 var(--serif); color: var(--accent); opacity: .06;
  pointer-events: none; user-select: none;
}
.hero-body { min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs > * + *::before { content: "/"; margin-right: 10px; color: var(--line-2); }
.hero h1 { font-size: clamp(40px, 7vw, 68px); line-height: 1.1; font-weight: 900; letter-spacing: .1em; }
.h-tag {
  display: inline-block; vertical-align: .35em; margin-right: .5em;
  padding: .28em .55em; border-radius: 8px;
  font-size: .32em; font-weight: 700; letter-spacing: .12em; line-height: 1;
  background: var(--accent); color: #fff;
}
.hero-sub { margin-top: 14px; font: 500 clamp(15px, 2vw, 18px)/1.7 var(--serif); color: var(--accent); letter-spacing: .06em; }
.hero-sub span { white-space: nowrap; }
.hero-sum { margin-top: 12px; max-width: 40em; font-size: 16.5px; line-height: 1.85; color: var(--ink-2); }
.hero-sub a { text-decoration: underline; text-underline-offset: 4px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 12.5px; color: var(--ink-3); letter-spacing: .1em; }
.swatch i { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); }

.seal {
  flex: none; display: grid; place-items: center;
  width: 88px; height: 88px; border-radius: 10px;
  background: var(--accent); color: #fff;
  font: 900 48px/1 var(--serif);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .22), 0 10px 24px -10px var(--accent-deep);
  transform: rotate(-3deg);
}
.seal.two { writing-mode: vertical-rl; font-size: 34px; letter-spacing: .04em; }

/* ---------------------------------------------------------------- 通用区块 */

.sec { margin-top: 64px; }
.sec-h { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; font-size: 26px; letter-spacing: .14em; }
.sec-h i {
  font-style: normal; display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 15px; letter-spacing: 0; color: var(--accent);
  border: 1.5px solid var(--accent);
}
.sec-h::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.sub-h { margin: 44px 0 18px; font-size: 19px; letter-spacing: .12em; color: var(--ink-2); }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  overflow: hidden;
}
.stats div { padding: 16px 20px; min-width: 0; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.stats dt { font-size: 12.5px; color: var(--ink-3); letter-spacing: .18em; }
.stats dd { margin-top: 4px; font: 700 17px/1.45 var(--serif); }
.stats dd small { font-size: 13px; margin-left: 2px; color: var(--ink-2); }

.intro { margin-top: 30px; max-width: 50em; font-size: 17px; line-height: 2; }
.intro p { text-indent: 2em; text-wrap: pretty; }
.intro p + p { margin-top: 1em; }
.coverage { margin-top: 18px; padding: 12px 16px; border-left: 3px solid var(--accent-mid); background: var(--accent-soft); font-size: 14px; color: var(--ink-2); }
.sources, .ev-body > p.sources { margin-top: 12px; font-size: 12px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.sources a { text-decoration: underline; text-underline-offset: 3px; }

.highlights { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.highlights li { position: relative; padding: 20px 22px 20px 70px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.hl-no {
  position: absolute; left: 20px; top: 20px; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent); font: 700 16px/1 var(--serif);
}
.highlights h3 { font-size: 17px; letter-spacing: .06em; margin-bottom: 4px; }
.highlights p { font-size: 14.5px; line-height: 1.85; color: var(--ink-2); }

/* ---------------------------------------------------------------- 世系 */

.vt { position: absolute; opacity: 0; pointer-events: none; }
.lineage-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.toggle { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-deep); }
.toggle label { padding: 6px 16px; border-radius: 999px; font-size: 14px; cursor: pointer; color: var(--ink-2); transition: background .2s, color .2s; }
#view-tree:checked ~ .lineage-bar label[for=view-tree],
#view-list:checked ~ .lineage-bar label[for=view-list] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(60, 40, 20, .18); }
#view-tree:focus-visible ~ .lineage-bar label[for=view-tree],
#view-list:focus-visible ~ .lineage-bar label[for=view-list] { outline: 2px solid var(--accent); }
#view-tree:checked ~ .views .rlist,
#view-list:checked ~ .views .tree-scroll,
#view-list:checked ~ .views .swipe-hint { display: none; }
.swipe-hint { margin: 10px 0 -14px; font-size: 12.5px; color: var(--ink-3); text-align: center; letter-spacing: .1em; }
.tap-hint { margin-top: 14px; font-size: 13.5px; color: var(--accent); }
.tap-hint::before { content: "☞ "; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-node { width: 18px; height: 12px; border-radius: 3px; background: var(--accent); }
.lg-node.ghost { background: transparent; border: 1px dashed var(--ink-3); }
.lg-line { width: 22px; border-top: 2px solid var(--line-2); }
.lg-line.dashed { border-top-style: dashed; border-color: var(--accent-mid); }
.lg-line.succession { border-top-style: dotted; border-color: var(--accent); }
.lg-line.spouse { border-top: 4px double var(--accent); }

.tree-block + .tree-block { margin-top: 44px; }
.tree-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 0; font-size: 20px; letter-spacing: .12em; }
.tree-title::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: var(--accent); }

.tree-scroll {
  container-type: inline-size;
  overflow-x: auto; overscroll-behavior-x: contain;
  padding: 28px 0 20px;
  /* 宽树可越出正文栏，最多用到视口宽度（两侧各留 16px） */
  margin-inline: calc((100% - min(100vw - 32px, 1480px)) / 2);
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.tree {
  /* 卡片宽度随容器自适应：放得下就放大，放不下就保持最小宽度并横向滚动 */
  --g: 18px;
  --cw: clamp(148px, calc((100cqw - 8px - var(--cols) * var(--g)) / (var(--cols) + 1)), 280px);
  --u: calc(var(--cw) + var(--g));
  --ch: 68px;
  --vg: 34px;
  --rh: calc(var(--ch) + var(--vg));
  position: relative;
  width: calc(var(--cols) * var(--u) + var(--cw));
  height: calc(var(--rows) * var(--rh) - var(--vg));
  margin: 0 auto;
}

.e { position: absolute; display: block; pointer-events: none; border: 0 solid var(--line-2); }
.e-full, .e-stem, .e-drop { left: calc(var(--x) * var(--u) + var(--cw) / 2 - 1px); border-left-width: 2px; }
.e-full { top: calc(var(--y) * var(--rh) + var(--ch)); height: var(--vg); }
.e-stem { top: calc(var(--y) * var(--rh) + var(--ch)); height: calc(var(--vg) / 2); }
.e-drop { top: calc(var(--y) * var(--rh) + var(--ch) + var(--vg) / 2 - 1px); height: calc(var(--vg) / 2 + 1px); }
.e-bar {
  left: calc(var(--x) * var(--u) + var(--cw) / 2 - 1px);
  width: calc(var(--w) * var(--u) + 2px);
  top: calc(var(--y) * var(--rh) + var(--ch) + var(--vg) / 2 - 1px);
  border-top-width: 2px;
}
.e.dashed { border-style: dashed; border-color: var(--accent-mid); }
.e.succession { border-style: dotted; border-color: var(--accent); }
.e-spouse {
  left: calc(var(--x) * var(--u) + var(--cw));
  width: calc(var(--w) * var(--u) - var(--cw));
  top: calc(var(--y) * var(--rh) + var(--ch) / 2 - 3px);
  border-top: 6px double var(--accent);
}

.node {
  position: absolute; display: block;
  left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--rh));
  width: var(--cw); height: var(--ch);
  container-type: inline-size;
  background: var(--surface); border-radius: 10px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.node.linked { border-left: 3px solid var(--accent); }
.node.linked::after {
  content: "›"; position: absolute; right: 6px; top: 3px;
  font-size: 15px; line-height: 1; color: var(--accent-mid);
}
/* 卡片内容：宽卡两行（称号 | 姓名 年号 / 简介 年份）；窄卡（≤235px）三行（称号 姓名 / 年号 年份 / 简介） */
.nb {
  height: 100%; padding: 0 14px 0 12px;
  display: grid; align-content: center; align-items: center;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "tag r1" "tag r2";
  column-gap: 10px; row-gap: 3px;
}
.n-r1, .n-r2 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.n-r1 { grid-area: r1; }
.n-r2 { grid-area: r2; }
.n-tag {
  grid-area: tag; justify-self: start;
  padding: 5px 7px; border-radius: 6px;
  font: 600 13px/1.2 var(--serif); letter-spacing: .08em; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent);
}
.n-name, .n-era, .n-desc, .n-years { grid-area: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.n-name { flex: none; max-width: 100%; font: 700 18px/1.25 var(--serif); letter-spacing: .04em; }
.n-era { font: 600 14.5px/1.25 var(--serif); color: var(--accent); text-align: right; }
.n-desc { flex: 1 1 auto; font-size: 11.5px; line-height: 1.3; color: var(--ink-3); }
.n-years { flex: none; font-size: 11.5px; line-height: 1.3; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.node.long .n-name { font-size: 15px; letter-spacing: 0; }
.node.ghost { background: var(--bg); box-shadow: none; border: 1px dashed var(--line-2); }
.node.ghost.linked { border-left: 3px solid var(--accent-mid); }
.node.ghost .n-tag { background: var(--bg-deep); color: var(--ink-3); }
.node.ghost .n-name { color: var(--ink-2); }
.node.ghost .n-era { color: var(--ink-3); font-weight: 400; font-size: 13px; }

@container (max-width: 235px) {
  .nb {
    padding: 0 12px 0 10px; column-gap: 6px; row-gap: 1px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "tag name name" "era era years" "desc desc desc";
  }
  .n-r1, .n-r2 { display: contents; }
  .n-tag { padding: 2px 5px; font-size: 11.5px; letter-spacing: .04em; }
  .n-name { grid-area: name; font-size: 16px; }
  .n-era { grid-area: era; font-size: 12.5px; text-align: left; }
  .n-years { grid-area: years; }
  .n-desc { grid-area: desc; }
  .node.long .n-name { font-size: 14px; }
  .node.ghost .n-era { font-size: 12px; }
}

.rlist { display: grid; gap: 8px; margin-top: 24px; }
.rlist li > * {
  display: grid; grid-template-columns: 34px minmax(150px, 1.1fr) minmax(90px, .8fr) minmax(120px, .9fr) 1.4fr;
  align-items: center; gap: 12px; padding: 11px 16px;
  background: var(--surface); border-radius: 10px; border: 1px solid var(--line);
}
.rlist a { border-left: 3px solid var(--accent) !important; transition: background .2s; }
.r-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: var(--accent); background: var(--accent-soft); font-variant-numeric: tabular-nums; }
.r-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.r-who .n-tag { padding: 3px 7px; font-size: 13px; }
.r-who strong { font: 700 17px/1.3 var(--serif); }
.r-era { font: 600 15px/1.3 var(--serif); color: var(--accent); }
.r-years { font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.r-desc { font-size: 13.5px; color: var(--ink-3); }

.notes { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.notes li { display: flex; gap: 6px; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
.notes b { font-weight: 400; color: var(--accent); flex: none; }

/* ---------------------------------------------------------------- 朝代大事记 */

.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 132px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 132px 1fr; padding-bottom: 28px; }
.timeline li::before {
  content: ""; position: absolute; left: 127px; top: 10px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.timeline time { padding-right: 28px; text-align: right; font: 700 16px/1.9 var(--serif); color: var(--accent); font-variant-numeric: tabular-nums; }
.tl-body { padding-left: 30px; }
.tl-body h3 { font-size: 19px; letter-spacing: .06em; line-height: 1.6; }
.tl-body p { max-width: 46em; margin-top: 4px; font-size: 15px; line-height: 1.85; color: var(--ink-2); }

/* ---------------------------------------------------------------- 人物 */

.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  font: inherit; font-size: 14px; padding: 4px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  transition: background .2s, color .2s, border-color .2s;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.modern { border-color: var(--accent-mid); color: var(--accent); }
.chip.modern.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fig { padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.fig header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fig h3 { font-size: 21px; letter-spacing: .1em; }
.fig-meta { display: flex; justify-content: space-between; gap: 10px; margin: 2px 0 10px; font-size: 13.5px; color: var(--accent); }
.fig-meta span { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fig p:last-child { font-size: 14.5px; line-height: 1.85; color: var(--ink-2); }
.ftag { flex: none; padding: 1px 9px; border-radius: 5px; font-size: 12px; color: #fff; background: #7d7466; }
.t-emperor { background: #9a6f1e; }
.t-consort { background: #a3475e; }
.t-politics { background: #a33c2c; }
.t-military { background: #6e2f2a; }
.t-thought { background: #3c5878; }
.t-letters { background: #2f6e62; }
.t-art { background: #74508a; }
.t-science { background: #3f7340; }
.t-diplomacy { background: #2a6688; }
.t-religion { background: #8f6326; }
.t-other { background: #6f675c; }
.t-economy { background: #8a6a12; }
.t-culture { background: #2f6e62; }
.t-person { background: #7a5236; }
.t-society { background: #66615a; }

/* ---------------------------------------------------------------- 帝王页 */

.ruler-cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; align-items: start; }
.ruler-cols .intro { margin-top: 30px; }
.verdict {
  margin: 28px 0 0; padding: 20px 24px; border-radius: var(--radius);
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  font: 16px/1.95 var(--serif); color: var(--ink);
}
.verdict p { text-indent: 0; }
.verdict::before { content: "历史评价"; display: block; margin-bottom: 6px; font: 700 13px/1 var(--sans); letter-spacing: .2em; color: var(--accent); }
.kin { margin-top: 30px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.kin h3 { font-size: 16px; letter-spacing: .2em; color: var(--ink-3); }
.kin-desc { margin: 6px 0 12px; font: 600 15px/1.6 var(--serif); }
.kin ul { display: grid; gap: 6px; }
.kin li { display: flex; gap: 10px; align-items: baseline; font-size: 15px; }
.kin li small { flex: none; width: 2.6em; font-size: 12.5px; color: var(--ink-3); }
.kin li a { color: var(--accent); border-bottom: 1px solid var(--accent-mid); }
.kin-tree { display: inline-block; margin-top: 14px; font-size: 13.5px; color: var(--accent); }

.modern-box {
  margin-top: 36px; padding: 24px 26px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%);
  border: 1px solid var(--accent-mid);
}
.modern-box h3 { display: flex; align-items: center; gap: 10px; font-size: 19px; letter-spacing: .12em; margin-bottom: 14px; }
.modern-box h3::before { content: "今"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 15px; letter-spacing: 0; }
.modern-box ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px 28px; }
.modern-box li a { display: flex; gap: 10px; align-items: baseline; }
.modern-box li a span { font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; }
.modern-box li a b { font: 700 16px/1.5 var(--serif); }
.modern-box li a:hover b { color: var(--accent); }
.modern-box li p { margin-top: 2px; font-size: 14px; line-height: 1.8; color: var(--ink-2); }

.phase + .phase { margin-top: 18px; }
.phase-h {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px;
  padding: 5px 14px; border-radius: 999px;
  font: 700 14px/1.4 var(--sans); letter-spacing: .14em;
  background: var(--bg-deep); color: var(--ink-2);
}
.phase-during .phase-h { background: var(--accent); color: #fff; }
.rtl { position: relative; }
.rtl::before { content: ""; position: absolute; left: 110px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.ev { position: relative; display: grid; grid-template-columns: 110px 1fr; padding-bottom: 22px; scroll-margin-top: 90px; }
.ev::before {
  content: ""; position: absolute; left: 105px; top: 10px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent-mid);
}
.ev[data-modern]::before { border-color: var(--accent); background: var(--accent); }
.ev time { padding-right: 22px; text-align: right; font: 700 15px/1.9 var(--serif); color: var(--accent); font-variant-numeric: tabular-nums; }
.ev-body { padding-left: 26px; max-width: 48em; }
.ev-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.ev-head b { font: 700 18px/1.6 var(--serif); letter-spacing: .05em; }
.etype { padding: 1px 8px; border-radius: 5px; font-size: 12px; line-height: 1.6; color: #fff; }
.ev-body > p:not(.ev-head) { margin-top: 3px; font-size: 15px; line-height: 1.85; color: var(--ink-2); }
.ev-modern {
  margin-top: 8px !important; padding: 8px 12px; border-radius: 8px;
  background: var(--accent-soft); color: var(--ink) !important; font-size: 14px !important;
}
.ev-modern b { margin-right: 8px; font-size: 12.5px; color: var(--accent); letter-spacing: .1em; }
.ev:target .ev-body { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }

/* ---------------------------------------------------------------- 翻页 / 页脚 */

.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; margin: 72px 0 0; }
.pager .prev, .pager .next {
  display: grid; padding: 18px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--c);
}
.pager .next { text-align: right; }
.pager .empty { background: none; border: 0; }
.pager small { font-size: 12.5px; color: var(--ink-3); letter-spacing: .2em; }
.pager b { font: 700 21px/1.4 var(--serif); letter-spacing: .08em; }
.pager span { font-size: 13px; color: var(--ink-2); }
.pager .home {
  align-self: center; padding: 8px 18px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--ink-2); font-size: 14px; background: var(--surface);
}
.foot { margin-top: 80px; padding: 30px 0 44px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); text-align: center; }

/* ---------------------------------------------------------------- 首页 */

.home-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center;
  margin-top: 28px; padding: 56px 56px 52px; border-radius: 24px; overflow: hidden;
  background:
    radial-gradient(700px 360px at 100% 0%, rgba(180, 55, 42, .1), transparent 70%),
    radial-gradient(600px 300px at 0% 100%, rgba(44, 74, 99, .08), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
}
.eyebrow { font-size: 13.5px; letter-spacing: .4em; color: var(--accent); }
.home-hero h1 { margin-top: 10px; font-size: clamp(48px, 9vw, 92px); line-height: 1.05; font-weight: 900; letter-spacing: .16em; }
.hh-sub { margin-top: 16px; font: 18px/1.7 var(--serif); color: var(--ink-2); letter-spacing: .08em; }
.hh-stats { display: flex; flex-wrap: wrap; gap: 14px 40px; margin-top: 30px; }
.hh-stats dt { font-size: 12.5px; letter-spacing: .2em; color: var(--ink-3); }
.hh-stats dd { font: 700 26px/1.3 var(--serif); font-variant-numeric: tabular-nums; }
/* 朝代歌竖排：每句一列，从右往左读 */
.poem {
  writing-mode: vertical-rl;
  font: 17px/1.9 var(--serif); letter-spacing: .32em; color: var(--ink-2);
  padding-left: 28px; border-left: 1px solid var(--line);
}
.poem span { display: block; }
.poem span:nth-child(odd) { color: var(--ink); }
.poem span:nth-child(even) { margin-left: .9em; }

.river { margin-top: 40px; padding: 26px 28px 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.river-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 16px; }
.river-head h2 { font-size: 21px; letter-spacing: .16em; }
.river-head p { font-size: 13px; color: var(--ink-3); }
/* 给边缘刻度留出空间；等量外边距和内边距保留河道的宽度与年代比例。 */
.river-scroll { overflow-x: auto; margin-inline: -12px; padding: 0 12px 6px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.river-in { position: relative; min-width: 1000px; height: calc(var(--lanes) * 44px + 30px); }
.seg {
  position: absolute; left: var(--l); width: var(--w); min-width: 3px;
  top: calc(var(--lane) * 44px); height: 38px;
  display: grid; place-items: center; overflow: hidden;
  border-radius: 6px; background: var(--c); color: #fff;
  font: 700 15px/1 var(--serif); white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  transition: filter .2s, transform .2s;
}
.ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; border-top: 1px solid var(--line); }
.tick { position: absolute; left: var(--l); top: 0; padding-top: 4px; transform: translateX(-50%); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tick::before { content: ""; position: absolute; left: 50%; top: -5px; height: 5px; border-left: 1px solid var(--line-2); }
.tick.end { transform: translateX(-100%); }

.era { margin-top: 64px; }
.era-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 22px; }
.era-h h2 { font-size: 30px; letter-spacing: .16em; }
.era-motto { font: 16px/1 var(--serif); color: var(--ink-3); letter-spacing: .24em; }
.era-span { margin-left: auto; font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.dcard {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto; gap: 14px 16px;
  padding: 22px; border-radius: 16px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.dcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c); }
.dc-seal {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 10px;
  background: var(--c); color: #fff; font: 900 28px/1 var(--serif);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .2);
}
.dc-seal.two { writing-mode: vertical-rl; font-size: 19px; }
.dc-head { display: grid; align-content: center; }
.dc-head b { font: 700 23px/1.3 var(--serif); letter-spacing: .12em; }
.dc-head small { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dc-sum { grid-column: 1 / -1; font-size: 15px; line-height: 1.85; color: var(--ink-2); }
.dc-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.dc-meta span:last-child { color: var(--c); }

/* ---------------------------------------------------------------- 节点浮层（未建页的节点点按时显示完整信息） */

.pop {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
  max-width: 460px; margin: 0 auto; padding: 16px 18px;
  border-radius: 14px; background: var(--ink); color: #f4ede2;
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .5);
  font-size: 14px; line-height: 1.7;
}
.pop b { font: 700 20px/1.4 var(--serif); letter-spacing: .08em; }
.pop .pop-tag { margin-right: 8px; padding: 2px 7px; border-radius: 4px; font-size: 13px; background: var(--accent); color: #fff; vertical-align: 3px; }
.pop .pop-era { color: var(--accent-mid); font-family: var(--serif); }

/* 会位移的悬停效果只给有鼠标的设备：触屏上手指划过会触发 :hover，卡片会跟着上下跳 */
@media (hover: hover) and (pointer: fine) {
  .node.linked:hover { transform: translateY(-2px); border-color: var(--accent-mid); box-shadow: 0 2px 4px rgba(60, 40, 20, .06), 0 14px 28px -12px rgba(60, 40, 20, .35); z-index: 2; }
  .rlist a:hover { background: var(--accent-soft); }
  .pager .prev:hover, .pager .next:hover { transform: translateY(-2px); }
  .pager .prev, .pager .next { transition: transform .2s; }
  .dcard:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 2px 4px rgba(60, 40, 20, .06), 0 20px 36px -18px rgba(60, 40, 20, .4); }
  .seg:hover { filter: brightness(1.15); transform: translateY(-2px); }
  .chip:hover { border-color: var(--ink-3); }
  .pager .home:hover { border-color: var(--accent); color: var(--accent); }
}

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 900px) {
  .ruler-cols { grid-template-columns: 1fr; gap: 0; }
  .rlist li > * { grid-template-columns: 30px 1fr auto; gap: 4px 10px; }
  .r-no { grid-row: 1 / 3; }
  .r-era { text-align: right; }
  .r-years { grid-column: 2; }
  .r-desc { grid-column: 3; text-align: right; }
  .home-hero { grid-template-columns: 1fr; }
  .poem { writing-mode: horizontal-tb; display: flex; flex-wrap: wrap; gap: 2px 0; padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line); letter-spacing: .14em; font-size: 15px; }
  .poem span:nth-child(odd)::after { content: "，"; }
  .poem span:nth-child(even) { margin: 0 1.2em 0 0; }
  .poem span:nth-child(even)::after { content: "；"; }
  .poem span:last-child::after { content: "。"; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar-in { gap: 8px; height: 54px; }
  .brand-name { display: none; }
  .sections a { padding: 6px 9px; }
  .sections a::after { left: 9px; right: 9px; }
  .hero { display: block; margin-top: 16px; padding: 28px 22px 26px; border-radius: 16px; }
  .hero .seal { position: absolute; top: 22px; right: 18px; }
  .hero .crumbs, .hero h1 { padding-right: 64px; }
  .hero-mark { font-size: 220px; bottom: -70px; }
  .seal { width: 58px; height: 58px; font-size: 32px; }
  .seal.two { font-size: 22px; }
  .home-hero { margin-top: 16px; padding: 32px 22px 26px; border-radius: 18px; }
  .river { padding: 20px 16px 16px; }
  .sec { margin-top: 48px; }
  .sec-h { font-size: 22px; }
  .intro { font-size: 16px; }
  .highlights, .figs, .cards, .modern-box ol { grid-template-columns: 1fr; }
  .timeline::before, .rtl::before { left: 5px; }
  .timeline li, .ev { grid-template-columns: 1fr; padding-left: 28px; padding-bottom: 22px; }
  .timeline li::before, .ev::before { left: 0; top: 7px; }
  .timeline time, .ev time { text-align: left; padding: 0; line-height: 1.6; }
  .tl-body, .ev-body { padding-left: 0; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .home { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .era-h h2 { font-size: 26px; }
  .era-span { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .toggle, .filter, .pager { display: none !important; }
  body { background: #fff; }
  .tree-scroll { overflow: visible; }
}

/* 英文使用正常字距与横排，树图按更高的卡片计算连线，正文可自然换行。 */
html:lang(en) { --serif: Georgia, "Times New Roman", serif; }
html:lang(en) :is(h1, h2, h3, .brand-name, .eyebrow, .hh-sub, .hh-stats dt, .era-motto, .stats dt, .pager small, .pager b, .phase-h, .n-tag, .n-name, .swatch, .ev-head b, .ev-modern b, .kin h3, .sec-h, .dc-head b, .swipe-hint) { letter-spacing: normal; }
html:lang(en) .brand-name { font-size: 17px; }
html:lang(en) .home-hero { grid-template-columns: minmax(0, 1fr) minmax(240px, .75fr); gap: 36px; }
html:lang(en) .home-hero h1 { font-size: clamp(38px, 5.8vw, 66px); line-height: 1.08; }
html:lang(en) .poem { writing-mode: horizontal-tb; padding-left: 26px; font-size: 15px; line-height: 1.65; letter-spacing: normal; }
html:lang(en) .poem span { margin: 0; }
html:lang(en) .poem span::after { content: none; }
html:lang(en) .hero h1 { overflow-wrap: anywhere; }
html:lang(en) .hero-sub span { white-space: normal; }
html:lang(en) .h-tag { display: table; font-size: 18px; line-height: 1.3; margin: 0 0 12px; letter-spacing: normal; }
html:lang(en) .intro p { text-indent: 0; }
html:lang(en) .stats dd { overflow-wrap: anywhere; }
html:lang(en) .pk-row { grid-template-columns: minmax(0, 1fr); }
html:lang(en) .pk-row b { line-height: 1.4; }
html:lang(en) .tree { --cw: clamp(240px, calc((100cqw - 8px - var(--cols) * var(--g)) / (var(--cols) + 1)), 320px); --ch: 164px; }
html:lang(en) .nb { display: flex; flex-direction: column; justify-content: center; align-items: stretch; padding: 12px 14px; gap: 6px; }
html:lang(en) .nb .n-tag { align-self: flex-start; max-width: 100%; padding: 3px 6px; font-size: 12px; white-space: normal; }
html:lang(en) :is(.n-r1, .n-r2) { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
html:lang(en) .nb .n-name { font-size: 17px; line-height: 1.2; }
html:lang(en) .nb .n-era { font-size: 12px; text-align: left; }
html:lang(en) .nb .n-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; font-size: 12px; line-height: 1.3; }
html:lang(en) .nb .n-years { font-size: 12px; text-align: left; }
html:lang(en) .r-who { flex-wrap: wrap; gap: 5px; }
html:lang(en) .r-who .n-tag { white-space: normal; }
html:lang(en) .rlist li > * { min-width: 0; }
html:lang(en) .r-era { overflow-wrap: anywhere; }
html:lang(en) .kin li { flex-wrap: wrap; gap: 4px 10px; }
html:lang(en) .kin li small { width: auto; }
html:lang(en) .fig header, html:lang(en) .fig-meta { flex-wrap: wrap; }
html:lang(en) .verdict::before { content: "Historical assessment"; letter-spacing: normal; }
html:lang(en) .modern-box h3::before { content: "Now"; width: 38px; font-size: 12px; }
html:lang(en) .river-in { min-width: 1600px; }
html:lang(en) .seg { font-size: 12px; }

/* ---------------------------------------------------------------- 历史时空探索 */
.explorer-nav { flex: none; white-space: nowrap; padding: 5px 11px; border-radius: 999px; color: var(--accent-deep); background: var(--accent-soft); font-size: 13px; font-weight: 700; }
.explorer-nav:hover, .explorer-nav:focus-visible { background: var(--accent-mid); color: var(--ink); }
.explorer-cta { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 34px; padding: 12px 17px; border: 1px solid var(--accent-mid); border-radius: 12px; background: var(--accent-soft); color: var(--accent-deep); transition: transform .2s, background .2s; }
.explorer-cta:hover { transform: translateY(-2px); background: var(--surface); }
.explorer-cta > span { font-size: 12px; }
.explorer-cta b { font: 700 18px/1.5 var(--serif); }
.explorer-page { max-width: 1000px; }
.explorer-hero { margin-top: 28px; padding: 42px 44px 38px; border-radius: 20px 20px 0 0; background: radial-gradient(700px 220px at 100% 0%, var(--accent-soft), transparent 85%), var(--surface); border: 1px solid var(--line); border-bottom: 0; }
.explorer-hero h1 { margin-top: 8px; font-size: clamp(32px, 5vw, 48px); line-height: 1.25; }
.explorer-hero > p:last-child { margin-top: 10px; max-width: 48em; font-size: 15px; color: var(--ink-2); }
.explorer-panel { padding: 0 44px 38px; border-radius: 0 0 20px 20px; background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.explorer-form { border-top: 1px solid var(--line); padding-top: 28px; }
.explorer-form label { display: block; margin-bottom: 10px; font: 700 17px/1.4 var(--serif); }
.explorer-form-row { display: flex; align-items: stretch; gap: 10px; }
.explorer-form-row input { min-width: 0; flex: 1; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink); font: 20px/1.4 var(--sans); font-variant-numeric: tabular-nums; }
.explorer-form-row input:focus { outline: 2px solid var(--accent-mid); outline-offset: 1px; }
.explorer-form-row button { flex: none; padding: 10px 20px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font: 700 15px/1.4 var(--sans); cursor: pointer; }
.explorer-form-row button:hover { background: var(--accent-deep); }
.explorer-form-row button span { margin-left: 10px; }
#explorer-help, .explorer-method { color: var(--ink-3); font-size: 13px; line-height: 1.7; }
#explorer-help { margin-top: 10px; }
.explorer-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.explorer-examples a { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.explorer-examples a:hover { border-color: var(--accent-mid); color: var(--accent-deep); }
.explorer-results { margin-top: 32px; border-top: 1px solid var(--line); }
.explorer-loading, .explorer-error { padding: 26px 0; color: var(--ink-2); }
.explorer-error { color: var(--accent-deep); }
.explorer-result-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; padding: 24px 0; }
.explorer-result-kicker { width: 100%; font-size: 12px; letter-spacing: .15em; color: var(--accent); }
.explorer-result-head h2 { font-size: clamp(30px, 4vw, 42px); line-height: 1.25; font-variant-numeric: tabular-nums; }
.explorer-dynasty-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.explorer-dynasty-tags a { padding: 3px 11px; border-radius: 999px; color: #fff; background: var(--c); font: 700 13px/1.6 var(--serif); }
.explorer-transition { margin: 0 0 18px; padding: 9px 13px; border-left: 3px solid var(--accent-mid); background: var(--accent-soft); color: var(--ink-2); font-size: 13px; }
.explorer-section { padding: 23px 0 25px; border-top: 1px solid var(--line); }
.explorer-section h2 { margin-bottom: 14px; font-size: 20px; line-height: 1.4; }
.explorer-empty { color: var(--ink-3); font-size: 14px; }
.explorer-context-grid, .explorer-rulers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.explorer-context-card, .explorer-ruler { display: flex; flex-direction: column; align-items: flex-start; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.explorer-context-card { border-top: 3px solid var(--c); }
.explorer-card-title, .explorer-ruler a { font: 700 18px/1.4 var(--serif); }
.explorer-card-title:hover, .explorer-ruler a:hover, .explorer-event-copy > a:hover, .explorer-people a:hover { color: var(--accent); }
.explorer-context-card small, .explorer-ruler small { margin-top: 4px; color: var(--ink-3); font-size: 12px; }
.explorer-context-card p { margin-top: 9px; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.explorer-events { display: grid; gap: 10px; }
.explorer-event { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.explorer-event:last-child { border-bottom: 0; }
.explorer-event time { font-size: 13px; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.explorer-event-copy > a:first-child { font: 700 17px/1.4 var(--serif); }
.explorer-event-copy p { margin-top: 5px; color: var(--ink-2); font-size: 14px; line-height: 1.75; }
.explorer-event-copy .explorer-source { display: inline-block; margin-top: 7px; font-size: 12px; color: var(--accent-deep); }
.explorer-people { display: flex; flex-wrap: wrap; gap: 8px; }
.explorer-people li { display: inline-flex; flex-wrap: wrap; gap: 4px 7px; padding: 5px 11px; border-radius: 999px; background: var(--bg-deep); font-size: 13px; }
.explorer-people a { font-weight: 700; }
.explorer-people span { color: var(--ink-2); }
.explorer-method { padding: 14px 4px 0; }
.explorer-noscript { padding: 12px 16px; margin-top: 20px; border-left: 3px solid var(--accent); background: var(--accent-soft); font-size: 14px; }
html:lang(en) .explorer-hero h1, html:lang(en) .explorer-section h2, html:lang(en) .explorer-cta b { letter-spacing: normal; }
@media (max-width: 640px) {
  .explorer-nav { padding: 4px 7px; font-size: 12px; }
  .explorer-hero { margin-top: 16px; padding: 27px 22px 25px; border-radius: 16px 16px 0 0; }
  .explorer-panel { padding: 0 22px 26px; border-radius: 0 0 16px 16px; }
  .explorer-form-row { flex-direction: column; }
  .explorer-form-row button { width: 100%; }
  .explorer-context-grid, .explorer-rulers { grid-template-columns: 1fr; }
  .explorer-event { grid-template-columns: 1fr; gap: 2px; }
  .explorer-section h2 { font-size: 18px; }
}
@media (max-width: 900px) {
  .topbar-in { gap: 10px; }
  html:lang(en) .brand-name { display: none; }
  html:lang(en) .home-hero { grid-template-columns: minmax(0, 1fr); }
  html:lang(en) .poem { display: grid; grid-template-columns: 1fr; border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
}
@media (max-width: 640px) {
  .language-switch a { padding-inline: 7px; }
  .picker summary { padding-inline: 10px; }
  html:lang(en) .home-hero h1 { font-size: 42px; }
  html:lang(en) .hero h1 { font-size: 36px; }
  html:lang(en) .sec-h { font-size: 23px; }
  html:lang(en) .rlist li > * { grid-template-columns: 28px minmax(0, 1fr); }
  html:lang(en) .r-no { grid-column: 1; grid-row: 1 / 5; }
  html:lang(en) :is(.r-who, .r-era, .r-years, .r-desc) { grid-column: 2; text-align: left; }
}
