/* ===== 历代人物生卒年表 · 浅色简约样式 ===== */
: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;
  --tl-row-h: 44px;         /* 表1 每行高度：canvas 的行距、色块定位、撑高元素都按它算 */
  --label-w: 190px;         /* 表1 左侧「姓名/身份」栏宽度：canvas 的左栏与刻度条起点共用。
                               取值依据：最长姓名「爱新觉罗·努尔哈赤」9 字 ×（16px 字号 + 0.5px 字距）= 148.5px，
                               加左右内边距 28px = 176.5px，190px 留有余量且不显空。 */
  --nav-h: 66px;           /* 吸顶导航实际高度，由 app.js 量出后覆盖；锚点定位用它算 scroll-margin */
  --bar-h: 70px;            /* 吸顶导航／名句条／表1筛选栏 三者统一高度（运行期由 JS 按导航实际高度覆盖） */

  /* ---------- 动效令牌（V1.08）：全站过渡与动画只取这几档，避免各写各的手感 ---------- */
  --ease-out: cubic-bezier(.22, 1, .36, 1);   /* 出场与悬停：快起慢收 */
  --ease-io: cubic-bezier(.4, 0, .2, 1);      /* 双向与状态切换 */
  --t-fast: .16s;                             /* 悬停、按压这类即时反馈 */
  --t-base: .24s;                             /* 底色、描边、遮罩的渐显渐隐 */
  --t-slow: .4s;                              /* 进场：卡片、面板、名句切换 */
  --reveal-y: 10px;                           /* 卡片入场上移量 */
  --motion-accent: rgba(74, 85, 104, .55);    /* 行强调条与排序列下划线 */
  --motion-glow: rgba(74, 144, 201, .13);     /* 键盘焦点环的柔光 */
  --pane-h: 76vh;                            /* 全部表格的视口高度（V1.10 起统一）。
                                                 此前三处各写各的：时间轴 86vh、表2 90vh、内容表 70vh，
                                                 于是「有的表大有的表小」。改这一处即全站一致。 */
  --nav-blur: 5px;                            /* 吸顶导航毛玻璃半径。V1.09 由 8px 降到 5px：
                                                 .top-nav 是 sticky，整页滚动时每帧都要重新采样背后内容，
                                                 而 backdrop-filter 的开销随半径近似二次增长。改回 8px 即还原。 */

  /* 交互控件的统一过渡：原先 8 处用了 all 简写（会让浏览器在悬停时枚举所有可动画属性），
     现改为显式属性清单并抽成一条令牌，改一处即全站生效。 */
  --t-ctl: background var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io),
           color var(--t-fast) var(--ease-io), box-shadow var(--t-fast) var(--ease-out),
           transform var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-io);


  /* 说明：令牌写在这里而不是 motion.css，是为了让 motion.css 可以整份删除——
     本文件里所有 transition 都引用这些变量，删掉动效层不会连基线一起坏掉。 */
}

* { 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 h1 .ver-badge {
  display: inline-block; vertical-align: middle;
  margin-left: 16px; padding: 3px 12px;
  font-family: var(--sans); font-size: 13px; font-weight: 400;
  letter-spacing: 2px; color: var(--accent);
  border: 1px solid var(--dim); border-radius: 4px;
  background: #fff; transform: translateY(-6px);
}
.site-head p { color: var(--muted); margin: 4px 0; letter-spacing: 2px; font-size: 14px; }
/* 首屏规模数字（数值由 app.js 的 renderHeadStats() 现算写入，滚动计数见 motion.js） */
.head-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px;
  margin: 14px 0 0; font-family: var(--sans); font-size: 12.5px;
  letter-spacing: 1px; color: var(--muted);
}
.head-stats .hs-item { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.head-stats b {
  font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--ink);
  letter-spacing: 0; font-variant-numeric: tabular-nums;   /* 计数滚动时数字不跳宽 */
}

.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: var(--t-ctl); 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: var(--t-ctl);
}
.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; }

/* ---------- 表间快速切换（V1.12）：右侧上下两个圆钮 ----------
 * 与左侧球阵同一序列。圆钮本身不吃 hover 位移以外的效果，边框/底色都沿用纸面语言。 */
.tbl-jump {
  position: fixed; right: 20px; top: 50%; transform: translateY(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: 10px;
  font-family: var(--sans);
  -webkit-user-select: none; user-select: none;
}
.jump-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: color var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io),
              background var(--t-fast) var(--ease-io), box-shadow var(--t-fast) var(--ease-io),
              opacity var(--t-fast) var(--ease-io), transform var(--t-fast) var(--ease-out);
}
.jump-btn:not(:disabled):hover { color: var(--ink); border-color: var(--muted); background: #fafbfc; transform: translateY(-1px); }
.jump-btn:not(:disabled):active { transform: translateY(0) scale(.94); }
/* 两端不可用时压暗并去掉投影 —— 一眼能看出「到头了」，而不是点了没反应 */
.jump-btn:disabled { opacity: .3; cursor: default; box-shadow: none; }
/* 窄屏：正文两侧本就没有留白了，圆钮收到贴边处 */
@media (max-width: 1080px) { .tbl-jump { right: 10px; } .jump-btn { width: 36px; height: 36px; } }

/* ---------- 表卡折叠（V1.10） ----------
 * 每张表卡右上角一个圆圈按钮，点一下把表格收成只剩标题栏的窄条 ——
 * 折叠只隐藏滚动视口，卡片本身就是「宽而矮的圆角矩形」，不必另做一套形态。
 * 按钮放在 .head-actions 里（没有就挂在表头末尾），因此始终停在右上角。 */
.fold-btn {
  flex: 0 0 auto; width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: #fff; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--t-ctl);
}
.fold-btn:hover { border-color: var(--accent); color: var(--accent); }
.fold-btn .fold-ico {
  width: 7px; height: 7px; margin-top: 3px;
  border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(135deg);                      /* 未折叠：朝上（点一下收起） */
  transition: transform var(--t-base) var(--ease-out);
}
.card-folded .fold-btn .fold-ico { transform: rotate(-45deg); margin-top: -3px; }
.card-folded .timeline-scroll,
.card-folded .table-scroll,
.card-folded .events-scroll { display: none; }
/* 收起后表头不再需要下边线，否则会成一条悬空的横线 */
.card-folded .timeline-head,
.card-folded .table-head,
.card-folded .events-head { border-bottom: none; }
/* ---------- Timeline ---------- */
.timeline-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 0; box-shadow: var(--shadow);   /* V1.10：与其余表卡同为「表头 + 视口」两段式 */
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease-io), box-shadow var(--t-base) var(--ease-io);
}
/* 可滚动视口：纵向滚动 + 横向平移时间轴 */
.timeline-scroll {
  position: relative;       /* canvas 与撑高元素都以它为定位参照 */
  height: var(--pane-h); 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; }

