/* 古画 · 字解码 · 褚遂良《阴符经》
 * 形态：卷轴 + 竖排 + 单例释文面板
 *
 * 卷轴解剖：
 *   .scroll               外框
 *     .scroll__rod--top   天杆（深木轴）
 *     .scroll__silk--top  天头（米色绫绢）
 *     #yfj.yfj            画心（vertical-rl 横滚）
 *     .scroll__silk--bot  地头
 *     .scroll__rod--bot   地杆
 */

:root {
  --ink: #1a1714;
  --ink-soft: #44403c;
  --ink-faint: #8c8580;
  --paper: #f5f1ea;
  --paper-warm: #ede6d8;
  --paper-aged: #e8dcc4;       /* 画心：陈年宣纸 */
  --silk: #c9a876;             /* 天地头：浅金绫绢 */
  --silk-deep: #a8865a;        /* 绫绢深色 */
  --rod: #3a2817;              /* 木轴 */
  --rod-light: #5c3f24;
  --rule: #c8bfb0;
  --accent: #8b1a1a;            /* 朱砂红 */
  --accent-deep: #6b1313;
  --max-width: 880px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-feature-settings: "palt", "kern";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  overflow-wrap: break-word;
  /* 卷轴用 calc(50% - 50vw) 撑满视口宽度，防止它把 body 撑出额外横滚 */
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
a:hover { text-decoration-color: var(--accent); }

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) clamp(20px, 5vw, 48px) 96px;
}

/* ----- 标题区 ----- */
.masthead {
  text-align: center;
  margin-bottom: clamp(48px, 8vh, 96px);
}
.kicker {
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 16px;
}
.title {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0 0 12px;
  line-height: 1.2;
}
.subtitle {
  font-size: clamp(14px, 1.6vw, 17px);
  color: var(--ink-soft);
  font-style: italic;
  margin: 0;
  line-height: 1.6;
}

/* ----- 散文 ----- */
.essay {
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.85;
  color: var(--ink-soft);
  margin: 0 auto clamp(32px, 6vh, 64px);
  max-width: 680px;
}
.essay p {
  margin: 0 0 1.2em;
  text-align: justify;
  hyphens: auto;
}
.essay .lede {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.75;
}
.essay strong { color: var(--ink); font-weight: 700; }
.essay--after { margin-top: clamp(48px, 8vh, 96px); }

/* ============================================
   卷轴外框
   ============================================ */

.scroll {
  margin: clamp(32px, 6vh, 64px) calc(50% - 50vw);  /* 撑满视口宽度 */
  max-width: 100vw;
  position: relative;
  filter: drop-shadow(0 16px 32px rgba(58, 40, 23, 0.18));
  /* 让面板的 backdrop-filter 不被外层 filter 吞掉时仍能正常工作 */
  isolation: isolate;
}

/* 天杆 / 地杆：木轴 */
.scroll__rod {
  height: 14px;
  background:
    linear-gradient(180deg,
      var(--rod-light) 0%,
      var(--rod) 30%,
      #1f1409 50%,
      var(--rod) 70%,
      var(--rod-light) 100%);
  position: relative;
  box-shadow:
    inset 0 1px 2px rgba(255, 220, 180, 0.15),
    inset 0 -1px 2px rgba(0, 0, 0, 0.4);
}
/* 轴头：左右两个圆形端帽 */
.scroll__rod::before,
.scroll__rod::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%,
      #6b4825 0%,
      var(--rod) 40%,
      #1f1409 90%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.scroll__rod::before { left: -8px; }
.scroll__rod::after { right: -8px; }

/* 天头 / 地头：浅金绫绢 */
.scroll__silk {
  height: 28px;
  background:
    linear-gradient(180deg,
      var(--silk-deep) 0%,
      var(--silk) 20%,
      var(--silk) 80%,
      var(--silk-deep) 100%);
  position: relative;
}
/* 绫绢的暗纹：横向细条 */
.scroll__silk::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg,
      rgba(0, 0, 0, 0.04) 0 1px,
      transparent 1px 6px);
  pointer-events: none;
}

