/* ===== 历代人物生卒年表 · 浅色简约样式 ===== */
:root {
  --bg: #f3f4f6;
  --bg-grad: #eef0f3;
  --card: #ffffff;
  --border: #e6e8ec;
  --border-soft: #eef0f3;
  --text: #2b2f36;
  --muted: #8a909c;
  --dim: #b3b9c4;
  --ink: #3b4252;
  --accent: #4a5568;
  --shadow: 0 6px 24px rgba(40, 48, 64, 0.08);
  --shadow-sm: 0 2px 8px rgba(40, 48, 64, 0.06);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "宋体", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  --bar-h: 70px;            /* 吸顶导航／名句条／表1筛选栏 三者统一高度（运行期由 JS 按导航实际高度覆盖） */
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background:
    radial-gradient(1100px 520px at 50% -8%, #ffffff 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-grad), var(--bg));
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.wrap { max-width: 1360px; margin: 0 auto; padding: 44px 20px 80px; }

/* ---------- Header ---------- */
.site-head { text-align: center; margin-bottom: 30px; }
.site-head .seal {
  display: inline-block; font-family: var(--serif); font-size: 13px;
  letter-spacing: 2px; color: var(--accent);
  border: 1px solid var(--dim); border-radius: 4px;
  padding: 4px 13px; margin-bottom: 16px; background: #fff;
}
.site-head h1 {
  font-family: var(--serif); font-weight: 700; font-size: 36px;
  letter-spacing: 7px; margin: 0 0 10px; color: var(--ink);
}
.site-head p { color: var(--muted); margin: 4px 0; letter-spacing: 2px; font-size: 14px; }
.site-head .rule {
  width: 72px; height: 2px; margin: 18px auto 0;
  background: linear-gradient(90deg, transparent, var(--dim), transparent);
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  justify-content: space-between;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 18px; margin: 34px 0;
  min-height: var(--bar-h, 70px);
  box-shadow: var(--shadow);
}
.tool-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-group .lbl { color: var(--dim); font-size: 12px; letter-spacing: 2px; margin-right: 4px; }

button.ctl {
  background: #fff; color: var(--ink); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 14px; font-size: 14px; cursor: pointer;
  transition: all .18s ease; font-family: var(--sans);
}
button.ctl:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.chip {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 7px 16px; cursor: pointer; font-size: 13px;
  letter-spacing: 1px; transition: all .18s ease;
}
.chip[data-active="1"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:hover { color: var(--ink); }
.chip[data-active="1"]:hover { color: #fff; }

.zoom-level { color: var(--accent); font-size: 13px; min-width: 240px; text-align: center; letter-spacing: .5px; }

/* ---------- Timeline ---------- */
.timeline-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 18px 8px; box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
/* 可滚动视口：纵向滚动 + 横向平移时间轴 */
.timeline-scroll {
  max-height: 86vh; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--dim) transparent;
  -webkit-overflow-scrolling: touch;
}
.timeline-scroll::-webkit-scrollbar { width: 10px; }
.timeline-scroll::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 6px; border: 3px solid #fff; }
.timeline-scroll::-webkit-scrollbar-track { background: transparent; }
.axis {
  position: sticky; top: 0; z-index: 6; background: var(--card);
  box-shadow: 0 1px 0 var(--border);
  height: 32px; margin-left: 200px;
  border-bottom: 1px solid var(--border); user-select: none;
}
.axis .tick {
  position: absolute; bottom: 0; transform: translateX(-50%);
  color: var(--dim); font-size: 12px; font-family: var(--serif);
}
.axis .tick::after {
  content: ""; position: absolute; left: 50%; bottom: -1px;
  width: 1px; height: 6px; background: var(--border); transform: translateX(-50%);
}
.axis .tick.major { color: var(--muted); }
.axis .tick.major::after { height: 10px; background: var(--dim); }
.axis .tick.origin { color: var(--accent); font-weight: 700; font-size: 11px; bottom: 1px; }
.axis .tick.origin::after { width: 2px; height: 14px; background: var(--accent); }

.rows { position: relative; cursor: grab; }
.rows:active { cursor: grabbing; }
.rows.no-anim .row { animation: none !important; opacity: 1; transform: none; }
/* 拖拽平移时关闭色块过渡，避免每帧动画造成的卡顿 */
.rows.panning .bar { transition: none; }
.row {
  display: flex; align-items: center; border-bottom: 1px solid var(--border-soft);
  height: 44px; position: relative; z-index: 1;
  opacity: 0; transform: translateY(6px); animation: rise .45s ease forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
.row:hover { background: #fafbfc; }

.row .label {
  width: 200px; flex: 0 0 200px; padding-right: 16px; text-align: right;
  border-right: 1px solid var(--border-soft); height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-end;
}
.row .label .nm { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: .5px; color: var(--ink); }
.row .label .tt { font-size: 11px; color: var(--dim); margin-top: 2px; letter-spacing: 1px; }

.track { position: relative; flex: 1 1 auto; height: 100%; cursor: grab; }
.track:active { cursor: grabbing; }

.bar {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 20px; border-radius: 6px; display: flex; align-items: center;
  padding: 0 9px; gap: 6px; font-size: 12px; letter-spacing: .5px;
  color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), var(--shadow-sm);
  transition: left .14s ease, width .14s ease, filter .18s ease, opacity .18s ease;
  cursor: pointer;
}
.bar:hover { filter: brightness(1.05); }
.bar.minister { opacity: .72; }
.bar .role {
  width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}
.bar.minister .role { background: transparent; box-shadow: inset 0 0 0 1.5px #fff; }
.bar.artisan .role { background: #1f7a6a; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.bar .yr { opacity: .92; font-weight: 500; }
/* 生卒年不详：未知一端用线性渐变淡显，并以虚线边框提示「开放式/未定」跨度 */
.bar.birth-unknown, .bar.death-unknown { box-sizing: border-box; border: 1.5px dashed rgba(55,55,55,.55); }

/* 朝代时代带 */
.timeline-body { position: relative; }
.era-overlay { position: absolute; top: 0; left: 200px; right: 0; bottom: 0; pointer-events: none; z-index: 0; }
.era-band { position: absolute; top: 0; bottom: 0; }
.era-band .fill { position: absolute; inset: 0; border-radius: 0; }
.era-label {
  position: absolute; top: 4px; left: 8px; font-family: var(--serif);
  font-size: 13px; letter-spacing: 2px; font-weight: 700;
}

.legend { display: flex; flex-wrap: wrap; gap: 20px; padding: 12px 4px 2px; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 22px; height: 11px; border-radius: 4px; margin-right: 7px; vertical-align: middle; }
.legend .lm-r { background: #fff; border: 1px solid var(--border); }
.legend .lm-r .dot { display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--ink);margin-right:6px;vertical-align:middle;}
.legend .lm-r .ring { display:inline-block;width:6px;height:6px;border-radius:50%;box-shadow:inset 0 0 0 1.5px var(--ink);margin-right:6px;vertical-align:middle;}
.legend .lm-s { background: #f6efe6; border: 1px solid #e8dccb; }
.legend .lm-s .dot { display:inline-block;width:6px;height:6px;border-radius:50%;background:#9a6b3f;margin-right:6px;vertical-align:middle;}
.legend .lm-a { background: #eaf3f1; border: 1px solid #bfe0d8; }
.legend .lm-a .sq { display:inline-block;width:6px;height:6px;background:#2aa198;margin-right:6px;vertical-align:middle;}
.hint { color: var(--dim); font-size: 11px; padding: 6px 4px 12px; letter-spacing: .3px; }

/* ---------- Table ---------- */
.table-card {
  margin-top: 34px; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.table-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.table-head h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: 3px; margin: 0; color: var(--ink); }
.table-head .sub { color: var(--dim); font-size: 12px; letter-spacing: 1px; }

/* 时间轴卡片表头（命名为「交互总表」），用负边距抵消卡片内边距使其通栏 */
.timeline-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: -18px -18px 14px; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.timeline-head h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: 3px; margin: 0; color: var(--ink); }
.timeline-head .sub { color: var(--dim); font-size: 12px; letter-spacing: 1px; }
.tbl-no { color: #b3b8c2; font-family: var(--sans); font-size: 13px; font-weight: 400; letter-spacing: 1px; margin-left: 10px; vertical-align: middle; }
/* 表头右上角复制按钮组 */
.head-actions { display: inline-flex; gap: 8px; flex-shrink: 0; }
.copy-btn {
  font-family: var(--sans); font-size: 12px; letter-spacing: .5px;
  color: var(--dim); background: transparent;
  border: 1px solid var(--border); border-radius: 14px;
  padding: 4px 12px; cursor: pointer; transition: all .15s ease;
  white-space: nowrap;
}
.copy-btn:hover { color: #2f6fb0; border-color: #2f6fb0; background: rgba(47,111,176,.06); }
.copy-btn:active { transform: translateY(1px); }
.copy-excel:hover { color: #1f8a4c; border-color: #1f8a4c; background: rgba(31,138,76,.06); }
.copy-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(40,44,52,.92); color: #fff; font-family: var(--sans); font-size: 13px;
  padding: 9px 18px; border-radius: 8px; letter-spacing: .5px;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 9999;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; vertical-align: middle; color: var(--muted); font-weight: 500; letter-spacing: 1px; font-size: 13px;
  padding: 9px 18px; border-bottom: 1px solid var(--border); cursor: pointer;
  user-select: none; white-space: nowrap; background: #fafbfc;
  position: sticky; top: 0; z-index: 3;
}
thead th:hover { color: var(--accent); }
thead th .arr { color: var(--dim); margin-left: 4px; font-size: 10px; }
tbody td { padding: 8px 18px; border-bottom: 1px solid var(--border-soft); color: var(--text); text-align: left; vertical-align: middle; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f7f8fa; }
.nm-cell { font-family: var(--serif); font-size: 15px; letter-spacing: 1px; white-space: normal; word-break: break-word; line-height: 1.45; }
/* 表2 风流人物：姓名列允许换行，并为姓名/简介分配更合理宽度，避免长名（如爱新觉罗·努尔哈赤）遮挡次列 */
.table-scroll thead th[data-key="name"]  { width: 13%; }
.table-scroll thead th[data-key="title"] { width: 17%; }
.table-scroll thead th[data-key="note"]  { width: 30%; }

.tag { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 999px; letter-spacing: 1px; }
.tag.emperor { background: #eef1f6; color: var(--ink); border: 1px solid #d6dbe4; }
.tag.minister { background: #f3f0f1; color: #8a6b78; border: 1px solid #e3d6dc; }
.tag.scholar { background: #f6efe6; color: #9a6b3f; border: 1px solid #e8dccb; }
.tag.artisan { background: #eaf3f1; color: #1f7a6a; border: 1px solid #bfe0d8; }
.dy { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dy i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.age { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- 总表行「定位」高亮（点姓名外单元格 → 时间轴定位缩放） ---------- */
/* 定位时整张卡片微微变色，提示焦点已落到该人物的「表头/条目」上 */
.table-card.locating,
.timeline-card.locating {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(74, 85, 104, .12), var(--shadow);
}
/* 被定位的那一行：左侧强调条 + 淡淡的底色，UI 微微变色 */
tbody tr.locate {
  background: linear-gradient(90deg, rgba(74, 85, 104, .12), rgba(74, 85, 104, .04));
  box-shadow: inset 3px 0 0 var(--accent);
}
tbody tr.locate td { color: var(--ink); }
/* 时间轴上对应的生卒色块：描一圈淡色强调环 */
.bar.locate {
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm);
  filter: brightness(1.06);
  z-index: 2;
}

/* ---------- Tooltip ---------- */
.tip {
  position: fixed; z-index: 50; pointer-events: none;
  background: rgba(255,255,255,.98); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; max-width: 264px;
  box-shadow: 0 10px 34px rgba(40,48,64,.16);
  opacity: 0; transform: translateY(6px); transition: opacity .15s ease, transform .15s ease;
  font-size: 13px; line-height: 1.65;
}
.tip.show { opacity: 1; transform: none; }
.tip .t-nm { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: .5px; color: var(--ink); }
.tip .t-meta { color: var(--muted); margin: 4px 0; }
.tip .t-note { color: var(--text); }

/* 诗词全文赏析浮动窗：与人物提示同款样式 */
/* ---------- 诗词全文赏析弹窗（与人物简介弹窗同款） ---------- */
.poem-modal { z-index: 110; }
.poem-panel { width: min(94vw, 760px); height: min(88vh, 450px); }
.poem-body { flex: 1 1 auto; min-height: 0; padding: 18px 26px 24px; overflow-y: auto; display: flex; flex-direction: column; }
.poem-text { font-family: var(--serif); color: var(--text); text-align: center; margin: auto 0; }
.poem-text p { margin: 0; font-size: 18px; line-height: 2.05; letter-spacing: .5px; }
/* 「经典片段」列：整段作为可点击的诗句链接 */
.poem-excerpt .poem-link {
  color: var(--accent); cursor: pointer;
  border-bottom: 1px dashed var(--accent); text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.poem-excerpt .poem-link:hover { color: var(--ink); border-color: var(--ink); }

.empty { text-align: center; color: var(--dim); padding: 40px; }
footer { text-align: center; color: var(--dim); font-size: 12px; letter-spacing: 2px; margin-top: 40px; }
.credit-line { margin-top: 28px; color: #b3b9c4; font-size: 12px; letter-spacing: 1px; font-weight: 400; }
/* 版本更新说明（页脚上方） */
.ver-notes { margin-top: 44px; padding: 20px 24px; border: 1px solid var(--border); border-radius: 12px; background: #fafbfc; }
.ver-notes h3 { font-family: var(--serif); font-size: 17px; letter-spacing: 2px; color: var(--ink); margin: 0 0 12px; }
.ver-notes details { border-top: 1px solid var(--border); padding: 8px 0; }
.ver-notes details:first-of-type { border-top: none; }
.ver-notes summary { cursor: pointer; font-family: var(--serif); font-size: 15px; letter-spacing: 1px; color: var(--ink); padding: 2px 0; outline: none; user-select: none; }
.ver-notes summary::marker { color: var(--muted); }
.ver-notes details[open] summary { color: var(--accent, #2f6fb0); margin-bottom: 6px; }
.ver-notes ul { margin: 6px 0 4px; padding-left: 20px; }
.ver-notes li { font-size: 13.5px; line-height: 1.9; color: var(--text); }

@media (max-width: 720px) {
  .axis { margin-left: 120px; }
  .row .label { width: 120px; flex-basis: 120px; }
  .era-overlay { left: 120px; }
  .site-head h1 { font-size: 26px; }
  .zoom-level { min-width: 0; }
}

/* ---------- 姓名可点击（打开关系图） ---------- */
.row .label .nm, .nm-cell { cursor: pointer; transition: color .15s ease; }
.row .label .nm:hover, .nm-cell:hover { color: var(--accent); text-decoration: underline; }

/* ---------- 关系图弹窗（球棍图） ---------- */
.rel-modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: rgba(30, 36, 48, .46); backdrop-filter: blur(2px);
}
.rel-modal.show { display: flex; animation: relFade .2s ease; }
@keyframes relFade { from { opacity: 0; } to { opacity: 1; } }

.rel-panel {
  width: min(94vw, 760px); height: min(88vh, 450px);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: 0 24px 70px rgba(30, 38, 56, .34);
  display: flex; flex-direction: column; overflow: hidden;
}
.rel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 22px 12px; border-bottom: 1px solid var(--border-soft);
}
.rel-title { display: flex; flex-direction: column; gap: 4px; }
.rt-name { font-family: var(--serif); font-size: 26px; letter-spacing: 3px; color: var(--ink); font-weight: 700; }
.rt-meta { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.rel-close {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  width: 34px; height: 34px; border-radius: 9px; font-size: 20px; line-height: 1;
  cursor: pointer; transition: all .15s ease;
}
.rel-close:hover { color: var(--ink); border-color: var(--accent); }

.rel-legend {
  display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 22px;
  color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--border-soft);
}
.rel-legend i { display: inline-block; width: 16px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.rel-canvas { position: relative; flex: 1 1 auto; overflow: hidden; background:
  radial-gradient(900px 460px at 50% 40%, #fbfcfe 0%, #f3f5f8 70%); }
#relSvg { width: 100%; height: 100%; display: block; cursor: grab; }
.rel-edge { stroke-width: 2.4; stroke-opacity: .72; stroke-linecap: round; }
.rel-elabel {
  font-size: 11px; text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round;
  font-family: var(--sans);
}
.rel-node { cursor: pointer; }
.rel-node:hover circle { stroke: #e8b04b; }
.rel-nlabel {
  font-size: 13px; text-anchor: middle; fill: #2b2f36; pointer-events: none;
  paint-order: stroke; stroke: #fff; stroke-width: 3.5px; stroke-linejoin: round;
  font-family: var(--serif); letter-spacing: 1px;
}
.rel-nlabel.focus { font-size: 15px; font-weight: 700; fill: #1f2329; }

.rel-hint {
  padding: 9px 22px; color: var(--dim); font-size: 11px; letter-spacing: .4px;
  border-top: 1px solid var(--border-soft); text-align: center;
}

/* ---------- 总表「简介」列（点击弹出人物简介） ---------- */
thead th.no-sort { cursor: default; }
thead th.no-sort:hover { color: var(--muted); }
thead th .arr:empty { display: none; }
.intro-cell {
  cursor: pointer; color: var(--text); max-width: none; white-space: normal;
  line-height: 1.5; transition: color .15s ease;
}
.intro-cell:hover { color: var(--accent); text-decoration: underline; text-decoration-style: dotted; }

/* ---------- 人物简介弹窗（与关系图同款风格） ---------- */
.intro-modal { z-index: 110; }
.intro-panel { width: min(94vw, 760px); height: min(88vh, 450px); }
.intro-body { flex: 1 1 auto; min-height: 0; padding: 18px 24px 10px; overflow-y: auto; }
.intro-text {
  font-family: var(--serif); font-size: 16px; line-height: 1.95;
  color: var(--text); margin: 2px 0 18px; text-align: justify;
}
.intro-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; margin: 0; }
.intro-meta > div {
  display: flex; align-items: baseline; gap: 10px;
  border-bottom: 1px dashed var(--border-soft); padding-bottom: 8px;
}
.intro-meta dt { color: var(--dim); font-size: 12px; letter-spacing: 1px; min-width: 34px; margin: 0; }
.intro-meta dd { margin: 0; color: var(--text); font-size: 14px; }
.intro-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 22px; border-top: 1px solid var(--border-soft);
}
.intro-rel-btn {
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  border-radius: 9px; padding: 8px 16px; font-size: 13px; cursor: pointer;
  letter-spacing: 1px; transition: all .15s ease; font-family: var(--sans);
}
.intro-rel-btn:hover { background: #2b313c; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.intro-foot-hint { color: var(--dim); font-size: 11px; letter-spacing: .4px; }

/* ---------- 总表独立滚动区（更高的可视高度，表头吸顶） ---------- */
.table-scroll {
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
  -webkit-overflow-scrolling: touch;
}
.table-scroll::-webkit-scrollbar { width: 10px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 6px; border: 3px solid #fff; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- 顶部吸顶导航菜单 ---------- */
html { scroll-behavior: smooth; }
.table-card, .events-card, .timeline-card, .notes-card { scroll-margin-top: 66px; }
.top-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 auto 26px; max-width: 1360px;
  padding: 11px 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.2) blur(8px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.top-nav .nav-brand {
  font-family: var(--serif); font-size: 15px; letter-spacing: 2px; color: var(--ink);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 10px;
}
.top-nav .nav-links { display: flex; flex-wrap: wrap; gap: 6px 4px; justify-content: flex-start; }
.top-nav .nav-link {
  font-family: var(--sans); font-size: 13.5px; color: var(--accent);
  text-decoration: none; padding: 6px 12px; border-radius: 9px;
  border: 1px solid transparent; transition: all .15s ease; white-space: nowrap;
}
.top-nav .nav-link:hover { background: #f5f6f8; border-color: var(--border); color: var(--ink); }
.top-nav .nav-link.nav-top { color: var(--muted); }

/* ---------- 左侧「球棍式」纵向导航 ----------
 * 一根细棍贯穿，诸球依次悬挂；棍上深色段为已读进度。
 * 整栏紧贴视口左缘，为标签让出全部留白，不侵占正文。
 * 球数多于一屏时，滑轨随滚动平移，当前球始终居中，余者先后出没。 */
.side-rail {
  --rail-x: 13px;                 /* 球心距容器左缘 */
  --dot: 12px;                    /* 球径 */
  --rail-pad: 50px;               /* 滑轨上下留白，须 ≥ 遮罩渐隐高度 */
  /* 贴左但留一段呼吸位：宽屏时随正文留白略向右挪，窄屏退回边缘。
     1335px 为正文实测宽度，150px 为「标签整体宽 + 安全间隙」，据此保证标签不触正文 */
  left: clamp(10px, calc((100vw - 1335px) / 2 - 150px), 32px);
  position: fixed; top: 50%; transform: translateY(-50%);
  z-index: 60; width: 215px;
  font-family: var(--sans);
  -webkit-user-select: none; user-select: none;
  /* 整栏不吃鼠标事件，仅「热区条」与「球」可交互，浮出的标签绝不拦截正文点击 */
  pointer-events: none;
}
/* 热区条：供「鼠标移入侧栏即显标签」用。
   必须压在球阵之下（z-index:0），否则会抢走球的点击，导致无法跳转。 */
.side-rail .rail-hot {
  position: absolute; left: 0; top: -14px; width: 42px; height: calc(100% + 28px);
  pointer-events: auto; z-index: 0;
}

/* 可视窗口：限高 + 上下渐隐，超出部分由滑轨平移带入 */
.rail-viewport {
  position: relative; z-index: 1; height: min(74vh, 660px); overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.rail-track {
  position: absolute; left: 0; top: 0; width: 100%;
  transition: transform .42s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}
/* 滚轮手动翻动时去掉缓动，保证跟手 */
.rail-track.no-anim { transition: none; }

.rail-track .rail-stick,
.rail-track .rail-fill {
  position: absolute; left: var(--rail-x); width: 1px;
  transform: translateX(-0.5px); border-radius: 1px;
}
.rail-track .rail-stick {
  top: var(--rail-pad); bottom: var(--rail-pad);
  background: linear-gradient(180deg, transparent, var(--border) 4%, var(--dim) 50%, var(--border) 96%, transparent);
}
.rail-track .rail-fill {
  top: var(--rail-pad); height: 0;
  background: linear-gradient(180deg, var(--dim), var(--accent));
  transition: height .3s cubic-bezier(.4, 0, .2, 1);
}

/* 上下留白 = 遮罩渐隐区，保证首尾两球平移到位后也能完全显形 */
.rail-list { list-style: none; margin: 0; padding: var(--rail-pad) 0; position: relative; }
.rail-item { position: relative; }
.rail-node {
  display: flex; align-items: center; gap: 13px;
  padding: 9px 0; text-decoration: none; position: relative;  /* 间隔已加大 */
}

/* 球 */
.rail-node .dot {
  flex: 0 0 auto; position: relative; pointer-events: auto; z-index: 1;
  width: var(--dot); height: var(--dot); border-radius: 50%;
  margin-left: calc(var(--rail-x) - var(--dot) / 2);
  background: #fff; border: 1.5px solid var(--dim);
  transition: width .18s ease, height .18s ease, margin .18s ease,
              background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
/* 隐形热区：便于点选（随球径放大同步加大） */
.rail-node .dot::after { content: ""; position: absolute; inset: -9px -14px; border-radius: 14px; }
.rail-node:hover .dot { --dot: 15px; border-color: var(--accent); background: var(--accent); }
.rail-item.on .dot {
  --dot: 17px;
  border-color: var(--accent); background: var(--accent);
  box-shadow: 0 0 0 4.5px rgba(74, 85, 104, .12);
}
/* 首颗「顶部」球：空心留白，与表目略作区隔 */
.rail-item.rail-home { margin-bottom: 9px; }
.rail-item.rail-home .dot { background: #fff; }
.rail-item.rail-home:hover .dot,
.rail-item.rail-home.on .dot { background: #fff; border-color: var(--accent); }

/* 标签：默认隐匿；滚动中与悬停时浮出，静止后自行退去，不长期压住表格 */
.rail-label {
  opacity: 0; transform: translateX(-6px); pointer-events: none;
  white-space: nowrap; max-width: 175px; overflow: hidden; text-overflow: ellipsis;
  font-size: 14px; letter-spacing: 1px; color: var(--accent);
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--border-soft); border-radius: 9px;
  padding: 4px 12px; box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(1.2) blur(6px);
  transition: opacity .2s ease, transform .2s ease, color .2s ease, border-color .2s ease;
}
.rail-label i { font-style: normal; color: var(--dim); margin-right: 8px; font-size: 12px; letter-spacing: 0; }
.side-rail:hover .rail-label,
.side-rail.is-scrolling .rail-label { opacity: .5; transform: none; }
.side-rail:hover .rail-item.on .rail-label,
.side-rail.is-scrolling .rail-item.on .rail-label,
.rail-node:hover .rail-label {
  opacity: 1; transform: none; color: var(--ink); border-color: var(--border);
}
.rail-item.on .rail-label i { color: var(--accent); }
/* 标签显形（鼠标已在侧栏内）时也可点击跳转，扩大命中面积；
   其余时刻保持 none，绝不拦截正文 */
.side-rail:hover .rail-label { pointer-events: auto; cursor: pointer; }

/* 左侧留白不足以容纳标签（约 1700px 以下）：取消「滚动自动浮出」，
   标签仅在鼠标移入侧栏时才显示，避免被动遮挡表格 */
@media (max-width: 1699px) {
  .side-rail.is-scrolling .rail-label,
  .side-rail.is-scrolling .rail-item.on .rail-label { opacity: 0; transform: translateX(-6px); }
  .side-rail:hover .rail-label { opacity: .5; transform: none; }
  .side-rail:hover .rail-item.on .rail-label,
  .rail-node:hover .rail-label { opacity: 1; transform: none; }
}
/* 更窄时球阵略收并贴紧边缘，给正文让出空间 */
@media (max-width: 1520px) {
  .side-rail { --rail-x: 11px; --dot: 11px; }
  .rail-node:hover .dot { --dot: 14px; }
  .rail-item.on .dot { --dot: 16px; }
  .rail-label { font-size: 13px; }
}

/* 再窄则球阵本身也会压到正文（正文左缘 ≈ (100vw-1335)/2，需 ≥ 球右缘 26px + 间隙）：
   索性隐去侧栏，由顶部吸顶目录承担导航 */
@media (max-width: 1419px) { .side-rail { display: none; } }
@media (hover: none) { .side-rail { display: none; } }

/* ---------- 表间轮换名句条 ---------- */
.quote-strip {
  margin: 34px auto; max-width: none;
  background: linear-gradient(180deg, #ffffff, #fafbfc);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 13px 28px;
  min-height: var(--bar-h, 70px);
  display: flex; align-items: center;
  overflow: hidden;
}
.quote-strip .quote-inner {
  width: 100%;
  position: relative; text-align: center;
  opacity: 1; transition: opacity .65s ease;
}
.quote-strip.q-fading .quote-inner { opacity: 0; }
.quote-strip .q-mark {
  font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--dim);
  position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
}
.quote-strip .q-mark-r { left: auto; right: 6%; top: auto; bottom: -8px; }
.quote-strip .q-text {
  font-family: var(--serif); font-size: 16px; line-height: 1.55; color: var(--ink);
  letter-spacing: .5px; margin: 6px 0 8px; text-align: justify;
}
.quote-strip .q-author {
  font-family: var(--sans); font-size: 12px; color: var(--muted); letter-spacing: .5px; margin: 0;
}

/* ---------- 人物简介弹窗 · 新三国台词 ---------- */
.intro-quotes {
  margin: 4px 0 18px; padding: 14px 16px;
  background: #f7f8fa; border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.intro-quotes .iq-title {
  font-family: var(--sans); font-size: 12.5px; letter-spacing: 1.5px;
  color: var(--accent); margin: 0 0 10px; font-weight: 600;
}
.intro-quotes .iq-quote {
  margin: 0 0 10px; padding: 8px 14px;
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
  background: #fff; color: var(--text);
  font-family: var(--serif); font-size: 15px; line-height: 1.7;
}
.intro-quotes .iq-quote:last-child { margin-bottom: 0; }
.intro-quotes .iq-quote cite {
  display: block; margin-top: 4px; font-style: normal;
  font-family: var(--sans); font-size: 12px; color: var(--muted); letter-spacing: .5px;
}
/* 先贤名句（本人传世格言）——暖色区分于新三国台词 */
.intro-quotes.iq-famous {
  background: #fbf7ef; border-color: #ecdcc0;
}
.intro-quotes.iq-famous .iq-title { color: #b07d2b; }
.intro-quotes.iq-famous .iq-quote { border-left-color: #c8922f; background: #fffdf8; }

/* ---------- 重大历史事件表 ---------- */
.events-card {
  margin-top: 34px; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
}
.events-head {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
  border-bottom: 1px solid var(--border); gap: 16px; flex-wrap: wrap;
}
.events-head h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: 3px; margin: 0; color: var(--ink); }
.events-head .sub { color: var(--dim); font-size: 12px; letter-spacing: .5px; }
.events-head .evt-hl { color: #2f6fb0; font-weight: 600; }
.events-scroll {
  max-height: 70vh; overflow-y: auto; scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent; -webkit-overflow-scrolling: touch;
}
.events-scroll::-webkit-scrollbar { width: 10px; }
.events-scroll::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 6px; border: 3px solid #fff; }
.events-scroll::-webkit-scrollbar-track { background: transparent; }
.events-scroll table { width: 100%; border-collapse: collapse; font-size: 14px; }
.events-scroll thead th {
  text-align: left; vertical-align: middle; color: var(--muted); font-weight: 500; letter-spacing: 1px; font-size: 13px;
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: #fafbfc;
  position: sticky; top: 0; z-index: 3; user-select: none; white-space: nowrap;
}
.events-scroll thead th.sortable { cursor: pointer; }
.events-scroll thead th.sortable:hover { color: var(--accent); }
.events-scroll thead th .arr { color: var(--dim); margin-left: 4px; font-size: 10px; }
.events-scroll tbody td { padding: 10px 16px; border-bottom: 1px solid var(--border-soft); color: var(--text); text-align: left; vertical-align: middle; }
.events-scroll tbody tr { transition: background .15s ease; }
.events-scroll tbody tr:hover { background: #f7f8fa; }
.ev-time {
  font-family: var(--serif); white-space: nowrap; color: var(--accent);
  font-variant-numeric: tabular-nums; letter-spacing: .5px; min-width: 110px;
}
.ev-dynasty { color: var(--muted); font-size: 12.5px; white-space: nowrap; min-width: 92px; }
.ev-title { font-family: var(--serif); font-size: 15px; letter-spacing: 1px; color: var(--ink); min-width: 150px; }
.ev-impact { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 520px; }
.ev-figs { line-height: 1.9; }
.evt-fig {
  color: #2f6fb0; cursor: pointer; text-decoration: none; border-bottom: 1px dashed rgba(47,111,176,.5);
  margin: 0 2px; transition: color .15s ease, border-color .15s ease;
}
.evt-fig:hover { color: #1d4e80; border-bottom-color: #1d4e80; }
.evt-fig-missing { color: var(--dim); margin: 0 2px; border-bottom: 1px dotted var(--border); }
/* 表3~表7 名称 → 百度百科词条链接（新标签页打开） */
.baike-link {
  color: #2f6fb0; text-decoration: none; border-bottom: 1px dashed rgba(47,111,176,.5);
  cursor: pointer; transition: color .15s ease, border-color .15s ease;
}
.baike-link:hover { color: #1d4e80; border-bottom-color: #1d4e80; }
.baike-link::after { content: " \2197"; font-size: 11px; color: var(--dim); }
/* 从事件表跳转后，人物总表中被定位的那一行：强调高亮并短暂闪烁 */
tbody tr.evt-jump {
  background: linear-gradient(90deg, rgba(47,111,176,.16), rgba(47,111,176,.05));
  box-shadow: inset 3px 0 0 #2f6fb0;
  animation: evtFlash 1.1s ease 2;
}
tbody tr.evt-jump td { color: var(--ink); }
@keyframes evtFlash { 0%,100% { background: linear-gradient(90deg, rgba(47,111,176,.16), rgba(47,111,176,.05)); } 50% { background: linear-gradient(90deg, rgba(47,111,176,.34), rgba(47,111,176,.14)); } }

/* ---------------- 经典人物组合表（复用 events-card / evt-fig 视觉） ---------------- */
.groups-card { margin-top: 34px; }
.grp-name { font-family: var(--serif); font-size: 15px; letter-spacing: 1px; color: var(--ink); min-width: 130px; white-space: nowrap; }
.grp-era { color: var(--muted); font-size: 12.5px; white-space: nowrap; min-width: 92px; }
.grp-mem { line-height: 1.9; }
.grp-desc { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 520px; }

/* ---------------- 经典典故表（复用 events-card / evt-fig 视觉） ---------------- */
.allusions-card { margin-top: 34px; }
.allu-phrase { font-family: var(--serif); font-size: 15px; letter-spacing: 1px; color: var(--ink); min-width: 140px; font-weight: 600; white-space: normal; word-break: break-word; }
.allu-cat { color: var(--text); font-size: 13px; white-space: nowrap; font-weight: 400; }
.allu-era { color: var(--muted); font-size: 12.5px; white-space: nowrap; min-width: 92px; }
.allu-cat-col { white-space: nowrap; }
.allu-meaning { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 520px; }
.allu-people { line-height: 1.9; }

/* ---------------- 经典典籍表（复用 events-card / evt-fig 视觉） ---------------- */
.books-card { margin-top: 34px; }
.book-title { font-family: var(--serif); font-size: 15px; letter-spacing: .5px; color: var(--ink); min-width: 110px; font-weight: 600; white-space: nowrap; }
.book-cat { color: #2f6fb0; font-size: 12.5px; white-space: nowrap; }
.book-cat-col { white-space: nowrap; }
.book-author { line-height: 1.9; white-space: nowrap; }
.book-era { color: #8a6d3b; font-size: 13px; white-space: nowrap; }
.book-era-col { white-space: nowrap; }
.book-note { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 560px; }

/* ---------------- 经典文物表（复用 events-card / evt-fig 视觉） ---------------- */
.artifacts-card { margin-top: 34px; }
.art-name { font-family: var(--serif); font-size: 15px; letter-spacing: .5px; color: var(--ink); min-width: 130px; font-weight: 600; white-space: nowrap; }
.art-era { color: #8a6d3b; font-size: 13px; white-space: nowrap; min-width: 150px; }
.art-era-col { white-space: nowrap; }
.art-intro { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 440px; }
.art-meaning { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 420px; }
.art-intro-col, .art-meaning-col { white-space: normal; }

/* ============ 列宽统一（表2 ~ 表7） ============ */
.table-scroll table, .events-scroll table { table-layout: fixed; }
.table-scroll td, .events-scroll td { min-width: 0; overflow-wrap: anywhere; }
/* 表2 · 信息列表 */
.table-scroll thead th[data-key="name"]    { width: 9%; }
.table-scroll thead th[data-key="title"]   { width: 12%; }
.table-scroll thead th[data-key="dynasty"] { width: 12%; }
.table-scroll thead th[data-key="role"]    { width: 9%; }
.table-scroll thead th[data-key="birth"]   { width: 8%; }
.table-scroll thead th[data-key="death"]   { width: 8%; }
.table-scroll thead th[data-key="age"]     { width: 8%; }
.table-scroll thead th[data-key="note"]    { width: 34%; }
/* 表3 · 历史事件 */
.events-scroll thead th.ev-title-col   { width: 20%; }
.events-scroll thead th.ev-dyn-col     { width: 10%; }
.events-scroll thead th.ev-sort        { width: 12%; }
.events-scroll thead th.ev-impact-col  { width: 36%; }
.events-scroll thead th.ev-fig-col     { width: 22%; }
/* 表4 · 人物组合 */
.events-scroll thead th.grp-sort    { width: 20%; }
.events-scroll thead th.grp-era-col { width: 13%; }
.events-scroll thead th.grp-mem-col { width: 25%; }
.events-scroll thead th.grp-desc-col{ width: 42%; }
/* 表5 · 历史典故（源流/主题 合并为单一「类别」列） */
.events-scroll thead th.allu-sort        { width: 20%; }
.events-scroll thead th.allu-era-col     { width: 12%; }
.events-scroll thead th.allu-cat-col     { width: 16%; }
.events-scroll thead th.allu-meaning-col { width: 30%; }
.events-scroll thead th.allu-people-col  { width: 22%; }
/* 表6 · 翰墨书香（类别改为领域标签） */
.events-scroll thead th.book-sort     { width: 15%; }
.events-scroll thead th.book-cat-col  { width: 9%; }
.events-scroll thead th.book-author-col{ width: 13%; }
.events-scroll thead th.book-era-col  { width: 15%; }
.events-scroll thead th.book-note-col { width: 48%; }
/* 表7 · 经典文物 */
.events-scroll thead th.art-sort        { width: 16%; }
.events-scroll thead th.art-era-col     { width: 18%; }
.events-scroll thead th.art-intro-col   { width: 34%; }
.events-scroll thead th.art-meaning-col { width: 32%; }
/* 表8 · 雕梁画栋 */
.events-scroll thead th.bld-sort       { width: 16%; }
.events-scroll thead th.bld-era-col    { width: 13%; }
.events-scroll thead th.bld-people-col { width: 15%; }
.events-scroll thead th.bld-desc-col   { width: 26%; }
.events-scroll thead th.bld-intro-col  { width: 30%; }
/* 表9 · 天工机巧 */
.events-scroll thead th.inv-sort       { width: 16%; }
.events-scroll thead th.inv-era-col    { width: 13%; }
.events-scroll thead th.inv-people-col { width: 15%; }
.events-scroll thead th.inv-desc-col   { width: 26%; }
.events-scroll thead th.inv-intro-col  { width: 30%; }
/* 表10 · 灵根仙草 */
.events-scroll thead th.herb-sort        { width: 16%; }
.events-scroll thead th.herb-era-col     { width: 13%; }
.events-scroll thead th.herb-origin-col  { width: 15%; }
.events-scroll thead th.herb-eff-col     { width: 26%; }
.events-scroll thead th.herb-intro-col   { width: 30%; }
/* 表11 · 梨园雅韵 */
.events-scroll thead th.op-sort         { width: 16%; }
.events-scroll thead th.op-era-col      { width: 13%; }
.events-scroll thead th.op-author-col   { width: 15%; }
.events-scroll thead th.op-genre-col    { width: 12%; }
.events-scroll thead th.op-intro-col    { width: 44%; }
.bld-era-col, .inv-era-col, .herb-era-col, .op-era-col, .poem-era-col { white-space: nowrap; }
/* 表12 · 诗词歌赋 */
.events-scroll thead th.poem-sort         { width: 18%; }
.events-scroll thead th.poem-author-col   { width: 12%; }
.events-scroll thead th.poem-era-col      { width: 10%; }
.events-scroll thead th.poem-excerpt-col  { width: 26%; }
.events-scroll thead th.poem-intro-col    { width: 34%; }
.poem-name { font-family: var(--serif); font-size: 15px; letter-spacing: .5px; color: var(--ink); min-width: 130px; font-weight: 600; white-space: nowrap; }
.poem-author { line-height: 1.9; white-space: nowrap; }
.poem-excerpt { font-family: var(--serif); font-size: 14px; letter-spacing: .5px; color: var(--ink); line-height: 1.7; }
.poem-intro { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 560px; }

/* 表13 · 山水墨色 */
.events-scroll thead th.artw-sort        { width: 16%; }
.events-scroll thead th.artw-author-col  { width: 12%; }
.events-scroll thead th.artw-cat-col    { width: 10%; }
.events-scroll thead th.artw-era-col     { width: 16%; }
.events-scroll thead th.artw-intro-col   { width: 46%; }
.artw-name { white-space: nowrap; min-width: 120px; }
.artw-author { line-height: 1.9; white-space: nowrap; }
.artw-era { line-height: 1.9; white-space: nowrap; }
.artw-cat { color: var(--text); font-size: 13px; white-space: nowrap; }
.artw-cat-col { white-space: nowrap; }
.artw-intro { line-height: 1.7; color: var(--text); font-size: 13.5px; }

/* 表14 · 兵戈缭乱（战役表） */
.events-scroll thead th.bt-name-col    { width: 14%; }
.events-scroll thead th.bt-dynasty-col { width: 13%; }
.events-scroll thead th.bt-sort        { width: 12%; }
.events-scroll thead th.bt-sides-col   { width: 22%; }
.events-scroll thead th.bt-impact-col  { width: 39%; }
.bt-name { color: var(--ink); min-width: 120px; white-space: nowrap; }
.bt-dynasty { white-space: nowrap; min-width: 130px; }
.bt-time { white-space: nowrap; min-width: 110px; }
.bt-sides { color: var(--text); font-size: 13.5px; }
.bt-impact { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 560px; }

/* 表15 禅茶一味 */
.events-scroll thead th.tea-name-col    { width: 14%; }
.events-scroll thead th.tea-type-col    { width: 13%; }
.events-scroll thead th.tea-sort        { width: 16%; }
.events-scroll thead th.tea-flavor-col  { width: 18%; }
.events-scroll thead th.tea-origin-col  { width: 16%; }
.events-scroll thead th.tea-note-col    { width: 23%; }
.tea-name { color: var(--ink); min-width: 90px; white-space: nowrap; }
.tea-type { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.tea-era {
  white-space: nowrap; min-width: 130px;
}
.tea-flavor { color: var(--text); font-size: 13.5px; }
.tea-origin { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.tea-note { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 460px; }

/* 表16 薪火相传 */
.events-scroll thead th.ih-name-col     { width: 17%; }
.events-scroll thead th.ih-type-col     { width: 12%; }
.events-scroll thead th.ih-inventor-col { width: 17%; }
.events-scroll thead th.ih-sort         { width: 15%; }
.events-scroll thead th.ih-note-col     { width: 39%; }
.ih-name { color: var(--ink); min-width: 110px; white-space: nowrap; }
.ih-type { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.ih-inventor { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.ih-era {
  white-space: nowrap; min-width: 130px;
}
.ih-note { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 620px; }

/* 表17 贝叶遗珍 · 表18 珍馐美馔 列样式 */
.sc-name { color: var(--ink); min-width: 110px; white-space: nowrap; }
.sc-rel { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.sc-era { white-space: nowrap; min-width: 130px; }
.sc-people { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.sc-note { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 620px; }
.events-scroll thead th.fd-name-col    { width: 14%; }
.events-scroll thead th.fd-sort         { width: 13%; }
.events-scroll thead th.fd-people-col   { width: 12%; }
.events-scroll thead th.fd-category-col { width: 13%; }
.events-scroll thead th.fd-region-col   { width: 12%; }
.events-scroll thead th.fd-note-col     { width: 36%; }
.fd-name { color: var(--ink); min-width: 110px; white-space: nowrap; }
.fd-era { white-space: nowrap; min-width: 130px; }
.fd-people { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.fd-category { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.fd-region { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.fd-note { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 620px; }

/* 表19 丝竹管弦 / 表20 大音希声 / 表21 碎金削玉 / 表22 吐故纳新 —— 统一「名 · 时代 · 人物 · 介绍」四栏 */
.events-scroll thead th.inst-name-col    { width: 14%; }
.events-scroll thead th.inst-sort         { width: 13%; }
.events-scroll thead th.inst-people-col   { width: 12%; }
.events-scroll thead th.inst-intro-col    { width: 61%; }
.events-scroll thead th.mel-name-col      { width: 14%; }
.events-scroll thead th.mel-sort          { width: 13%; }
.events-scroll thead th.mel-people-col    { width: 12%; }
.events-scroll thead th.mel-intro-col     { width: 61%; }
.events-scroll thead th.wpn-name-col      { width: 13%; }
.events-scroll thead th.wpn-sort          { width: 12%; }
.events-scroll thead th.wpn-type-col      { width: 9%; }
.events-scroll thead th.wpn-people-col    { width: 11%; }
.events-scroll thead th.wpn-intro-col     { width: 55%; }
.events-scroll thead th.mar-name-col      { width: 14%; }
.events-scroll thead th.mar-sort          { width: 13%; }
.events-scroll thead th.mar-people-col    { width: 12%; }
.events-scroll thead th.mar-intro-col     { width: 61%; }
.inst-name, .mel-name, .wpn-name, .mar-name { color: var(--ink); min-width: 100px; white-space: nowrap; }
.inst-era, .mel-era, .wpn-era, .mar-era { white-space: nowrap; min-width: 130px; }
.inst-people, .mel-people, .wpn-people, .mar-people { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.inst-intro, .mel-intro, .wpn-intro, .mar-intro { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 620px; }
.wpn-type { text-align: center; vertical-align: middle; }
.wpn-tag { display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 12px; line-height: 1.6; white-space: nowrap; }
.wpn-tag.cold  { background: #eaf2fb; color: #2c6cb0; border: 1px solid #cfe0f2; }
.wpn-tag.fire  { background: #fdeceb; color: #c0392b; border: 1px solid #f5c6c0; }
.wpn-tag.siege { background: #f3ece0; color: #8a6d3b; border: 1px solid #e3d4b8; }
.wpn-tag.other { background: #eee; color: #666; border: 1px solid #ddd; }

/* 锦绣神州（可缩放中国地图，置于页面底部，暂不进导航） */
.china-wrap { max-width: 960px; margin: 0 auto; }
.china-map-svg { width: 100%; height: auto; display: block; border: 1px solid var(--border); border-radius: 12px; background: #eaf2f8; box-shadow: var(--shadow-sm); }
.china-btn { font-family: var(--sans); font-size: 14px; padding: 5px 12px; border: 1px solid var(--border); background: var(--card); color: var(--ink); border-radius: 8px; cursor: pointer; }
.china-btn:hover { background: #f3ece0; border-color: #b8923a; }
.china-hint { text-align: center; color: var(--dim); font-size: 12.5px; margin: 10px 0 0; letter-spacing: .5px; }
.dyn-tabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 8px; }
.dyn-tab { cursor: pointer; border: 1px solid #c2a05f; background: #fff; color: #7a5a2a; border-radius: 14px; padding: 4px 13px; font-size: 13px; line-height: 1.4; font-family: var(--sans); transition: all .15s; }
.dyn-tab:hover { background: #f3e6c8; }
.dyn-tab.active { background: #9c7b3f; color: #fff; border-color: #9c7b3f; font-weight: 600; }
.china-dyn-note { text-align: center; color: var(--text); font-size: 12.5px; line-height: 1.6; margin: 8px auto 0; max-width: 880px; padding: 0 12px; min-height: 38px; }
.china-city { font-family: var(--sans); font-size: 9px; fill: #3a2f1a; paint-order: stroke; stroke: #fbf6ea; stroke-width: 2.4px; stroke-linejoin: round; pointer-events: none; font-weight: 500; }
.china-city.china-cap { font-size: 10.5px; fill: #7a1f12; font-weight: 700; stroke-width: 2.8px; }
.events-scroll thead th.lan-name-col      { width: 14%; }
.events-scroll thead th.lan-sort          { width: 13%; }
.events-scroll thead th.lan-people-col    { width: 12%; }
.events-scroll thead th.lan-intro-col     { width: 61%; }
.lan-name { color: var(--ink); min-width: 100px; white-space: nowrap; }
.lan-era { white-space: nowrap; min-width: 130px; }
.lan-people { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.lan-intro { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 620px; }

/* 表24 凤冠朱颜 / 表25 经纶世务 列样式 */
.cos-name { color: var(--ink); min-width: 110px; white-space: nowrap; }
.cos-era { white-space: nowrap; min-width: 130px; }
.cos-people { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.cos-intro { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 620px; }
.gov-name { color: var(--ink); min-width: 120px; white-space: nowrap; }
.gov-era { white-space: nowrap; min-width: 130px; }
.gov-people { color: var(--text); font-size: 13.5px; white-space: nowrap; }
.gov-intro { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 620px; }

/* 统一全表第一栏「名称」字体（衬线 · 600）：形成 页标题36 > 表标题20 > 第一栏名头16 > 表头13 > 正文14 的排版梯度；允许换行避免长名（如爱新觉罗·努尔哈赤）遮挡次列 */
.ev-title, .nm-cell, .grp-name, .allu-phrase, .art-name, .book-title,
.bld-name, .inv-name, .herb-name, .op-name, .poem-name, .artw-name, .bt-name, .tea-name, .ih-name, .sc-name, .fd-name,
.inst-name, .mel-name, .wpn-name, .mar-name, .lan-name, .cos-name, .gov-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--ink);
  white-space: normal;
  word-break: break-word;
}

/* 时间列统一「色点 + 朝代名」样式（与表2 朝代列一致） */
.era-cell { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.era-cell i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 9px; }
.era-sep { color: var(--dim); margin: 0 1px; }
.era-empty { color: var(--dim); }

/* ---------- 年代注记 说明块（表1 之后） ---------- */
.notes-card {
  margin: 30px auto 0;
  background: var(--card); border: 1px solid var(--border);
  border-left: 4px solid #b8923a;
  border-radius: 14px; box-shadow: var(--shadow-sm);
  padding: 18px 22px 16px;
}
.notes-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.notes-head h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: 3px; margin: 0; color: var(--ink); }
.notes-badge {
  font-family: var(--sans); font-size: 12px; letter-spacing: 1px; color: #fff;
  background: #b8923a; border-radius: 4px; padding: 2px 8px; margin-left: 2px; vertical-align: middle;
}
.notes-head .sub { color: var(--dim); font-size: 12px; letter-spacing: .5px; }
.notes-list { margin: 0; padding-left: 20px; }
.notes-list li { font-size: 14px; line-height: 1.75; color: var(--text); margin: 6px 0; text-align: justify; }
.notes-list li strong { color: var(--ink); font-weight: 600; }

/* ---- 表26 千金良方 列宽（方剂名/年代/人物/出处/主要成分/功效主治） ---- */
.events-scroll thead th.rx-name-col   { width: 12%; }
.events-scroll thead th.rx-era-col    { width: 10%; }
.events-scroll thead th.rx-person-col { width: 10%; }
.events-scroll thead th.rx-source-col { width: 14%; }
.events-scroll thead th.rx-comp-col   { width: 30%; }
.events-scroll thead th.rx-effect-col { width: 24%; }
/* 方剂表药材名 → 灵根仙草 蓝链 + 高亮 */
.herb-jump { color: var(--accent); cursor: pointer; text-decoration: none; border-bottom: 1px dashed var(--accent); }
.herb-jump:hover { color: #b8442a; }
tr.herb-hl td { background: #fff3d6 !important; transition: background .3s ease; }

/* ---- 表后免责声明块 ---- */
.disclaimer-note {
  margin: 34px auto 0;
  background: #fff8f3;
  border: 1px solid #f0d6c4;
  border-left: 4px solid #d98a4e;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06));
}
.disclaimer-note .disc-title {
  font-family: var(--serif);
  font-size: 16px; font-weight: 600; letter-spacing: 1px;
  color: #c0561f; margin: 0 0 8px;
}
.disclaimer-note p { font-size: 13.5px; line-height: 1.8; color: var(--text); margin: 0 0 8px; text-align: justify; }
.disclaimer-note p:last-child { margin-bottom: 0; }
.disclaimer-note b { color: #b8442a; font-weight: 600; }

