/* 歷史故事：博物館展廳的排版，台版歷史書書封的配色。
   一個朝代一面牆（--wall 由頁面指定）；展品是白色說明卡；
   燙金只用在細線與大字；炭灰管未上架與次要文字。 */

:root {
  --wall: #7E416B;
  --wall-deep: color-mix(in oklab, var(--wall) 78%, #000);
  --wall-text: #FFFFFF;
  --wall-muted: color-mix(in oklab, var(--wall) 18%, #FFF);
  --ink: #121212;
  --ink-soft: #3A3A3A;
  --paper: #FFFFFF;
  --ground: #F4F4F2;
  --pale: var(--ground);
  --gold: #C4A15A;
  --gold-line: color-mix(in oklab, var(--gold) 70%, transparent);
  --slate: #4A4A4A;
  --slate-tint: #EFEFEF;
  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", "PingFang TC", sans-serif;
  --measure: 38em;
  --lamp: 0 22px 44px -18px rgb(0 0 0 / .55), 0 0 70px -10px rgb(255 240 228 / .35);
  color-scheme: light;
}
/* 朝代的頁：地面、展品卡、展間目錄換成淡牆色（牆色 8%，跟說明卡上的評語淡底同一階）。
   html 上的 class 由 pages.base(pale=True) 加；概念、大廳等跨朝代的頁維持暖灰地面與白底。 */
.dyn { --pale: color-mix(in oklab, var(--wall) 8%, #FFF); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--pale);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  font-kerning: normal;
}
::selection { background: color-mix(in oklab, var(--gold) 45%, #fff); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
img { max-width: 100%; height: auto; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5em 1em; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── 牆 ───────────────────────────── */
/* 牆色底（.wall）、內頁標題帶、展品說明卡的規則在 chrome.css：人物關係圖頁也要用 */

/* ── 朝代展廳 ─────────────────────── */
.hall { padding: 3rem 1.5rem 2.5rem; }
.hall-head {
  max-width: 73rem; margin: 0 auto; padding-bottom: 2rem;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.5rem 2.5rem; align-items: end;
  border-bottom: 1px solid var(--gold-line);
}
.hall-title { margin: 0; display: contents; }
.hall-char {
  grid-row: 1 / span 2; font-weight: 900; line-height: .9;
  font-size: clamp(5.5rem, 12vw, 10.5rem); letter-spacing: 0;
}
.hall-years {
  align-self: end; font-weight: 600; color: var(--gold);
  font-size: clamp(2.4rem, 5.4vw, 4.6rem); line-height: 1; font-variant-numeric: lining-nums;
}
.hall-lede { grid-column: 2; margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.35rem); letter-spacing: .06em; line-height: 1.7; }
.shelf { grid-column: 3; grid-row: 1 / span 2; align-self: start; text-align: right; font-family: var(--sans); }
.shelf ol { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; gap: 4px; justify-content: flex-end; align-items: flex-end; }
.spine {
  width: 1.9rem; height: 5.2rem; background: var(--spine);
  display: flex; align-items: flex-start; justify-content: center; padding-top: .45rem;
  writing-mode: vertical-rl; font-family: var(--serif); font-size: .95rem; letter-spacing: .1em;
  color: rgb(255 255 255 / .62); box-shadow: inset -3px 0 0 rgb(0 0 0 / .18);
}
.spine--on { height: 6rem; border: 1px solid var(--gold); color: var(--wall-text); }
.spine a { text-decoration: none; }
.shelf p { margin: 0; font-size: .85rem; color: var(--wall-muted); }

.corridor { max-width: 73rem; margin: 0 auto; padding-top: 2.5rem; }
.ex-more { margin: -1rem 0 2rem; font-family: var(--sans); font-size: .85rem; color: var(--wall-muted); }
.ex-more a { color: var(--wall-text); }
.exhibits { list-style: none; margin: 0 0 2rem; padding: 0; display: flex; gap: 1.25rem; align-items: flex-end; }
.exhibit { flex: 1 1 0; min-width: 0; }
.exhibit--事件 { flex-grow: 1.55; }
.exhibit a {
  display: grid; gap: .2rem; text-decoration: none; color: var(--ink);
  background: var(--pale); padding: 1.3rem 1.4rem 1.1rem; position: relative;
  box-shadow: var(--lamp);
  transition: box-shadow .5s cubic-bezier(.16, 1, .3, 1), transform .5s cubic-bezier(.16, 1, .3, 1);
}
.exhibit a::before {
  content: ""; position: absolute; inset: -28px 10% auto; height: 28px;
  background: radial-gradient(60% 100% at 50% 100%, rgb(255 244 236 / .38), transparent 70%);
  pointer-events: none;
}
.exhibit a:hover, .exhibit a:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 30px 50px -18px rgb(0 0 0 / .6), 0 0 90px -6px rgb(255 240 228 / .5);
}
.ex-year { font-weight: 600; font-size: 1.15rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ex-year::after { content: ""; display: block; width: 2.4rem; height: 2px; background: var(--gold); margin: .45rem 0 .35rem; }
.ex-title { font-weight: 900; font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.25; text-wrap: balance; }
.exhibit--事件 .ex-title { font-size: clamp(1.9rem, 3.2vw, 2.9rem); }
.ex-meta { font-family: var(--sans); font-size: .9rem; color: var(--slate); }
.ex-src {
  margin-top: .7rem; padding-top: .55rem; border-top: 1px solid var(--gold-line);
  font-family: var(--sans); font-size: .8rem; color: var(--slate); line-height: 1.5;
}

.track-scroll { overflow-x: auto; scrollbar-color: var(--gold-line) transparent; padding-bottom: .5rem; }
.track { --label-h: 2.6rem; position: relative; min-width: 62rem; padding-top: var(--label-h); }
.rooms {
  list-style: none; margin: 0; padding: 0; display: flex; height: 4.2rem;
  border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold);
}
.rooms li {
  flex-basis: 0; min-width: 0; border-left: 1px solid var(--gold-line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  container-type: inline-size; position: relative;
}
.rooms li:last-child { border-right: 1px solid var(--gold-line); }
.room-name { font-weight: 600; font-size: 1.05rem; letter-spacing: .08em; line-height: 1.2; white-space: nowrap; }
.room-years { font-family: var(--sans); font-size: .72rem; color: var(--wall-muted); font-variant-numeric: tabular-nums; }
@container (max-width: 4.5rem) { .room-years { display: none; } }
/* 窄格放不下字：年號橫排標在軌道上方，用細線連回格子中線 */
.room--narrow .room-name, .room--narrow .room-years { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.room-link { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: inherit; text-decoration: none; }
a.room-link:hover { background: rgb(255 255 255 / .09); }
/* 序廳（建國以前：明的元末、清的入關以前）：淡斜紋、字暗一階，看得出在正廳之前 */
.room--prelude { background: repeating-linear-gradient(135deg, rgb(255 255 255 / .07) 0 3px, transparent 3px 9px); }
.room--prelude .room-name, .room--prelude .room-years { color: var(--wall-muted); }
.room-tags a { color: inherit; text-decoration: none; }
.room-tags a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .2em; }
.room-tags { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0 0 auto; height: 1.5rem; }
.room-tags li {
  position: absolute; bottom: 0; transform: translateX(-50%); white-space: nowrap;
  font-weight: 600; font-size: .85rem; letter-spacing: .04em; line-height: 1.2;
}
.room-leads { position: absolute; top: 1.5rem; left: 0; width: 100%; height: 1.1rem; }
.room-leads line { stroke: rgb(255 255 255 / .35); stroke-width: 1; vector-effect: non-scaling-stroke; }
/* 燈從軌道上緣垂下來：只露出軌道線以下的半顆，光暈往下散 */
.lamps { position: absolute; inset: calc(var(--label-h) - 6px) 0 auto; height: 12px; pointer-events: none; clip-path: inset(6px -30px -30px -30px); }
.lamp {
  position: absolute; top: 0; width: 11px; height: 11px; border-radius: 50%; transform: translateX(-50%);
  background: #FFF6EC; box-shadow: 0 0 0 2px var(--gold), 0 0 16px 4px rgb(255 238 220 / .7);
}
/* 大廳的燈對應頂端的展品卡（data-i 同序號）：平常暗，滑到或聚焦某張卡，它那盞亮、其餘更暗。
   亮暗由頁面上一小段 script 切 class（Safari 的 :has() 對 :hover 不可靠，不用它）。
   觸控沒有 hover，維持原亮度；年號頁的燈沒有 data-i，不受影響 */
@media (hover: hover) {
  .lamp[data-i] { opacity: .4; transition: opacity .35s cubic-bezier(.16, 1, .3, 1); }
  .corridor.probing .lamp[data-i] { opacity: .12; }
  .corridor.probing .lamp[data-i].on { opacity: 1; }
}
@media (hover: hover) and (prefers-reduced-motion: reduce) { .lamp[data-i] { transition: none; } }
.leads { display: block; width: 100%; height: 2.5rem; }
.leads line { stroke: rgb(255 255 255 / .35); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tags { list-style: none; margin: 0; padding: 0; position: relative; height: 11.5rem; }
.tag {
  position: absolute; top: 0; transform: translateX(-50%); width: 2.3rem;
  background: var(--slate); color: #ECECEC; border-top: 1px solid var(--gold-line);
  display: flex; flex-direction: column; align-items: center; padding: .55rem 0 .4rem;
  box-shadow: 0 10px 18px -10px rgb(0 0 0 / .5);
}
.tag-name { writing-mode: vertical-rl; font-size: .98rem; font-weight: 600; letter-spacing: .12em; line-height: 1.15; }
.tag-year { font-family: var(--sans); font-size: .72rem; margin-top: .45rem; font-variant-numeric: tabular-nums; }
.tag--lit { background: var(--paper); color: var(--ink); border-top: 2px solid var(--gold); box-shadow: var(--lamp); }
.tag--lit a { text-decoration: none; }
.tag--lit a::after { content: ""; position: absolute; inset: 0; }
.legend { margin: 1rem 0 0; font-family: var(--sans); font-size: .85rem; color: var(--wall-muted); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.lg { display: inline-block; width: .8rem; height: .8rem; }
.lg-lit { background: var(--paper); box-shadow: 0 0 8px rgb(255 240 228 / .8); }
.lg-off { background: var(--slate); }
.lg-pre { box-shadow: inset 0 0 0 1px var(--gold-line); background: repeating-linear-gradient(135deg, rgb(255 255 255 / .35) 0 2px, transparent 2px 5px); }
.lg-item { display: inline-flex; align-items: center; gap: .4rem; margin-right: 1rem; white-space: nowrap; }

/* ── 展間目錄與索引 ─────────────────── */
.catalog { background: var(--paper); }
.dyn .catalog, .dyn .cat-filter { background: var(--pale); }
.catalog-inner { max-width: 76rem; margin: 0 auto; padding: 3.5rem 1.5rem 4rem; }
.catalog h2 { font-size: 1.7rem; font-weight: 900; margin: 0 0 .3rem; letter-spacing: .06em; }
.cat-note { margin: 0 0 2.2rem; font-family: var(--sans); font-size: .9rem; color: var(--slate); }
/* 展間目錄的篩選列：黏在視窗上緣，長清單捲到後面也能改；勾選框用牆色 */
.cat-filter {
  position: sticky; top: 0; z-index: 3; margin: -.6rem 0 2rem; padding: .7rem 0; border: 0; border-bottom: 1px solid var(--gold-line);
  background: var(--paper); display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.4rem;
  font-family: var(--sans); font-size: .95rem;
}
.cat-filter legend { float: left; margin-right: .4rem; padding: 0; color: var(--slate); font-size: .9rem; }
.cat-check { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; cursor: pointer; }
.cat-check input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--wall); cursor: pointer; }
.cat-check span { color: var(--slate); font-size: .8rem; font-variant-numeric: tabular-nums; }
/* 「全部」跟四類之間隔一道細線，看得出它管的是後面四個 */
.cat-all { padding-right: 1.4rem; border-right: 1px solid var(--gold-line); font-weight: 600; }
.cat-count { margin-left: auto; color: var(--slate); font-size: .85rem; font-variant-numeric: tabular-nums; }
/* 名字搜尋：跟勾選框同一列，窄螢幕自己換到下一行、撐滿 */
.cat-search { flex: 1 1 14rem; max-width: 20rem; }
.cat-search input {
  width: 100%; box-sizing: border-box; min-height: 40px; padding: .35rem .7rem; font: inherit; font-size: .95rem;
  color: var(--ink); background: var(--paper); border: 1px solid #BDBDB8; border-radius: 0;
}
.cat-search input::placeholder { color: #6B6B6B; }
.cat-search input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--slate); }
/* 搜尋時沒有符合的年號整間藏起來 */
.cat-room[hidden] { display: none; }
/* 篩完沒剩東西的年號：只留標題，字淡一點 */
.cat-room--empty h3 { color: var(--slate); }
.cat-room li[hidden] { display: none; }
/* 每間超過 10 件時收起來的「更多／收起」：跟目錄的字同一套無襯線小字，牆色、金色底線，點擊範圍撐到 44px */
.cat-more {
  display: block; min-height: 44px; margin: .2rem 0 0; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--sans); font-size: .85rem; color: var(--wall-deep);
  text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .25em;
}
.cat-more:hover { text-decoration-thickness: 2px; }
.cat-more:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cat-more[hidden] { display: none; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 2.4rem 2.2rem; }
.cat-room h3 {
  margin: 0 0 .6rem; padding-bottom: .4rem; border-bottom: 1px solid var(--gold);
  font-size: 1.15rem; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline;
}
.cat-room h3 span { font-family: var(--sans); font-size: .78rem; font-weight: 400; color: var(--slate); font-variant-numeric: tabular-nums; }
.cat-room ul, .plain-list { list-style: none; margin: 0; padding: 0; }
.cat-room li, .plain-list li {
  display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; align-items: baseline;
  padding: .28rem 0; font-size: .98rem; line-height: 1.5;
}
.cat-name { color: var(--slate); }
.cat-kind, .cat-year { font-family: var(--sans); font-size: .78rem; color: var(--slate); font-variant-numeric: tabular-nums; }
/* 每列各自排版，年份長短不一會讓類別欄跟著跑：年份欄給固定寬度、靠右（最長的是「活躍於 1457」） */
.cat-year { min-width: 6.6em; text-align: right; color: #6B6B6B; }
/* 排序與分間用的那個年份寫深（人物是卒年，其他是起年），另一頭淡；往下掃深色那排就是由早到晚 */
.cat-year .yr-key { color: var(--ink); font-weight: 700; }
.cat-lit a { color: var(--wall-deep); font-weight: 700; text-decoration-color: var(--gold); }
.cat-lit a:hover { text-decoration-thickness: 2px; }
.plain-list { max-width: var(--measure); }
.plain-list li { grid-template-columns: 1fr auto; font-size: 1.1rem; padding: .7rem 0; border-bottom: 1px solid #E4E4E0; }

/* ── 內頁 ─────────────────────────── */
/* 標題帶（.hall-band）與說明卡（.label-card）在 chrome.css */
/* 右欄：說明卡與全篇目錄一起黏在視窗上緣（2026-10-29 使用者要的；原本只黏目錄、卡片跟著捲走）。
   兩者加起來約 850px，筆電放不下，所以整欄限高、目錄在自己的框裡捲（TOC_JS 會把讀到的那一項捲進框裡）；
   視窗矮於 40rem 時連卡片都放不下，退回只黏目錄。
   目錄的刻度尺做法同互動圖故事分頁：讀到哪一節，那一格的刻度變長、字加粗 */
.side { min-width: 0; display: flex; flex-direction: column; gap: 2.2rem; }
.side .label-card { position: static; flex: none; }
@media (min-height: 40rem) {
  .side { position: sticky; top: 1.5rem; align-self: start; max-height: calc(100vh - 3rem); }
  .side .toc { position: static; display: flex; flex-direction: column; min-height: 0; }
  /* 刻度伸到框外 28px：捲動框往左撐開同樣寬度，刻度才不會被裁掉 */
  .side .toc ol { overflow-y: auto; min-height: 0; margin-left: -28px; padding: 0 .4rem 0 28px; scrollbar-width: thin; }
}
.toc { position: sticky; top: 1.5rem; margin-left: .6rem; padding: 2px 0 2px 20px; border-left: 1px solid var(--gold-line);
  font-family: var(--sans); font-size: .9rem; line-height: 1.55; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { position: relative; margin: 0 0 .8rem; }
.toc li:last-child { margin-bottom: 0; }
.toc li::before { content: ""; position: absolute; left: -21px; top: .78em; width: 9px; height: 1px; background: var(--wall); }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--wall-deep); text-decoration: underline; text-decoration-color: var(--gold); }
.toc li.on::before { width: 16px; height: 3px; left: -28px; top: .7em; }
.toc li.on a { color: var(--wall-deep); font-weight: 700; }
.prose h2 { scroll-margin-top: 1.5rem; }

.page {
  max-width: 76rem; margin: 0 auto; padding: 3rem 1.5rem 5rem;
  display: grid; grid-template-columns: minmax(0, var(--measure)) 17.5rem; gap: 4rem; justify-content: space-between;
}
.page--single { grid-template-columns: minmax(0, var(--measure)); justify-content: center; }


/* ── 正文 ─────────────────────────── */
.prose { min-width: 0; font-size: 18px; letter-spacing: .03em; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-weight: 700; font-size: 1.5rem; line-height: 1.4; margin: 2.6em 0 .7em; letter-spacing: .03em; text-wrap: balance; }
.prose h3 { font-weight: 700; font-size: 1.18rem; line-height: 1.5; margin: 2.2em 0 .5em; }
.prose h4 { font-weight: 700; font-size: 1.05rem; margin: 1.8em 0 .4em; }
.prose h2:first-child + p { font-size: 1.12rem; line-height: 1.9; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .35em 0; }
.prose li > ul, .prose li > ol { margin: .3em 0; }
/* ①②③ 小項：編號自成一欄，換行的字對齊編號後面（懸掛縮排），編號底下不排字 */
.prose .ci { display: block; position: relative; padding-left: 1.5em; }
.prose .ci-n { position: absolute; left: 0; }
.prose strong { font-weight: 600; }
.prose mark { background: color-mix(in oklab, var(--gold) 30%, #fff); color: inherit; padding: 0 .1em; }
/* 站內連結用深牆色加粗：淡牆色地面上，牆色本身做字辨識度不夠（2026-11-01 使用者反映） */
.prose a.xref { color: var(--wall-deep); font-weight: 700; text-decoration-color: var(--gold); }
.prose a.xref:hover { text-decoration-thickness: 2px; }
.prose a:not(.xref) { color: var(--wall-deep); }
.prose blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.2em; border-left: 1px solid var(--slate); color: var(--ink-soft); }
.prose hr { border: 0; width: 3rem; height: 1px; background: var(--gold); margin: 2.6em auto; }
.prose table {
  display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse;
  margin: 1.4em 0; font-size: .95rem; line-height: 1.6; font-variant-numeric: tabular-nums;
}
.prose th { font-family: var(--sans); font-weight: 700; font-size: .85rem; text-align: left; color: var(--slate); border-bottom: 1px solid var(--gold); }
.prose th, .prose td { padding: .5em .9em .5em 0; vertical-align: top; }
.prose td { border-bottom: 1px solid #E4E4E0; }
.prose code { font-size: .88em; background: var(--slate-tint); padding: .05em .3em; }
.prose pre { background: var(--paper); border: 1px solid #E4E4E0; padding: 1rem 1.2rem; overflow-x: auto; font-size: .85rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose pre.mermaid { text-align: center; font-family: var(--sans); color: transparent; }
.prose pre.mermaid[data-processed] { color: inherit; }
.prose--story { font-size: 18px; }

.callout { margin: 1.8em 0; padding: 1.1rem 1.3rem .4rem; background: var(--slate-tint); }
.callout-title { margin: 0 0 .5rem !important; font-family: var(--sans); font-weight: 700; font-size: .95rem; color: var(--slate); letter-spacing: .08em; }
.callout > :last-child { margin-bottom: .8rem; }

.relation { margin: 2.5em 0; }
.relation img { display: block; background: var(--paper); border: 1px solid #E4E4E0; }
.relation figcaption { margin-top: .6rem; font-family: var(--sans); font-size: .85rem; color: var(--slate); }

.sources { margin-top: 3.5em; padding-top: 1.2em; border-top: 1px solid var(--gold); font-family: var(--sans); font-size: .88rem; line-height: 1.6; }
.sources h2 { font-family: var(--serif); font-size: 1.15rem !important; margin: 0 0 .7em !important; }
.sources ol { padding-left: 1.4em; }
.sources a { word-break: break-all; }

/* ── 大廳：館內導覽圖（2026-11-04，plans/首頁大廳-設計簡報.md） ──
   淺色地面；左欄毛筆站名、說明與館內導覽，右邊紙雕城靜態圖（.claude/tools/lobby_city.py 截的），
   開展的建築上掛白牌；下面一區一區疊（最新開展、精選展品），以後的功能照同一個區塊格式往下加。
   朝代牆色只用在導覽色塊與白牌上；燙金只做線：圖框、回紋角、區塊標題前的回紋帶、白牌頂邊。 */
:root {
  --rule: #E4E4E0;
  --fret-tl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='square'%3E%3Cpath transform='rotate(0 11 11)' d='M1.5 20.5v-19h19v11h-13v-6h7v2.5'/%3E%3C/svg%3E");
  --fret-tr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='square'%3E%3Cpath transform='rotate(90 11 11)' d='M1.5 20.5v-19h19v11h-13v-6h7v2.5'/%3E%3C/svg%3E");
  --fret-br: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='square'%3E%3Cpath transform='rotate(180 11 11)' d='M1.5 20.5v-19h19v11h-13v-6h7v2.5'/%3E%3C/svg%3E");
  --fret-bl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='square'%3E%3Cpath transform='rotate(270 11 11)' d='M1.5 20.5v-19h19v11h-13v-6h7v2.5'/%3E%3C/svg%3E");
  --fret-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='square'%3E%3Cpath d='M0 9.2h12M2 9.2V.8h8v5.6H5V3.6h2.5'/%3E%3C/svg%3E");
}
/* 首頁的頂列改白底墨字、頁尾改炭灰（其他頁照舊深牆色）；園區開著時頂列另有規則（下面 html.park-on） */
html.lobby-day .topbar { --wall-deep: #FFFFFF; --wall-text: #121212; --wall-muted: #3A3A3A; box-shadow: inset 0 -1px 0 var(--rule); }
html.lobby-day .nav-halls ul { background: #FFFFFF; border-color: var(--rule); box-shadow: 0 14px 30px -14px rgb(0 0 0 / .3); }
html.lobby-day .nav-halls li a:hover, html.lobby-day .nav-halls li a.here { background: var(--ground); }
html.lobby-day .nav-halls li a::before { box-shadow: none; }
html.lobby-day .nav-halls-all { border-top-color: var(--rule); }
html.lobby-day .site-foot { --wall-deep: #4A4A4A; --wall-muted: #E8E8E8; }
.lobby { background: var(--ground); padding: 3rem 1.5rem 4.5rem; }
.lobby-inner { max-width: 73rem; margin: 0 auto; display: grid; grid-template-columns: minmax(17rem, 23rem) minmax(0, 1fr); gap: 3rem 3.5rem; align-items: start; }
/* 站名寫成毛筆字，像騎樓上掛的招牌（2026-11-03）；毛筆只有一種粗細，不用 900 */
.lobby-title { margin: 0; color: var(--ink); font-weight: 400; letter-spacing: .06em; font-size: clamp(3.6rem, 6.4vw, 5.8rem); line-height: 1.1; }
.lobby-tagline { margin: .5rem 0 0; font-weight: 600; font-size: clamp(1.15rem, 1.7vw, 1.4rem); letter-spacing: .3em; }
.lobby-gloss { margin: .9rem 0 0; font-family: var(--sans); font-size: .95rem; line-height: 1.75; color: var(--ink-soft); }
.lobby-gloss b { font-weight: 700; color: var(--ink); }
.lobby-lede { margin: 1rem 0 0; font-size: 1.1rem; line-height: 1.75; }
/* 館內導覽：頂邊一道燙金線（跟說明卡同一個做法），一列一間；開展的整列是連結 */
.guide { margin-top: 2rem; border-top: 2px solid var(--gold); }
.guide h2 { margin: .9rem 0 .25rem; font-family: var(--sans); font-size: .85rem; font-weight: 500; letter-spacing: .3em; color: var(--slate); }
.guide ul { list-style: none; margin: 0; padding: 0; }
.guide-row > a, .guide-row > span {
  display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; align-items: center; gap: .85rem;
  min-height: 3rem; padding: .4rem 0; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none;
}
.guide-chip { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; background: var(--chip, var(--slate)); color: #FFF; font-weight: 900; font-size: 1.15rem; line-height: 1; }
.guide-name { font-weight: 700; font-size: 1.12rem; letter-spacing: .04em; }
.guide-meta { display: inline-flex; align-items: center; gap: .45em; font-family: var(--sans); font-size: .85rem; color: var(--slate); font-variant-numeric: tabular-nums; }
.guide-row > a .guide-meta::after {
  content: ""; width: 1em; height: 1em; background: currentColor; transition: transform .2s ease-out;
  -webkit-mask: var(--icon-arrow-right) no-repeat center / contain; mask: var(--icon-arrow-right) no-repeat center / contain;
}
.guide-row > a:hover .guide-name, .guide-row.is-linked > a .guide-name { color: color-mix(in oklab, var(--chip, var(--slate)) 82%, #000); }
.guide-row > a:hover .guide-meta::after, .guide-row.is-linked > a .guide-meta::after { transform: translateX(3px); }
/* 籌備中：序廳那套淡斜紋，不打色（籌備中的朝代併一列，色塊寫「籌」） */
.is-off .guide-chip { background-color: var(--paper); background-image: repeating-linear-gradient(135deg, rgb(0 0 0 / .07) 0 2px, transparent 2px 6px); box-shadow: inset 0 0 0 1px #D4D4CE; color: #6B6B6B; }
.is-off .guide-name { font-weight: 500; color: #555; }
.guide-sub { margin: 1.2rem 0 0; padding-bottom: .3rem; border-bottom: 1px solid var(--rule); font-family: var(--sans); font-size: .82rem; letter-spacing: .3em; color: var(--slate); }
/* 紙雕城：白紙圖框、燙金細框、四角回紋；圖不裁切（寬高比照截圖），白牌的百分比座標才準 */
.city { position: relative; margin: 0; padding: .7rem; background: var(--paper); border: 1px solid var(--gold-line); box-shadow: 0 24px 48px -30px rgb(0 0 0 / .45); }
.city::before {
  content: ""; position: absolute; inset: -8px; pointer-events: none; background: var(--gold);
  -webkit-mask: var(--fret-tl) top left / 22px no-repeat, var(--fret-tr) top right / 22px no-repeat, var(--fret-br) bottom right / 22px no-repeat, var(--fret-bl) bottom left / 22px no-repeat;
  mask: var(--fret-tl) top left / 22px no-repeat, var(--fret-tr) top right / 22px no-repeat, var(--fret-br) bottom right / 22px no-repeat, var(--fret-bl) bottom left / 22px no-repeat;
}
.city-stage { position: relative; }
.city img { display: block; width: 100%; height: 100%; }
html.has-park .city img { cursor: pointer; }
/* 白牌：釘在建築頂端，一條燙金細線牽下來；頂邊 2px 燙金＝已開展（同籤條）。靠圖邊的往圖內伸 */
.pin { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); width: 0; height: 0; }
.pin::before { content: ""; position: absolute; left: -.5px; bottom: 0; width: 1px; height: 2.2rem; background: var(--gold); }
.pin::after { content: ""; position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
.pin a {
  position: absolute; left: 0; bottom: 2.2rem; transform: translateX(var(--ax)); display: flex; align-items: stretch; white-space: nowrap;
  background: var(--paper); color: var(--ink); text-decoration: none; border-top: 2px solid var(--gold);
  box-shadow: 0 16px 30px -14px rgb(0 0 0 / .55); transition: transform .5s cubic-bezier(.16, 1, .3, 1), box-shadow .5s cubic-bezier(.16, 1, .3, 1);
}
.pin b { display: grid; place-items: center; padding: 0 .6rem; background: var(--chip); color: #FFF; font-weight: 900; font-size: 1.25rem; }
.pin a > span { display: grid; padding: .45rem .85rem .5rem; font-weight: 700; font-size: 1rem; line-height: 1.35; }
.pin em { font-style: normal; font-family: var(--sans); font-weight: 400; font-size: .8rem; color: var(--slate); font-variant-numeric: tabular-nums; }
.pin a:hover, .pin a:focus-visible, .pin.is-linked a { transform: translateX(var(--ax)) translateY(-3px); box-shadow: 0 24px 36px -14px rgb(0 0 0 / .6); }
/* 淺色地面上燙金焦點框不夠看（約 2.2:1），大廳一律用墨色 */
html.lobby-day .lobby a:focus-visible, html.lobby-day .lobby button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
/* 首頁白底頂列也一樣（園區開著時頂列疊在場景上，照園區的規則，不換） */
html.lobby-day:not(.park-on) .topbar a:focus-visible, html.lobby-day:not(.park-on) .nav-halls summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
/* 往下一區一區疊：區塊標題前一段回紋帶，右邊「查看更多」 */
.lobby-secs { max-width: 73rem; margin: 4rem auto 0; display: grid; gap: 3.5rem; }
.sec-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.1rem; }
.sec-head h2 { margin: 0; display: flex; align-items: center; gap: .8rem; font-size: 1.7rem; font-weight: 900; letter-spacing: .08em; }
.sec-head h2::before { content: ""; flex: none; width: 4.5rem; height: .75rem; background: var(--gold); -webkit-mask: var(--fret-band) repeat-x left center / .9rem .75rem; mask: var(--fret-band) repeat-x left center / .9rem .75rem; }
.sec-more { margin-left: auto; display: inline-flex; align-items: center; gap: .35em; font-family: var(--sans); font-weight: 700; font-size: .92rem; color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .28em; }
.sec-more::after { content: ""; width: 1em; height: 1em; background: currentColor; transition: transform .2s ease-out; -webkit-mask: var(--icon-arrow-right) no-repeat center / contain; mask: var(--icon-arrow-right) no-repeat center / contain; }
.sec-more:hover::after { transform: translateX(3px); }
.news { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 2.5rem; }
.news li { border-top: 1px solid var(--rule); padding-top: .9rem; }
.news time { font-family: var(--sans); font-weight: 700; font-size: .9rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.news p { margin: .35rem 0 0; font-size: 1.05rem; line-height: 1.85; }
.news a { white-space: nowrap; }   /* 名字不從中間斷行，只在「、」換行 */
.news a, .pick-hall a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .28em; text-decoration-thickness: 1px; }
.news a:hover, .pick-hall a:hover { text-decoration-thickness: 2px; }
.news-more { white-space: nowrap; font-family: var(--sans); font-size: .85rem; color: var(--slate); }
/* /latest/：同一套格式排成一欄，一天一則、一類一行，類別貼在名字前 */
.news--all { grid-template-columns: minmax(0, 1fr); gap: 0; }
.news--all li { padding: 1rem 0 1.2rem; }
.news--all p { margin: .3rem 0 0; }
.news-kind { display: inline-block; min-width: 3.2em; margin-right: .6em; font-family: var(--sans); font-size: .82rem; color: var(--slate); }
/* 精選展品：同展廳的展品卡（年份領頭、燙金短線、毛筆名），放在淺色地面上改白卡、頂邊燙金 */
.pick-group + .pick-group { margin-top: 2.4rem; }
.pick-hall { display: flex; align-items: center; gap: .7rem; margin: 0 0 1rem; font-family: var(--sans); font-size: .88rem; color: var(--slate); font-variant-numeric: tabular-nums; }
.pick-hall::before { content: ""; width: .9rem; height: .9rem; background: var(--chip); }
.pick-hall a { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.picks { margin: 0; align-items: stretch; }
.picks .exhibit a { height: 100%; background: var(--paper); border-top: 2px solid var(--gold); box-shadow: 0 18px 36px -24px rgb(0 0 0 / .45); }
.picks .exhibit a::before { display: none; }
.picks .exhibit a:hover, .picks .exhibit a:focus-visible { box-shadow: 0 28px 44px -24px rgb(0 0 0 / .5); }

/* ── 首頁 3D 園區 ─────────────────── */
/* 寬螢幕直接開、窄螢幕按「看 3D 園區」才開；開的時候蓋住頂列以下整個視窗（top 由程式量頂列高度），
   書架、不分朝代、頁尾藏起來。紙色背景跟 3D 場景的背景同一組漸層，載入前後看不出接縫 */
.park-open {
  position: absolute; left: 1rem; bottom: 1rem; display: inline-flex; align-items: center; gap: .45em; margin: 0; padding: .6rem 1.1rem;
  font: 500 .95rem/1.4 var(--sans); letter-spacing: .06em; color: #FFF; background: var(--ink); border: 0; cursor: pointer;
  box-shadow: 0 12px 24px -12px rgb(0 0 0 / .6);
}
.park-open[hidden] { display: none; }
.park-open::after {
  content: ""; width: 1em; height: 1em; background: currentColor; transition: transform .2s ease-out;
  -webkit-mask: var(--icon-arrow-right) no-repeat center / contain; mask: var(--icon-arrow-right) no-repeat center / contain;
}
.park-open:hover::after { transform: translateX(3px); }
.park-open:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
/* 園區開著時不讓頁面捲動：只鎖 html。body 也鎖的話，書架、目錄藏起來後 body 只剩頂列高，
   往下展開的「展廳」選單會被 body 裁掉（2026-11-01 修） */
html.park-on { overflow: hidden; }
html.park-on .lobby, html.park-on .site-foot { display: none; }
/* 園區開著時頂列沒有底色，疊在滿版 3D 上，站名與導覽靠左（跟左下提示列同一條 16px 邊）（2026-11-02）。
   字色跟著天色：白天墨色、入夜淺紙色（PARK_JS 在 html 上加 park-dark），外加一圈同調的柔光，壓在樹、建築上也讀得到。
   頂列整條不吃滑鼠，只有字吃，拖曳上緣一樣能移動園區。展開的「展廳」選單照舊深牆色底、白字。 */
html.park-on .topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 6; background: none; box-shadow: none; pointer-events: none;
  --wall-text: #2B2620; --wall-muted: #4A4238; --halo: rgb(251 247 238 / .85);
}
html.park-on.park-dark .topbar { --wall-text: #F7F1E3; --wall-muted: #DCD3C0; --halo: rgb(14 18 38 / .8); }
html.park-on .topbar-inner { max-width: none; margin: 0; padding: .7rem 16px; }
html.park-on .site-name, html.park-on .site-nav { pointer-events: auto; text-shadow: 0 0 4px var(--halo), 0 0 10px var(--halo); }
html.park-on .topbar .site-mark { filter: drop-shadow(0 0 2px var(--halo)) drop-shadow(0 0 6px var(--halo)); }
/* 「展廳」選單在園區裡跟右上的各朝清單重複（清單還多了籌備中的朝代、跟場景連動），園區開著時藏起來（2026-11-02 使用者定） */
html.park-on .nav-halls { display: none; }
.park {
  --park-ink: #2B2620; --park-muted: #6B6255; --park-card: #FBF7EE;
  position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 5; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 45%, #F6F0E3 0%, #EDE4D1 60%, #E2D6BE 100%);
  color: var(--park-ink); font-family: var(--sans);
}
.park[hidden] { display: none; }
.park-stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.park-hint { position: absolute; left: 16px; bottom: 16px; margin: 0; display: flex; align-items: center; gap: .8rem; font-size: .82rem; color: var(--park-muted); }
/* 操作說明：滑鼠與觸控各寫各的（觸控裝置沒有右鍵與滾輪） */
.park-hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .park-hint-mouse { display: none; } .park-hint-touch { display: inline; } }
.park-close, .park-night { font: inherit; color: var(--park-ink); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.park-close:focus-visible, .park-night:focus-visible, .park-list :focus-visible, .park-card-go:focus-visible { outline: 2px solid var(--park-ink); outline-offset: 2px; }
/* 建築頂上的小牌：牆色方塊寫朝代，白底寫建築名；籌備中的字淡 */
/* 夜裡提示列在靛藍夜空上：字改成淺紙色（對比 ≥ 4.5:1） */
.park.is-night .park-hint { color: #CFC6B4; }
.park.is-night .park-close, .park.is-night .park-night { color: #F1EADB; }
.park.is-night .park-close:focus-visible, .park.is-night .park-night:focus-visible { outline-color: #F1EADB; }
.park-tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.park-tag { position: absolute; left: 0; top: 0; will-change: transform; display: flex; align-items: stretch; white-space: nowrap; font-size: .85rem; line-height: 1; background: var(--park-card); box-shadow: 0 6px 14px -6px rgb(60 40 20 / .45); }
.park-tag b { display: grid; place-items: center; padding: .38rem .45rem; background: var(--chip); color: #fff; font-family: var(--serif); font-weight: 900; }
.park-tag span { padding: .38rem .55rem; font-family: var(--serif); font-weight: 600; }
.park-tag.is-closed span { color: var(--park-muted); font-weight: 400; }
/* 說明卡跳的那一朝：小牌加一圈牆色框、疊到最上層 */
.park-tag.is-on { z-index: 1; outline: 2px solid var(--chip); outline-offset: 2px; }
.park-tag.is-on span { color: var(--park-ink); }
/* 說明卡 */
.park-card { position: absolute; right: 16px; bottom: 16px; width: min(20rem, calc(100% - 32px)); padding: 1rem 1.15rem 1.1rem; background: var(--park-card); border-top: 4px solid var(--chip); box-shadow: 0 18px 40px -18px rgb(60 40 20 / .5); }
.park-card[hidden] { display: none; }
.park-card h2 { margin: .15rem 0 .45rem; font-family: var(--serif); font-weight: 900; font-size: 1.3rem; }
.park-card p { margin: 0; font-size: .95rem; line-height: 1.7; }
.park-card .park-card-kicker { color: var(--park-muted); font-size: .82rem; letter-spacing: .06em; }
.park-card-go { display: inline-flex; align-items: center; gap: .4em; margin-top: .8rem; padding: .45rem .9rem; background: var(--chip); color: #fff; text-decoration: none; font-weight: 500; }
.park-card-go::after { content: ""; width: 1em; height: 1em; background: currentColor; -webkit-mask: var(--icon-arrow-right) no-repeat center / contain; mask: var(--icon-arrow-right) no-repeat center / contain; }
/* 各朝清單：平常看得到一排小字，Tab 會走到；拿到焦點的那一朝，建築浮起來、跳出說明卡 */
.park-list { position: absolute; top: 16px; right: 16px; margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; max-width: calc(100% - 32px); }
.park-list a, .park-list button { display: inline-flex; align-items: center; gap: .35em; padding: .3rem .6rem; font: inherit; font-size: .85rem; color: var(--park-ink); background: var(--park-card); border: 0; cursor: pointer; text-decoration: none; box-shadow: 0 4px 10px -6px rgb(60 40 20 / .4); }
.park-list a::before, .park-list button::before { content: ""; width: .7em; height: .7em; background: var(--chip); }
.park-list button { color: var(--park-muted); }
/* 頂列疊在園區上：視窗不夠寬放兩排並列時，清單退到頂列底下 */
@media (max-width: 72rem) { .park-list { top: 3.6rem; } }
@media (max-width: 640px) {
  .park-list { top: auto; bottom: 52px; left: 16px; right: 16px; justify-content: flex-start; }
  .park-hint { left: 16px; right: 16px; bottom: 16px; justify-content: space-between; }
  .park-card { bottom: 128px; }
}

/* ── 窄螢幕 ───────────────────────── */
@media (max-width: 52rem) {
  .hall { padding: 2rem 1rem 2rem; }
  .hall-head { grid-template-columns: auto minmax(0, 1fr); }
  .hall-char { grid-row: 1 / span 2; }
  .shelf { grid-column: 1 / -1; grid-row: auto; text-align: left; }
  .shelf ol { justify-content: flex-start; }
  .exhibits { flex-direction: column; align-items: stretch; }
  .page { grid-template-columns: minmax(0, 1fr); gap: 2rem; padding: 2rem 1rem 4rem; }
  .side { order: -1; }
  .toc { display: none; }   /* 窄螢幕說明卡在正文上面，再加目錄會把正文推太遠 */
  .catalog-inner { padding-left: 1rem; padding-right: 1rem; }
  /* 大廳單欄：站名與說明 → 紙雕城 → 館內導覽 → 最新開展 → 精選展品 */
  .lobby { padding: 2rem 1rem 3.5rem; }
  .lobby-inner { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lobby-intro { display: contents; }
  .city { order: 1; margin-top: 1.8rem; }
  .guide { order: 2; }
  .lobby-secs { margin-top: 3rem; gap: 3rem; }
  .news { grid-template-columns: minmax(0, 1fr); }
  .sec-head h2 { font-size: 1.45rem; }
  .sec-head h2::before { width: 2.7rem; }
  /* 精選展品在手機上兩欄，免得八張卡疊成半頁長 */
  .picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
  .picks .exhibit a { padding: 1rem 1rem .9rem; }
  .picks .ex-title, .picks .exhibit--事件 .ex-title { font-size: clamp(1.3rem, 5.4vw, 1.7rem); }
  .picks .ex-year { font-size: 1rem; }
}

/* 手機：圖上的白牌太小、點不準，拿掉，導覽靠圖例；圖框收窄 */
@media (max-width: 40rem) {
  .pin { display: none; }
  .city { padding: .45rem; }
  .park-open { left: .7rem; bottom: .7rem; }
}

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

/* ── 年號頁：放大的軌道 ─────────────── */
/* 軌道上方留一條窄帶，放人物、制度、著作的燈名 */
.track--reign { --label-h: 2rem; }
/* 可點的燈：點擊範圍比燈大，外觀仍是下面那層 .lamps 的半顆燈 */
.lamp-links { position: absolute; inset: 0 0 auto; height: calc(var(--label-h) + 16px); pointer-events: none; }
.lamp-hit {
  position: absolute; top: calc(var(--label-h) - 16px); left: var(--x); width: 32px; height: 32px;
  transform: translateX(-50%); border-radius: 50%; pointer-events: auto;
}
/* 同一年可能有好幾件：名字排成一列、各自可點，移上去（或鍵盤聚焦其中一個）整列出現 */
.lamp-label {
  position: absolute; top: .25rem; left: var(--xl); transform: translateX(-50%); white-space: nowrap;
  font-family: var(--sans); font-size: .82rem; font-weight: 500; letter-spacing: .04em; line-height: 1.2;
  color: var(--wall-text); opacity: 0; transition: opacity .15s;
}
.lamp-label a { color: inherit; text-decoration: none; }
.lamp-label a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .2em; }
.lamp-label a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lamp-note { margin-left: .4em; font-weight: 400; color: var(--wall-muted); font-variant-numeric: tabular-nums; }
.lamp-stop:hover .lamp-label, .lamp-stop:focus-within .lamp-label { opacity: 1; pointer-events: auto; }
/* 靠軌道邊緣的一組，名字被夾離燈：燈到名字中心之間鋪一條透明的橋，滑鼠走過去才不會離開 hover。
   橋只在已經 hover 時才收滑鼠，平常不擋軌道；排在燈與名字之前，疊在它們下面 */
.lamp-stop::before {
  content: ""; position: absolute; top: .25rem; height: 2.75rem; pointer-events: none;
  left: min(var(--x), var(--xl)); width: calc(max(var(--x), var(--xl)) - min(var(--x), var(--xl)));
}
.lamp-stop:hover::before { pointer-events: auto; }
/* 觸控裝置沒有「移上去」：名字一律顯示，錯開排；省掉年份免得擠 */
@media (hover: none) {
  .lamp-label { opacity: 1; left: var(--xt); pointer-events: auto; }
  .lamp-note { display: none; }
  /* 名字只有約 16px 高，手指點不準：用內距撐大點擊範圍，負 margin 抵掉，版面不動。
     橫向留在名字間「、」的寬度以內，相鄰的名字不會互相蓋住 */
  .lamp-label a { display: inline-block; padding: .85rem .3rem; margin: -.85rem -.3rem; }
}
.ruler { list-style: none; margin: 0; padding: 0; position: relative; height: 2.6rem; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
.ruler li { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--gold-line); }
.ruler li span { display: block; padding: .55rem 0 0 .4rem; font-family: var(--sans); font-size: .78rem; color: var(--wall-muted); font-variant-numeric: tabular-nums; }
/* 當朝名稱置中在上；上一個年號在左、下一個在右，放在名稱下方、對齊軌道的兩個端點 */
.reign-head { margin: .4rem 0 1.2rem; }
.reign-title { text-align: center; }
.reign-ends { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.4rem; }
.reign-end {
  display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .7rem;
  border: 1px solid var(--gold-line); color: var(--wall-text); text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.reign-end--next { text-align: right; }
/* 前後鈕的箭頭：跟說明卡連結同一組 SVG 圖示（chrome.css 的 --icon-arrow-*），燙金 */
.re-arrow { display: inline-block; width: 1.1rem; height: 1.1rem; background: var(--gold);
  -webkit-mask: var(--icon) no-repeat center / contain; mask: var(--icon) no-repeat center / contain; }
.re-arrow--prev { --icon: var(--icon-arrow-left); }
.re-arrow--next { --icon: var(--icon-arrow-right); }
.re-text { display: flex; flex-direction: column; }
.re-name { font-weight: 600; font-size: 1rem; letter-spacing: .08em; line-height: 1.25; }
.re-years { font-family: var(--sans); font-size: .68rem; color: var(--wall-muted); font-variant-numeric: tabular-nums; }
a.reign-end:hover { background: rgb(255 255 255 / .09); border-color: var(--gold); }
a.reign-end:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* 沒有展品的年號沒有頁：照順序列出，但灰掉、不能點 */
.reign-end--none { border: 0; padding: 0; }

/* 引文難念的字：字後面接〔音同：囚〕（build 時由「引文難念的字」那一行產生） */
.yin {
  font-family: var(--sans); font-size: .72em; font-weight: 400; letter-spacing: 0; color: var(--slate);
  background: color-mix(in oklab, var(--slate) 11%, transparent); border-radius: .3em;
  padding: .08em .4em; margin: 0 .15em; white-space: nowrap;
}
/* 字與它後面的標音不拆開換行：零寬的 word joiner 禁止兩者之間斷行 */
.yin::before { content: "\2060"; }

/* 專名號：庫裡有筆記、但這裡沒有連結的名字，畫灰色細線（連結是金色底線，可以點） */
u.nm { text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--slate) 45%, transparent); text-decoration-thickness: 1px; text-underline-offset: .28em; }
.read-note { margin: 0 0 1.4rem; font-family: var(--sans); font-size: .82rem; color: var(--slate); line-height: 1.6; }
.rn-link { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: .22em; font-weight: 700; color: var(--wall-deep); }
/* 故事版的入口：淡金底、四周一圈燙金細線，像展牆上的導覽牌 */
.story-lead {
  margin: 0 0 1.6rem; padding: .7rem 1rem; border: 1px solid var(--gold-line);
  background: color-mix(in oklab, var(--gold) 8%, #fff);
  font-family: var(--sans); font-size: .95rem; line-height: 1.7; letter-spacing: .02em;
}
.story-lead a { color: var(--wall-deep); font-weight: 700; text-decoration-color: var(--gold); text-underline-offset: .22em; }
.story-lead a:hover { text-decoration-thickness: 2px; }
.story-group h2 { margin: 0 0 .4rem; font-size: 1.05rem; font-family: var(--sans); color: var(--slate); letter-spacing: .1em; display: flex; align-items: center; gap: .55em; }
/* 朝代色塊：大廳書架上那本書的書背色 */
.story-group h2::before { content: ""; width: .7em; height: 1.1em; background: var(--chip); }
.story-group + .story-group { margin-top: 2.4rem; }
.cat-kind a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: .2em; }