/* ============================================
   画心：竖排横滚
   ============================================ */

.yfj {
  position: relative;  /* 字位浮层的定位锚 */
  background: var(--paper-aged);
  /* 宣纸纹理：径向斑驳 */
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(139, 100, 60, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(139, 100, 60, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(58, 40, 23, 0.03) 0%, transparent 60%);
  padding: clamp(28px, 4vw, 48px) clamp(20px, 4vw, 40px);
  /* 竖排 + 横向滚动 */
  writing-mode: vertical-rl;
  -webkit-writing-mode: vertical-rl;
  /* 用物理 height 设定列的最大高度。
     vertical-rl 里 block-size = 物理 width，不要混淆。 */
  height: clamp(440px, 60vh, 640px);
  /* max-width 必须显式给 —— 否则在 vertical-rl 下 block-size:auto
     会让容器宽度被内容撑成 3000+px，整页横向溢出，scroll 永远不触发 */
  max-width: 100vw;
  overflow-x: auto;
  overflow-y: hidden;
  /* 上下边缘的暗纹 */
  box-shadow:
    inset 0 12px 24px -12px rgba(58, 40, 23, 0.25),
    inset 0 -12px 24px -12px rgba(58, 40, 23, 0.25);
  scroll-behavior: smooth;
}
/* 滚动条：低调 */
.yfj::-webkit-scrollbar { height: 6px; }
.yfj::-webkit-scrollbar-track { background: transparent; }
.yfj::-webkit-scrollbar-thumb {
  background: var(--silk-deep);
  border-radius: 3px;
  opacity: 0.5;
}

/* 引首：标题 + 印章
   block 元素在 vertical-rl 容器里，每个 block 自动成为一列。
   要让印章和标题在"同一列内（标题上、印章下）"，
   印章必须 absolute 定位，否则它会被推成下一列。 */
.yfj-heading {
  display: block;
  position: relative;
  margin-left: clamp(24px, 3.5vw, 48px);
  padding-left: clamp(14px, 2vw, 22px);
  border-left: 1px solid rgba(58, 40, 23, 0.18);
  height: 100%;
  /* 列宽至少要容纳印章 */
  min-width: clamp(50px, 5.5vw, 64px);
}
.yfj-heading__title {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.15em;
  line-height: 1.6;
}
.yfj-heading__seal {
  /* 横排方块，绝对定位到 heading 列底部居中 */
  position: absolute;
  bottom: clamp(8px, 1.5vh, 16px);
  left: 50%;
  transform: translateX(-50%);
  writing-mode: horizontal-tb;
  -webkit-writing-mode: horizontal-tb;
  width: clamp(38px, 4.2vw, 50px);
  height: clamp(38px, 4.2vw, 50px);
  background: var(--accent);
  color: #fff8f0;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px rgba(255, 248, 240, 0.3);
  filter: contrast(1.1) saturate(1.1);
}

/* 篇章分隔（上 / 中 / 下） */
.yfj-part {
  display: block;
  margin-left: clamp(14px, 2vw, 24px);
  padding: 0 clamp(8px, 1vw, 14px);
  font-size: clamp(13px, 1.4vw, 15px);
  color: var(--ink-faint);
  letter-spacing: 0.4em;
  height: 100%;
  border-left: 1px dashed rgba(58, 40, 23, 0.2);
  border-right: 1px dashed rgba(58, 40, 23, 0.2);
}

/* 一句 = 一列（如果太长会自动换次列） */
.yfj-col {
  display: block;
  margin-left: clamp(8px, 1.4vw, 18px);
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.65;
  color: var(--ink);
  letter-spacing: 0.05em;
}

/* 单字 */
.yfj-ch {
  display: inline;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
  border-radius: 2px;
  padding: 1px 2px;
}
.yfj-ch:hover {
  color: var(--accent);
  background: rgba(139, 26, 26, 0.08);
}
.yfj-ch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.yfj-ch--active {
  color: var(--accent);
  background: rgba(139, 26, 26, 0.14);
  font-weight: 500;
  box-shadow: 0 0 0 1px rgba(139, 26, 26, 0.3);
}

.yfj-pun {
  color: var(--ink-faint);
}

/* 字位上的笔顺动画浮层 —— 跟着字滚动 */
.yfj-stroke-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  /* 强制横排，否则会继承 .yfj 的 vertical-rl 把 SVG 的内部 layout 拧歪 */
  writing-mode: horizontal-tb;
  -webkit-writing-mode: horizontal-tb;
  /* 衬底：半透明朱砂晕染，模拟印泥渗开 */
  background: radial-gradient(
    circle at center,
    rgba(245, 235, 215, 0.85) 0%,
    rgba(245, 235, 215, 0.6) 50%,
    rgba(245, 235, 215, 0) 78%
  );
  border-radius: 50%;
  animation: yfj-overlay-in 0.32s ease-out;
}
@keyframes yfj-overlay-in {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

/* 拖尾 */
.yfj-tail {
  display: block;
  margin-left: clamp(20px, 2.5vw, 36px);
  padding-right: clamp(14px, 2vw, 22px);
  border-right: 1px solid rgba(58, 40, 23, 0.18);
  height: 100%;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.3em;
}

/* ============================================
   释文面板：浮层吸附在画心底部，沉浸不离场
   ============================================ */

.yfj-panel {
  position: absolute;
  /* 上下避开天杆/地杆/绫绢，吸在画心底部
     右侧给印章列留位置（避免遮住朱砂印） */
  left: clamp(32px, 6vw, 80px);
  right: clamp(96px, 12vw, 160px);
  bottom: calc(14px + 28px + clamp(20px, 3vh, 36px));  /* rod + silk + gap */
  /* 半透明宣纸 + 背景模糊：上方文字隐约可见，沉浸感保住 */
  background: rgba(245, 235, 215, 0.94);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
  backdrop-filter: blur(8px) saturate(1.05);
  border: 1px solid rgba(58, 40, 23, 0.25);
  border-left: 3px solid var(--accent);
  box-shadow:
    0 -8px 24px -8px rgba(58, 40, 23, 0.18),
    0 4px 12px rgba(58, 40, 23, 0.12);
  /* 不设 max-height / 不滚动 —— 让面板按内容自然撑开，
     从 bottom 向上延伸，真迹图 + 文本 + 注释整体可见 */
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.8;
  display: none;
  z-index: 10;
}
.yfj-panel--open {
  display: block;
  animation: yfj-rise 0.36s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes yfj-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.yfj-panel__head {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
  padding: clamp(12px, 2vw, 16px) clamp(20px, 3vw, 28px);
  border-bottom: 1px solid var(--rule);
}
.yfj-panel__src {
  flex: 1;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.2em;
}
.yfj-panel__close {
  font-family: inherit;
  font-size: 22px;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  width: 32px;
  height: 32px;
  cursor: pointer;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s, color 0.2s;
}
.yfj-panel__close:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Body：双栏（左字形，右文本） */
.yfj-panel__body {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 2.5vw, 28px);
  padding: clamp(14px, 2vw, 20px) clamp(20px, 3vw, 28px) clamp(16px, 2.5vw, 22px);
}
.yfj-panel__char-box {
  flex: 0 0 auto;
  text-align: center;
}
.yfj-panel__stage {
  width: 180px;
  height: 220px;
  background: var(--paper);
  border: 1px solid var(--rule);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.yfj-panel__leaf-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.4s ease;
}
.yfj-panel__leaf-img:hover {
  transform: scale(1.04);
}
.yfj-panel__char-label {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
}
.yfj-panel__text {
  flex: 1;
  min-width: 0;
}
.yfj-panel__text p {
  margin: 0 0 0.7em;
}
.yfj-panel__text p:last-child {
  margin-bottom: 0;
}
.yfj-panel__orig {
  font-size: clamp(15px, 1.7vw, 17px);
  color: var(--ink);
  font-weight: 500;
  padding-bottom: 0.6em;
  border-bottom: 1px dashed var(--rule);
}
.yfj-panel__orig-hit {
  color: var(--accent);
  background: rgba(139, 26, 26, 0.12);
  font-weight: 700;
  padding: 0 3px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(139, 26, 26, 0.35);
}
.yfj-panel__tr {
  color: var(--ink);
}
.yfj-panel__note {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 0.92em;
}
.yfj-panel__todo {
  color: var(--ink-faint);
  font-style: italic;
}

/* ============================================
   书家侧写
   ============================================ */

.bio {
  max-width: 680px;
  margin: clamp(64px, 10vh, 120px) auto 0;
  padding-top: clamp(32px, 6vh, 56px);
  border-top: 1px solid var(--rule);
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.85;
  color: var(--ink-soft);
}
.bio__head {
  text-align: center;
  margin-bottom: clamp(32px, 6vh, 56px);
}
.bio__kicker {
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 14px;
}
.bio__title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.2;
}
.bio__dates {
  font-size: 13px;
  font-style: italic;
  color: var(--ink-faint);
  letter-spacing: 0.15em;
  margin: 0;
}
.bio p {
  margin: 0 0 1.2em;
  text-align: justify;
  hyphens: auto;
}
.bio__source {
  margin-top: clamp(24px, 4vh, 40px);
  padding-top: clamp(16px, 3vh, 24px);
  border-top: 1px dashed var(--rule);
  font-size: 13px;
  color: var(--ink-faint);
  font-style: italic;
  text-align: center;
}

