/* 上蔡县志 ･ 编年长卷 —— 沉浸式全屏影像时间轴
 * 版式严格照《永乐大典》数字化页的信息层级：
 *   巨幅章节名 → 年份大字 → 事件粗标题 → 通栏正文段落
 *   底部：全屏宽进度轴（分段刻度 + 滑块）+ 等分阶段格
 * 全屏分屏用原生 CSS scroll-snap，不引外部库。
 * 三主题统一暗底影像（压在照片上），只有压暗配方与强调色不同。
 */

/* 朱雀仿宋（Zhuque Fangsong, technical preview v0.212）——
   璇玑造字 / TrionesType 出品，SIL Open Font License 1.1，可免费商用。
   由 _tools/subset-zhuque.py 从官方 TTF 子集而来（8.4MB → 205KB），
   仅含本页实际用字 601 个，缺字（攺/羮/郹 等异体字）自动回退宋体，不影响正文。 */
@font-face {
  font-family: "Zhuque Fangsong SC";
  src: url("./zhuque-fangsong-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* ---------- 古色三件套：字体 / 双强调色 / 纹理 ---------- */
/* 衬线（宋）巨幅标题用；楷体给导语与引文。
   站内没有自托管这两类字面，靠系统字栈回退：Windows 有宋体/楷体，
   macOS/iOS 有 Songti SC / Kaiti SC，Linux 有 Noto Serif CJK。 */
.wb-sc {
  --sc-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "STSong", "SimSun", "宋体", serif;
  --sc-fangsong: "Zhuque Fangsong SC", "FangSong", "STFangsong", "仿宋", "FangSong_GB2312", var(--sc-serif);
  --sc-kai: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "Noto Serif CJK SC", serif;
}

/* ---------- 三套影像配方 ----------
   v6 转向：**晨光通透**（照识典《永乐大典》数字化页）。
   之前做的「压暗旧绢」方向反了 —— 步哥连说两次太暗，要的是那种
   清晨雾气里透光的亮堂画面：底子亮、对比低、暖金色调。
   所以这里的配方反过来了：
     · scrim 不再是「压暗」，而是**淡米色雾罩**（提亮，不是压黑）
     · 正文靠**文字自身的深色 + 轻投影**保证可读，不靠压背景
   强调色仍是朱砂 + 藤黄（传统颜料，跟晨光暖调是一路的）。 */
.wb-sc {
  /* 日间：晨光暖金，最亮的一套 */
  --sc-fg: #2b1f14;
  --sc-fg-2: rgba(43, 31, 20, .82);
  --sc-fg-3: rgba(43, 31, 20, .62);
  /* 雾罩：米白偏暖，用来「提亮」而不是压暗 */
  --sc-scrim-l: rgba(255, 248, 232, .28);
  --sc-scrim-xl: rgba(255, 248, 232, .15);
  --sc-scrim-m: rgba(255, 248, 232, .05);
  --sc-scrim-r: rgba(255, 248, 232, 0);
  --sc-scrim-b: rgba(255, 246, 228, .18);
  --sc-scrim-flat: rgba(255, 250, 238, .05);   /* 全屏均匀提亮 */
  --sc-card: rgba(255, 252, 244, .72);
  --sc-line: rgba(60, 42, 26, .18);
  --sc-line-2: rgba(60, 42, 26, .34);
  --sc-accent: #b8351f;                       /* 朱砂：印泥红 */
  --sc-gold: #9a6b1e;                         /* 藤黄（深一档，浅底上要够 contrast） */
  --sc-accent-soft: rgba(184, 53, 31, .12);
  --sc-rail: rgba(255, 253, 247, .88);
  --sc-nav: rgba(43, 31, 20, .86);
}
html.dark .wb-sc {
  /* 古纸主题：宣纸米底，介于晨光与旧纸之间 */
  --sc-fg: #33251a;
  --sc-fg-2: rgba(51, 37, 26, .84);
  --sc-fg-3: rgba(51, 37, 26, .64);
  --sc-scrim-l: rgba(255, 246, 226, .32);
  --sc-scrim-xl: rgba(255, 246, 226, .17);
  --sc-scrim-m: rgba(255, 246, 226, .06);
  --sc-scrim-r: rgba(255, 246, 226, 0);
  --sc-scrim-b: rgba(255, 243, 220, .20);
  --sc-scrim-flat: rgba(255, 248, 234, .06);
  --sc-card: rgba(255, 250, 238, .74);
  --sc-line: rgba(70, 50, 30, .20);
  --sc-line-2: rgba(70, 50, 30, .36);
  --sc-accent: #b8351f;
  --sc-gold: #8d5f18;
  --sc-accent-soft: rgba(184, 53, 31, .12);
  --sc-rail: rgba(255, 250, 238, .90);
  --sc-nav: rgba(51, 37, 26, .86);
}
html.ink .wb-sc {
  /* 夜主题：仍保留「墨中带褐」，但整体提到中调，不做纯黑压死 */
  --sc-fg: #f4ecdc;
  --sc-fg-2: rgba(244, 236, 220, .90);
  --sc-fg-3: rgba(244, 236, 220, .70);
  --sc-scrim-l: rgba(30, 21, 13, .52);
  --sc-scrim-xl: rgba(30, 21, 13, .34);
  --sc-scrim-m: rgba(30, 21, 13, .16);
  --sc-scrim-r: rgba(30, 21, 13, 0);
  --sc-scrim-b: rgba(26, 18, 11, .40);
  --sc-scrim-flat: rgba(28, 20, 12, .12);
  --sc-card: rgba(38, 27, 17, .68);
  --sc-line: rgba(244, 236, 220, .24);
  --sc-line-2: rgba(244, 236, 220, .44);
  --sc-accent: #e07a52;
  --sc-gold: #e6bb72;
  --sc-accent-soft: rgba(224, 122, 82, .16);
  --sc-rail: rgba(34, 25, 16, .80);
  --sc-nav: rgba(244, 236, 220, .86);
}

/* 影像页导航条。
   ⚠️ 关键：本页必须 position:fixed，不能沿用全站的 sticky。
   sticky 会在文档流里实占 71px 高，把 100dvh 的滚动容器整体下推 71px，
   结果是「导航条背后露body 底色的脏带」+「文档总高比视口多 71px、
   底部再露一条空白」，画面永远铺不满。fixed 后导航浮在画面之上，
   滚动容器从 y=0 起、height 正好 = 视口高，才是真正的平铺拉满。 */
.wb-sc .VPNav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--sc-rail) 62%, transparent);
  border-bottom-color: var(--sc-line);
}
.wb-sc .VPNavBarTitle,
.wb-sc .VPNavBarMenuLink { color: var(--sc-fg) !important; }
.wb-sc .VPNavBarTitle__text .vp-tx-a { color: var(--sc-fg) !important; }
.wb-sc .VPNavBarTitle__text .vp-tx-b { color: var(--sc-accent) !important; }
.wb-sc .VPNavBarTitle__mark { border-color: var(--sc-fg); }
.wb-sc .VPNavBarMenuLink:hover { color: var(--sc-accent) !important; }