/* 表1 是一张**画出来的图**（渲染见 app.js 的「表1：Canvas 渲染」）：
 * 全部内容在一个 canvas 上，滚动条由一个空 div 撑出高度。
 * canvas 用 sticky 钉在视口顶部 —— 于是滚动时它视觉不动，JS 只需按 scrollTop 重绘内容，
 * 既不用每帧写 transform，更不用写几十个 left（旧 DOM 方案正是死在「每帧总得写点什么」上）。
 * sticky 比「绝对定位 + 每帧 translateY 抵消」更好：抵消要每帧写一次样式，sticky 是浏览器免费的。 */
.tl-canvas {
  position: sticky; top: 0; display: block; z-index: 2;
  cursor: grab; touch-action: none;
}
/* 撑高元素：只负责让原生滚动条覆盖整幅时间轴，本身不显示任何东西。
   高度 = 总行高 − 行区视口高，于是「滚到底」恰好等于「最后一行的下沿对齐画布下沿」。 */
.tl-run { width: 1px; }
/* 拖拽中禁选，免得鼠标划过文字时选中一片 */
.timeline-scroll.tl-dragging { user-select: none; -webkit-user-select: none; }
.timeline-scroll.tl-dragging .tl-canvas { cursor: grabbing; }

/* 图例与提示常驻滚动容器底部：原先它们排在五万像素的滚动内容末尾，得一路滚到底才看得见。
   sticky bottom 让它们始终贴着视口下沿，也让 measureTimeline() 知道该给 canvas 让出多少高度。 */
.tl-foot { position: sticky; bottom: 0; z-index: 3; background: var(--card); }

/* 打印时替换 canvas 的位图（由 beforeprint 生成、afterprint 移除） */
.tl-print-sheet { display: none; }

/* 给读屏器的说明：表1 是图，它的表是表2 */
.tl-a11y {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.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 var(--t-base) var(--ease-io), box-shadow var(--t-base) var(--ease-io);
}
.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); }

/* 时间轴卡片表头（命名为「交互总表」），用负边距抵消卡片内边距使其通栏 */
.timeline-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0; 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); }
.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: var(--t-ctl);
  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 var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out); 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: 10px 14px; 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: 9px 14px; border-bottom: 1px solid var(--border-soft); color: var(--text); text-align: left; vertical-align: middle; }
tbody tr { transition: background var(--t-fast) var(--ease-io); }
tbody tr:hover { background: #f7f8fa; }
.nm-cell { font-family: var(--serif); font-size: 15px; letter-spacing: 1px; white-space: nowrap; line-height: 1.45; }
/* 表2 风流人物：姓名与简介均可换行；列宽见文件上部「列宽总表」 */

.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); }