@media (max-width: 600px) {
  .bio { font-size: 16px; }
  .bio p { text-align: left; }
  .bio__title { font-size: 26px; }
}

/* ============================================
   总览页专用：顶部导航 · 深度入口卡 · 作品年表
   ============================================ */

/* 顶部返回导航（用在 /yinfujing/ 页） */
.topnav {
  max-width: 680px;
  margin: 0 auto clamp(24px, 4vh, 40px);
  padding: 0;
  font-size: 13px;
  letter-spacing: 0.1em;
}
.topnav__back {
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 0.2s, border-color 0.2s;
}
.topnav__back:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* 深度入口卡（阴符经 featured） */
.feature {
  display: block;
  max-width: 680px;
  margin: clamp(32px, 6vh, 56px) auto;
  padding: clamp(24px, 4vw, 36px) clamp(28px, 5vw, 44px);
  background: linear-gradient(135deg,
    rgba(237, 230, 216, 0.8) 0%,
    rgba(232, 220, 196, 0.6) 100%);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -12px rgba(58, 40, 23, 0.22);
}
.feature__badge {
  position: absolute;
  top: clamp(18px, 3vw, 28px);
  right: clamp(22px, 4vw, 36px);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 2px;
}
.feature__title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: 0.04em;
}
.feature__desc {
  margin: 0 0 16px;
  color: var(--ink-soft);
  line-height: 1.8;
  font-size: clamp(14px, 1.6vw, 16px);
}
.feature__cta {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 500;
}