/* ---------- 全屏分屏容器 ---------- */
/* 锁死文档级滚动：滚动只允许发生在 .wb-sc-scroll 内部。
   否则 html/body 自己也会滚出一段距离，导航条（fixed）与画面脱节，
   底部露body 底色。100% + overflow:hidden 是配合 fixed 导航的关键。 */
html:has(body.wb-sc),
body.wb-sc {
  height: 100%;
  overflow: hidden;
}
.wb-sc-scroll {
  position: relative;        /* 桌面端 48 屏绝对叠放，需要定位祖先 */
  width: 100%;
  max-width: 100%;
  height: 100vh;             /* 老内核 fallback（dvh 需要 Chromium 108+，搜狗等内核偏旧） */
  height: 100dvh;
  overflow: hidden;          /* 桌面端不滚动，靠叠化切换；滚动交给 wheel/touch 拦截 */
  scroll-snap-type: none;
  background: #1a1108;/* 深褐，与压暗层同族（原来用蓝黑 #0c0f11 → 阴冷的源头之一） */
}
/* 事件屏容器只做挂载点：display:contents 让里面的 section
   直接成为 scroll-snap 容器的子级，否则 snap 会失效。 */
#scEvents { display: contents; }

/* ---------- 单屏 ----------
   大典版式的关键：一屏一事件，文字块靠左、纵向居中。
   桌面端用 height（不是 min-height）锁死一屏 = 100dvh：
   min-height 允许内容把它顶高，snap 对齐就会在屏与屏之间露出缝。
   padding 上 96px 让开 fixed 导航（71px），下 104px 让开底部阶段条（60px）+ 进度轴。 */
.wb-sc-panel {
  position: absolute;       /* 桌面端：48 屏全部叠放在同一视口，靠 opacity 叠化 */
  inset: 0; top: 0; right: 0; bottom: 0; left: 0;  /* inset 老内核 fallback */
  isolation: isolate;
  width: 100%;
  max-width: 100%;
  height: 100vh;             /* 老内核 fallback */
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  /* ⚠️ 关键：覆盖全局 `assets/style.css` 的 `[id]{scroll-margin-top:96px}`。
     分屏都带 id，搜狗等浏览器若按规范兑现这条吸附边距，除首屏（不可负滚）外
     每屏都会下沉 96px、顶部露出上一屏底部 —— 表现正是「只有第一章铺满」。
     这些全屏吸附屏绝不需要锚点偏移，强制归零。 */
  scroll-margin-top: 0;
  scroll-margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 96px clamp(24px, 6vw, 110px) 134px;
  overflow: hidden;
  color: var(--sc-fg);
  /* 叠化转场：默认不可见，仅当前屏 is-active 可见；切换时 opacity 交叉淡入淡出。
     失活后 visibility 延迟 1.2s 才隐藏，保证交叉淡出期间两屏同显。
     （2026-10-17 步哥：1.2s——淡入淡出要看得出来，0.9s 偏急） */
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s ease, visibility 0s linear 1.2s;
}
/* 当前屏：立即可见并淡入；失活屏延迟隐藏 → 两屏短暂同显 = 真正的叠化 */
.wb-sc-panel.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 1.2s ease, visibility 0s;
}

/* 桌面端淡入淡出再加一档：进场屏从 98.8% 轻微放大到 100%，
   与 1.2s 透明度交叉叠加，翻屏动作一眼可辨（窄屏滑入动画在 760 内，互不干扰）。 */
@media (min-width: 761px) {
  .wb-sc-panel {
    transform: scale(.988);
    transition: opacity 1.2s ease, transform 1.4s ease, visibility 0s linear 1.2s;
  }
  .wb-sc-panel.is-active {
    transform: scale(1);
    transition: opacity 1.2s ease, transform 1.4s ease, visibility 0s;
  }
}

/* 底图层容器：同时承载「缓慢缩放的图」与「片头视频」。
   两层都绝对定位铺满，靠 z-index 叠放。 */
.wb-sc-panel__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  /* 底图按需挂载（见 sc-chronicle.js 的 syncBg）：离屏屏会卸掉 <img>，
     这一层必须先垫一张纸色，否则卸载瞬间会露出 body 的深底、闪一下黑。 */
  background: #efe6d3;
  /* 缩放动画要绕中心；动画停在 scale(1.04)，留余量免得缩小时露边 */
  transform-origin: 50% 50%;
}
/* 底图本体：用 <img> 而非 background-image —— 被 filter+transform+animation
   三重加持的 background 层，在部分真实浏览器（GPU 合成）里「首屏可见的会画、
   滚进去的离屏层不重绘」，表现就是「只有第一屏有图、后面全是空」。
   换成 replaced element（img + object-fit:cover）后合成稳定，各屏都能画出。
   scale 从 1.13 缓慢缩到 1.04，即步哥要的「从大到小慢慢缩」。 */
.wb-sc-panel__bg > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: sepia(.20) saturate(1.16) contrast(1.02) brightness(1.12);
  transform: scale(1.13);
  transform-origin: 50% 50%;
  will-change: transform;
  backface-visibility: hidden;
  animation: wb-sc-zoom 26s ease-out forwards;
}
@keyframes wb-sc-zoom {
  from { transform: scale(1.13); }
  to   { transform: scale(1.04); }
}

/* 晨雾层：暖白雾从左下漫上来，模拟清晨水汽 —— 是「提亮」不是「压暗」。 */
.wb-sc-panel__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 88% 74% at 22% 74%,
      rgba(255, 250, 236, .20) 0%,
      rgba(255, 250, 236, 0) 68%),
    radial-gradient(ellipse 70% 58% at 78% 18%,
      rgba(255, 252, 240, .12) 0%,
      rgba(255, 252, 240, 0) 70%);
}
/* 分层雾罩：左侧厚（正文靠左，要保证文字对比）、右侧透亮显画。
   变量现在装的是**米白雾**而非褐色，所以这层是在提亮而不是压暗。
   ⚠️ 2026-10-15 修正：原顶部有一条 `var(--sc-scrim-b) 0% → 22%` 的白带，
   宽屏下特别扎眼（步哥红框：导航条底下那一条空带）；
   现改为**只在底部留薄薄一层**、顶部完全透明，画面从导航条底下就显出来。
   同时整体雾量下调（见上面三套主题变量），让底图真的看得见、不再糊成一片米色。 */
.wb-sc-panel__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(255, 248, 232, 0) 0%,
      rgba(255, 248, 232, 0) 76%,
      var(--sc-scrim-b) 100%),
    linear-gradient(100deg,
      var(--sc-scrim-l) 0%,
      var(--sc-scrim-xl) 36%,
      var(--sc-scrim-m) 66%,
      var(--sc-scrim-r) 100%),
    var(--sc-scrim-flat);
}

/* 正文列 */
.wb-sc-panel__body {
  position: relative;
  width: 100%;
  max-width: 1180px;
}
/* 事件屏正文：自带一层局部**提亮**（米白雾），深色文字压在任何亮底图上都读得清。
   v6 反转了配色方向 —— 文字改深色，所以这里从「压暗」变成「加雾」。 */