/* ---------- 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 var(--t-fast) var(--ease-io), transform var(--t-fast) var(--ease-io);
  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, var(--panel-w, 860px)); height: min(88vh, var(--panel-h, 580px)); }
.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 var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io);
}
.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; }
/* ---------- 统一信息卡片（版本说明 / 免责声明 共用一套视觉） ---------- */
.info-panel {
  margin: 34px auto 0;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.info-panel .ip-title {
  position: relative; padding-left: 12px; margin: 0 0 10px;
  font-family: var(--serif); font-size: 16px; font-weight: 500;
  letter-spacing: 3px; color: var(--ink);
}
.info-panel .ip-title::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 15px; border-radius: 2px; background: var(--accent);
}
.info-panel .ip-lead {
  margin: 0 0 12px; font-size: 13.5px; line-height: 1.85;
  color: var(--text); text-align: justify;
}
.info-panel .ip-lead strong { color: var(--ink); font-weight: 500; }
.info-panel code {
  font-family: var(--sans); font-size: 12.5px; color: var(--accent);
  background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: 4px; padding: 0 4px;
}
.info-panel details { border-top: 1px dashed var(--border); padding: 8px 0; }
.info-panel details:first-of-type { border-top: none; }
.info-panel summary {
  cursor: pointer; padding: 2px 0; outline: none; user-select: none;
  font-family: var(--serif); font-size: 14px; letter-spacing: 1px; color: var(--ink);
}
.info-panel summary::marker { color: var(--muted); }
.info-panel details[open] summary { color: var(--accent); margin-bottom: 6px; }
.info-panel .ip-list { margin: 4px 0 2px; padding-left: 18px; }
.info-panel .ip-list li { margin-bottom: 2px; font-size: 13.5px; line-height: 1.9; color: var(--text); }
.info-panel .ip-list b { color: var(--ink); font-weight: 500; }
.info-panel .ip-dl { margin: 0; }
.info-panel .ip-dl > div { border-top: 1px dashed var(--border); padding: 10px 0; }
.info-panel .ip-dl > div:first-child { border-top: none; padding-top: 2px; }
.info-panel .ip-dl dt {
  margin-bottom: 5px; font-family: var(--serif); font-size: 14px;
  font-weight: 500; letter-spacing: 1px; color: var(--ink);
}
.info-panel .ip-dl dd { margin: 0 0 6px; font-size: 13.5px; line-height: 1.85; color: var(--text); text-align: justify; }
.info-panel .ip-dl dd:last-child { margin-bottom: 0; }
.info-panel b { color: var(--ink); font-weight: 500; }
/* 唯一的暖色强调：医药安全警示（两个模块共用同一 token，不破坏配色一致性） */
.info-panel .ip-em { color: #b8442a; font-weight: 500; }

@media (max-width: 720px) {
  :root { --label-w: 132px; }
  .site-head h1 { font-size: 26px; letter-spacing: 4px; }
  .site-head h1 .ver-badge {
    display: block; margin: 10px auto 0; width: fit-content;
    font-size: 12px; transform: none;
  }
  .zoom-level { min-width: 0; }
}

/* ---------- 姓名可点击（打开人物简介；关系图由简介窗口进入） ---------- */
.nm-cell { cursor: pointer; transition: color var(--t-fast) var(--ease-io); }
.nm-cell:hover { color: var(--accent); text-decoration: underline; }

/* ============================================================================
   列宽总表（全站唯一处）
   ----------------------------------------------------------------------------
   规则：每张表各列宽度之和恒为 100%；宽度按该列内容实际渲染宽度加权分配——
         短列（名称/年代/类别）按最长条目取值，保证基本不折行；
         长文本列（简介/说明/影响/释义）按 90 分位取值，容许极少数长条目折行；
         名单列（人物/成员）按 90 分位取值，列表换行自然。
   维护：新增列时补一条规则并重新配平该表；改数据后可跑
         node tools/colcheck.js  复核每张表是否仍为 100%。
   ============================================================================ */
.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: 15%; }
.table-scroll thead th[data-key="title"]   { width: 16%; }
.table-scroll thead th[data-key="dynasty"] { width: 8%; }
.table-scroll thead th[data-key="role"]    { width: 7%; }
.table-scroll thead th[data-key="birth"]   { width: 6%; }
.table-scroll thead th[data-key="death"]   { width: 6%; }
.table-scroll thead th[data-key="age"]     { width: 6%; }
.table-scroll thead th[data-key="note"]    { width: 36%; }

/* 表3 · 往事勾陈（重大事件 朝代 发生时间 牵涉人物 文明影响） */
.events-scroll thead th.ev-title-col   { width: 19%; }
.events-scroll thead th.ev-dyn-col     { width: 10%; }
.events-scroll thead th.ev-time-col    { width: 13%; }
.events-scroll thead th.ev-fig-col     { width: 20%; }
.events-scroll thead th.ev-impact-col  { width: 38%; }

/* 表4 · 人物组合（组合名称 所处时期 主要成员 简介） */
.events-scroll thead th.grp-name-col { width: 14%; }
.events-scroll thead th.grp-era-col  { width: 10%; }
.events-scroll thead th.grp-mem-col  { width: 27%; }
.events-scroll thead th.grp-desc-col { width: 49%; }

/* 表5 · 历史典故（典故短语 朝代 类别 牵涉人物 释义） */
.events-scroll thead th.allu-name-col    { width: 20%; }
.events-scroll thead th.allu-era-col     { width: 8%; }
.events-scroll thead th.allu-cat-col     { width: 11%; }
.events-scroll thead th.allu-people-col  { width: 13%; }
.events-scroll thead th.allu-meaning-col { width: 48%; }

/* 表6 · 翰墨书香（书名 成书时代 作者 类别 著作简介） */
.events-scroll thead th.book-title-col  { width: 15%; }
.events-scroll thead th.book-era-col    { width: 8%; }
.events-scroll thead th.book-author-col { width: 15%; }
.events-scroll thead th.book-cat-col    { width: 7%; }
.events-scroll thead th.book-note-col   { width: 55%; }

/* 表7 · 经典文物（文物名称 所处年代 文物简介 文物意义） */
.events-scroll thead th.art-name-col    { width: 20%; }
.events-scroll thead th.art-era-col     { width: 9%; }
.events-scroll thead th.art-intro-col   { width: 35%; }
.events-scroll thead th.art-meaning-col { width: 36%; }

/* 表8 · 雕梁画栋（名称 建造年代 涉及人物 建筑说明 简介） */
.events-scroll thead th.bld-name-col   { width: 12%; }
.events-scroll thead th.bld-era-col    { width: 9%; }
.events-scroll thead th.bld-people-col { width: 7%; }
.events-scroll thead th.bld-desc-col   { width: 34%; }
.events-scroll thead th.bld-intro-col  { width: 38%; }

/* 表9 · 天工机巧（名称 发明年代 涉及人物 物品说明 简介） */
.events-scroll thead th.inv-name-col   { width: 10%; }
.events-scroll thead th.inv-era-col    { width: 9%; }
.events-scroll thead th.inv-people-col { width: 8%; }
.events-scroll thead th.inv-desc-col   { width: 32%; }
.events-scroll thead th.inv-intro-col  { width: 41%; }