/* 作品年表 */
.works {
  max-width: 680px;
  margin: clamp(64px, 10vh, 120px) auto 0;
  padding-top: clamp(32px, 6vh, 56px);
  border-top: 1px solid var(--rule);
}
.works__head {
  text-align: center;
  margin-bottom: clamp(40px, 7vh, 72px);
}
.works__note {
  max-width: 520px;
  margin: clamp(16px, 3vh, 24px) auto 0;
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.8;
  color: var(--ink-faint);
  font-style: italic;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
/* 纵向时间线 */
.timeline::before {
  content: "";
  position: absolute;
  left: clamp(48px, 8vw, 72px);
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--rule);
}

.timeline__item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 28px);
  padding: clamp(18px, 3vh, 28px) 0;
  transition: opacity 0.2s;
}
.timeline__item--dim {
  opacity: 0.55;
}
.timeline__item--featured {
  background: rgba(139, 26, 26, 0.03);
  border-radius: 2px;
  padding-left: clamp(12px, 2vw, 20px);
  padding-right: clamp(12px, 2vw, 20px);
  margin: 0 clamp(-12px, -2vw, -20px);
}

.timeline__year {
  flex: 0 0 auto;
  width: clamp(50px, 8vw, 72px);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 700;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  padding-top: 2px;
  letter-spacing: 0.04em;
  text-align: center;
  position: relative;
  z-index: 1;
  background: var(--paper);
  padding: 4px 0;
}
.timeline__item--dim .timeline__year {
  color: var(--ink-faint);
}