.wb-sc-panel--ev .wb-sc-panel__body::before,
.wb-sc-panel--cover .wb-sc-panel__body::before,
#scTop .wb-sc-panel__body::before,
.wb-sc-coda .wb-sc-panel__body::before {
  content: "";
  position: absolute;
  inset: -7vh -7vw -7vh -4vw;
  z-index: -1;
  background: radial-gradient(ellipse 58% 54% at 28% 50%,
    rgba(255, 252, 242, .64) 0%,
    rgba(255, 250, 236, .28) 56%,
    rgba(255, 250, 236, 0) 100%);
}

/* 封面屏与概览屏：字号最大，雾要更厚才托得住深色字 */
.wb-sc-panel--cover .wb-sc-panel__bg::after,
#scTop .wb-sc-panel__bg::after {
  background:
    linear-gradient(100deg,
      var(--sc-scrim-l) 0%,
      var(--sc-scrim-xl) 44%,
      var(--sc-scrim-m) 78%,
      var(--sc-scrim-r) 100%),
    linear-gradient(to bottom,
      rgba(255, 248, 232, 0) 0%,
      rgba(255, 248, 232, 0) 76%,
      var(--sc-scrim-b) 100%),
    var(--sc-scrim-flat);
}

/* ---------- 层级① 巨幅章节名 ---------- */
.wb-sc-chapter {
  margin: 0 0 clamp(18px, 3vh, 34px);
  font-family: var(--sc-serif);
  font-size: clamp(44px, 8.4vw, 116px);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: .12em;         /* 宋体加字距＝刻本的味道 */
  color: var(--sc-fg);
  text-shadow: 0 2px 18px rgba(255, 253, 246, .92), 0 1px 3px rgba(255, 253, 246, .8);
}

/* ---------- 层级② 年份大字 ---------- */
.wb-sc-year {
  margin: 0 0 clamp(20px, 3.4vh, 40px);
  font-family: var(--sc-serif);
  font-size: clamp(30px, 4.6vw, 62px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--sc-gold);         /* 年份用藤黄（描金），不抢朱砂 */
  text-shadow: 0 2px 14px rgba(255, 253, 246, .85);
}
/* ⚠️ 原 .wb-sc-year small（印「40 条」计数的那个 <small>）已于 2026-10-17 删除 ——
   步哥「几条几条的都要去掉」。留这条注释防止以后又加回来。 */

/* ---------- 层级③ 事件屏：章名小字 + 纪年 + 粗标题 + 通栏正文 ---------- */
/* 所属阶段的提示条（大典的章节面包屑） */
.wb-sc-ev__crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 clamp(14px, 2.2vh, 24px);
  font-size: clamp(12px, 1.1vw, 14px);
  letter-spacing: .22em;
  color: var(--sc-fg-3);
}
.wb-sc-ev__crumb::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  min-width: 30px;
  background: linear-gradient(to right, var(--sc-line-2), transparent);
}

/* 纪年小字行：年号 + 干支 + 公历 */
.wb-sc-ev__when {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 14px;
  font-size: clamp(14px, 1.32vw, 18px);
  letter-spacing: .07em;
  color: var(--sc-fg-2);
}
.wb-sc-ev__gan { font-family: var(--wb-pixel); }

/* 粗体事件标题（大典第二层级，字号仅次于章节名） */
.wb-sc-ev__title {
  position: relative;
  margin: 0 0 clamp(18px, 3vh, 32px);
  max-width: 20ch;
  font-family: var(--sc-serif);
  font-size: clamp(30px, 5.4vw, 76px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--sc-fg);
  text-shadow: 0 2px 16px rgba(255, 253, 246, .90);
}

/* 通栏正文段落（大典的正文是大字号、宽行距的通栏段，不是小字注） */
.wb-sc-ev__text {
  position: relative;
  margin: 0;
  max-width: 40ch;
  font-size: clamp(16px, 1.62vw, 23px);
  line-height: 2.15;
  letter-spacing: .016em;
  color: var(--sc-fg-2);
  text-shadow: 0 1px 10px rgba(255, 253, 246, .88);
}
/* 长条目/带标记的原文加竖线，起到视觉锚的作用 */
.wb-sc-ev__text--quote {
  padding-left: 18px;
  border-left: 3px solid var(--sc-accent);
  color: var(--sc-fg);
}

.wb-sc-ev__tag {
  padding: 1px 9px;
  font-size: 11.5px;
  letter-spacing: .04em;
  font-weight: 700;
  color: var(--sc-accent);
  border: 1px solid var(--sc-accent);
  border-radius: 2px;
}

/* 章节导语（封面屏的说明文字，克制但要读得清） */
.wb-sc-lead {
  position: relative;
  margin: 0;
  max-width: 40ch;
  font-family: var(--sc-kai);
  font-size: clamp(15px, 1.55vw, 21px);
  line-height: 2.05;
  letter-spacing: .03em;
  color: var(--sc-fg);
  text-shadow: 0 1px 10px rgba(255, 253, 246, .95);
}

/* ---------- 概览屏 ---------- */
.wb-sc-top__kicker {
  margin: 0 0 10px;
  font-size: clamp(13px, 1.3vw, 16px);
  letter-spacing: .3em;
  color: var(--sc-accent);
}
.wb-sc-top__title {
  margin: 0 0 14px;
  font-family: var(--sc-serif);
  font-size: clamp(38px, 7.4vw, 104px);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--sc-fg);
  text-shadow: 0 2px 20px rgba(255, 253, 246, .92);
}
.wb-sc-top__title em {
  font-style: normal;
  color: var(--sc-accent);
  text-shadow: 0 1px 12px rgba(255, 253, 246, .95);  /* 提亮朱砂，压住艳 */
}
.wb-sc-top__sub {
  margin: 0 0 clamp(16px, 2.2vh, 24px);
  max-width: 50ch;
  font-family: var(--sc-kai);
  font-size: clamp(13.5px, 1.2vw, 16px);
  line-height: 1.95;
  letter-spacing: .02em;
  color: var(--sc-fg-2);
}
/* 概览著录：竖排标签条，不用网格卡片。两栏排布，6 项占 3 行，不挤一屏。
   行高/内外边距都收了一档 —— 原版 3 行 × 34px 把概览屏顶到 658px（超视口 105px）。 */
.wb-sc-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 4vw, 56px);
  margin: 0 0 clamp(14px, 2vh, 22px);
  padding: 2px 0;
  border-top: 1px solid var(--sc-line-2);
  border-bottom: 1px solid var(--sc-line-2);
  max-width: 1000px;
}
.wb-sc-meta__row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 4px 0;
  border-bottom: 1px solid var(--sc-line);
  min-width: 0;
}
/* 两栏各3 行，去掉每列最后一行的底线 */
.wb-sc-meta__row:nth-child(3n+2),
.wb-sc-meta__row:last-child { border-bottom: 0; }
.wb-sc-meta__k {
  flex: 0 0 5.4em;
  font-size: clamp(12px, 1.05vw, 13.5px);
  letter-spacing: .18em;
  color: var(--sc-fg-3);
}
.wb-sc-meta__v {
  font-family: var(--sc-serif);
  font-size: clamp(14px, 1.3vw, 17px);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--sc-fg);
}
.wb-sc-top__note {
  margin: 0;
  max-width: 58ch;
  font-size: clamp(12px, 1.05vw, 13.5px);
  line-height: 1.9;
  color: var(--sc-fg-3);
}

