/* ============================================================
   语文电子书 · 翻页阅读器  —  主题：暖纸 + 书桌
   ============================================================ */
:root {
  --ink: #3a322a;
  --ink-soft: #6b6255;
  --paper: #fdfaf3;
  --paper-deep: #f3ead8;
  --desk: #e9e0ce;
  --desk-2: #d9cdb4;
  --accent: #b5492e;        /* 朱砂红 */
  --accent-soft: #d8836a;
  --line: #e6dcc6;
  --shadow: rgba(90, 70, 40, .28);
  --sidebar-w: 150px;       /* 2026-09-25 由 300px 收窄一半，把空间让给书本区 */
  --thumb-h: 52px;          /* 2026-09-25 由 104px 收窄一半 */
  --toolbar-h: 60px;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(120% 120% at 50% 0%, #f4eddd 0%, #e7dcc2 55%, #d8c9a8 100%);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.toolbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--toolbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  background: rgba(253, 250, 243, .95);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}
.toolbar .brand {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.toolbar .brand .logo {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--accent), #8f3521);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC", "SimSun", serif; font-weight: 700; font-size: 18px;
  box-shadow: 0 3px 8px rgba(181,73,46,.35);
}
.toolbar .brand .titles { display: flex; flex-direction: column; line-height: 1.15; }
.toolbar .brand .titles b { font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 17px; letter-spacing: .5px; }
.toolbar .brand .titles span { font-size: 11.5px; color: var(--ink-soft); }

.toolbar .spacer { flex: 1; }

.page-indicator {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}
.page-indicator b { color: var(--accent); font-size: 15px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; transition: all .15s ease;
}
.icon-btn:hover { background: var(--paper-deep); border-color: var(--accent-soft); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- 布局 ---------- */
.layout {
  position: fixed; inset: var(--toolbar-h) 0 var(--thumb-h) 0;
  display: flex;
}

/* 侧栏目录 */
.sidebar {
  width: var(--sidebar-w); flex: none;
  background: rgba(253, 250, 243, .97);
  border-right: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden;
  transition: margin-left .28s ease;
  z-index: 30;
}
.sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-w)); }

.sidebar .side-head {
  padding: 10px 10px 7px; font-size: 11px; color: var(--ink-soft);
  display: flex; align-items: center; gap: 4px; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar .side-head b { color: var(--ink); font-size: 12px; }

.group { border-top: 1px solid var(--line); }
.group:first-child { border-top: none; }
.group-head {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 10px; cursor: pointer; user-select: none;
  font-weight: 600; font-size: 12px; color: var(--ink);
  position: sticky; top: 0; background: rgba(253,250,243,.96); z-index: 2;
}
.group-head:hover { background: var(--paper-deep); }
.group-head .ic { font-size: 13px; }
.group-head .caret { margin-left: auto; font-size: 10px; color: var(--ink-soft); transition: transform .2s; }
.group-head.open .caret { transform: rotate(90deg); }

.group-items { overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.group.open .group-items { max-height: 800px; }

.lesson {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px 6px 16px; cursor: pointer;
  font-size: 12px; color: var(--ink-soft);
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
}
.lesson:hover { background: var(--paper-deep); color: var(--ink); }
.lesson.active {
  background: linear-gradient(90deg, rgba(181,73,46,.10), transparent);
  color: var(--accent); border-left-color: var(--accent); font-weight: 600;
}
.lesson .pg { margin-left: auto; font-size: 10px; color: #b3a88f; flex: none; }
/* 窄栏下课文名过长时的收敛（保留末尾页码不被挤掉） */
.lesson .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 侧栏标签页 */
.side-tabs {
  display: flex; border-bottom: 1px solid var(--line);
  background: rgba(253, 250, 243, .95);
  position: sticky; top: 0; z-index: 3;
}
.side-tab {
  flex: 1; padding: 9px 4px; text-align: center;
  font-size: 12px; color: var(--ink-soft); cursor: pointer;
  border-bottom: 2px solid transparent; user-select: none;
  white-space: nowrap; letter-spacing: 0;
  transition: all .15s;
}
.side-tab:hover { color: var(--ink); background: var(--paper-deep); }
.side-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.side-panel { max-height: calc(100vh - var(--toolbar-h) - var(--thumb-h) - 48px); overflow-y: auto; }
.side-panel.hidden { display: none; }

/* 课文朗读面板 */
.read-panel { padding: 6px 6px 80px; }        /* 2026-09-25 随栏宽收窄同步收缩 */
.read-line {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 7px 7px; margin-bottom: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; transition: all .15s;
}
.read-line:hover { border-color: var(--accent-soft); background: #fffaf3; transform: translateX(2px); }
.read-line.playing { border-color: var(--accent); background: linear-gradient(90deg, rgba(181,73,46,.08), transparent); }
.read-line .play-icon {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
}
.read-line.playing .play-icon { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.read-line .text { flex: 1; min-width: 0; font-size: 12px; line-height: 1.6; color: var(--ink); word-break: break-all; }
.read-line .text .ch { display: inline-block; padding: 0 1px; border-radius: 3px; cursor: pointer; transition: background .12s; }
.read-line .text .ch:hover { background: rgba(181,73,46,.15); color: var(--accent); }
.read-line .text .ch.has-word { cursor: pointer; }
.read-empty { padding: 40px 20px; text-align: center; color: #b3a88f; font-size: 13px; }

/* ---------- 教学要点（侧栏「教学要点」标签页） ---------- */
.notes-panel { padding: 6px 6px 80px; }        /* 2026-09-25 随栏宽收窄同步收缩 */
.notes-title {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 13px; color: var(--ink); letter-spacing: .3px;
  margin: 2px 0 8px; display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap;
}
.notes-title span { font-family: inherit; font-size: 10.5px; color: var(--ink-soft); }

.notes-card {
  background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--c, var(--accent));
  border-radius: 9px; padding: 7px 8px; margin-bottom: 6px;
  box-shadow: 0 1px 4px rgba(120, 96, 60, .06);
  transition: transform .15s, box-shadow .15s;
}
.notes-card:hover { transform: translateX(2px); box-shadow: 0 3px 10px rgba(120, 96, 60, .12); }
.notes-card-head { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.notes-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c, var(--accent)); flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--accent)) 18%, transparent);
}
.notes-card-head b {
  font-size: 11.5px; color: var(--c, var(--accent));
  font-family: "Songti SC", "STSong", "SimSun", serif; letter-spacing: .5px;
}
.notes-card-body {
  font-size: 11.5px; line-height: 1.65; color: var(--ink);
  white-space: normal; word-break: break-word;
}

.notes-empty { padding: 30px 10px; text-align: center; color: #b3a88f; font-size: 11.5px; }
.notes-empty-icon { font-size: 24px; margin-bottom: 6px; opacity: .8; }
.notes-empty p { margin: 0 0 12px; }
.notes-goto, .notes-edit {
  display: inline-block; padding: 5px 11px; border-radius: 999px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-size: 11px; transition: opacity .15s, transform .15s;
}
.notes-goto:hover, .notes-edit:hover { opacity: .88; transform: translateY(-1px); }
.notes-edit {
  display: block; text-align: center; margin-top: 4px;
  background: transparent; color: var(--accent);
  border: 1px dashed var(--accent-soft);
}

/* 领读控制区 */
.read-control {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 0 9px;
}
.read-btn {
  padding: 6px 13px; border: none; border-radius: 18px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
  cursor: pointer; box-shadow: 0 3px 10px rgba(181,73,46,.35);
  transition: all .15s; letter-spacing: .5px;
}
.read-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(181,73,46,.45); }
.read-btn.active { background: #8f3521; }
.read-hint { font-size: 10.5px; color: #b3a88f; }
.read-lines { display: flex; flex-direction: column; gap: 6px; }

/* 本课生字区 */
.chars-section {
  margin-top: 12px; padding: 8px;
  background: linear-gradient(180deg, #fffaf3, #fdf6e8);
  border: 1px solid var(--line); border-radius: 9px;
}
.chars-title { font-size: 11px; color: var(--ink-soft); margin-bottom: 8px; font-weight: 600; }
.chars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; }
.char-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 2px; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; cursor: pointer; transition: all .12s;
}
.char-cell:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 3px 8px rgba(181,73,46,.2); }
.char-big {
  font-family: "Kaiti SC", "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 17px; color: var(--ink); line-height: 1.1;
}
.char-py { font-size: 8px; color: var(--accent); }

/* 课文动画按钮 */
.anim-btn {
  position: absolute; top: 12px; right: 12px; z-index: 15;
  padding: 8px 16px; border: none; border-radius: 20px;
  background: var(--accent); color: #fff; font-size: 14px;
  font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(181,73,46,.45);
  transition: all .2s;
}
.anim-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(181,73,46,.55); }
.anim-btn.hidden { display: none; }
.anim-btn::before { content: ''; position: absolute; inset: -4px; border-radius: 24px; border: 2px solid var(--accent); opacity: 0; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { opacity: .6; transform: scale(.95); } 100% { opacity: 0; transform: scale(1.15); } }