.timeline__content {
  flex: 1;
  min-width: 0;
}
.timeline__title {
  font-size: clamp(17px, 2.1vw, 21px);
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
  line-height: 1.4;
}
.timeline__titlelink {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.timeline__titlelink:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.timeline__sep {
  color: var(--ink-faint);
  margin: 0 6px;
}
.timeline__tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  padding: 2px 8px;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 8px;
}
.timeline__meta {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.timeline__note {
  margin: 0 0 10px;
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.75;
  color: var(--ink-soft);
}
.timeline__link {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 1px dashed var(--rule);
  transition: color 0.2s, border-color 0.2s;
}
.timeline__link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.timeline__link--strong {
  color: var(--accent);
  font-weight: 500;
  border-bottom-color: var(--accent);
}

/* 分组分隔（已系年 vs 未系年） */
.timeline__divider {
  list-style: none;
  margin: clamp(20px, 4vh, 36px) 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
  text-transform: none;
}
.timeline__divider::before,
.timeline__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
  margin: 0 clamp(12px, 2vw, 20px);
}
.timeline__divider span {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .feature {
    margin-left: 0;
    margin-right: 0;
  }
  .feature__badge {
    position: static;
    display: inline-block;
    margin-bottom: 14px;
  }

  .timeline::before {
    left: 28px;
  }
  .timeline__item {
    padding: 18px 0;
    gap: 12px;
  }
  .timeline__year {
    width: 48px;
    font-size: 14px;
  }
  .timeline__title {
    font-size: 17px;
  }
  .timeline__note {
    font-size: 14px;
  }
}

/* ============================================
   Lightbox 全局图片预览
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
  padding: clamp(32px, 5vw, 64px);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.lightbox--open {
  display: flex;
  animation: lightbox-fade 0.24s ease-out;
}
@keyframes lightbox-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox__img {
  max-width: min(95vw, 1400px);
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: default;
  animation: lightbox-zoom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes lightbox-zoom {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
.lightbox__close {
  position: absolute;
  top: clamp(16px, 2vw, 28px);
  right: clamp(16px, 2vw, 28px);
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
  background: transparent;
  color: rgba(245, 241, 234, 0.85);
  border: 1px solid rgba(245, 241, 234, 0.4);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.lightbox__close:hover {
  background: rgba(245, 241, 234, 0.15);
  color: #fff;
  border-color: rgba(245, 241, 234, 0.7);
}
.lightbox__caption {
  position: absolute;
  bottom: clamp(16px, 2vw, 28px);
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(245, 241, 234, 0.65);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.1em;
  pointer-events: none;
}

/* ============================================
   作品页：Tier B 原文 + 释读阅读器
   ============================================ */

.reader {
  max-width: 680px;
  margin: clamp(48px, 7vh, 72px) auto;
  padding: clamp(32px, 5vw, 48px) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.reader__title {
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: none;
  color: var(--ink-faint);
  margin: 0 0 clamp(28px, 4vh, 40px);
  text-align: center;
  font-weight: 400;
  font-style: italic;
}
.reader__group {
  margin-bottom: clamp(28px, 4vh, 40px);
  padding-left: clamp(14px, 2vw, 22px);
  border-left: 2px solid var(--rule);
  transition: border-color 0.2s;
}
.reader__group:last-child { margin-bottom: 0; }
.reader__group:hover { border-left-color: var(--accent); }
.reader__group--highlight {
  border-left-color: var(--accent);
  background: rgba(139, 26, 26, 0.035);
  padding: clamp(16px, 3vh, 24px) clamp(14px, 2vw, 22px);
}
.reader__orig {
  margin: 0 0 0.8em;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.85;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.reader__group--highlight .reader__orig {
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--accent);
  font-weight: 700;
}
.reader__note {
  margin: 0;
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.85;
  color: var(--ink-soft);
  font-style: italic;
}

/* ============================================
   作品页：图版画廊
   ============================================ */

.gallery {
  max-width: 760px;
  margin: clamp(40px, 6vh, 72px) auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vh, 40px);
}
.gallery__item {
  margin: 0;
  padding: 0;
}
.gallery__item img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper-warm);
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 6px 18px -8px rgba(58, 40, 23, 0.18);
}
.gallery__item img:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -8px rgba(58, 40, 23, 0.26);
}
.gallery__item figcaption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-faint);
  font-style: italic;
  text-align: center;
  letter-spacing: 0.05em;
}