/* ---------- 末屏 ---------- */
.wb-sc-coda .wb-sc-panel__bg::after {
  background:
    radial-gradient(ellipse 66% 50% at 42% 48%,
      var(--sc-scrim-l) 0%,
      var(--sc-scrim-m) 52%,
      var(--sc-scrim-r) 100%),
    linear-gradient(to bottom,
      rgba(255, 248, 232, 0) 0%,
      rgba(255, 248, 232, 0) 76%,
      var(--sc-scrim-b) 100%),
    var(--sc-scrim-flat);
}
.wb-sc-coda__quote {
  margin: 0 0 20px;
  max-width: 26ch;
  font-family: var(--sc-serif);
  font-size: clamp(30px, 4.4vw, 58px);
  line-height: 1.56;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--sc-fg);
  text-shadow: 0 2px 18px rgba(255, 253, 246, .92);
}
.wb-sc-coda__by {
  margin: 0 0 18px;
  font-size: clamp(13px, 1.15vw, 15px);
  color: var(--sc-fg-2);
}

/* ---------- 转场：画面交叠的暖光柔化 ----------
   真正的「叠化」靠 .wb-sc-panel 的 opacity 交叉淡入淡出（见 .wb-sc-panel.is-active）。
   这里只做一抹暖光在全屏柔化铺开，作为叠化的陪衬，让两屏交接更润，不抢画面。
   不再是硬扫的卷轴白带。仍只用第 1 层，其余层 display:none。 */
.wb-sc-smoke {
  position: fixed;
  inset: 0;
  z-index: 35;
  overflow: hidden;
  pointer-events: none;
  /* 绝不能写 opacity:0 —— 父级透明会把子层整体压死。 */
}
.wb-sc-smoke span {
  position: absolute;
  inset: 0;
  opacity: 0;
  /* 叠化陪衬：一抹暖光在全屏柔化铺开（不再是硬扫的卷轴白带），不抢画面 */
  background:
    radial-gradient(ellipse 88% 72% at 50% 46%,
      rgba(255, 248, 232, .42) 0%,
      rgba(255, 246, 226, .10) 52%,
      rgba(255, 246, 226, 0) 78%);
  will-change: opacity;
}
/* 旧版卷边/纤维装饰在柔光下是多余的横条，关掉 */
.wb-sc-smoke span::before,
.wb-sc-smoke span::after { display: none; }
.wb-sc-smoke span:not(:first-child) { display: none; }
/* 卷边：贴在绢面上沿的一道亮缝 + 下方细影，做出「纸卷起来」的厚度感。 */
.wb-sc-smoke span::before {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  top: -18px;
  height: 20px;
  background: linear-gradient(to bottom,
    rgba(250, 240, 214, .95) 0%,
    rgba(214, 188, 138, .72) 40%,
    rgba(112, 86, 50, .40) 100%);
  box-shadow: 0 10px 26px rgba(52, 36, 18, .46);
}
/* 绢面纤维：极淡的横向纹理，斜向擦过时能看出是「纸」不是「雾」。 */
.wb-sc-smoke span::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .34;
  background:
    repeating-linear-gradient(90deg,
      rgba(255, 248, 226, .05) 0 2px,
      rgba(120, 92, 54, 0) 2px 6px),
    repeating-linear-gradient(0deg,
      rgba(120, 92, 54, .05) 0 1px,
      rgba(255, 248, 226, 0) 1px 9px);
}
.wb-sc-smoke span { animation-duration: 1000ms; animation-timing-function: ease-in-out; }

/* 暖光柔化铺开：0→峰值→0，配合 opacity 叠化，不做硬扫 */
@keyframes wb-smoke-a {
  0%   { opacity: 0; }
  42%  { opacity: .34; }
  100% { opacity: 0; }
}
.wb-sc-smoke.is-play span                { animation-name: wb-smoke-a; animation-fill-mode: both; }

/* ---------- 氛围：水墨飞鸟掠空 ----------
   仿《永乐大典》数字化页的「鸟从画上飞过」：几只淡墨小雀缓缓横掠、翅尖轻扇、
   上下微浮，落在晨光底图上不抢文字。分层放在面板之上、导航/阶段条之下（z=40），
   纯装饰、不挡阅读。wing/flap 用 scaleY 仿真扇翅，translateY/X 横掠，
   全部走 2D transform + opacity，避开 GPU 合成不重绘的老坑。 */
.wb-sc-birds {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}
.wb-sc-bird {
  position: absolute;
  left: 0;
  top: var(--y, 20vh);
  opacity: var(--op, .35);
  transform: scale(var(--scale, 1));
}
.wb-sc-bird--rev { transform: scale(var(--scale, 1)) scaleX(-1); }
.wb-sc-bird__fly {
  animation: wb-bird-fly var(--dur, 24s) linear var(--delay, 0s) infinite;
}
.wb-sc-bird--rev .wb-sc-bird__fly { animation-name: wb-bird-fly-rev; }
.wb-sc-bird__svg {
  display: block;
  animation: wb-bird-bob calc(var(--dur, 24s) / 6) ease-in-out var(--delay, 0s) infinite;
}
.wb-sc-bird__wings {
  transform-origin: 50% 50%;
  transform-box: fill-box;
  display: block;
  animation: wb-bird-flap var(--flap, .55s) ease-in-out infinite;
}
@keyframes wb-bird-fly {
  from { transform: translateX(-14vw); }
  to   { transform: translateX(114vw); }
}
@keyframes wb-bird-fly-rev {
  from { transform: translateX(114vw); }
  to   { transform: translateX(-14vw); }
}
@keyframes wb-bird-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}
@keyframes wb-bird-flap {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(.5); }
}