/* 弹窗（通用） */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; }
.modal.show { display: flex; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* 【禁止使用 backdrop-filter】
   遮罩与弹窗内正在播放的 <video> 处于同一合成树，Chromium 必须每帧重新生成
   遮罩的「背景快照」，在本机 GPU 合成路径上会以硬边矩形闪出黑块
   （现象：弹窗左侧书页区域持续闪烁黑色方块）。
   改用更实的纯色遮罩来营造「背景后退」的层次，不做实时模糊。 */
.modal-mask { position: absolute; inset: 0; background: rgba(48, 40, 33, .75); }
.modal-box {
  position: relative; background: #fff;
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
  max-width: 92vw; max-height: 92vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: scaleIn .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes scaleIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute; top: 10px; right: 12px;
  width: 36px; height: 36px; border: none; background: transparent;
  font-size: 26px; color: var(--ink-soft); cursor: pointer; z-index: 2;
  border-radius: 50%; transition: all .15s;
}
.modal-close:hover { background: var(--paper-deep); color: var(--accent); }

/* 视频弹窗 */
.video-box { width: 90vw; max-width: 1000px; }
.video-box h3 { padding: 16px 24px; margin: 0; font-size: 18px; color: var(--ink); border-bottom: 1px solid var(--line); }
/* 【禁止加 transform: translateZ(0)】见 #word-video 上方说明：会把视频推离标准合成路径导致黑屏 */
#video-player { width: 100%; max-height: 75vh; background: #000; }

/* 生字卡片 */
.word-box { width: 720px; max-width: 92vw; }
.word-head { display: flex; gap: 24px; padding: 28px 28px 16px; border-bottom: 1px dashed var(--line); }
.word-char {
  width: 130px; height: 150px; flex: none;
  background: linear-gradient(180deg, #fff, #fdf6e8);
  border: 2px solid var(--accent); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Kaiti SC", "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 84px; color: var(--ink);
  box-shadow: 0 4px 12px rgba(181,73,46,.2);
}
.word-info { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.word-row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.word-row .lbl {
  display: inline-block; min-width: 44px; padding: 3px 8px;
  background: var(--paper-deep); color: var(--accent);
  border-radius: 4px; font-size: 12px; text-align: center;
}
.word-pinyin { color: var(--accent); font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.word-audios { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.word-audio-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: #fff; border: 1px solid var(--accent-soft);
  border-radius: 20px; color: var(--accent); cursor: pointer; font-size: 13px;
  transition: all .12s;
}
.word-audio-btn:hover { background: var(--accent); color: #fff; }
.word-audio-btn.playing { background: var(--accent); color: #fff; }
.word-audio-btn .ic { font-size: 11px; }
.word-no-audio {
  display: inline-block; padding: 6px 14px;
  background: #f5f1e8; border: 1px dashed #d4c8b0; border-radius: 20px;
  color: #b3a88f; font-size: 12px;
}
.word-video-wrap { padding: 16px 28px 24px; }
.word-video-wrap h4 { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
/* 笔顺视频容器：尺寸由布局固定为正方形，不依赖 <video> 是否成功加载元数据。
   若改为跟随视频固有尺寸（fit-content），一旦媒体加载失败，<video> 会退化成
   300×150 默认盒，叠加的田字格（inset:0）随之变成扁矩形 —— 这是曾经的线上现象。 */
.word-video-grid { position: relative; width: 320px; height: 320px; max-width: 100%; margin: 0 auto; }
/* 支持 aspect-ratio 的内核改为「随宽度自适应的正方形」，窄窗口下自动缩小。
   用 @supports 包裹而不是直接写 aspect-ratio：老内核不认该属性会导致高度塌成 0。 */
@supports (aspect-ratio: 1 / 1) {
  .word-video-grid { width: min(320px, 100%); height: auto; aspect-ratio: 1 / 1; }
}
#word-video {
  width: 100%; height: 100%; object-fit: contain;
  background: #fafafa; border-radius: 8px; display: block;
  -webkit-user-select: none; user-select: none;
  /* 【禁止给本元素加 transform: translateZ(0) / will-change: transform】
     它会把视频推离标准合成路径，在部分 GPU 驱动下导致画面全黑，
     2026-09-24 曾因此回退。闪烁问题请从遮罩层（backdrop-filter）方向解决。 */
}
/* 田字格：叠加在笔顺视频上，外框 + 横中线 + 竖中线 */
.tianzige {
  position: absolute;
  inset: 0 0 0 0;
  pointer-events: none;
  border: 2px solid rgba(200, 80, 60, .5);
  background:
    linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(200,80,60,.35) calc(50% - 0.5px), rgba(200,80,60,.35) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to right, transparent calc(50% - 0.5px), rgba(200,80,60,.35) calc(50% - 0.5px), rgba(200,80,60,.35) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  border-radius: 8px;
}

/* ---------- 笔顺视频自定义控制条（替代原生控件） ----------
   原生控件已去掉：静音、全屏、三点菜单里的下载
   仅保留：播放/暂停、进度、时间、播放速度、画中画            */
.wv-ctrl {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex; align-items: center; gap: 7px;
  padding: 16px 8px 7px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(to top, rgba(38, 30, 20, .66), rgba(38, 30, 20, .28) 55%, transparent);
  opacity: 1; transition: opacity .22s;
}


* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(120% 120% at 50% 0%, #f4eddd 0%, #e7dcc2 55%, #d8c9a8 100%);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.toolbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--toolbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  background: rgba(253, 250, 243, .95);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}
.toolbar .brand {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.toolbar .brand .logo {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--accent), #8f3521);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC", "SimSun", serif; font-weight: 700; font-size: 18px;
  box-shadow: 0 3px 8px rgba(181,73,46,.35);
}
.toolbar .brand .titles { display: flex; flex-direction: column; line-height: 1.15; }
.toolbar .brand .titles b { font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 17px; letter-spacing: .5px; }
.toolbar .brand .titles span { font-size: 11.5px; color: var(--ink-soft); }

.toolbar .spacer { flex: 1; }

.page-indicator {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}
.page-indicator b { color: var(--accent); font-size: 15px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; transition: all .15s ease;
}
.icon-btn:hover { background: var(--paper-deep); border-color: var(--accent-soft); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- 布局 ---------- */
.layout {
  position: fixed; inset: var(--toolbar-h) 0 var(--thumb-h) 0;
  display: flex;
}

/* 侧栏目录 */
.sidebar {
  width: var(--sidebar-w); flex: none;
  background: rgba(253, 250, 243, .97);
  border-right: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden;
  transition: margin-left .28s ease;
  z-index: 30;
}
.sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-w)); }

.sidebar .side-head {
  padding: 10px 10px 7px; font-size: 11px; color: var(--ink-soft);
  display: flex; align-items: center; gap: 4px; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar .side-head b { color: var(--ink); font-size: 12px; }

.group { border-top: 1px solid var(--line); }
.group:first-child { border-top: none; }
.group-head {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 10px; cursor: pointer; user-select: none;
  font-weight: 600; font-size: 12px; color: var(--ink);
  position: sticky; top: 0; background: rgba(253,250,243,.96); z-index: 2;
}
.group-head:hover { background: var(--paper-deep); }
.group-head .ic { font-size: 13px; }
.group-head .caret { margin-left: auto; font-size: 10px; color: var(--ink-soft); transition: transform .2s; }
.group-head.open .caret { transform: rotate(90deg); }

.group-items { overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.group.open .group-items { max-height: 800px; }

.lesson {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px 6px 16px; cursor: pointer;
  font-size: 12px; color: var(--ink-soft);
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
}
.lesson:hover { background: var(--paper-deep); color: var(--ink); }
.lesson.active {
  background: linear-gradient(90deg, rgba(181,73,46,.10), transparent);
  color: var(--accent); border-left-color: var(--accent); font-weight: 600;
}
.lesson .pg { margin-left: auto; font-size: 10px; color: #b3a88f; flex: none; }
/* 窄栏下课文名过长时的收敛（保留末尾页码不被挤掉） */
.lesson .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 侧栏标签页 */
.side-tabs {
  display: flex; border-bottom: 1px solid var(--line);
  background: rgba(253, 250, 243, .95);
  position: sticky; top: 0; z-index: 3;
}
.side-tab {
  flex: 1; padding: 9px 4px; text-align: center;
  font-size: 12px; color: var(--ink-soft); cursor: pointer;
  border-bottom: 2px solid transparent; user-select: none;
  white-space: nowrap; letter-spacing: 0;
  transition: all .15s;
}
.side-tab:hover { color: var(--ink); background: var(--paper-deep); }
.side-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.side-panel { max-height: calc(100vh - var(--toolbar-h) - var(--thumb-h) - 48px); overflow-y: auto; }
.side-panel.hidden { display: none; }

/* 课文朗读面板 */
.read-panel { padding: 6px 6px 80px; }        /* 2026-09-25 随栏宽收窄同步收缩 */
.read-line {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 7px 7px; margin-bottom: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; transition: all .15s;
}
.read-line:hover { border-color: var(--accent-soft); background: #fffaf3; transform: translateX(2px); }
.read-line.playing { border-color: var(--accent); background: linear-gradient(90deg, rgba(181,73,46,.08), transparent); }
.read-line .play-icon {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
}
.read-line.playing .play-icon { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.read-line .text { flex: 1; min-width: 0; font-size: 12px; line-height: 1.6; color: var(--ink); word-break: break-all; }
.read-line .text .ch { display: inline-block; padding: 0 1px; border-radius: 3px; cursor: pointer; transition: background .12s; }
.read-line .text .ch:hover { background: rgba(181,73,46,.15); color: var(--accent); }
.read-line .text .ch.has-word { cursor: pointer; }
.read-empty { padding: 40px 20px; text-align: center; color: #b3a88f; font-size: 13px; }

/* ---------- 教学要点（侧栏「教学要点」标签页） ---------- */
.notes-panel { padding: 6px 6px 80px; }        /* 2026-09-25 随栏宽收窄同步收缩 */
.notes-title {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 13px; color: var(--ink); letter-spacing: .3px;
  margin: 2px 0 8px; display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap;
}
.notes-title span { font-family: inherit; font-size: 10.5px; color: var(--ink-soft); }

.notes-card {
  background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--c, var(--accent));
  border-radius: 9px; padding: 7px 8px; margin-bottom: 6px;
  box-shadow: 0 1px 4px rgba(120, 96, 60, .06);
  transition: transform .15s, box-shadow .15s;
}
.notes-card:hover { transform: translateX(2px); box-shadow: 0 3px 10px rgba(120, 96, 60, .12); }
.notes-card-head { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.notes-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c, var(--accent)); flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--accent)) 18%, transparent);
}
.notes-card-head b {
  font-size: 11.5px; color: var(--c, var(--accent));
  font-family: "Songti SC", "STSong", "SimSun", serif; letter-spacing: .5px;
}
.notes-card-body {
  font-size: 11.5px; line-height: 1.65; color: var(--ink);
  white-space: normal; word-break: break-word;
}

.notes-empty { padding: 30px 10px; text-align: center; color: #b3a88f; font-size: 11.5px; }
.notes-empty-icon { font-size: 24px; margin-bottom: 6px; opacity: .8; }
.notes-empty p { margin: 0 0 12px; }
.notes-goto, .notes-edit {
  display: inline-block; padding: 5px 11px; border-radius: 999px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-size: 11px; transition: opacity .15s, transform .15s;
}
.notes-goto:hover, .notes-edit:hover { opacity: .88; transform: translateY(-1px); }
.notes-edit {
  display: block; text-align: center; margin-top: 4px;
  background: transparent; color: var(--accent);
  border: 1px dashed var(--accent-soft);
}

/* 领读控制区 */
.read-control {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 0 9px;
}
.read-btn {
  padding: 6px 13px; border: none; border-radius: 18px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
  cursor: pointer; box-shadow: 0 3px 10px rgba(181,73,46,.35);
  transition: all .15s; letter-spacing: .5px;
}
.read-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(181,73,46,.45); }
.read-btn.active { background: #8f3521; }
.read-hint { font-size: 10.5px; color: #b3a88f; }
.read-lines { display: flex; flex-direction: column; gap: 6px; }

/* 本课生字区 */
.chars-section {
  margin-top: 12px; padding: 8px;
  background: linear-gradient(180deg, #fffaf3, #fdf6e8);
  border: 1px solid var(--line); border-radius: 9px;
}
.chars-title { font-size: 11px; color: var(--ink-soft); margin-bottom: 8px; font-weight: 600; }
.chars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; }
.char-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 2px; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; cursor: pointer; transition: all .12s;
}
.char-cell:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 3px 8px rgba(181,73,46,.2); }
.char-big {
  font-family: "Kaiti SC", "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 17px; color: var(--ink); line-height: 1.1;
}
.char-py { font-size: 8px; color: var(--accent); }

/* 课文动画按钮 */
.anim-btn {
  position: absolute; top: 12px; right: 12px; z-index: 15;
  padding: 8px 16px; border: none; border-radius: 20px;
  background: var(--accent); color: #fff; font-size: 14px;
  font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(181,73,46,.45);
  transition: all .2s;
}
.anim-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(181,73,46,.55); }
.anim-btn.hidden { display: none; }
.anim-btn::before { content: ''; position: absolute; inset: -4px; border-radius: 24px; border: 2px solid var(--accent); opacity: 0; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { opacity: .6; transform: scale(.95); } 100% { opacity: 0; transform: scale(1.15); } }

/* 弹窗（通用） */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; }
.modal.show { display: flex; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* 【禁止使用 backdrop-filter】
   遮罩与弹窗内正在播放的 <video> 处于同一合成树，Chromium 必须每帧重新生成
   遮罩的「背景快照」，在本机 GPU 合成路径上会以硬边矩形闪出黑块
   （现象：弹窗左侧书页区域持续闪烁黑色方块）。
   改用更实的纯色遮罩来营造「背景后退」的层次，不做实时模糊。 */
.modal-mask { position: absolute; inset: 0; background: rgba(48, 40, 33, .75); }
.modal-box {
  position: relative; background: #fff;
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
  max-width: 92vw; max-height: 92vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: scaleIn .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes scaleIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute; top: 10px; right: 12px;
  width: 36px; height: 36px; border: none; background: transparent;
  font-size: 26px; color: var(--ink-soft); cursor: pointer; z-index: 2;
  border-radius: 50%; transition: all .15s;
}
.modal-close:hover { background: var(--paper-deep); color: var(--accent); }

/* 视频弹窗 */
.video-box { width: 90vw; max-width: 1000px; }
.video-box h3 { padding: 16px 24px; margin: 0; font-size: 18px; color: var(--ink); border-bottom: 1px solid var(--line); }
/* 【禁止加 transform: translateZ(0)】见 #word-video 上方说明：会把视频推离标准合成路径导致黑屏 */
#video-player { width: 100%; max-height: 75vh; background: #000; }

/* 生字卡片 */
.word-box { width: 720px; max-width: 92vw; }
.word-head { display: flex; gap: 24px; padding: 28px 28px 16px; border-bottom: 1px dashed var(--line); }
.word-char {
  width: 130px; height: 150px; flex: none;
  background: linear-gradient(180deg, #fff, #fdf6e8);
  border: 2px solid var(--accent); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Kaiti SC", "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 84px; color: var(--ink);
  box-shadow: 0 4px 12px rgba(181,73,46,.2);
}
.word-info { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.word-row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.word-row .lbl {
  display: inline-block; min-width: 44px; padding: 3px 8px;
  background: var(--paper-deep); color: var(--accent);
  border-radius: 4px; font-size: 12px; text-align: center;
}
.word-pinyin { color: var(--accent); font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.word-audios { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.word-audio-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: #fff; border: 1px solid var(--accent-soft);
  border-radius: 20px; color: var(--accent); cursor: pointer; font-size: 13px;
  transition: all .12s;
}
.word-audio-btn:hover { background: var(--accent); color: #fff; }
.word-audio-btn.playing { background: var(--accent); color: #fff; }
.word-audio-btn .ic { font-size: 11px; }
.word-no-audio {
  display: inline-block; padding: 6px 14px;
  background: #f5f1e8; border: 1px dashed #d4c8b0; border-radius: 20px;
  color: #b3a88f; font-size: 12px;
}
.word-video-wrap { padding: 16px 28px 24px; }
.word-video-wrap h4 { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
/* 笔顺视频容器：尺寸由布局固定为正方形，不依赖 <video> 是否成功加载元数据。
   若改为跟随视频固有尺寸（fit-content），一旦媒体加载失败，<video> 会退化成
   300×150 默认盒，叠加的田字格（inset:0）随之变成扁矩形 —— 这是曾经的线上现象。 */
.word-video-grid { position: relative; width: 320px; height: 320px; max-width: 100%; margin: 0 auto; }
/* 支持 aspect-ratio 的内核改为「随宽度自适应的正方形」，窄窗口下自动缩小。
   用 @supports 包裹而不是直接写 aspect-ratio：老内核不认该属性会导致高度塌成 0。 */
@supports (aspect-ratio: 1 / 1) {
  .word-video-grid { width: min(320px, 100%); height: auto; aspect-ratio: 1 / 1; }
}
#word-video {
  width: 100%; height: 100%; object-fit: contain;
  background: #fafafa; border-radius: 8px; display: block;
  -webkit-user-select: none; user-select: none;
  /* 【禁止给本元素加 transform: translateZ(0) / will-change: transform】
     它会把视频推离标准合成路径，在部分 GPU 驱动下导致画面全黑，
     2026-09-24 曾因此回退。闪烁问题请从遮罩层（backdrop-filter）方向解决。 */
}
/* 田字格：叠加在笔顺视频上，外框 + 横中线 + 竖中线 */
.tianzige {
  position: absolute;
  inset: 0 0 0 0;
  pointer-events: none;
  border: 2px solid rgba(200, 80, 60, .5);
  background:
    linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(200,80,60,.35) calc(50% - 0.5px), rgba(200,80,60,.35) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to right, transparent calc(50% - 0.5px), rgba(200,80,60,.35) calc(50% - 0.5px), rgba(200,80,60,.35) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  border-radius: 8px;
}

/* ---------- 笔顺视频自定义控制条（替代原生控件） ----------
   原生控件已去掉：静音、全屏、三点菜单里的下载
   仅保留：播放/暂停、进度、时间、播放速度、画中画            */
.wv-ctrl {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex; align-items: center; gap: 7px;
  padding: 16px 8px 7px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(to top, rgba(38, 30, 20, .66), rgba(38, 30, 20, .28) 55%, transparent);
  opacity: 1; transition: opacity .22s;
}
/* ---------- 底部控制条：加大 + 提色，避免白图标看不见 ---------- */
/* 闲置时不做大幅淡化：控制条本身有深色渐变底，白图标本来就看得清，
   过度淡化反而把红色播放键也一起变灰了。仅轻微降低透明度。 */
.wv-ctrl.idle { opacity: .88; }
.wv-ctrl.idle:hover { opacity: 1; }
.wv-btn {
  flex: none; width: 26px; height: 26px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 7px; cursor: pointer;
  background: transparent; color: #fff;
  transition: background .15s, transform .12s;
}
.wv-btn:hover { background: rgba(255, 255, 255, .2); }
.wv-btn:active { transform: scale(.92); }
.wv-btn svg { width: 17px; height: 17px; fill: currentColor; }
/* 图标切换：.wv-btn svg 的优先级高于 .wv-ic-play{display:none}，
   若保留 display:block 会导致播放/暂停两个图标同时显示。 */
.wv-btn .wv-ic-play { display: block; }
.wv-btn .wv-ic-pause { display: none; }


.wv-ic-pause { display: none; }
.wv-ctrl.playing .wv-ic-play { display: none; }
.wv-ctrl.playing .wv-ic-pause { display: block; }

/* 播放/暂停键：仅把「透明底白图标」改成「红底白图标」，形状尺寸不变 */
.wv-btn[data-act="play"] { background: #e0603f; color: #fff; }
.wv-btn[data-act="play"]:hover { background: #d4502f; }

/* 视频「加载中」状态（preload=none，点播放才拉数据）
   没有这个反馈的话，用户点下播放键后画面毫无变化，会以为按钮坏了。
   表现：按键轻微脉动 + 变淡，并叠加旋转的等待环。 */
.wv-ctrl.wv-loading .wv-btn[data-act="play"] {
  animation: wvLoadingPulse .9s ease-in-out infinite;
}
.wv-ctrl.wv-loading .wv-btn[data-act="play"] .wv-ic-play { opacity: .35; }
@keyframes wvLoadingPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: .55; transform: scale(.92); }
}
/* 视频容器上盖一层「加载中」文字，随 canplay 自动消失 */
.word-video-grid.is-loading::before {
  content: '视频加载中…';
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 13px; line-height: 1.4;
  letter-spacing: .5px;
  pointer-events: none;
  white-space: nowrap;
}
.word-video-grid:not(.is-loading)::before { content: none; }

.wv-rate {
  width: auto; min-width: 34px; padding: 0 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
}

.wv-track {
  position: relative; flex: 1; min-width: 40px; height: 16px;
  display: flex; align-items: center; cursor: pointer;
}
.wv-track::before {
  content: ''; position: absolute; left: 0; right: 0;
  height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .34);
  transition: height .15s;
}
.wv-track:hover::before { height: 6px; }
.wv-bar {
  position: absolute; left: 0; width: 0; height: 4px;
  border-radius: 3px; background: #fff; transition: height .15s;
}
.wv-track:hover .wv-bar { height: 6px; }
.wv-knob {
  position: absolute; top: 50%; left: 0;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  opacity: 0; transition: opacity .15s;
}
.wv-track:hover .wv-knob { opacity: 1; }

.wv-time {
  flex: none; color: #fff; font-size: 11.5px;
  font-variant-numeric: tabular-nums; letter-spacing: .2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  white-space: nowrap;
}

/* 拼音表 */
.pinyin-box { width: 900px; max-width: 95vw; max-height: 88vh; }
.pinyin-box h3 { padding: 16px 24px; margin: 0; font-size: 18px; color: var(--ink); border-bottom: 1px solid var(--line); }
.pinyin-tabs {
  display: flex; gap: 4px; padding: 12px 20px 0;
  border-bottom: 1px solid var(--line); overflow-x: auto;
  flex-shrink: 0;
}
.pinyin-tab {
  padding: 8px 14px; cursor: pointer; font-size: 13px;
  color: var(--ink-soft); border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all .12s;
}
.pinyin-tab:hover { color: var(--ink); }
.pinyin-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.pinyin-grid {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
}
.pinyin-cell {
  padding: 14px 8px; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  font-size: 18px; color: var(--ink); cursor: pointer;
  transition: all .12s; font-family: "Times New Roman", serif;
  position: relative;
}
.pinyin-cell:hover { border-color: var(--accent); background: #fffaf3; transform: translateY(-2px); }
.pinyin-cell.playing { background: var(--accent); color: #fff; border-color: var(--accent); }
.pinyin-cell .noplay { display: block; font-size: 9px; color: #c5b89f; margin-top: 2px; }
.pinyin-cell.playing .noplay { color: rgba(255,255,255,.8); }

/* ============================================================
   标定系统
   ============================================================ */
/* 热点按钮（贴在书页上） */
.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 60;
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px; border: none; border-radius: 10px;
  cursor: pointer; background: transparent;
  transition: transform .15s ease;
  pointer-events: auto;
}
.hotspot:hover { transform: translate(-50%, -50%) scale(1.15); }
/* 框选出来的矩形区域热点（不用 transform 居中，按 w/h 直接铺）—— 不显示红色边框 */
.hotspot.hs-area {
  transform: none;
  border: none;
  background: transparent;
  border-radius: 6px;
  display: block;
  padding: 0;
}
.hotspot.hs-area:hover {
  background: transparent;
  border-color: transparent;
}
/* 文字为空的矩形热点：用半透明云朵印记替代虚线框 */
.hotspot.hs-area.hs-empty-label {
  background: transparent;
  border: none;
}
.hotspot.hs-area.hs-empty-label::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 46px; height: 31px;
  /* --hs-yunduo 由 assets/js/media.js 在「线上走 COS」时注入；
     没注入就用本地相对路径兜底。CSS 里 url() 不能直接写 var()，
     但整个 url() 放在 var() 的兜底位是合法的。 */
  background: var(--hs-yunduo, url('../pages/yunduo.png')) center / contain no-repeat;
  opacity: 0.45;
  filter: sepia(1) saturate(4) hue-rotate(-18deg);  /* 浅红色调 */
  pointer-events: none;
}
.hotspot.hs-area.hs-empty-label:hover { background: rgba(181,73,46,.08); }
.hotspot.hs-area.hs-empty-label:hover::after { opacity: 0.7; }
.hotspot .hs-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.hotspot .hs-label {
  padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,.6);
  color: #fff; font-size: 11px; white-space: nowrap;
}
/* 矩形热点内的图标/文字：放在区域中心 */
.hotspot.hs-area .hs-icon {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 32px; height: 32px; font-size: 14px;
}
.hotspot.hs-area .hs-label {
  position: absolute; left: 50%; top: calc(50% + 22px);
  transform: translateX(-50%);
}
.hotspot.htype-video .hs-icon { background: #e67e22; }
.hotspot.htype-audio .hs-icon { background: #27ae60; }
.hotspot.htype-word .hs-icon { background: #b5492e; }
.hotspot.htype-pinyin .hs-icon { background: #2980b9; }
.hotspot.htype-flip .hs-icon { background: #8e44ad; }

/* ============================================================
   领读热点（audio）+ 课文动画热点（video）：都用老师卡通形象（2 倍尺寸）
   ============================================================ */
.hotspot.htype-audio .hs-icon,
.hotspot.htype-video .hs-icon {
  /* --hs-teacher 由 assets/js/media.js 在「线上走 COS」时注入；没注入就用本地相对路径兜底。 */
  background: var(--hs-teacher, url('../pages/teacher.png')) center / contain no-repeat;
  width: 72px; height: 108px;  /* 老师形象 2:3 比例，2 倍放大 */
  font-size: 0;  /* 隐藏原 unicode */
  border-radius: 0;
  box-shadow: none;
}
/* 矩形热点内的图标稍小一点（但仍是 2 倍） */
.hotspot.htype-audio.hs-area .hs-icon,
.hotspot.htype-video.hs-area .hs-icon {
  width: 64px; height: 96px;
}

/* ============================================================
   生字热点（运行时）—— 完全隐身不遮挡生字，只留点击区域
   标定模式下仍显示完整编辑图标（方便定位）
   ============================================================ */
.hotspot.htype-word .hs-icon { display: none !important; }
.hotspot.htype-word::before { display: none !important; }
/* 点状生字热点：48x48 透明点击区域（覆盖字中心，hover 给一个淡光环提示） */
.hotspot.htype-word:not(.hs-area) { width: 48px; height: 48px; }
.hotspot.htype-word:hover { box-shadow: 0 0 0 2px rgba(181,73,46,.18); border-radius: 50%; }
/* 标定模式下恢复完整编辑图标 */
body.calibrating .hotspot.htype-word .hs-icon { display: flex !important; }
body.calibrating .hotspot.htype-word::before { display: none; }

body.calibrating .hotspot { opacity: .9; }
body.calibrating .hotspot .hs-icon { box-shadow: 0 0 0 3px rgba(255,255,255,.8), 0 3px 10px rgba(0,0,0,.4); }
/* 标定模式下矩形热点显示更明显的编辑边框 */
body.calibrating .hotspot.hs-area { border-color: var(--accent); border-style: dashed; }
body.calibrating .hotspot::after {
  content: '编辑'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  padding: 1px 6px; border-radius: 4px; background: #333; color: #fff; font-size: 9px;
  white-space: nowrap; opacity: 0; transition: opacity .15s;
}
body.calibrating .hotspot:hover::after { opacity: 1; }

/* 标定模式：书页可点击定位（翻页由 JS 拦截 mousedown 冒泡实现，左右箭头仍可翻页） */
body.calibrating .page { cursor: crosshair; }
body.calibrating .stf__block { box-shadow: 0 0 0 2px rgba(181,73,46,.35), 0 22px 50px -8px var(--shadow); }

/* 标定工具栏 */
.cal-toolbar {
  position: fixed; left: 50%; bottom: calc(var(--thumb-h) + 16px);
  transform: translateX(-50%);
  display: none; align-items: center; gap: 14px;
  padding: 8px 16px; border-radius: 30px;
  background: rgba(40, 36, 30, .94);
  color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  z-index: 90;
}
.cal-toolbar.show { display: flex; }
.cal-badge { background: #e67e22; padding: 3px 10px; border-radius: 14px; font-size: 12px; font-weight: 600; }
.cal-info { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.cal-actions { display: flex; gap: 8px; }
.cal-btn {
  padding: 7px 14px; border: 1px solid rgba(255,255,255,.3); border-radius: 18px;
  background: transparent; color: #fff; cursor: pointer; font-size: 13px;
  transition: all .15s; white-space: nowrap;
}
.cal-btn:hover { background: rgba(255,255,255,.15); }
.cal-btn.primary { background: #e67e22; border-color: #e67e22; font-weight: 600; }
.cal-btn.primary:hover { background: #d97706; }
.cal-btn.danger { color: #ff9d8a; }

/* 标定配置弹窗 */
.cal-box { width: 580px; max-width: 94vw; }
.cal-box h3 { padding: 16px 24px; margin: 0; font-size: 17px; color: var(--ink); border-bottom: 1px solid var(--line); }
.cal-box h3 span { color: var(--accent); font-size: 13px; margin-left: 8px; }
.cal-body { padding: 16px 24px; max-height: 70vh; overflow-y: auto; }

/* ============================================================
   配置表面板（查看 / 编辑 / 删除所有已标定热点）
   ============================================================ */
.list-box { width: 880px; max-width: 96vw; max-height: 86vh; display: flex; flex-direction: column; }
.list-box h3 { padding: 14px 20px; margin: 0; font-size: 16px; color: var(--ink); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.list-box h3 span { color: var(--accent); font-size: 13px; font-weight: 400; }
.list-toolbar { padding: 12px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: #faf6ed; }
.list-toolbar input { flex: 1; padding: 7px 12px; border: 1px solid #d4c8b0; border-radius: 6px; background: #fff; font-size: 13px; font-family: inherit; outline: none; }
.list-toolbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181,73,46,.1); }
.list-stats { font-size: 12px; color: #6b5a3a; font-family: monospace; white-space: nowrap; }
.list-table-wrap { flex: 1; overflow: auto; padding: 0; }
.list-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.list-table thead { position: sticky; top: 0; z-index: 1; background: linear-gradient(180deg, #f5ead2, #ebe0c2); }
.list-table th { padding: 8px 10px; text-align: left; font-weight: 600; color: #5a4a2a; border-bottom: 2px solid #d4c8b0; font-size: 12px; }
.list-table td { padding: 7px 10px; border-bottom: 1px solid #f0e8d4; vertical-align: middle; }
.list-table tbody tr { cursor: pointer; transition: background .12s; }
.list-table tbody tr:hover { background: var(--paper-deep); }
.list-table .col-page { font-weight: 600; color: var(--accent); font-size: 11.5px; line-height: 1.3; text-align: center; }
.list-table .col-content { color: var(--ink); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; }
.list-table .col-pos { color: #8b7c5a; font-family: monospace; font-size: 11px; }
.list-table .col-label { color: #6b5a3a; font-size: 12px; }
.list-table .col-actions { white-space: nowrap; }
.lt-type { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.lt-type-video { background: #fce4cf; color: #b5492e; }
.lt-type-audio { background: #d4edda; color: #1d6f42; }
.lt-type-word { background: #f8d7da; color: #a32a3b; }
.lt-type-pinyin { background: #cfe2f3; color: #1a5490; }
.lt-type-flip { background: #e2d2ee; color: #6a1b9a; }
.lt-btn { padding: 3px 9px; margin-right: 4px; border: 1px solid #d4c8b0; border-radius: 4px; background: #fffaf2; color: var(--ink); font-size: 11.5px; cursor: pointer; font-family: inherit; }
.lt-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.lt-btn.lt-del { color: #a32a3b; }
.lt-btn.lt-del:hover { background: #a32a3b; color: #fff; border-color: #a32a3b; }
.list-empty { padding: 60px 20px; text-align: center; color: #b3a88f; font-size: 14px; }
.list-footer { padding: 10px 20px; border-top: 1px solid var(--line); background: #faf6ed; }
.list-hint { color: #8b7c5a; font-size: 11.5px; }

/* ============================================================
   自定义 Combobox（搜索框 + 可滚动分组列表）
   ============================================================ */
.cb-wrap { position: relative; }
.cb-input {
  width: 100%; padding: 8px 36px 8px 12px;
  border: 1.5px solid #d4c8b0; border-radius: 8px;
  background: #fffaf2; font-size: 14px; color: var(--ink);
  font-family: inherit; box-sizing: border-box;
  cursor: pointer;
}
.cb-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181,73,46,.12); }
.cb-toggle {
  position: absolute; right: 4px; top: 4px;
  width: 28px; height: 28px;
  border: none; background: transparent; border-radius: 6px;
  cursor: pointer; font-size: 10px; color: #8b7c5a;
  display: flex; align-items: center; justify-content: center;
}
.cb-toggle:hover { background: var(--paper-deep); color: var(--accent); }
.cb-panel {
  display: none;
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 300;
  background: #fffaf2; border: 1.5px solid #d4c8b0; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(60,40,20,.18);
  flex-direction: column; overflow: hidden;
  max-height: 380px;
}
.cb-panel.cb-open { display: flex; animation: fadeIn .15s; }
.cb-search {
  width: 100%; padding: 8px 12px;
  border: none; border-bottom: 1px solid var(--line);
  background: #fff; font-size: 13px; font-family: inherit;
  box-sizing: border-box; outline: none;
}
.cb-search:focus { background: #fff8ed; }
.cb-list {
  flex: 1; overflow-y: auto; padding: 4px 0;
  scrollbar-width: thin;
}
.cb-list::-webkit-scrollbar { width: 6px; }
.cb-list::-webkit-scrollbar-thumb { background: #c8b894; border-radius: 3px; }
.cb-group-head {
  padding: 6px 14px;
  background: linear-gradient(180deg, #f5ead2, #ebe0c2);
  color: #6b5a3a; font-weight: 700; font-size: 12px;
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid #e0d5b8;
  border-bottom: 1px solid #e0d5b8;
}
.cb-group-count { font-size: 11px; color: #9c8d68; font-weight: 400; }
.cb-item {
  padding: 7px 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  border-bottom: 1px solid #f0e8d4;
}
.cb-item:hover { background: var(--paper-deep); }
.cb-item.cb-active { background: rgba(181,73,46,.12); }
.cb-item.cb-selected { background: rgba(181,73,46,.18); border-left: 3px solid var(--accent); padding-left: 11px; }
.cb-item-label { font-size: 13px; color: var(--ink); font-weight: 500; }
.cb-item-fn { font-size: 10px; color: #a89875; font-family: monospace; }
.cb-empty { padding: 30px; text-align: center; color: #b3a88f; font-size: 13px; }
.cal-row { margin-bottom: 14px; }
.cal-row > label {
  display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px;
}
.cal-types { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-type-btn {
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 20px;
  background: #fff; color: var(--ink); cursor: pointer; font-size: 13px;
  transition: all .12s;
}
.cal-type-btn:hover { border-color: var(--accent-soft); }
.cal-type-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal-row select, .cal-row input[type="text"], .cal-row input[type="number"] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; color: var(--ink); background: #fff;
}
.cal-row select:focus, .cal-row input:focus { outline: none; border-color: var(--accent); }
.cal-hint { font-size: 12px; color: #b3a88f; margin-top: 6px; }
.cal-pos-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-pos-row > label { margin-bottom: 0; }
.cal-pos-row span { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.cal-pos-row input[type="number"] { width: 70px; }
.cal-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-top: 1px solid var(--line);
}
.cal-footer .spacer { flex: 1; }
.cal-footer .cal-btn { color: var(--ink); border-color: var(--line); }
.cal-footer .cal-btn.primary { color: #fff; }
.cal-footer .cal-btn.danger { color: var(--accent); border-color: var(--accent-soft); }

/* ---------- 书本区 ---------- */
.book-area {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  /* 上下留出书页堆叠 + 桌面投影的空间，避免阴影被裁掉。
     v3：外扩的「书页体块」右侧最多到 +19px、书脊硬壳左侧到 -8px、
         地脚接触阴影再向下 ~20px，因此左右各留 64px、下方留 62px。 */
  padding: 40px 64px 62px;
}
/* 书本宽度约束容器（JS 计算最大宽度以适配高度） */
.book-sizer {
  position: relative;
  width: 100%;
  max-width: 1180px;
}

/* ============================================================
   ⚠️ 反闪烁 / 反卡顿：禁止书区参与任何 CSS 过渡（2026-09-25）
   ------------------------------------------------------------
   现象：从封面点开第一页时，内页会先出现在"封面所在位置"，
        再向左滑到跨页位置 —— 也就是用户说的"从左边加载到正中间"。
   根因（逐帧实测）：翻页引擎在横向模式下把 .stf__block 渲染成
        「双页宽」；封面态我们给它加了 .cover-only{translateX(-25%)}。
        点开第一页时引擎已经把左右两页摆到跨页坐标（#1@225 / #2@707），
        但 .cover-only 类是在翻页「落定后」才移除的 —— 于是这两页
        先套着 translateX(-25%) 渲染在 x≈466（正是封面位置），
        等类被移除后再"弹"回最终位置，肉眼即一帧闪烁 + 位移动画。
   做法：① 书区所有元素一律 transition:none，类切换瞬时生效；
        ② 位移改由 margin-left 承担（见下），彻底避开过渡。
   ============================================================ */
.book-area,
.book-area *,
.stf__parent,
.stf__wrapper,
#book .stf__block,
#book .stf__item,
#book .stf__item::before,
#book .stf__item::after {
  transition: none !important;
}

/* 注意：`.book-area *` 会连 .nav-arrow / .thumb 等命中，
   但翻页按钮的位移是 transform，transition:none 只让它"变得干脆"，
   不影响功能；hover 缩放仍会瞬时生效。 */

#book { width: 100%; }

/* 翻页引擎页面 */
#book .page {
  overflow: hidden;
  /* 让页面成为「容器查询」基准：页内按钮的 cqw 以「页面宽度」为参照，
     从而在任何屏型下都按页面尺寸等比缩放（而不是按视口缩放）。
     container-type: inline-size = contain: layout style inline-size，
     只影响宽度计算方式与绝对定位包含块，不改变页面外观与翻页引擎布局。 */
  container-type: inline-size;
}
#book .page img {
  width: 100%; height: 100%; display: block;
  pointer-events: none; user-select: none;
  /* 图片未到时先显示纸色底 + 轻微渐变（不是刺眼的白纸），
     加载完成后再淡入，避免「打开时先看到一片空白页」的廉价感 */
  background: linear-gradient(100deg, #f6f1e6 0%, #efe8d8 60%, #f3ecdd 100%);
  opacity: 0; transition: opacity .18s ease-out;
}
#book .page img.loaded { opacity: 1; }

/* ============================================================
   仿真「俯视摊开的实体书」效果  2026-09-25 (v2 修正)
   参考：真实教科书平摊在书桌上的俯拍照片。
   纯 CSS 实现（不侵入翻页引擎），分五层：
     1. 书桌木质背景 + 环境光（柔化，不喧宾夺主）
     2. 书页堆叠边缘（书口 / 天头地脚，一叠纸的厚度）
     3. 中缝装订凹槽（仅在真正的双页模式显示）
     4. 纸张纹理、暗角、纸色
     5. 整体投影（落在桌面上的一圈柔和暗影）
   ------------------------------------------------------------
   v2 修正要点：
   · 桌面由深棕改为暖灰木桌，明度提高，避免"黑框"感
   · 中缝只在双页时出现；封面/单页模式（--simple）绝不显示
   · 封面单页模式的书脊改到左侧（真实书封的样子），而非对称堆叠
   · 纸色提亮，暗角减弱，让内页更像"白纸上的印刷"
   ============================================================ */

/* --- 1. 书区背景：暖色木质书桌 + 顶部环境光 + 柔和暗角 --- */
.book-area {
  background:
    /* 顶部斜射光：像台灯从上方照在桌面上 */
    radial-gradient(120% 90% at 50% -18%,
      rgba(255,247,228,.42) 0%,
      rgba(255,243,214,.14) 36%,
      transparent 66%),
    /* 四角柔和压暗，把视线收拢到书本上 */
    radial-gradient(75% 65% at 50% 50%,
      transparent 55%, rgba(72,52,30,.18) 100%),
    /* 细密木纹 */
    repeating-linear-gradient(93deg,
      rgba(255,255,255,.020) 0px, rgba(255,255,255,.020) 1px,
      rgba(0,0,0,.013) 1px, rgba(0,0,0,.013) 4px),
    repeating-linear-gradient(0deg,
      rgba(120,92,58,.05) 0px, rgba(120,92,58,.05) 2px,
      transparent 2px, transparent 26px),
    /* 桌面.base：暖灰木，比 v1 明显提亮 */
    linear-gradient(168deg, #a99276 0%, #9a8467 40%, #8a7458 100%);
  background-color: #9a8467;
  perspective: 2600px;
  perspective-origin: 50% 44%;
}

/* --- 2. 书页堆叠：用多层 box-shadow 模拟一叠纸的侧边 --- */
.stf__block {
  box-shadow:
    /* 书口（左右外沿）与天头地脚的一叠纸边 —— 由浅到深，像一叠纸的横截面 */
    2px 0 0 0 #f7f0e2, 4px 0 0 0 #eee4d2, 6px 0 0 0 #e4d8c2,
    8px 0 0 0 #d9caae, 10px 0 0 0 #cdbb9a, 12px 0 0 0 #c0ac88,
    -2px 0 0 0 #f7f0e2, -4px 0 0 0 #eee4d2, -6px 0 0 0 #e4d8c2,
    -8px 0 0 0 #d9caae, -10px 0 0 0 #cdbb9a, -12px 0 0 0 #c0ac88,
    0 2px 0 0 #efe6d4, 0 4px 0 0 #e2d6c0, 0 6px 0 0 #d4c5aa,
    /* 整体落在桌面上的投影：近实远虚三层 */
    0 18px 32px -12px rgba(52,34,14,.44),
    0 40px 68px -20px rgba(52,34,14,.34),
    0 70px 110px -34px rgba(52,34,14,.26);
  border-radius: 1px 2px 2px 1px;
}

/* --- 3. 中缝凹槽：只在「真正的双页摊开」时出现 ---
   注意：stf__block 在翻页过程中是常驻的，不能凭它判断；
   用 :has() 看当前是否真的渲染出左右两页内容，才是准确的判据。 */
#book .stf__block:has(.stf__item.--left[style*="block"]):has(.stf__item.--right[style*="block"])::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; width: 4.6%; height: 100%;
  transform: translateX(-50%);
  pointer-events: none; z-index: 12;
  background:
    linear-gradient(90deg,
      rgba(70,48,24,0) 0%,
      rgba(70,48,24,.05) 18%,
      rgba(62,42,20,.16) 34%,
      rgba(54,36,16,.34) 45%,
      rgba(40,26,10,.50) 50%,
      rgba(54,36,16,.34) 55%,
      rgba(62,42,20,.16) 66%,
      rgba(70,48,24,.05) 82%,
      rgba(70,48,24,0) 100%);
  mix-blend-mode: multiply;
  opacity: .85;
  /* ⚠️ 2026-10-01 修复「中缝两条印记」
     ------------------------------------------------------------
     现象：跨页摊开时，中缝两侧各有一条 9px 宽的浅棕竖条，像两道压痕。
     根因（实机量出来的，不是猜的）：下面「书页堆叠」那条规则
     （#book .stf__block:not(.cover-only)::before，见文件后半段）
     用的是**同一个伪元素** ::before。它带的 box-shadow 是
     「左 9 层 + 右 9 层」奶白→浅棕台阶（-1px..-9px / 1px..9px）。
     两条规则在跨页态同时命中：本规则靠 :has() 拿到更高特异性，
     赢下了 left / width / height / background / z-index，
     但 **box-shadow 本规则没写，于是从那条规则漏了过来** ——
     那 9 层台阶就画到了这个 38px 宽的中缝伪元素身上，
     左右各探出 9px，正好是肉眼看到的两条竖条。
     做法：显式置空，断掉级联串味。中缝只保留它自己的渐变。
     （同理把 border-radius / background-color 也一并清掉，
       避免以后改那条规则时又被带进来。） */
  box-shadow: none;
  border-radius: 0;
  background-color: transparent;
}

/* --- 4. 纸张：纸色 + 纤维纹 + 四周极淡暗角 --- */
#book .page {
  position: relative;
  background: #fdfbf6;
}
#book .page::after {
  content: '';
  position: absolute; inset: 0; z-index: 6;
  pointer-events: none;
  background:
    /* 暗角：中心透明，四角略深（模拟纸张受光） */
    radial-gradient(125% 112% at 50% 46%,
      transparent 68%, rgba(122,96,60,.055) 88%, rgba(100,76,44,.11) 100%),
    /* 横向纸纤维 */
    repeating-linear-gradient(0deg,
      rgba(160,132,92,.014) 0px, rgba(160,132,92,.014) 1px,
      transparent 1px, transparent 2px),
    /* 纵向纸纤维 */
    repeating-linear-gradient(90deg,
      rgba(160,132,92,.010) 0px, rgba(160,132,92,.010) 1px,
      transparent 1px, transparent 3px);
}

/* 靠外沿的页边微微泛黄（真实书页的"书口黄"） */
#book .stf__item::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  box-shadow:
    inset 0 0 34px rgba(158,124,72,.075),
    inset 0 0 10px rgba(158,124,72,.05);
}

/* 翻页中的那一页投影加重，增强厚度感 */
#book .stf__item.--left .stf__outerShadow,
#book .stf__item.--right .stf__outerShadow { opacity: .88; }

/* --- 5. 封面态：让孤立封面看起来像一本「合上的书」 ---
   翻页引擎在横向模式下，block 宽度 = 双页宽（≈964px），
   而封面只有一个 --simple 的 item（≈482px，靠右），左半是空的 —— 直接露桌面，很假。
   真实场景：合上的书只占一个页面宽。
   做法：当 block 里只有「一个 --simple 的 item」时，把 block 收到半宽并居中，
        同时补一层"书壳底板"，让封面像躺在硬壳封面上。 */

/* 封面态：block 收成单页宽 + 居中 */
#book .stf__block.cover-only {
  /* 封面只有右半幅内容（宽 50%），空着的左半让它视觉重心偏右。
     要让它落到书区正中，就把它左移「半个封面宽」= 50% × 50% = 25% 块宽。
     若实机观感偏左/偏右，只需微调这一个数值。
     ⚠️ 用 margin-left 而不是 translateX：margin 不参与 transform 过渡，
        类被 JS 摘掉时是「瞬时归零」，不会产生从封面位置滑回跨页的动画
        （translateX 版本配合 transition 就是闪烁的主因，见上方说明）。 */
  margin-left: -25%;
  transform: rotateX(1deg);
  border-radius: 3px 2px 2px 3px;
  box-shadow:
    /* 左侧书脊：较厚，带一条压痕 */
    -1px 0 0 0 #e8dcc6, -3px 0 0 0 #dccfb4, -5px 0 0 0 #cdbc9c,
    -6px 0 0 0 #b9a582, -7px 0 0 0 rgba(120,95,60,.55),
    /* 右侧书口：薄 */
    2px 0 0 0 #f2e9d8, 4px 0 0 0 #e3d7c0, 6px 0 0 0 #d2c2a4,
    /* 顶部与底部纸边 */
    0 2px 0 0 #efe6d4, 0 4px 0 0 #ddd0b6,
    /* 投影略收，单页更"立" */
    0 16px 30px -10px rgba(52,34,14,.42),
    0 38px 64px -20px rgba(52,34,14,.30),
    0 66px 100px -32px rgba(52,34,14,.22);
  overflow: visible;
}

/* 封面态的书口纸边 / 书脊压痕：
   已由下方「实体书『体块感』强化 v3」区块统一接管
   （那版把纸口做成有分层的一叠纸 + 硬壳书脊圆背），
   此处不再重复定义，避免两条规则互相覆盖造成维护困惑。 */


/* 竖屏/单页宽屏（block 本身就是单页宽）时不需要位移 */
@media (max-aspect-ratio: 1/1) {
  #book .stf__block.cover-only {
    margin-left: 0;
    transform: rotateX(1deg);
  }
}

/* ============================================================
   实体书「体块感」强化  2026-09-25 (v3)
   ------------------------------------------------------------
   问题（用户反馈）：v2 已经把封面做成了带纸边的卡片，但整体仍然是
       「一张扁平卡片贴在纯色木桌上」—— 看不到一本书该有的
       ▸ 硬壳书板的厚度（书壳比内页大一圈、且是深色硬板）
       ▸ 书页体块（书口那一叠纸的"侧面"，有分层与阴影，不是一条白边）
       ▸ 书脊圆背（精装/胶装书脊是圆的，会把封面顶起一道弧）
       ▸ 书自身的厚度投影（近桌面处最实、向外迅速衰减的接触阴影）
   目标（对齐用户参考图 #2）：像一本**厚书近乎侧看**的样子 ——
       奶油白色的纸边体块 + 圆润的分层阴影，贴着暖褐色桌面。

   实现思路（关键）：全部用 ::before / ::after 与 box-shadow 叠加，
   **不新增 DOM、不碰翻页引擎**，因此不会引入新的重排/重绘开销，
   也不会破坏已修好的反闪烁逻辑（这些层不参与任何 transition）。

   两套形态：
     A. 摊开态（.stf__block 双页）—— 左右两叠纸口 + 中央书脊凹陷
     B. 封面态（.stf__block.cover-only）—— 右侧整本书的纸口体块 +
        左侧硬壳书脊圆背 + 书壳外沿（比内页大一圈的深色硬板）
   ============================================================ */

/* --- A-1. 摊开态：书页体块（书口）做成有分层的"一叠纸" ---
   用两层叠加：
     ::before → 纸口主体（奶油白 → 米黄，向下渐深，模拟纸叠的受光/背光）
     配合 box-shadow 的"台阶"—— 每一阶 1px、颜色逐级加深，
     视觉上就是一层层纸的横截面。 */
#book .stf__block:not(.cover-only)::before {
  content: '';
  position: absolute;
  left: -13px; top: -3px; right: -13px; bottom: -3px;
  z-index: -2;
  pointer-events: none;
  border-radius: 2px 2px 3px 3px;
  /* ⚠️ 注意：本规则与上面「中缝凹槽」那条用的是同一个 ::before。
     跨页摊开时两条同时命中，中缝那条靠 :has() 特异性更高，
     会覆盖这里的 left / width / height / background / z-index。
     所以本规则实际只在「中缝那条不命中」时生效 —— 而它的 :has()
     条件要求左右两页都渲染出来，正是跨页态本身，两者几乎完全重叠。
     也就是说：**跨页态下这里只有 box-shadow 会露出来**（其余属性被盖掉）。
     2026-10-01 已在中缝规则里显式 box-shadow:none 来阻断这个泄漏；
     若将来要真正启用这套「书页堆叠」外观，应把它换到别的宿主
     （例如 .stf__wrapper::before），不要和中缝抢同一个伪元素。 */
  background:
    linear-gradient(180deg,
      #fbf7ee 0%, #f6efe0 42%, #ece1cb 72%, #ddcfb2 100%);
  box-shadow:
    /* 左侧书口：一叠纸的横截面，由外向内逐级变深 */
    -1px 0 0 0 #f4ecdb, -2px 0 0 0 #eadfc9, -3px 0 0 0 #dfd1b5,
    -4px 0 0 0 #d3c2a1, -5px 0 0 0 #c7b591, -6px 0 0 0 #bcaa84,
    -7px 0 0 0 #b1a078, -8px 0 0 0 #a89770, -9px 0 0 0 #9d8c66,
    /* 右侧书口 */
    1px 0 0 0 #f4ecdb, 2px 0 0 0 #eadfc9, 3px 0 0 0 #dfd1b5,
    4px 0 0 0 #d3c2a1, 5px 0 0 0 #c7b591, 6px 0 0 0 #bcaa84,
    7px 0 0 0 #b1a078, 8px 0 0 0 #a89770, 9px 0 0 0 #9d8c66,
    /* 天头 / 地脚的纸口 */
    0 1px 0 0 #f4ecdb, 0 2px 0 0 #e8dcc6, 0 3px 0 0 #dbcdaf,
    0 4px 0 0 #cdbc9b, 0 5px 0 0 #c0ae8a;
}

/* --- A-2. 摊开态：书压在桌面上的接触阴影 ---
   真实摄影里，书与桌面的接触线最实、最暗，向外扩散很快变淡。
   所以这里用「小偏移 + 小模糊 + 高不透明度」贴一条，再叠两层大范围柔影。 */
#book .stf__block:not(.cover-only)::after {
  content: '';
  position: absolute;
  left: 6px; right: 6px; bottom: -14px; height: 22px;
  z-index: -3;
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(60% 100% at 50% 0%,
      rgba(48,30,12,.30) 0%,
      rgba(48,30,12,.14) 48%,
      transparent 78%);
  filter: blur(6px);
}

/* --- B-1. 封面态：整本书的「书页体块」—— 这是立体感的核心 ---
   参考图 #2 给人的第一印象就是「一整叠厚纸的侧面」：
   从上到下有一条条极细的横向分层线（每张纸的边缘），
   靠近封面一侧亮、向外逐渐沉入阴影。
   这里用 repeating-linear-gradient 做「纸页分层」，
   再用 12 级 box-shadow 向右拉出体块的厚度。 */
#book .stf__block.cover-only {
  /* 书壳外沿：硬壳比内页大一圈，深色硬板，四周各露出 8px */
  outline: 8px solid #6f5940;
  outline-offset: 0px;
}

#book .stf__block.cover-only::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  z-index: -1;
  border-radius: 3px 1px 1px 3px;
  pointer-events: none;
  /* 纸口主体：一排排细密的横向纸页分层 */
  background:
    repeating-linear-gradient(180deg,
      rgba(120,96,60,.00) 0px,
      rgba(120,96,60,.00) 2px,
      rgba(120,96,60,.16) 2px,
      rgba(120,96,60,.16) 2.6px),
    linear-gradient(90deg,
      #efe4cf 0%, #f9f3e6 12%, #fdfaf3 30%,
      #f7f0e1 62%, #eee2ca 84%, #e0d1b4 100%);
  box-shadow:
    /* 书页体块的厚度：向右一阶一阶加深（每阶 1.4px） */
    2px 0 0 0 #f2e8d6, 3.5px 0 0 0 #e9dcc4, 5px 0 0 0 #dfd0b3,
    6.5px 0 0 0 #d4c2a0, 8px 0 0 0 #c9b58f, 9.5px 0 0 0 #bda87f,
    11px 0 0 0 #b29c72, 12.5px 0 0 0 #a79066,
    14px 0 0 0 #9c855b, 15.5px 0 0 0 #917a51,
    17px 0 0 0 #867047, 18.5px 0 0 0 #7b663f,
    /* 体块自身也落影：越靠外越淡，形成「从书里透出来的光」 */
    22px 3px 12px -4px rgba(70,48,22,.34),
    /* 天头 / 地脚的纸口 */
    0 2px 0 0 #e9dcc4, 0 4px 0 0 #d8c9ab,
    0 -1px 0 0 #efe5d2,
    /* 接触阴影：贴着桌面那条最实 */
    0 16px 22px -10px rgba(48,30,12,.48),
    0 40px 60px -22px rgba(48,30,12,.32),
    0 78px 110px -40px rgba(48,30,12,.22);
}

/* --- B-2. 封面态：左侧硬壳书脊「圆背」 ---
   真实精装/胶装书的书脊是外凸的圆弧，转折处被光扫亮一条高光。
   用一条竖向渐变 + 内侧阴影模拟，宽度 16px。 */
#book .stf__block.cover-only::after {
  content: '';
  position: absolute; left: -8px; top: -8px;
  width: 17px; height: calc(100% + 16px);
  pointer-events: none; z-index: 13;
  border-radius: 5px 0 0 5px;
  background:
    linear-gradient(90deg,
      #4e3d2a 0%,
      #6f5940 14%,
      /* 圆背高光：光从左上打来，脊背顶部被扫亮 */
      #a08668 34%,
      #b89b78 44%,
      #8d7455 62%,
      #5f4b34 86%,
      #46351f 100%);
  box-shadow:
    /* 书脊与封面之间的压痕（装订凹槽） */
    inset -3px 0 6px -2px rgba(24,14,4,.55),
    inset 3px 0 5px -1px rgba(255,240,215,.20),
    /* 书脊自身的立体感 */
    2px 0 5px -1px rgba(40,26,10,.40);
}

/* 让封面图不要盖住书脊压痕：封面图本体从书脊右侧开始 */
#book .stf__block.cover-only .stf__item {
  border-radius: 0 2px 2px 0;
}

/* 移动端/窄屏：书区留白收窄，桌面感减弱，避免小屏上四周都是木纹 */
@media (max-width: 620px) {
  .book-area {
    padding: 18px 16px 20px;
    background:
      radial-gradient(130% 100% at 50% -20%, rgba(255,247,228,.38) 0%, rgba(255,243,214,.12) 40%, transparent 70%),
      linear-gradient(168deg, #a99276 0%, #99836a 45%, #8a7458 100%);
    background-color: #99836a;
  }
  #book .page::after { background: none; }   /* 小屏省掉纸纹，减少合成开销 */
}

/* 平板（<=1024px）同样省掉纸纹层：这一层是「噪点+渐变」叠加，
   在 iPad 这类 GPU 上会持续增加每页重绘成本，拖动/翻页时更明显。 */
@media (max-width: 1024px) {
  #book .page::after { background: none; }
}

/* 页面内跳转链接（拼音点读入口页）：
   只覆盖海报图片本身，而不是整页——避免点空白处也跳转带来的「莫名跳走」感。
   位置按 page-002.jpg 海报实际像素标定（1191x1684 → 2.2% / 27.2% / 97.7% / 62.4%）。

   2026-10-01 修复「第 2 页拼音点读没展示出来」：
   原先封面图是烘焙进 page-002.jpg 的，换图后被覆盖，热区就成了空框。
   现在把封面图叠在这个热区上（background-image 由 book.js 设置，走
   MEDIA.url 解析，线上取 COS），这里只负责卡片外观。
   ⚠️ 必须用 background-* 长写属性：用 background 简写会把 JS 设的
      background-image 之外的东西重置掉，也会让 hover 状态把封面图抹掉。 */
.page-link {
  position: absolute;
  left: 2.2%; top: 27.2%; width: 95.5%; height: 35.2%;
  display: block; z-index: 50; cursor: pointer;
  border-radius: 14px;
  background-color: rgba(255,255,255,.94);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  box-shadow: 0 8px 22px rgba(70,52,28,.22);
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .18s, background-color .18s, transform .18s;
}
.page-link::after {
  content: '点击进入 ▸';
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  padding: 4px 14px; border-radius: 999px;
  background: rgba(181,73,46,.92); color: #fff;
  font-size: 13px; letter-spacing: 1px; white-space: nowrap;
  opacity: 0; transition: opacity .18s;
  box-shadow: 0 4px 12px rgba(90,70,40,.35);
  pointer-events: none;
}
.page-link:hover {
  box-shadow: 0 0 0 3px var(--accent), 0 12px 30px rgba(70,52,28,.30);
  background-color: rgba(255,255,255,.99);
}
.page-link:hover::after { opacity: 1; }
.page-link:active { transform: scale(.985); }

/* ---------- 页内「横幅式」入口（如第 4 页「语文游戏乐园」） ----------
   与 .page-link（整页热区）的区别：
     .page-link  = 整页可点，页面上盖一块大白底再放背景图（用于封面页）
     .page-card  = 页内一条大横幅，横跨页面大部分宽度
   用途：第 4 页是整幅海洋插图（没有留白），入口必须浮在插图上半部，
        既醒目（用户反馈：小卡片太难点到）又不破坏插图完整性。
   形式参照线上「拼音点读游戏」的横幅入口。
   ---------------------------------------------------------------- */
.page-card {
  position: absolute;
  z-index: 50;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 26px rgba(70,52,28,.30), 0 2px 8px rgba(70,52,28,.18);
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .18s, transform .18s;
}
.page-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* ★ 必须显式把 opacity 拉回 1。
     站点有一条全局规则 `#book .page img { opacity: 0 }`（0,2,1 特异性）——
     页面图靠 JS 加 .loaded 类才淡入，避免"打开时先看到一片空白页"。
     我们的横幅封面图不走那套加载流程，没有 .loaded 类，
     于是被这条规则压成全透明 ——
     表现就是「横幅里一片空白」，极难察觉。
     这条规则的特异性是 (0,2,1)，这里用 `#book .page-card img` 覆盖。 */
  opacity: 1 !important;
  pointer-events: none;
  user-select: none;
  background: none;
}
/* 底部只留一条极淡的压暗（标题文字已画进图里，不再叠加文字标签） */
.page-card::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 24%;
  background: linear-gradient(180deg, rgba(20,40,60,0) 0%, rgba(20,40,60,.16) 100%);
  pointer-events: none;
}
.page-card:hover {
  box-shadow: 0 0 0 3px var(--accent), 0 16px 36px rgba(70,52,28,.38);
  transform: translateY(-3px);
}
.page-card:active { transform: scale(.985); }

/* 「免费」小角标 */
.page-card__badge {
  position: absolute; left: 7px; top: 7px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFE9A8, #FFD166);
  border: 1.5px solid #fff;
  color: #7A3E12;
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  box-shadow: 0 2px 6px rgba(90,60,20,.28);
  pointer-events: none;
}

/* ---------- 页内按钮式入口（如第 63 页「拼音点读游戏」） ----------
   与 .page-link（整页热区）的区别：这里只占页面左下角一小块，做成浅绿椭圆按钮。
   ★ 等比适配原则：**所有尺寸都按页面尺寸等比缩放**，不再对手机端单独放大。
     · 宽度   : 页面宽的 30%（百分比，跟随页面缩放）
     · 高度   : 由 aspect-ratio 推出（4.3:1，与课本 mockup 的椭圆比例一致）
     · 字号   : cqw = 按钮自身宽度的 1%，所以字也随按钮等比缩放
     · 边框   : 同理用 cqw，并设 1px 下限避免高分屏上边框消失
     · 圆角   : 999px（椭圆）；按钮较矮时浏览器会自动收敛成半高圆端
     这样 web（双页 940px 宽）/ 平板 / 手机（单页 390px 宽）上按钮与页面
     的相对大小完全一致，不会像之前那样在手机上被放大、压住下方内容。
   left / bottom 由 book.js 按 page-062.jpg 实际像素标定后内联设置。 */
.page-btn {
  position: absolute;
  z-index: 50;
  width: 30%;
  aspect-ratio: 4.3 / 1;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  container-type: normal;                /* 容器基准在 .page 上（见上），此处不能自己引用自己 */
  font-family: inherit;
  font-size: 3.45cqw;                    /* 页面宽的 3.45%（cqw 以 .page 宽度为基准） */
  font-weight: 600;
  line-height: 1;
  letter-spacing: .04em;
  white-space: nowrap;
  cursor: pointer;
  border: max(1px, .35cqw) solid #7fae62;
  border-radius: 999px;
  background: #dcf0c8;
  color: #3f6134;
  box-shadow: 0 .5cqw 1.6cqw rgba(90,70,40,.16), inset 0 1px 0 rgba(255,255,255,.7);
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.page-btn:hover { background: #cfe9b8; box-shadow: 0 .8cqw 2.6cqw rgba(90,70,40,.22), inset 0 1px 0 rgba(255,255,255,.8); }
.page-btn:active { transform: scale(.97); }
.page-btn:focus-visible { outline: 3px solid #4a9a5a; outline-offset: 2px; }
/* 可点区域扩展：视觉尺寸严格按页面等比缩放（不因手机端而变大），
   但用透明层把触摸命中区向外扩一圈，手机上更好点而不改变外观比例。 */
.page-btn::before {
  content: '';
  position: absolute;
  left: -8%; right: -8%; top: -34%; bottom: -34%;
}
/* 注：.stf__block / .stf__item 的仿真书外观统一在上方「仿真俯视摊开的实体书」区块定义，
   此处不再覆盖，避免后者把书页堆叠与投影效果冲掉。 */

/* 两侧翻页点击热区 + 提示 */
.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.7); border: 1px solid var(--line);
  color: var(--ink); cursor: pointer; z-index: 20;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  box-shadow: 0 4px 14px rgba(90,70,40,.18);
  transition: all .15s;
}
.nav-arrow:hover { background: #fff; color: var(--accent); transform: translateY(-50%) scale(1.06); }
.nav-arrow.prev { left: 8px; }
.nav-arrow.next { right: 8px; }
.nav-arrow:disabled { opacity: 0; pointer-events: none; }

/* ---------- 底部缩略图 ---------- */
.thumb-bar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--thumb-h);
  background: rgba(253, 250, 243, .95);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 5px; padding: 0 8px;
  z-index: 40;
}
.thumb-scroll {
  display: flex; gap: 5px; overflow-x: auto; padding: 4px 2px;
  scroll-behavior: smooth; flex: 1;
}
.thumb-scroll::-webkit-scrollbar { height: 4px; }
.thumb-scroll::-webkit-scrollbar-thumb { background: #d6c9ab; border-radius: 4px; }
.thumb {
  flex: none; width: 28px; height: 38px; border-radius: 3px;   /* 2026-09-25 随 --thumb-h 缩半 */
  background-size: cover; background-position: center;
  border: 2px solid transparent; cursor: pointer; position: relative;
  box-shadow: 0 1px 3px rgba(90,70,40,.2);
  transition: transform .12s, border-color .12s;
}
.thumb:hover { transform: translateY(-2px); }
.thumb.active { border-color: var(--accent); }
.thumb .no {
  position: absolute; left: 2px; bottom: 1px; font-size: 7px; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

/* ---------- 开场遮罩 ---------- */
#intro {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(120% 120% at 50% 30%, #3a2d20 0%, #231a12 70%);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 20px;
  transition: opacity .6s ease;
}
#intro.hide { opacity: 0; pointer-events: none; }
#intro .book-ico { font-size: 56px; }
#intro h1 {
  color: #f4ecd8; font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 30px; letter-spacing: 6px; font-weight: 600;
}
#intro p { color: #cbb98f; font-size: 14px; letter-spacing: 2px; }
#intro .btn {
  margin-top: 8px; padding: 12px 34px; border-radius: 30px;
  background: var(--accent); color: #fff; font-size: 15px; letter-spacing: 4px;
  cursor: pointer; border: none; box-shadow: 0 6px 20px rgba(181,73,46,.5);
  transition: transform .15s;
}
#intro .btn:hover { transform: translateY(-2px); }

/* 移动端 */
/* ---------- 平板 / 手机统一适配（断点 620 → 1024） ----------
   平板（iPad 等）此前走的是「桌面那套」：工具栏不收窄、侧栏挤压书区、翻页箭头常驻。
   在 1024×768 横屏下这套会让书区被侧栏挤窄；iPad 若开「桌面版网站」，
   CSS 视口会掉到 620px 以下、侧栏变覆盖层而书页仍按全宽居中 → 正文被侧栏盖住
   （用户反馈的「正文被截断」）。
   现在把平板并入手机这一套：工具栏收窄、侧栏变覆盖层、书页获得完整宽度。
   ⚠ book.js 的 layoutBook() 用 getComputedStyle 读padding，
     侧栏展开时 body.side-open 的 padding-left 会自动触发书页重算。 */
@media (max-width: 1366px) {
  :root { --toolbar-h: 52px; --thumb-h: 46px; }   /* 2026-09-25 同步收窄 */
  .sidebar { position: fixed; top: var(--toolbar-h); bottom: var(--thumb-h); left: 0; box-shadow: 8px 0 30px rgba(0,0,0,.15); }
  .book-area { padding: 12px 8px; }

  /* 小屏侧栏是 fixed 覆盖层（不占布局宽度）。展开时必须给书区让出等宽左边距，
     否则 layoutBook() 仍按书区全宽算书页宽度 → 书页居中在整屏、被侧栏盖住左侧，
     平板「桌面版网站 / 非 100% 缩放」时最明显，表现为正文被截断。
     书区加了 padding 后，layoutBook() 会用 getComputedStyle 读到新的 padding 并自动重算宽度。 */
  body.side-open .book-area { padding-left: calc(var(--sidebar-w) + 10px); }

  /* 覆盖层应有的遮罩：点空白处收起侧栏（由 book.js 的 .layout 点击事件处理）
     .layout 本身已经是 inset: 工具栏 0 缩略条 0，所以遮罩用 inset:0 即可 */
  body.side-open .layout::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(35, 24, 12, .26); z-index: 25;
  }
  /* 悬浮翻页箭头：窄屏下只是缩小（桌面 52px → 窄屏 40px），保持可见。
     用户 2026-10-11 明确要求：悬窗箭头与工具栏翻页箭头都要保留，不要隐藏。 */
  .nav-arrow { width: 40px; height: 40px; font-size: 17px; }

  .toolbar { padding: 0 10px; gap: 6px; height: var(--toolbar-h); }
  .toolbar .brand .titles { display: none; }
  .toolbar .brand .logo { width: 32px; height: 32px; font-size: 16px; border-radius: 8px; }
  .page-indicator { font-size: 11px; }
  .page-indicator b { font-size: 12px; }
  .icon-btn { width: 32px; height: 32px; font-size: 15px; }
  .thumb { width: 24px; height: 33px; }
  .thumb .no { font-size: 6px; }
}

/* ---------- 页面教学配置面板（pagenotes.html） ---------- */
.pn-panel {
  width: 360px; flex: none;
  background: rgba(253, 250, 243, .96);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
/* 面板内嵌工具条（替代原 fixed 底部工具条，避免遮挡书页与面板） */
.pn-toolbar {
  padding: 8px 10px;
  background: rgba(40, 36, 30, .95);
  display: flex; flex-direction: column; gap: 8px;
}
.pn-toolbar .cal-info { flex-wrap: wrap; row-gap: 2px; }
.pn-toolbar .cal-actions { flex-wrap: wrap; }
.pn-toolbar .cal-badge { background: #b5492e; }

/* 缩略图条被隐藏时（no-flip 配置页/标定页），书区回收底部空间 */
body.no-flip .layout { inset: var(--toolbar-h) 0 0 0; }
body.no-flip .tip { bottom: 26px; }

@media (max-width: 1280px) {
  .pn-panel { width: 320px; }
}

.pn-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); background: #faf6ed; }
.pn-head-row { display: flex; align-items: center; gap: 8px; }
.pn-head-title { font-size: 14.5px; font-family: "Songti SC", "STSong", "SimSun", serif; }
.pn-state {
  margin-left: auto; padding: 2px 10px; border-radius: 12px;
  font-size: 11.5px; color: #8b7c5a; background: #efe7d5; white-space: nowrap;
}
.pn-state.on { background: var(--accent); color: #fff; font-weight: 600; }
.pn-page-info {
  margin-top: 8px; font-size: 21px; color: var(--accent);
  font-family: "Songti SC", "STSong", "SimSun", serif; letter-spacing: 1px;
}
.pn-meta { margin-top: 2px; font-size: 11.5px; color: var(--ink-soft); }

.pn-server-warn {
  margin: 10px 16px 0; padding: 9px 11px;
  background: #fdf0ec; border: 1px solid #e8b7a6; border-radius: 8px;
  font-size: 12px; line-height: 1.7; color: #8a3b22;
}
.pn-server-warn a { color: #1a5f8f; text-decoration: underline; font-weight: 600; }
.pn-server-warn b { color: #8a3b22; }

.pn-body {
  flex: 1; overflow-y: auto; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.pn-body::-webkit-scrollbar { width: 7px; }
.pn-body::-webkit-scrollbar-thumb { background: #d9cdb4; border-radius: 4px; }

.pn-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(90, 70, 40, .06);
  transition: border-color .15s, box-shadow .15s;
}
.pn-card:focus-within { border-color: var(--accent); box-shadow: 0 2px 10px rgba(181, 73, 46, .14); }
.pn-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pn-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pn-card-head b { font-size: 13.5px; color: var(--ink); }
.pn-count { margin-left: auto; font-size: 11px; color: #b3a88f; }
.pn-count.filled { color: var(--accent); }
.pn-input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; line-height: 1.75; resize: vertical;
  font-family: inherit; color: var(--ink); background: #fffdf8; min-height: 76px;
}
.pn-input:focus { outline: none; border-color: var(--accent); background: #fff; }
.pn-input::placeholder { color: #c3b9a2; }

.pn-foot { padding: 10px 16px 14px; border-top: 1px solid var(--line); background: #faf6ed; }
.pn-hint { font-size: 11.5px; color: #9c9078; line-height: 1.6; margin-bottom: 10px; }
.pn-foot-btns { display: flex; gap: 8px; }
.pn-btn {
  flex: 1; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.pn-btn:hover { background: var(--paper-deep); border-color: var(--accent-soft); }
.pn-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pn-btn.primary:hover { background: #9e3d25; }
.pn-dirty { color: #ffb26b; font-size: 12px; }
.pn-list-box { width: 860px; max-width: 94vw; }
a.cal-btn { text-decoration: none; display: inline-flex; align-items: center; }

@media (max-width: 820px) {
  .pn-panel { width: 300px; }
  .pn-input { min-height: 58px; }
}

/* 工具提示 */
.tip {
  position: fixed; left: 50%; bottom: calc(var(--thumb-h) + 26px);
  transform: translateX(-50%); padding: 8px 16px; border-radius: 20px;
  background: rgba(58,50,42,.88); color: #f4ecd8; font-size: 12.5px; letter-spacing: 1px;
  opacity: 0; pointer-events: none; transition: opacity .3s;
  /* 必须高于 .modal(200)：媒体加载失败提示需要在弹窗打开时可见，
     否则「生字笔顺视频加载失败」这类提示会被压在弹窗遮罩之后 */
  z-index: 300;
}
.tip.show { opacity: 1; }

/* ---------- 翻页合成优化 ----------
   只给「当前页」提升为独立合成层：翻页动画由 GPU 接管，抖动更小。
   刻意不加在 .page / .stf__item 上——那样会一次创建 119 个合成层，
   平板内存和合成开销反而更糟。 */
.stf__item--current { will-change: transform; }