/* 如果图多于 2 张，桌面端切成两列 */
@media (min-width: 720px) {
  .gallery--cols {
    grid-template-columns: 1fr 1fr;
  }
}

/* ----- 页脚 ----- */
.colophon {
  margin-top: clamp(64px, 10vh, 120px);
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.7;
  text-align: center;
}
.colophon p { margin: 0 0 8px; }
.colophon .meta { font-style: italic; }

/* ============================================
   Mobile：< 600px
   竖排卷轴在窄屏上不可读，降级为横排堆叠
   ============================================ */
@media (max-width: 600px) {
  .page {
    padding: 32px 18px 48px;
  }

  .title { font-size: 30px; }
  .subtitle { font-size: 14px; }

  .essay {
    font-size: 16px;
    line-height: 1.85;
  }
  .essay .lede { font-size: 17px; }
  .essay p { text-align: left; }

  /* 卷轴：去掉装饰木轴/绫绢，改为简单纸张框 */
  .scroll {
    margin: 28px calc(50% - 50vw);
  }
  .scroll__rod, .scroll__silk { display: none; }

  .yfj {
    writing-mode: horizontal-tb;
    -webkit-writing-mode: horizontal-tb;
    height: auto;
    max-width: 100vw;
    white-space: normal;
    padding: 22px 18px;
    box-shadow: inset 0 0 0 1px rgba(58, 40, 23, 0.15);
  }
  .yfj-heading,
  .yfj-tail,
  .yfj-part {
    display: block;
    height: auto;
    margin: 14px 0;
    padding: 0;
    border: none;
    text-align: center;
    min-width: 0;
  }
  .yfj-heading {
    position: static;  /* 解除卷轴模式的 relative，让印章 inline 显示 */
    border-bottom: 1px solid rgba(58, 40, 23, 0.18);
    padding-bottom: 14px;
  }
  .yfj-heading__title {
    font-size: 22px;
  }
  .yfj-heading__seal {
    position: static;
    transform: none;
    margin: 12px auto 0;
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
  .yfj-part {
    border-top: 1px dashed rgba(58, 40, 23, 0.2);
    border-bottom: 1px dashed rgba(58, 40, 23, 0.2);
    padding: 6px 0;
    font-size: 11px;
  }
  .yfj-col {
    display: block;
    margin: 8px 0 14px;
    font-size: 18px;
    line-height: 1.95;
    text-align: justify;
  }

  /* 字位浮层：mobile 字小，浮层圆形衬底缩小、降低不透明度 */
  .yfj-stroke-overlay {
    z-index: 8;
  }

  /* 释文面板：从底部 absolute 改为流式 block，单栏堆叠 */
  .yfj-panel {
    position: static;
    left: auto; right: auto; bottom: auto;
    max-height: none;
    margin: 18px 14px 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--paper-warm);
  }
  .yfj-panel__body {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 18px 18px;
  }
  .yfj-panel__char-box {
    width: 100%;
  }
  .yfj-panel__stage {
    width: 100%;
    height: auto;
    aspect-ratio: 1467 / 1773;
    max-width: 280px;
    margin: 0 auto;
  }
  .yfj-panel__char-label {
    font-size: 11px;
  }
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