/* 表10 · 经纶世务（制度名称 对应朝代 经典人物 制度简介） */
.events-scroll thead th.gov-name-col   { width: 15%; }
.events-scroll thead th.gov-era-col    { width: 13%; }
.events-scroll thead th.gov-people-col { width: 14%; }
.events-scroll thead th.gov-intro-col  { width: 58%; }

/* 表11 · 梨园雅韵（名称 年代 作者 类型 简介） */
.events-scroll thead th.op-name-col    { width: 13%; }
.events-scroll thead th.op-era-col     { width: 9%; }
.events-scroll thead th.op-author-col  { width: 11%; }
.events-scroll thead th.op-genre-col   { width: 9%; }
.events-scroll thead th.op-intro-col   { width: 58%; }

/* 表12 · 诗词歌赋（名称 创作年代 作者 经典片段 简介） */
.events-scroll thead th.poem-name-col    { width: 21%; }
.events-scroll thead th.poem-era-col     { width: 7%; }
.events-scroll thead th.poem-author-col  { width: 7%; }
.events-scroll thead th.poem-excerpt-col { width: 22%; }
.events-scroll thead th.poem-intro-col   { width: 43%; }

/* 表13 · 雄文壮词（篇名 时代 作者 体裁 名句 简介）—— 首列按最长「生于忧患，死于安乐」配宽 */
.events-scroll thead th.es-name-col    { width: 16%; }
.events-scroll thead th.es-era-col     { width: 7%; }
.events-scroll thead th.es-author-col  { width: 7%; }
.events-scroll thead th.es-genre-col   { width: 8%; }
.events-scroll thead th.es-excerpt-col { width: 20%; }
.events-scroll thead th.es-intro-col   { width: 42%; }

/* 表14 · 山水墨色（名称 创作年代 作者 类别 简介） */
.events-scroll thead th.artw-name-col   { width: 16%; }
.events-scroll thead th.artw-era-col    { width: 10%; }
.events-scroll thead th.artw-author-col { width: 8%; }
.events-scroll thead th.artw-cat-col    { width: 8%; }
.events-scroll thead th.artw-intro-col  { width: 58%; }

/* 表15 · 兵戈缭乱（战役名 朝代 具体时间 交战双方 战争影响） */
.events-scroll thead th.bt-name-col    { width: 20%; }
.events-scroll thead th.bt-dynasty-col { width: 7%; }
.events-scroll thead th.bt-time-col    { width: 15%; }
.events-scroll thead th.bt-sides-col   { width: 20%; }
.events-scroll thead th.bt-impact-col  { width: 38%; }

/* 表16 · 奇案异闻（案件名 朝代 时间 相关人物 案情概要 结局与影响） */
.events-scroll thead th.cs-name-col   { width: 14%; }
.events-scroll thead th.cs-era-col    { width: 7%; }
.events-scroll thead th.cs-time-col   { width: 14%; }
.events-scroll thead th.cs-people-col { width: 12%; }
.events-scroll thead th.cs-case-col   { width: 25%; }
.events-scroll thead th.cs-result-col { width: 28%; }

/* 表17 · 志异妙传（故事名 朝代 主要人物 故事梗概 虚实考辨） */
.events-scroll thead th.lg-name-col  { width: 14%; }
.events-scroll thead th.lg-era-col   { width: 7%; }
.events-scroll thead th.lg-hero-col  { width: 13%; }
.events-scroll thead th.lg-story-col { width: 34%; }
.events-scroll thead th.lg-truth-col { width: 32%; }

/* 表18 · 禅茶一味（茶名 出现时代 茶类 味型 主要产地 简介） */
.events-scroll thead th.tea-name-col   { width: 10%; }
.events-scroll thead th.tea-era-col    { width: 10%; }
.events-scroll thead th.tea-type-col   { width: 8%; }
.events-scroll thead th.tea-flavor-col { width: 15%; }
.events-scroll thead th.tea-origin-col { width: 15%; }
.events-scroll thead th.tea-note-col   { width: 42%; }

/* 表19 · 薪火相传（项目名 起源时代 发明者／代表人物 类别 简介） */
.events-scroll thead th.ih-name-col     { width: 25%; }
.events-scroll thead th.ih-era-col      { width: 8%; }
.events-scroll thead th.ih-inventor-col { width: 20%; }
.events-scroll thead th.ih-type-col     { width: 7%; }
.events-scroll thead th.ih-note-col     { width: 40%; }

/* 表20 · 贝叶遗珍（典籍名 成书年代 牵涉人物 宗教 典籍简介） */
.events-scroll thead th.sc-name-col   { width: 15%; }
.events-scroll thead th.sc-era-col    { width: 12%; }
.events-scroll thead th.sc-people-col { width: 21%; }
.events-scroll thead th.sc-rel-col    { width: 7%; }
.events-scroll thead th.sc-note-col   { width: 45%; }

/* 表21 · 珍馐美馔（美食名 产生时代 代表人物 类别 地方 美食简介） */
.events-scroll thead th.fd-name-col     { width: 12%; }
.events-scroll thead th.fd-era-col      { width: 13%; }
.events-scroll thead th.fd-people-col   { width: 10%; }
.events-scroll thead th.fd-category-col { width: 8%; }
.events-scroll thead th.fd-region-col   { width: 8%; }
.events-scroll thead th.fd-note-col     { width: 49%; }

/* 表22 · 丝竹管弦（乐器名 出现时代 代表人物 乐器介绍） */
.events-scroll thead th.inst-name-col   { width: 12%; }
.events-scroll thead th.inst-era-col    { width: 15%; }
.events-scroll thead th.inst-people-col { width: 14%; }
.events-scroll thead th.inst-intro-col  { width: 59%; }