/* ---------- 长串防撑破 ---------- */
.wb-sc-meta__v,
.wb-sc-ev__era,
.wb-sc-ev__gan,
.wb-sc-ev__when,
.wb-sc-ev__crumb,
.wb-sc-coda__by { max-width: 100%; overflow-wrap: anywhere; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  /* 移动端恢复原生滚动，不做叠化（桌面端才叠放交叉淡入淡出） */
  html:has(body.wb-sc),
  body.wb-sc { height: auto; overflow: auto; }
  .wb-sc-scroll {
    position: static;
    height: auto;
    overflow: visible;
    scroll-snap-type: none;
  }
  .wb-sc-panel {
    /* ⚠️ 必须是 relative、不能是 static：底图层 .wb-sc-panel__bg 是 absolute+inset:0，
       父级一旦 static，48 个底图层会全部脱缰到「初始包含块」互相堆叠在文档原点 ——
       2026-10-16 修复，移动端实况是「首屏堆叠出一张图、往下滚动全屏无图」。
       relative 不产生文档流偏移，窄屏自然滚动与 IO 高亮均不受影响；
       滚动容器 .wb-sc-scroll 保持 static（它若 relative，inset:0 会变成整卷轴高，更糟）。 */
    position: relative;
    inset: auto;
    min-height: 0;
    height: auto;
    opacity: 1;
    visibility: visible;
    transition: none;
    padding: 96px 18px 150px;
    scroll-snap-align: none;
    justify-content: flex-start;
  }
  .wb-sc-panel__body { max-width: none; }
  /* 窄屏不再强制分屏，字号跟着放大 */
  .wb-sc-ev__title { font-size: clamp(24px, 8.2vw, 36px); max-width: none; }
  .wb-sc-ev__text { max-width: none; font-size: clamp(15px, 4.3vw, 18px); }
  .wb-sc-ev__text--quote { padding-left: 14px; }
  /* 章节名不能被下方阶段条切掉 */
  .wb-sc-chapter { padding-bottom: 6px; }
  .wb-sc-chapter,
  .wb-sc-top__title { font-size: clamp(38px, 13vw, 62px); }
  .wb-sc-year { font-size: clamp(26px, 8.6vw, 40px); }

  /* 概览著录两栏在窄屏放不下 → 回退单栏 */
  .wb-sc-meta { grid-template-columns: minmax(0, 1fr); max-width: none; }
  .wb-sc-meta__row:nth-child(3n+2) { border-bottom: 1px solid var(--sc-line); }
  .wb-sc-meta__row:last-child { border-bottom: 0; }
  .wb-sc-meta__k { flex: 0 0 4.6em; }

  /* 手机端关强制分屏后卷轴压时长 */
  .wb-sc-smoke span { animation-duration: 900ms; }
}

@media (prefers-reduced-motion: reduce) {
  .wb-sc-scroll { scroll-behavior: auto; }
  .wb-sc-smoke { display: none; }
  .wb-sc-birds { display: none; }
  .wb-sc-panel { opacity: 1 !important; visibility: visible !important; transition: none !important; }
}
/* ========== 右侧滚动字幕（县志编年要目，向上循环，仅桌面端） ==========
   落在正文列右侧的空白留白上：纯文字，无卡片框、无标题栏、无分组底色、无雾。
   ⚠️ 步哥原话「把右边的字号变大一些，白雾底色去掉」——已照做，理由见下方 .wb-sc-ticker 注释。 */
.wb-sc-ticker {
  position: fixed;
  top: 17vh;
  bottom: 17vh;
  /* ⚠️ 步哥 2026-10-16 定位置：拿他的截图对页面底图做零均值归一化互相关
     （ncc=0.957, scale=0.75）定位出他框的那块城墙画面 → 目标区 x=1104 w=436。
     ⚠️ 这里必须**写死宽 436px**，不能用 calc(100% - 436px)：
     那样算出来是 1920-436=1484，取 max 后又落回右边，等于没挪。
     视口窄于 1540px 时（1104+436），left:min(1104px, …) 让它贴左边、宽度靠 right 收，
     1180px 以下整条隐去（有原生滚动版式兜底）。
     正文真实墨迹最右缘只有 1140（且仅首屏一处，p90 才 647），
     事件屏正文都是左对齐短行，1104 起不压字。 */
  /* 步哥 2026-10-17：整体右移 10cm（CSS 1cm=37.795px → 10cm=377.95px），
     落点 1104+378=1482。min() 的第二项是安全闸：视口窄于 1954px 时不让它
     顶到屏幕右缘（1920 实测会只剩 2px 余量，字会贴边），退到 100%-470px。 */
  left: min(calc(1104px + 10cm), calc(100% - 594px));
  /* 宽 560（原 490 → 步哥 2026-10-17「显示全」后加宽）。
   三列实测：年份 44 + 纪年最宽 159 + 事件名 11 字 × 23.5px(1.12em) = 258
   + 两个 1.1em 间距 46 = 507px，原 490 装不下，超出 ~20px 的条目就被裁。
   加宽到 560 后余 53px 富余。
   ⚠️ 左边落点不变（1482px），所以右缘推到 2042px 之外了 —— 配套把 left 的
     第二项从 calc(100% - 524px) 改成 calc(100% - 594px)，两者同步，右缘留白仍是 34px。 */
  width: 560px;
  max-width: calc(100% - 2.5vw);
  z-index: 41;                /* 在面板之上 */
  overflow: hidden;
  pointer-events: none;       /* 不拦滚轮，字幕照常随屏切换 */
  /* 无雾（步哥 2026-10-16：「白雾底色去掉」）：底图右侧实测 p05=141 / p50=204，
     最暗处也远高于文字，深色字对比度 4.45~10.55，不需要雾托底。
     仍保留上下 mask 淡出，让首尾两条不是硬切进出的。 */
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
}

.wb-sc-ticker__list {
  position: absolute;
  left: 0; right: 0; top: 0;
  /* ⚠️ 这行不能少：下面 padding 的 3em/.6em 是按**本元素**的 font-size 换算的，
     不在此声明就会退回继承的 16px —— 字号放大到 21px 后「留三个字」只剩 2.3 个字。 */
  font-size: clamp(15px, 1.35vw, 21px);
  /* ⚠️ 左内缩 3em → 1.6em（2026-10-17）：原值在 21px 下就是 63px，等于事件名
     的 5.5 个字宽度，而步哥要求「显示全」。右内缩 .6em 保留（防最宽那条顶到容器缘）。 */
  padding: 0 .6em 0 1.6em;
  animation: wb-sc-tick 96s linear infinite;
  will-change: transform;
}
.wb-sc-ticker:hover .wb-sc-ticker__list { animation-play-state: paused; }
@keyframes wb-sc-tick { from { transform: translateY(0); } to { transform: translateY(-50%); } }

/* 一条 = 纪年 + 年号 + 事件名，一行排开，字距松，整条看下去像字幕。
   ⚠️ 2026-10-16 字号 16px → 21px（步哥要求变大）：容器放宽到 ~475px 后，
   最宽一条实测 249px@16px → 327px@21px，加左内缩 63px 仍余 85px 富余。 */
.wb-sc-ticker__item {
  display: flex;
  align-items: baseline;
  /* 三列间距（纪年 · 年号 · 事件名）。2026-10-17 步哥要求加大：.8em → 1.6em；
     同日又要求「显示全」—— 每条 2 个 gap 在 21px 下就是 67px，直接吃掉事件名的
     预算，所以折中到 1.1em（每条 46px），视觉上仍明显宽于原来的 .8em。 */
  gap: 1.1em;
  padding: .52em 0;
  font-family: var(--sc-fangsong);
  line-height: 1.5;   /* font-size 继承自 __list，与 padding 的 em 同步 */
  letter-spacing: .04em;
  color: #2b1f14;
  /* 一条必须一行排开：曾因净宽不足把事件名压成竖排单字 */
  white-space: nowrap;
  /* 步哥 2026-10-16：去掉白边（text-stroke），改一层浅浅的暖褐阴影。
     ⚠️ 2026-10-17 再把阴影压淡一半：底图右侧本身就亮（p05=141），
     深色投影在亮底上会把字「加粗」，正是步哥嫌「最右边字太暗」的另一半原因。 */
  text-shadow:
    0 1px 2px rgba(74, 48, 20, .13),
    0 0 1px rgba(74, 48, 20, .09);
}
.wb-sc-ticker__yr {
  flex: 0 0 auto;
  font-weight: 400;
  color: #8a5a1e;            /* 藤黄：纪年，2026-10-17 由 #7a4c0d 提亮 */
  font-variant-numeric: tabular-nums;
}
.wb-sc-ticker__era {
  /* ⚠️ 2026-10-17 步哥「结尾是这些符号或者显示不全的」：原来 max-width 9.5em 配
     ellipsis，纪年被截成「清咸丰四年～七…」，同时又吃掉事件名的宽度预算
     （净宽 490 − 左内缩 63 − 间距 67 − 年份 44 − 纪年 100 ≈ 113px，只够 5 个字）。
     现在纪年不再截（靠 nowrap 让它按内容宽度自适应，最长「清咸丰四年～七年」9 字
     ≈ 128px），同时把事件名字号提到 1.12em，三列总宽重新算得下 11 字。 */
  flex: 0 0 auto;
  font-size: .8em;
  color: rgba(70, 54, 38, .72);
}
.wb-sc-ticker__ttl {
  /* ⚠️ 这里原来写 font-weight:700，2026-10-17 必须去掉 ——
     朱雀仿宋（ZhuqueFangsong-Regular.ttf）实测 OS/2 usWeightClass=400、
     无 fvar 轴、无 Bold 面，浏览器只能「合成加粗」：把已经够细的仿宋笔画
     横向糊开 1px，21px 下相邻笔画粘连 → 事件名变成一坨黑块，
     正是步哥说的「最右边字太暗」。
     层级改用「字号 1.12em + 居中的墨色」来表达，不再靠粗细。
   ⚠️ 2026-10-17 步哥「结尾是这些符号或者显示不全的，要么显示全，要么精简」：
     ellipsis 保留**仅作最后兜底**，目标是永不触发 —— 事件名已在数据层由
     tidyTitle() 压到 11 字以内、且不落在标点上。字号 1.06em → 1.12em，
     把让给纪年/间距/左内缩的宽度补回来。 */
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
  font-size: 1.12em;
  color: #241a10;
  white-space: nowrap;
}

/* 留白不够就不显示；窄屏另有原生滚动版式 */
@media (max-width: 1180px) { .wb-sc-ticker { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .wb-sc-ticker__list { animation: none; }
}

/* 事件出处：卷里每条都带志书出处，压在正文下方 */
.wb-sc-ev__src {
  margin: 14px 0 0;
  font-size: 12px;
  letter-spacing: .04em;
  opacity: .5;
}

/* ⚠️ 这里原来有一整节「换卷条」样式（.wb-sc-vols / .wb-sc-vol）+ 它带来的
   面板 padding-top:150px 占位，2026-10-17 按步哥要求整条去掉了。
   长卷是沉浸式一屏一节阅读，顶部不再挂任何常驻控件；
   卷与卷之间由方志枢纽页十张书目卡各自进入。
   面板顶部留白沿用基础版的 96px（导航 71px + 25px 间隙）。 */

/* 窄屏概览事实表：桌面是 2 栏 × 3 行，390px 下 2 栏会把标签压成竖排单字
   （.wb-sc-meta__k 的 flex-basis 5.4em 在半栏宽里放不下四字标签）→ 降为单栏。 */
@media (max-width: 760px) {
  .wb-sc-meta { grid-template-columns: 1fr; }
  .wb-sc-meta__row:nth-child(2n+1) { border-bottom: 1px solid var(--sc-line); }
  .wb-sc-meta__row:last-child { border-bottom: 0; }
  .wb-sc-meta__k { flex: 0 0 4.6em; }
}

/* 标签竖排的根因：.wb-sc-meta__k 的 flex-basis 用 em 定宽，四字标签在窄屏放不下就
   被 flex 压到一字宽、CJK 逐字换行成竖排。nowrap + auto 基准即可（标签最长四字，
   不需要固定宽度，值列自己吃掉剩余空间）。 */
@media (max-width: 760px) {
  .wb-sc-meta__k { flex: 0 0 auto; white-space: nowrap; }
  .wb-sc-meta__row { gap: 10px; }
}

/* ========== 手机版：自动播放长卷（页面自己往上滚）==========
   步哥 2026-10-17：「编年长卷在手机上显示真难看，可以重新设计手机版页面，
   页面自动向上滚动」。

   诊断：窄屏原来落回「原生长滚动」——一屏一节的沉浸式版式被拉成普通
   网页，48 屏顺序平铺、每次只看得到半屏、右侧要目整条隐藏，
   步哥截图里正是这种「又长又碎」的观感。

   重设计：窄屏改回桌面那套「全屏叠放 + 交叉淡入」，但**不再等用户操作**，
   由 JS 定时自动翻屏；每屏从下方 8vh 滑入并淡入 → 视觉上就是
   「页面自己一段段往上滚」。配一条总进度轴 + 一个暂停/计数 HUD。

   🔑 渐进增强（关键）：本节的开关是 JS 给 <html> 加的 `wb-sc-autoplay`。
      · 无 JS /  prefers-reduced-motion: reduce / 视口被拉到桌面
        → 不加此类，落回上面 760px 那段原生滚动版，绝不白屏。
      · 因此本节所有选择器都带 `html.wb-sc-autoplay` 前缀，
        特异性压过上方的原生滚动回退，且排在文件末尾，双保险。 */
@media (max-width: 760px) {
  /* --- 1) 解锁桌面那套全屏叠放 --- */
  html.wb-sc-autoplay:has(body.wb-sc),
  html.wb-sc-autoplay body.wb-sc { height: 100%; overflow: hidden; }

  html.wb-sc-autoplay .wb-sc-scroll {
    position: relative;
    height: 100dvh;
    overflow: hidden;
  }

  /* --- 2) 单屏：绝对叠放 + 从下方滑入（= 往上滚）---
     padding 让开 fixed 导航（71px）与底部 HUD；env(safe-area-inset-*)
     兜住刘海/手势条机型。 */
  html.wb-sc-autoplay .wb-sc-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8vh);
    transition: opacity .5s ease,
                transform .72s cubic-bezier(.22, .61, .36, 1),
                visibility 0s linear .5s;
    padding: calc(71px + env(safe-area-inset-top, 0px) + 16px) 20px
             calc(84px + env(safe-area-inset-bottom, 0px));
    justify-content: center;
    scroll-snap-align: none;
    /* 底图缩放动画在手机上 94 层同跑太贵：只让当前屏跑 */
    animation: none;
  }
  html.wb-sc-autoplay .wb-sc-panel.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .5s ease,
                transform .72s cubic-bezier(.22, .61, .36, 1),
                visibility 0s;
  }
  /* 失活屏的底图停帧（省 GPU）：只有当前屏的图在缓缩 */
  html.wb-sc-autoplay .wb-sc-panel:not(.is-active) .wb-sc-panel__bg > img {
    animation-play-state: paused;
  }
  /* 正文列：手机上不吃桌面那套 max-width，通栏更好读 */
  html.wb-sc-autoplay .wb-sc-panel__body { max-width: none; }

  /* --- 3) 顶部总进度轴 --- */
  html.wb-sc-autoplay #scAuto {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 60;
    pointer-events: none;
  }
  html.wb-sc-autoplay #scAuto__bar {
    height: 3px;
    background: color-mix(in srgb, var(--sc-fg) 14%, transparent);
  }
  html.wb-sc-autoplay #scAuto__fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--sc-accent);
    transition: width .45s ease;
  }

  /* --- 4) 底部 HUD：暂停键 + 计数 + 提示 ---
     #scAuto 容器是 pointer-events:none 的定位骨架，
     只有 HUD 自己收回指针事件（auto），否则整条会挡住「轻点画面暂停」。 */
  html.wb-sc-autoplay #scAuto__hud {
    position: fixed;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 60;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--sc-rail) 78%, transparent);
    border: 1px solid var(--sc-line);
    box-shadow: 0 6px 20px rgba(20, 12, 6, .18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--sc-fg);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
  }
  html.wb-sc-autoplay #scAuto__btn {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--sc-accent);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    flex: 0 0 auto;
  }
  html.wb-sc-autoplay #scAuto__btn:active { transform: scale(.94); }
  html.wb-sc-autoplay #scAuto__pos { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
  html.wb-sc-autoplay #scAuto__pos b { font-weight: 600; }
  /* 提示语：出现几秒后淡出（JS 控制 .is-dim） */
  html.wb-sc-autoplay #scAuto__hint {
    color: var(--sc-fg-3);
    font-size: 12px;
    transition: opacity .6s ease;
  }
  html.wb-sc-autoplay #scAuto__hint.is-dim { opacity: 0; }

  /* --- 5) 终屏：放完不循环，HUD 里给一个「再看一遍」--- */
  html.wb-sc-autoplay #scAuto__replay {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    border: 1px solid var(--sc-line-2);
    background: transparent;
    color: var(--sc-fg);
    font-size: 12px;
    padding: 5px 11px;
    border-radius: 999px;
    flex: 0 0 auto;
  }
  html.wb-sc-autoplay #scAuto__replay[hidden] { display: none; }

  /* --- 6) 烟雾/飞鸟在手机上减规模（小屏上大面积白雾太糊）--- */
  html.wb-sc-autoplay .wb-sc-smoke span { animation-duration: 820ms; }
  html.wb-sc-autoplay .wb-sc-birds { display: none; }

  /* --- 7) 沉浸式 reel 不放站点五联底栏 ---
     两个理由：① 底部只留「进度轴 + 暂停 HUD」一条控件，才是步哥要的沉浸感
     （他一贯反感本页出现常驻控件）；② .wb-mnav 里那个主题转盘跟头部主题开关
     重复，两个都能切主题只会让人犯糊。
     导航不受影响：头部汉堡里是全站入口。用户在系统设置里开「减少动效」→
     JS 不加 wb-sc-autoplay → 本条不生效，底栏自动回来。 */
  html.wb-sc-autoplay .wb-mnav { display: none !important; }
  /* 顺带撤掉 app.js 为底栏预留的 body 内边距（本页滚动容器是 100dvh，
     留着只会把文档顶高 72px 再被 overflow:hidden 切掉） */
  html.wb-sc-autoplay.wb-has-mnav body.wb-sc { padding-bottom: 0; }
}