/* 表23 · 大音希声（乐曲名 出现时代 代表人物 音乐介绍） */
.events-scroll thead th.mel-name-col   { width: 16%; }
.events-scroll thead th.mel-era-col    { width: 13%; }
.events-scroll thead th.mel-people-col { width: 13%; }
.events-scroll thead th.mel-intro-col  { width: 58%; }

/* 表24 · 碎金削玉（兵器名 类型 出现时代 代表人物 兵器介绍） */
.events-scroll thead th.wpn-name-col   { width: 13%; }
.events-scroll thead th.wpn-era-col    { width: 10%; }
.events-scroll thead th.wpn-people-col { width: 10%; }
.events-scroll thead th.wpn-type-col   { width: 8%; }
.events-scroll thead th.wpn-intro-col  { width: 59%; }

/* 表25 · 吐故纳新（功法名 出现时代 代表人物 功法介绍） */
.events-scroll thead th.mar-name-col   { width: 16%; }
.events-scroll thead th.mar-era-col    { width: 13%; }
.events-scroll thead th.mar-people-col { width: 13%; }
.events-scroll thead th.mar-intro-col  { width: 58%; }

/* 表26 · 名山大川（名称 出现时代 代表人物 风光与绝景） */
.events-scroll thead th.lan-name-col   { width: 13%; }
.events-scroll thead th.lan-era-col    { width: 11%; }
.events-scroll thead th.lan-people-col { width: 18%; }
.events-scroll thead th.lan-intro-col  { width: 58%; }

/* 表27 · 凤冠朱颜（名称 对应时代 经典人物 简介） */
.events-scroll thead th.cos-name-col   { width: 17%; }
.events-scroll thead th.cos-era-col    { width: 13%; }
.events-scroll thead th.cos-people-col { width: 12%; }
.events-scroll thead th.cos-intro-col  { width: 58%; }

/* 表28 · 灵根仙草（药材名称 发现时代 主要产地 主要功效 简介） */
.events-scroll thead th.herb-name-col   { width: 9%; }
.events-scroll thead th.herb-era-col    { width: 8%; }
.events-scroll thead th.herb-origin-col { width: 18%; }
.events-scroll thead th.herb-eff-col    { width: 28%; }
.events-scroll thead th.herb-intro-col  { width: 37%; }

/* 表29 · 千金良方（方剂名 年代 人物 出处 主要成分 功效主治） */
.events-scroll thead th.rx-name-col   { width: 12%; }
.events-scroll thead th.rx-era-col    { width: 6%; }
.events-scroll thead th.rx-person-col { width: 10%; }
.events-scroll thead th.rx-source-col { width: 13%; }
.events-scroll thead th.rx-comp-col   { width: 29%; }
.events-scroll thead th.rx-effect-col { width: 30%; }

/* 表30 · 物埠民丰（作物名称 类别 时代 原产／传入 相关人物 简介）—— 首列按最长「青稞（裸大麦）」配宽 */
.events-scroll thead th.crop-name-col   { width: 12%; }
.events-scroll thead th.crop-cat-col    { width: 8%; }
.events-scroll thead th.crop-era-col    { width: 8%; }
.events-scroll thead th.crop-origin-col { width: 13%; }
.events-scroll thead th.crop-people-col { width: 7%; }
.events-scroll thead th.crop-note-col   { width: 52%; }

/* 表31 · 市井百物（器物名称 类别 时代 主要工艺 简介）—— 首列按最长「低温铅釉陶」配宽 */
.events-scroll thead th.ware-name-col  { width: 10%; }
.events-scroll thead th.ware-cat-col   { width: 8%; }
.events-scroll thead th.ware-era-col   { width: 8%; }
.events-scroll thead th.ware-craft-col { width: 16%; }
.events-scroll thead th.ware-intro-col { width: 58%; }

/* 表32 · 安居乐业（名称 类别 时代 相关人物 玩法 简介）—— 首列按最长「龙舟竞渡」4 字配宽 */
.events-scroll thead th.act-name-col   { width: 10%; }
.events-scroll thead th.act-cat-col    { width: 8%; }
.events-scroll thead th.act-era-col    { width: 7%; }
.events-scroll thead th.act-people-col { width: 12%; }
.events-scroll thead th.act-play-col   { width: 23%; }
.events-scroll thead th.act-intro-col  { width: 40%; }
/* 主要工艺是短字段，锁单行；列宽已按最长「釉下钴料·一次高温烧成」配足 */
.ware-craft { white-space: nowrap; }

/* 表32 · 安居乐业 */
.act-name { min-width: 90px; }
.act-cat { color: var(--text); font-size: 13px; white-space: nowrap; }
.act-era { line-height: 1.9; white-space: nowrap; }
.act-people { color: var(--text); font-size: 13.5px; }
.act-play { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 420px; }
.act-intro { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 540px; }

/* ---------- 行内边距：首末列与卡片标题左右对齐（上下内边距见文件上部的 thead th / tbody td） ---------- */
.table-scroll thead th:first-child, .events-scroll thead th:first-child,
.table-scroll tbody td:first-child, .events-scroll tbody td:first-child { padding-left: 20px; }
.table-scroll thead th:last-child, .events-scroll thead th:last-child,
.table-scroll tbody td:last-child, .events-scroll tbody td:last-child { padding-right: 20px; }

/* ---------- 关系图弹窗（球棍图） ---------- */
.rel-modal {
  position: fixed; inset: 0; z-index: 140; 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 var(--t-base) var(--ease-io); }
@keyframes relFade { from { opacity: 0; } to { opacity: 1; } }
/* 从人物名片点【查看其关系图】时：名片与关系图面板同尺寸，若关系图再从透明淡入，
   中间那 0.2s 会露出背后的页面（观感就是「闪一下」）。此时跳过动画，做成同面板换内容。 */
.rel-modal.show.no-anim { animation: none; }

/* 面板在弹窗打开时会以 tabindex="-1" 接收焦点（键盘可达），不加焦点环以免误解为可点击 */
/* 二级窗口弹出时锁定页面滚动（由 app.js 的 lockScroll() 挂上/摘掉） */
body.modal-lock { overflow: hidden; }

.rel-panel:focus { outline: none; }
.rel-panel {
  width: min(94vw, var(--panel-w, 860px)); height: min(90vh, var(--panel-h, 580px));
  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: var(--t-ctl);
}
.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; }

/* ---------- 总表「简介」列（点击弹出人物简介） ---------- */
thead th.no-sort { cursor: default; }
thead th.no-sort:hover { color: var(--muted); }
thead th .arr:empty { display: none; }
/* 表2「简介」列：仅作展示，不再承担点击交互（简版简介；详版见人物名片） */
.note-cell { color: var(--text); max-width: none; white-space: normal; line-height: 1.5; }

/* ---------- 人物简介弹窗（与关系图同款风格） ----------
 * 层级：#provListModal 110 < .intro-modal 130 < .rel-modal 140
 * （关系图在最上：名片→关系图 切换时需完全盖住名片）
 * 省份列表打开后再点人物，人物名片必须叠在列表之上。 */
.intro-modal { z-index: 130; }
.intro-panel { width: min(94vw, var(--panel-w, 860px)); height: min(90vh, var(--panel-h, 580px)); }