/* 减少动效：连自动播放也不给（落回原生滚动版，由 JS 判断后不加开关类） */
@media (prefers-reduced-motion: reduce) {
  html.wb-sc-autoplay #scAuto { display: none; }
}

/* ========== 2026-10-17 手机版封面修补（步哥复检「还是不行」） ==========
   三件事：
   ① 全局禁掉手机浏览器「字体自动放大」（安卓微信 X5 / font boosting）——
      不禁的话正文块被强制放大、顶出容器，右侧整列裁字；
   ② 封面标题孤字换行治理：7-8 字标题（吳房三易一縣名 / 天中古郡汝寧名府）
      在 390 宽下按旧字号 50.7px 放不下，「名」字孤行——收紧到 clamp(28,10vw,42)
      后 7-8 字整行放下；最长 9 字（一部縣志裡的三千年）用 text-wrap:balance
      平衡成 5/4 两行，不再孤字；
   ③ 压掉标题背后那团 20px 白雾光晕（.92 透明度在手机上糊成一片），手机上
      收成 10px / .55，字口重新立起来。 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (max-width: 760px) {
  .wb-sc-top__title {
    font-size: clamp(28px, 10vw, 42px);
    line-height: 1.24;
    letter-spacing: .08em;
    text-wrap: balance;
    text-shadow: 0 1px 10px rgba(255, 253, 246, .55);
  }
  .wb-sc-top__title em {
    text-shadow: 0 1px 8px rgba(255, 253, 246, .6);
  }
  /* 导语在手机上放宽一点、行距松一档（原 13.5px 偏挤） */
  .wb-sc-top__sub { font-size: 15px; line-height: 2.05; }
  /* 尾注同步放宽半档 */
  .wb-sc-top__note { font-size: 12.5px; line-height: 1.95; }
  /* 墨色暗底上白雾光晕=糊字，直接去掉 */
  html.ink .wb-sc-top__title,
  html.ink .wb-sc-top__title em { text-shadow: none; }
}

/* ============================================================
   2026-10-17 步哥二改（手机自动播放模式）：
   ① 去掉底部播放控制条（#scAuto__hud：暂停键+计数+提示一整条）——
      轻点画面暂停、滑一屏翻页、顶部 3px 进度轴都保留；
      自动播完刷新页面即可重看。
   ② 恢复站点手机底栏 .wb-mnav（五联导航）：覆盖上方 1003 行的
      display:none。body 预留内边距维持 0（本页滚动容器是 100dvh，
      加了会把文档顶出视口）；底栏是 fixed 悬浮，面板自身
      padding-bottom 84px 足够让末行文字不被压住。
   ============================================================ */
@media (max-width: 760px) {
  html.wb-sc-autoplay #scAuto__hud { display: none !important; }
  html.wb-sc-autoplay .wb-mnav { display: grid !important; }
}

/* ============================================================
   2026-10-17 步哥三改（手机自动播放切换特效）：
   「上滑入」改「叠化」（crossfade）——新屏原地淡入盖住旧屏，
   无任何位移，两屏画面互相融合，不易察觉切换点。
   实现：去掉 translateY(8vh)；淡化从 .5s 放慢到 1.1s ease-in-out
   （旧屏同步延迟 1.1s 再藏，双方同窗交融）。桌面与原生滚动版
   不受影响（仍只在 760px 自动播放媒体查询内）。
   ============================================================ */