/* ---------- 省份代表人物列表弹窗（人物名片复用 #introModal） ---------- */
#provListModal { z-index: 110; }
.prov-list-body {
  flex: 1 1 auto; min-height: 0; padding: 16px 22px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; align-content: start;
}
.prov-fig-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  border: 1px solid var(--border); background: #fff; border-radius: 12px;
  padding: 12px 14px; cursor: pointer; transition: var(--t-ctl);
  font-family: var(--sans); color: var(--text);
}
.prov-fig-card:hover { border-color: #c2a05f; background: #fcf7ec; box-shadow: var(--shadow-sm); }
/* 已收录于人物库（表2）者，可进一步查看其关系图，以左侧蓝条与圆点标出 */
.prov-fig-card.has-entry { border-left: 3px solid #4a90c9; padding-left: 12px; }
.prov-fig-card.has-entry .pf-name::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px;
  border-radius: 50%; background: #4a90c9; vertical-align: middle;
}
.pf-name { font-family: var(--serif); font-size: 18px; letter-spacing: 1px; color: var(--ink); font-weight: 600; }
.pf-era { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.prov-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 40px 0; }
.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-brief {
  margin: -8px 0 18px; padding: 8px 12px; border-left: 3px solid var(--border);
  background: var(--bg); border-radius: 8px;
  font-size: 12.5px; line-height: 1.8; color: var(--muted); text-align: justify;
}
/* 条目名片：主文本之后的次要长文本小节（如「结局与影响」「虚实考辨」） */
.entry-sec { margin: 0 0 16px; }
.entry-text {
  margin: 0; font-family: var(--serif); font-size: 15px; line-height: 1.9;
  color: var(--text); text-align: justify;
}
/* 条目名片的短字段表：字段名比人物名片长（如「成书时代」「主要产地」），故加宽 dt */
.intro-meta.entry-meta dt { min-width: 56px; }
/* 人物名片：关联块（另见条目 / 关系人物 / 同时代人物） */
.intro-related { margin: 18px 0 2px; padding-top: 14px; border-top: 1px dashed var(--border); }
.intro-related .ir-sec { margin-bottom: 12px; }
.intro-related .ir-sec:last-child { margin-bottom: 0; }
.intro-related .ir-title {
  margin: 0 0 7px; font-family: var(--serif); font-size: 13px;
  font-weight: 500; letter-spacing: 2px; color: var(--ink);
}
.intro-related .ir-list { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.intro-related .ir-item {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; font-size: 12.5px; color: var(--text); line-height: 1.6;
}
.intro-related .ir-item b { font-weight: 500; color: var(--ink); }
/* 条目名片里的「相关人物」胶囊：命中人物库者做成链接 */
.intro-related a.ir-item { text-decoration: none; cursor: pointer; transition: var(--t-ctl); }
.intro-related a.ir-item:hover { border-color: #2f6fb0; color: #1d4e80; background: #f5f9fd; }
.intro-related .ir-item i { font-style: normal; font-size: 11px; color: var(--muted); }

.intro-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 22px; border-top: 1px solid var(--border-soft);
}
/* 左下角动作区：人物名片放【查看其关系图】，条目名片放【查看百度百科】，二者位置完全一致 */
.intro-foot-actions { display: flex; align-items: center; gap: 10px; }
.intro-rel-btn {
  display: inline-block; text-align: center; text-decoration: none; line-height: 1.5;
  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: var(--t-ctl); 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; }

/* ---------- 全站检索：右下角常驻按钮 + 检索面板（V1.06） ---------- */
.nav-search {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 15px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  font-family: var(--sans); font-size: 13px; letter-spacing: .5px; cursor: pointer;
  box-shadow: var(--shadow); transition: color var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io), transform var(--t-fast) var(--ease-io);
}
.nav-search:hover { color: var(--ink); border-color: var(--accent); transform: translateY(-1px); }
.nav-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-search .ns-icon { width: 14px; height: 14px; flex: 0 0 14px; }
.nav-search kbd {
  font-family: var(--sans); font-size: 10.5px; letter-spacing: 0;
  padding: 1px 5px; border-radius: 5px; color: var(--dim);
  border: 1px solid var(--border); background: var(--bg);
}
.search-box {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px; border-bottom: 1px solid var(--border-soft);
}
.search-box input {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: #fbfbfc; outline: none; transition: border-color var(--t-fast) var(--ease-io), box-shadow var(--t-fast) var(--ease-io);
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 85, 104, .09); }
.search-count { flex: 0 0 auto; font-size: 12px; color: var(--muted); letter-spacing: .4px; white-space: nowrap; }
.search-results {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 12px 12px;
  scrollbar-width: thin; scrollbar-color: var(--dim) transparent;
}
.search-results::-webkit-scrollbar { width: 10px; }
.search-results::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 6px; border: 3px solid #fff; }
.sr-empty { color: var(--muted); font-size: 13px; line-height: 1.9; padding: 18px 10px; margin: 0; }
.sr-hit {
  display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; cursor: pointer; font-family: var(--sans);
  transition: background var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io);
}
.sr-hit + .sr-hit { margin-top: 2px; }
.sr-hit:hover { border-color: var(--border); }
.sr-hit[aria-selected="true"] { background: #f5f7fa; border-color: var(--border); }
.sr-label {
  flex: 0 0 auto; max-width: 42%; color: var(--ink); font-family: var(--serif);
  font-size: 15px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sr-mark { color: #a8442a; font-weight: 500; }
.sr-tab {
  flex: 0 0 auto; font-size: 11px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px;
  background: var(--bg); white-space: nowrap;
}
.sr-sub {
  flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-tip { color: var(--dim); font-size: 11px; letter-spacing: .4px; }
/* 检索命中后短暂高亮该行（与 .herb-hl 同款） */
tr.search-hl td { background: #fff3d6 !important; transition: background var(--t-slow) var(--ease-out); }
/* 长距离跳转（超过 3 屏）不再平滑滚动，改为瞬时定位 + 目标卡片一次落点描边 */
.jump-hl { animation: jumpHl 1.5s ease; }
@keyframes jumpHl {
  0%, 100% { box-shadow: var(--shadow); }
  25% { box-shadow: 0 0 0 3px rgba(74, 85, 104, .3), var(--shadow); }
}

/* ---------- 总表独立滚动区（更高的可视高度，表头吸顶） ---------- */
.table-scroll {
  height: var(--pane-h);
  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 { scroll-margin-top: calc(var(--nav-h, 66px) + 14px); }
.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.955);
  backdrop-filter: saturate(1.2) blur(var(--nav-blur));
  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: var(--t-ctl); 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 var(--ease-io);
  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 var(--ease-io);
}

/* 上下留白 = 遮罩渐隐区，保证首尾两球平移到位后也能完全显形 */
.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 var(--t-fast) var(--ease-out), height var(--t-fast) var(--ease-out), margin var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
/* 隐形热区：便于点选（随球径放大同步加大） */
.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 var(--t-base) var(--ease-io), transform var(--t-base) var(--ease-io), color var(--t-base) var(--ease-io), border-color var(--t-base) var(--ease-io);
}
.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 + 间隙）：
   索性隐去侧栏，由顶部吸顶目录承担导航 */
/* ---------- 窄屏导航 ----------
 * 29 个栏目在窄屏若继续换行，吸顶导航会被撑到 200px 以上（占掉小半屏），
 * 且因为 sticky 会一直挡着。改为单行横向滚动：高度恒定一行，仍可左右滑动取用。 */
@media (max-width: 860px) {
  .top-nav { gap: 10px; }
  .top-nav .nav-brand { flex: 0 0 auto; }
  .top-nav .nav-links {
    flex-wrap: nowrap; min-width: 0; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .top-nav .nav-links::-webkit-scrollbar { display: none; }
}

@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 var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}
/* 换句：旧句上移淡出、新句自下方淡入 —— 有方向感，读者看得出「翻了一页」 */
.quote-strip.q-fading .quote-inner { opacity: 0; transform: translateY(-7px); }
/* 新句落位前的瞬时状态：先关掉过渡把它放到下方，再摘类，让它自己过渡上来 */
.quote-strip.q-entering .quote-inner { transition: none; opacity: 0; transform: translateY(7px); }
.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-scroll {
  height: var(--pane-h); 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;
  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 { border-bottom: 1px solid var(--border-soft); color: var(--text); text-align: left; vertical-align: middle; }
.events-scroll tbody tr { transition: background var(--t-fast) var(--ease-io); }
.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 var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io);
}
.evt-fig:hover { color: #1d4e80; border-bottom-color: #1d4e80; }
.evt-fig-missing { color: var(--dim); margin: 0 2px; border-bottom: 1px dotted var(--border); }
/* 表2 之后各表第一列（物件名称）→ 点击打开条目名片（百度百科入口在名片左下角） */
.entry-link {
  color: #2f6fb0; text-decoration: none; border-bottom: 1px dashed rgba(47,111,176,.5);
  cursor: pointer; transition: color var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io);
}
.entry-link:hover { color: #1d4e80; border-bottom-color: #1d4e80; }

/* ---------------- 经典人物组合表（复用 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: nowrap; }
.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-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 视觉） ---------------- */
.cases-card { margin-top: 34px; }
.cs-name { font-family: var(--serif); font-size: 15px; letter-spacing: .5px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.cs-era { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
/* 时间列内容为整句叙述（如「清同治十二年（1873）发案，光绪三年（1877）昭雪」），
   锁定单行会横向溢出到「相关人物」列，故允许折行 */
.cs-time { color: #8a6d3b; font-size: 13px; }
.cs-people { line-height: 1.9; }
.cs-case, .cs-result { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 520px; }

/* ---------------- 志异妙传表（复用 events-card / evt-fig 视觉） ---------------- */
.legends-card { margin-top: 34px; }
.lg-name { font-family: var(--serif); font-size: 15px; letter-spacing: .5px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.lg-era { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.lg-hero { line-height: 1.9; }
.lg-story { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 520px; }
.lg-truth { line-height: 1.7; color: var(--muted); font-size: 13px; max-width: 520px; }

/* ---------------- 经典典籍表（复用 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-author { line-height: 1.9; white-space: nowrap; }
.book-era { color: #8a6d3b; font-size: 13px; 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-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 · 风流人物（表头由 app.js 生成，列宽规则见文件上部的「列宽总表」） */
/* 表12 · 诗词歌赋 */
.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 · 雄文壮词 */
.es-name { min-width: 140px; }
.es-era { line-height: 1.9; white-space: nowrap; }
.es-author { line-height: 1.9; white-space: nowrap; }
.es-genre { color: var(--text); font-size: 13px; white-space: nowrap; }
.es-excerpt { font-family: var(--serif); font-size: 14px; letter-spacing: .5px; color: var(--ink); line-height: 1.7; }
.es-intro { line-height: 1.7; color: var(--text); font-size: 13.5px; max-width: 560px; }

/* 表14 · 山水墨色 */
.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-intro { line-height: 1.7; color: var(--text); font-size: 13.5px; }

/* 表15 · 兵戈缭乱（战役表） */
.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; }

/* 表17 禅茶一味 */
.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; }

/* 表18 薪火相传 */
.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; }

/* 表19 贝叶遗珍 · 表20 珍馐美馔 列样式 */
.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; }
.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; }

/* 表21 丝竹管弦 / 表22 大音希声 / 表23 碎金削玉 / 表24 固本培元 —— 统一「名 · 时代 · 人物 · 介绍」四栏 */
.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 { color: var(--text); font-size: 13.5px; white-space: nowrap; }

/* 锦绣神州（可缩放中国地图，置于页面底部，暂不进导航） */
.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: var(--t-ctl); }
.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; }
.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; }

/* 表27 凤冠朱颜 / 表11 经纶世务 列样式 */
.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,
.crop-name, .ware-name, .es-name, .act-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--ink);
  white-space: nowrap;   /* 条目名一律单行显示；列宽已按各表最长名称配足（见「列宽总表」） */
}

/* 时间列统一「色点 + 朝代名」样式（与表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); }
/* 未能映射到朝代体系的年代原文（民国／近现代／后秦／跨代…）：允许折行，避免溢出窄列 */
.era-raw { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; align-items: flex-start; }


/* ---- 表26 千金良方 列宽（方剂名/年代/人物/出处/主要成分/功效主治） ---- */
/* 方剂表药材名 → 灵根仙草 蓝链 + 高亮 */
.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 var(--t-slow) var(--ease-out); }

/* 表后【免责声明】与【版本说明】已统一为 .info-panel 卡片样式（见文件前部），此处不再单列样式 */

/* ---------- 筛选按钮行 ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 键盘可达性：跳过导航 + 统一焦点环 ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: #fff; padding: 10px 18px;
  border-radius: 0 0 8px 0; font-size: 14px; letter-spacing: 1px;
  text-decoration: none;
}
.skip-link:focus { left: 0; }
a:focus-visible, button:focus-visible, summary:focus-visible,
[tabindex]:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #4a90c9; outline-offset: 2px; border-radius: 3px;
  box-shadow: 0 0 0 5px var(--motion-glow);
  transition: box-shadow var(--t-fast) var(--ease-out), outline-color var(--t-fast) var(--ease-out);
}
.noscript-note {
  max-width: 620px; margin: 64px auto; padding: 20px 24px;
  background: #fff; border: 1px solid var(--border);
  border-left: 4px solid #b8442a; border-radius: 12px;
  font-size: 14px; line-height: 1.9; color: var(--text); text-align: center;
}

/* ---------- 尊重「减少动态效果」偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- 打印：只留内容本体 ---------- */
@media print {
  .side-rail, .top-nav, .tip, .rel-modal, .quote-strip, .toolbar, .nav-search, .tbl-jump,
  .zoom-level, .china-btn, .dyn-tabs, .head-actions, .skip-link, noscript { display: none !important; }
  html, body { background: #fff !important; }
  .wrap { max-width: none; padding: 0; }
  .events-card, .table-card, .timeline-card, .info-panel, .china-card {
    border: none; box-shadow: none; margin: 0 0 18px; padding: 0;
  }
  /* 打印时一律展开：height 必须归 auto，否则仍会被裁到一屏；折叠态也要强制恢复 */
  .timeline-scroll, .events-scroll, .table-scroll { height: auto !important; max-height: none !important; overflow: visible !important; }
  .card-folded .timeline-scroll, .card-folded .table-scroll, .card-folded .events-scroll { display: block !important; }
  .fold-btn { display: none !important; }
  /* 表1：隐藏交互用的画布、撑高块与常驻图例，改印 beforeprint 导出的位图 */
  .tl-canvas, .tl-run, .tl-foot { display: none !important; }
  .tl-print-sheet { display: block !important; width: 100% !important; }
  .events-scroll table, .table-scroll table { font-size: 10.5px; }
  .events-scroll thead th, .table-scroll thead th { position: static; }
  .site-head h1 { font-size: 24px; letter-spacing: 4px; }
  a { color: inherit; text-decoration: none; }
}