@media (max-width: 760px) {
  html.wb-sc-autoplay .wb-sc-panel {
    transform: none;
    transition: opacity 1.1s ease-in-out,
                visibility 0s linear 1.1s;
  }
  html.wb-sc-autoplay .wb-sc-panel.is-active {
    transform: none;
    transition: opacity 1.1s ease-in-out,
                visibility 0s;
  }
}

/* ============================================================
   2026-10-17 步哥四改（手机阶段屏/尾声屏字体层级重设计）：
   原 13vw 的章节大字太重、年代数字 8.6vw 粗体跟它打架，整体「文档感」。
   改按博物馆图版思路重排层级：
   ① 章节名收敛到 8.2vw/字重 600/字距 .14em/平衡换行——留白多、刻本味；
   ② 年代改「图版标注」式：小一号细体 + .3em 大字距 + 前缀一段藤黄细线
      （display:flex + ::before），数字像展签年代注，不再与标题抢戏；
   ③ 「标题+年代」成组（间距收紧），与导语拉开（16px）。
   阶段屏与尾声屏共用 .wb-sc-chapter/.wb-sc-year，一并统一。
   ============================================================ */
@media (max-width: 760px) {
  .wb-sc-chapter {
    font-size: clamp(27px, 8.2vw, 34px);
    font-weight: 600;
    line-height: 1.34;
    letter-spacing: .14em;
    text-wrap: balance;
    margin-bottom: 10px;
  }
  .wb-sc-year {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(15px, 4.4vw, 19px);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: .3em;
    margin-bottom: 16px;
  }
  .wb-sc-year::before {
    content: '';
    flex: 0 0 30px;
    height: 1px;
    background: var(--sc-gold);
    opacity: .75;
  }
  .wb-sc-lead { margin-top: 2px; }
}

/* ------------------------------------------------------------
   2026-10-17 步哥四改续（事件屏与图版风格统一）：
   事件标题同为「大字层级」——字重与章节名一致降 600、字距 .12em、
   平衡换行；纪年行与展签年代呼应（小一号、字距 .14em）。
   ------------------------------------------------------------ */
@media (max-width: 760px) {
  .wb-sc-ev__title {
    font-size: clamp(24px, 8vw, 34px);
    font-weight: 600;
    letter-spacing: .12em;
    line-height: 1.36;
    text-wrap: balance;
  }
  .wb-sc-ev__when {
    font-size: clamp(13px, 3.6vw, 15px);
    letter-spacing: .14em;
  }
}

/* ============================================================
   夜主题（ink）文字适配 —— 2026-10-17 步哥「夜间模式下文字太刺眼」
   根因：全套文字设计是 v6「深色字 + 白雾提亮」时代的产物：
     ① 正文背后的雾晕是硬编码亮米白（rgba(255,252,242,.64)），ink 亮字压在白雾上=眩光；
     ② 各级文字的发光阴影硬编码近白色（rgba(255,253,246,.8~.95)），夜模式里像描了圈白光；
     ③ 底图晨雾层也是硬编码暖白。
   修法（只动 html.ink，亮色古纸主题不受影响）：
     雾晕反转为深色（保对比、不眩光）；白光改为柔和深色投影；晨雾层去掉。
   ============================================================ */
html.ink .wb-sc-panel--ev .wb-sc-panel__body::before,
html.ink .wb-sc-panel--cover .wb-sc-panel__body::before,
html.ink #scTop .wb-sc-panel__body::before,
html.ink .wb-sc-coda .wb-sc-panel__body::before {
  background: radial-gradient(ellipse 58% 54% at 28% 50%,
    rgba(16, 10, 5, .60) 0%,
    rgba(16, 10, 5, .28) 56%,
    rgba(16, 10, 5, 0) 100%);
}
html.ink .wb-sc-panel__bg::before { content: none; }  /* 晨雾层=暖白，夜模式整层去掉 */
html.ink .wb-sc-chapter,
html.ink .wb-sc-year,
html.ink .wb-sc-ev__title,
html.ink .wb-sc-ev__text,
html.ink .wb-sc-ev__text--quote,
html.ink .wb-sc-lead,
html.ink .wb-sc-top__title,
html.ink .wb-sc-top__title em,
html.ink .wb-sc-coda__quote {
  text-shadow: 0 2px 14px rgba(8, 5, 2, .55);
}
/* 出处小字在夜模式下提回一档透明度（原 .5 压在深雾上几乎看不见） */
html.ink .wb-sc-ev__src { opacity: .66; }

/* ============================================================
   桌面端自动播放控件 —— 2026-10-17 步哥「电脑也要自动切换」
   手机版控件样式在上方 max-width:760px 媒体查询里；桌面翻屏本就
   是叠放交叉淡入（showPanel 直接可用），这里只需给同一套 DOM
   （#scAuto 进度轴 + 暂停 HUD）补桌面形态：
   进度轴同样固定顶部 3px，HUD 收到右下角小药丸，不挡正文。
   ============================================================ */
@media (min-width: 761px) {
  /* reel 接管滚动：禁掉原生滚动条，只留滚轮切屏（切屏即接管暂停） */
  html.wb-sc-autoplay .wb-sc-scroll { overflow: hidden; }
  html.wb-sc-autoplay #scAuto {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 60;
    pointer-events: none;
  }
  html.wb-sc-autoplay #scAuto__bar {
    height: 3px;
    background: color-mix(in srgb, var(--sc-fg) 12%, transparent);
  }
  html.wb-sc-autoplay #scAuto__fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--sc-accent);
    transition: width .45s ease;
  }
  html.wb-sc-autoplay #scAuto__hud {
    position: fixed;
    right: 22px;
    bottom: 18px;
    z-index: 60;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 12px 6px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--sc-rail) 80%, transparent);
    border: 1px solid var(--sc-line);
    box-shadow: 0 6px 20px rgba(20, 12, 6, .18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--sc-fg);
    font-size: 12.5px;
    line-height: 1;
    white-space: nowrap;
  }
  html.wb-sc-autoplay #scAuto__btn {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--sc-accent);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 0;
    flex: 0 0 auto;
  }
  html.wb-sc-autoplay #scAuto__btn:hover { filter: brightness(1.08); }
  html.wb-sc-autoplay #scAuto__pos { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
  html.wb-sc-autoplay #scAuto__pos b { font-weight: 600; }
  html.wb-sc-autoplay #scAuto__hint {
    color: var(--sc-fg-3);
    font-size: 12px;
    transition: opacity .6s ease;
  }
  html.wb-sc-autoplay #scAuto__hint.is-dim { opacity: 0; }
  html.wb-sc-autoplay #scAuto__replay {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    border: 1px solid var(--sc-line-2);
    background: transparent;
    color: var(--sc-fg);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    flex: 0 0 auto;
  }
  html.wb-sc-autoplay #scAuto__replay[hidden] { display: none; }
}




/* ---------- 背景音乐（古琴《陽關三疊》，轻微、循环；2026-10-17） ----------
   步哥同日再改：不要播放按钮，纯背景乐，无任何可见控件（纯 <audio loop>，无样式）。 */
