  :root {
    /* 告诉浏览器/系统本页支持的明暗能力：滚动回弹区、表单控件、
       独立窗口状态栏文字颜色都据此绘制，缺了它深色页面会被按浅色处理。 */
    color-scheme: light;
    --bg: #f5f3ee;
    --text: #2b2b2b;
    --text-dim: #9a948a;
    --bar-icon: #57534e;            /* 顶栏图标（金句/点赞/收藏）默认色：比 text-dim 更实，浮在封面上也看得清 */
    --focus: #d9480f;
    --bar-bg: rgba(245, 243, 238, 0.8);
    --privacy-bg: rgba(245, 243, 238, 0.9);
    --btn-bg: rgba(0, 0, 0, 0.06);
    --btn-text: #2b2b2b;
    --shadow: rgba(0, 0, 0, 0.12);
    /* 卡片描边专用：--shadow 是给投影用的（深色下更是半透明黑），
       拿来画边框会在米白底上压出一圈硬线。卡片本身已有毛玻璃和投影分层，
       边框只需要极轻的一点边界感，别让它抢戏。 */
    --card-border: rgba(0, 0, 0, 0.07);
    /* 卡面底色：列表卡片（继续播放等）用它，比页面底再「亮/实」一档才浮得起来 */
    --card-surface: #fffdf9;
    /* 语音浮层的整屏底（见 .vd-backdrop）。不能直接用 --bg：
       浅色下两者同色，浮层打开只是"内容凭空消失"，没有"盖了一层"的层次，
       文字和底下的书架糊在一起，识别度很低（2026-11-12 用户反馈）。
       这里比 --bg 深一档的暖米灰，纸感不变但边界出来了。 */
    --vd-veil: #e3dccb;
    /* 顶栏底部分割线专用：比 --shadow 淡得多。顶栏有毛玻璃本身就在分层，
       用 --shadow 会在米白底上压出一道硬线，很突兀。 */
    --divider: rgba(0, 0, 0, 0.06);
    /* 封面懒加载骨架：底色比卡片再实一档才看得出「在占位」，扫光用高透明度白 */
    --skeleton-bg: rgba(0, 0, 0, 0.05);
    --skeleton-sheen: rgba(255, 255, 255, 0.75);
    /* ── 折叠屏保留区（iPhone Duo 这类内外双屏设备）──
       折叠带与外屏前摄遮挡的位置，Web 侧拿不到 env()：HIG 只给了 ReservedRegion
       （SwiftUI/UIKit）这一条路。所以由原生壳读到 fold / occlusion 的 frame 后，
       注入下面四个变量（像素值），网页只负责把它们当额外内边距让开。
       普通设备下全是 0px，所有 calc() 自动退化成原来的值，不影响现有布局。 */
    --fold-l: 0px;
    --fold-r: 0px;
    --fold-t: 0px;
    --fold-b: 0px;
    /* 上面四边里只要有一边被折叠带 / 遮挡占住，__applyFoldInsets() 就把这个开关置 1。
       需要「只在折叠设备姿态下才生效」的样式乘上它：普通手机恒为 0，
       所有 calc() 自然退化，不会凭空多出边距（阅读页右侧那 14px 就是这么来的）。 */
    --fold-on: 0;
    /* 顶栏左右内边距与「标题让位」：两者必须同源，否则标题会压到按钮上
       （见 .title 的说明）。--tb-guard = 边距 + 两个 38px 按钮 + 8px 间距 + 4px 呼吸。
       宽屏下只改 --tb-pad 一处，标题让位自动跟着变。 */
    --tb-pad: 14px;
    --tb-guard: calc(var(--tb-pad) + 88px);
    /* 数字专用：等宽 / 等数字的西文字体栈，喜爱次数这种纯数字用它比宋体更利落。
       系统字体优先（零下载），一路退到通用 monospace；不随明暗变化，所以只在这里定义一次。 */
    --font-num: "SF Mono", SFMono-Regular, ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
    /* 全站衬线（宋体）字体栈：body 用它，顶栏标题 / 侧边栏抽屉也显式引用。
       不能只靠继承 —— 缺字重的设备会把 font-weight:600/700 的请求回落到黑体，
       一旦抽屉挂在某个自带字体的容器里，继承链一断就整片变黑体。 */
    --font-serif: "Songti SC", "STSong", "Source Han Serif SC", "Source Han Serif TC", "Noto Serif SC", "Noto Serif TC", "Noto Serif Tibetan", "Kailasa", "Microsoft Himalaya", "Noto Sans Tibetan", "Dojo ExtB", serif;
    /* 引导页专属色（跟随系统明暗自动切换，由 guide.php 设置 data-theme） */
    --guide-bg: #f3eee6;
    --guide-text: #2f2a24;
    --guide-line: #6b4f2e;            /* 漂浮摘录文字 / 粒子颜色（浅色下用暖棕，保证对比） */
    --guide-tagline: rgba(58, 46, 34, .62);
    --guide-foot-grad: rgba(243, 238, 230, .96);
    --guide-sheet-bg: #fbf8f3;
    --guide-sheet-text: #2f2a24;
    --guide-grab: rgba(0, 0, 0, .12);
    --guide-tab-bg: rgba(0, 0, 0, .05);
    --guide-tab-text: rgba(0, 0, 0, .55);
    --guide-muted: rgba(58, 46, 34, .55);
    --guide-link: #9c6b2e;
    --guide-remember: rgba(0, 0, 0, .55);
    --guide-sheet-shadow: rgba(0, 0, 0, .18);
  }
  [data-theme="dark"] {
    color-scheme: dark;
    --bg: #15171a;
    --text: #e8e6e1;
    --text-dim: #6b6f76;
    --bar-icon: #bcc1c9;            /* 深色主题：浅灰，在深色封面底上清晰可辨 */
    --focus: #ffa94d;
    --bar-bg: rgba(21, 23, 26, 0.8);
    --privacy-bg: rgba(21, 23, 26, 0.9);
    --btn-bg: rgba(255, 255, 255, 0.08);
    --btn-text: #e8e6e1;
    --shadow: rgba(0, 0, 0, 0.5);
    /* 深色底上黑色描边等于没有描边（只会把卡片边缘压暗），
       极低透明度的白线才是深色 UI 里"有边界但不刺眼"的做法。 */
    --card-border: rgba(255, 255, 255, 0.06);
    --card-surface: #1c1f23;
    /* 深色下浮层底要比页面底再沉一档，否则和 --bg 一样"看不出盖了一层" */
    --vd-veil: #0f1114;
    /* 深色底上黑色分割线只会"更黑"，低透明度白线才是深色 UI 的通行做法。 */
    --divider: rgba(255, 255, 255, 0.10);
    /* 深色下骨架靠一点点白提亮；扫光必须压低，否则黑底上会闪得像故障 */
    --skeleton-bg: rgba(255, 255, 255, 0.06);
    --skeleton-sheen: rgba(255, 255, 255, 0.13);
    /* 引导页专属色（暗色，跟随系统） */
    --guide-bg: #0e1013;
    --guide-text: #e8e6e1;
    --guide-line: #f4e8d5;
    --guide-tagline: rgba(232, 230, 225, .7);
    --guide-foot-grad: rgba(14, 16, 19, .96);
    --guide-sheet-bg: #16191d;
    --guide-sheet-text: #e8e6e1;
    --guide-grab: rgba(232, 230, 225, .25);
    --guide-tab-bg: rgba(255, 255, 255, .06);
    --guide-tab-text: rgba(232, 230, 225, .7);
    --guide-muted: rgba(232, 230, 225, .55);
    --guide-link: #e6c894;
    --guide-remember: rgba(232, 230, 225, .7);
    --guide-sheet-shadow: rgba(0, 0, 0, .5);
  }

  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
  html, body { margin: 0; height: 100%; background: var(--bg); }
  body {
    background: var(--bg);
    color: var(--text);
    /* 前台统一宋体（衬线）：系统宋体优先（苹果零下载）→ 自托管 Noto Serif SC 兜底 → 藏文 → 通用衬线。
       藏文字体必须排在中文字体之后，否则它 unicode-range 里的 U+2000-206F / U+3008-300B
       会截胡中文引号、破折号、书名号。
       "Dojo ExtB" 放最后：它是阅读器按需注入的 CJK 扩展 B 区补字字体（佛典生僻字），
       字体本身限定了 unicode-range:U+20000-3FFFF，正常字不会被它抢走；没注入时找不到
       该字体族，浏览器自动跳过，等于不存在。 */
    font-family: var(--font-serif);
    /* 宋体笔画细，macOS/iOS 默认的次像素渲染会让横画发糊、整体发灰；
       关掉后笔画干净利落，接近印刷宋体的观感。 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    touch-action: manipulation;
  }

  /* 表单控件不继承父级字体（浏览器默认给它们套系统字体），
     不显式继承的话，按钮里的中文仍是黑体，和周围宋体不搭。
     ⚠️ 另：文本类输入框 / 下拉 / 多行框的 font-size 一律写 ≥16px。
     iOS 在聚焦小于 16px 的控件时会自动放大整页，退出键盘后也不还原，
     整页就一直是放大状态（用户会以为「返回后页面被放大了」）。 */
  button, input, select, textarea { font-family: inherit; }

  /* 顶部栏
     ⚠️ 顶部安全区一律读 --sa-top（兜底才用 env）：iOS 旋转回竖屏后 env() 常常还留着
     横屏那份 0，顶栏和内容区会一起矮掉一个刘海的高度、被刘海压住。
     --sa-top 由 inc/sidebar.php 的 syncSafeArea() 维护（竖屏量到真值会记住）。 */
  .topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: calc(54px + var(--sa-top, env(safe-area-inset-top, 0px)));
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 左右也要吃安全区：横屏（尤其外屏「更宽更矮」的折叠设备）时左右边缘会被
       前摄/圆角压住，只让 top 会让两端的按钮点不到。内边距值走 --tb-pad，
       与 .title 的让位宽度同源（宽屏改一处即可）。 */
    padding: var(--sa-top, env(safe-area-inset-top, 0px))
             calc(var(--tb-pad) + env(safe-area-inset-right, 0px))
             0
             calc(var(--tb-pad) + env(safe-area-inset-left, 0px));
    background: var(--bar-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    z-index: 20;
    border-bottom: 1px solid var(--divider);
  }
  /* 标题：左右各让出按钮区，而不是「居中 + 固定 max-width」。
     原因是后者在折叠设备半折 / 横屏这类左右安全区不对称的姿态下会压住按钮：
     .actions 在正常流里，会被 padding-right（含 safe-area）往里推；
     而居中定位的标题只认顶栏自己的宽度，不会跟着让，于是几何上重叠
     （绝对定位元素还会盖在按钮上层，连点击都拦掉）。
     改成 left/right 同时约束后，标题宽度 = 中间剩余空间，天然不可能压到按钮；
     两侧让位相同（--tb-guard），所以内容区对称时标题仍在正中，
     安全区不对称时中心随内容区一起偏移 —— 这正是期望行为。 */
  .title {
    position: absolute;
    left: calc(var(--tb-guard) + env(safe-area-inset-left, 0px));
    right: calc(var(--tb-guard) + env(safe-area-inset-right, 0px));
    text-align: center;
    /* 字体显式写死衬线栈：绝对定位元素最容易在某个页面里丢掉继承链，
       丢了就按浏览器默认黑体渲染（朗读投稿页标题曾如此）。 */
    font-family: var(--font-serif);
    font-size: 17px; font-weight: 700; letter-spacing: 0.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--focus); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; text-decoration: none; flex-shrink: 0; cursor: pointer; transition: opacity .2s; overflow: hidden; }
  .avatar:hover { opacity: .9; }
  .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
  /* 缺省头像（白莲，见 lib/avatar.php）：深色主题下 --focus 变成亮橙，白线稿对比不足，
     按站内「深色配深图标」的惯例把线稿压成深色（.dock-item.ai 也是这么处理的） */
  [data-theme="dark"] img.avatar-def { filter: brightness(0) opacity(.78); }
  /* 头像外框：给「随喜小红花」一个定位参照。
     .avatar 本身 overflow:hidden，花挂在框上而不是头像里，才不会被裁掉。 */
  /* width:fit-content 必须：block 会被父级撑满宽，花就飘到头像外面去了 */
  .avatar-wrap { position: relative; flex: none; display: block; width: fit-content; line-height: 0; }
  .avatar-flower { position: absolute; right: -4px; top: -4px; width: 16px; height: 16px; display: block; pointer-events: none; }
  .avatar-flower[hidden] { display: none; }
  .avatar-flower svg { width: 100%; height: 100%; display: block; }
  .avatar-wrap.lg .avatar-flower { width: 18px; height: 18px; right: -4px; top: -4px; }
  /* margin-left: auto 是给「顶栏左侧没有元素」的页面兜底（如书架页去掉头像后），
     只有一个子元素时 space-between 会把它推到左边，靠这个保持右对齐。 */
  /* 按钮层永远压在标题之上：标题是绝对定位元素，一旦几何上重叠就会盖住按钮并且吃掉点击。
     让位宽度已经保证不重叠，这里再兜一层，以后哪个页面标题超宽也不会让按钮点不到。 */
  .actions { display: flex; gap: 8px; margin-left: auto; position: relative; z-index: 1; }
  .btn {
    border: none;
    background: var(--btn-bg);
    color: var(--btn-text);
    width: 38px; height: 38px;
    border-radius: 10px;
    font-size: 17px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s ease, background 0.3s ease;
  }
  /* 右侧按钮列同款样式：课堂人数、语言/释文(注)、更多(⋯)、字体放大/缩小（宽度与底色必须完全一致） */
  #classCountBtn, #langBtn, #bookMoreBtn, #fontMinus, #fontPlus {
    width: 48px;
    font-size: 16px;
    font-weight: 600;
    background: #f2eee6;
    color: #2b2b2b;
  }
  [data-theme="dark"] #classCountBtn, [data-theme="dark"] #langBtn, [data-theme="dark"] #bookMoreBtn, [data-theme="dark"] #fontMinus, [data-theme="dark"] #fontPlus {
    background: #3a3f47;
    color: #e8e6e1;
  }
  /* 「注」是纯文字按钮（其他三个都是 svg），行高会把它顶偏，这里压一下 */
  #langBtn .rail-glyph { line-height: 1; }
  /* 状态角标：现在读的是哪一份文稿（简/繁/藏/En…），正文（第一份）时不显示。
     不用整块变色 —— 底色突然变主题色会让人以为按钮本身被「打开」了，
     而它其实只是个切换键，状态用右上角的小角标表达更准。 */
  #langBtn { position: relative; overflow: visible; }
  #langBtn .rail-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px;
    background: var(--focus); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px;
    text-align: center; white-space: nowrap;
    box-shadow: 0 0 0 2px var(--bg, #fff);   /* 描一圈底色，压在按钮边缘也看得清 */
    pointer-events: none;
  }
  [data-theme="dark"] #langBtn .rail-badge { color: #14161a; }
  .btn:active { transform: scale(0.9); }
  .btn svg { width: 20px; height: 20px; }
  /* 已喜爱：爱心转实心 + 主题色（须排在深浅色规则之后；填充由 JS 换 .ico-fav-filled 承担，
     这里补的是颜色，两者合起来才是"点上了"的完整反馈） */
  #favBtn.on { color: var(--focus); }

  /* 课堂人数：按钮沿用 .btn 的规格，人数做成右上角标（角标要探出按钮外沿，故按钮 relative） */
  .class-count-btn { position: relative; }
  .class-count-n {
    position: absolute; top: -4px; right: -4px;
    min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
    border-radius: 9px; background: var(--focus); color: #fff;
    font-size: 10px; line-height: 17px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
  }

  /* 阅读区 */
  .reader {
    position: absolute;
    top: calc(54px + var(--sa-top, env(safe-area-inset-top, 0px))); bottom: 0;
    left: 0; right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 720px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* 聚焦行的放大倍数。放大只用 transform（见 .line.active .line-text）：
       不重排、不改行盒高度、不改滚动高度，所以才能「跟着滚动逐行放大」而不卡。
       代价是放大后的字会向左右各多占一点，--zoom-room 就是这个「多占」，
       取 (倍率 - 1) / 2 再宽一点给最坏情况（整行排满）留量。
       想调放大力度只改 --zoom 一处，左右留白与行号间距会自动跟着变。 */
    --zoom: 1.12;
    --zoom-room: calc((var(--zoom) - 1) * 50%);
    /* 页面左侧留白线：与顶栏 .topbar 的 padding（0 14px）同值。
       行号列就从这条线起排，视觉上与顶部按钮的左边缘落在同一条竖线上。 */
    --gutter: 14px;
    /* 行号列宽（.line-no 的 width 共用这个值） */
    --no-col: 26px;
    padding: 40vh var(--zoom-room);
    /* --rail-gap：给右侧那列浮动按钮（.font-stack，38px 按钮 + 10px 边距）留出的余量。
       **只在折叠设备（iPhone Duo 这类）有折叠带 / 遮挡时才生效**（--fold-on = 1）：
       那时右侧除了按钮还有铰链与安全区，两端对齐的行会压到按钮下沿；
       普通手机不避让 —— 按钮列浮在右下角，正文按左右对称留白正好居中，
       无条件加这一条会让右侧凭空多出 14px，整块内容看起来偏左、右侧边距过大。
       只加在右侧：左侧多让会让行号列与顶栏按钮的左边缘错开（那是刻意对齐的竖线）。 */
    --rail-gap: calc(14px * var(--fold-on, 0));
    padding-left: calc(var(--gutter)
                       + env(safe-area-inset-left, 0px) + var(--fold-l, 0px));
    /* 右侧留白必须等于左侧的实际占用（留白线 + 行号列 + 行号与正文的间距）。
       原来右边只有 6% 的放大留白，行号那一列在左边白占位，正文块整体就偏右。
       左右补平后，正文块的中心正好落在屏幕中线上。 */
    padding-right: calc(var(--gutter) + var(--no-col) + var(--zoom-room) + var(--rail-gap)
                        + env(safe-area-inset-right, 0px) + var(--fold-r, 0px));
    line-height: 1.9;
    font-size: 18px;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .reader::-webkit-scrollbar { display: none; }

  .reader p { margin: 0 0 0.6em; text-align: center; }

  /* 逐行阅读：行号 + 当前行聚焦放大 */
  .reader .line {
    display: flex;
    align-items: baseline;
    padding: 0.1em 0;
    color: var(--text);
    opacity: 0.5;
    /* 行本身仍然一条过渡都不留：滚动中每换一行都要重绘这一行，若每行还拖 0.2s 的
       颜色/不透明度补间，屏幕上会同时挂着十几行在过渡，等于每帧重绘整个视口，
       合成器本来只需平移已有画面，被这些重绘一掺和就变成一路拖影。
       所以高亮（颜色）保持瞬切，补间只留给下面 .line-text 的 transform —— 那是
       合成器属性，不重绘也不重排，可以放心地跟着滚动走。 */
  }
  .reader .line-no {
    flex: none;
    width: var(--no-col);
    /* 与正文之间留一段和左右留白同量的间距：放大的字会向左压过来，靠它挡在行号之外。
       右侧 padding 用同一组值补了对称留白，正文块因此仍然居中。 */
    margin-right: var(--zoom-room);
    /* 左对齐：个位/两位数字的左边缘都落在 --gutter 这条线上，与顶部按钮左边缘对齐 */
    text-align: left;
    font-size: 12px;
    color: var(--text-dim);
    opacity: 0.7;
    user-select: none;
  }
  .reader .line-text {
    flex: 1;
    /* 单行内容居中；折成多行的段落两端对齐，左右边缘齐平。
       只有一行时它同时是「最后一行」，text-align-last 因此也管得到它 ——
       于是单行自动居中、多行的末行也居中，整段看起来是一个四边齐整的居中块。
       justify 只对一行以上的段落起作用，单行永远不会被拉开字距。
       下面的默认值保持居中，真启用两端对齐的是紧随其后的 @supports 分支。 */
    text-align: center;
    /* 放大只动 transform。原先用 font-size 放大：字号一变，浏览器必须把整个 .reader
       重排一遍（几千行挨个重新定位），滚动中每换一行排一次，主线程必然追不上合成器，
       表现就是发涩 + 拖影；而且会改滚动高度，放大落下时下面的字会整体跳一下。
       transform 走合成：不重排、不改行盒高度、不改滚动高度，于是放大可以「滚动即到」，
       而不是等停稳再补一下（那种补一下反而更像卡了一下）。 */
    transform-origin: center center;
    transition: transform 0.16s ease-out;
  }
  /* 多行段落两端对齐 + 末行居中。text-align-last 是这套排版的开关：
     不认识它的老浏览器整块忽略，退回上面的全居中，不会把末行掉成左对齐。 */
  @supports (text-align-last: center) {
    .reader .line-text {
      text-align: justify;
      text-align-last: center;
    }
  }
  /* 聚焦：颜色瞬切负责跟手，transform 补间负责顺滑，两者落在同一行上同时发生 */
  .reader .line.active {
    color: var(--focus);
    opacity: 1;
    /* 抬一层：放大后的字会略微越出本行盒，避免被相邻行压住 */
    position: relative;
    z-index: 2;
  }
  .reader .line.active .line-no { color: var(--focus); opacity: 1; }
  .reader .line.active .line-text { transform: scale(var(--zoom)); }
  /* 改字号时临时禁用补间：那一下要按最终布局定位，不能停在过渡中间 */
  .reader.no-anim .line-text { transition: none; }
  /* 标记行：正文高亮为蓝色（含聚焦态） */
  .reader .line.marked .line-text { color: #2563eb; }
  /* 行内加粗（**文字**）：只加字重，颜色继承所在行 —— 蓝色标记行里的加粗仍是蓝的 */
  .reader .line-text strong { font-weight: 700; color: inherit; }
  /* 音频播放中：正文行可点击跳到该行音频，给出可点提示（未播放时不出现） */
  .reader[data-seek="1"] .line { cursor: pointer; }
  .reader[data-seek="1"] .line:hover:not(.active) { opacity: 0.85; }
  .reader .word {
    display: inline-block;
    color: var(--text-dim);
    opacity: 0.45;
    transform: scale(0.82);
    transform-origin: center center;
    transition: opacity 0.2s ease, color 0.2s ease;
    will-change: transform, opacity;
  }
  /* 为放大预留水平空间，避免焦点字压到上下文 */
  .reader.zh .word { padding: 0 0.25em; margin: 0 0.06em; }
  .reader.en .word { padding: 0 0.45em; margin: 0 0.1em; }
  .reader .space { display: inline-block; width: 0.28em; }

  /* ── 注音模式：字上方 ruby 拼音（仅简体，见 reader.php 注音模块）──
     行高统一放大到 3 倍是刻意的：ruby 会让行盒变高，若只有「已渲染注音的行」变高，
     滚动用的 lineTop/lineH 缓存就会与实际错位，聚焦行会漂。把行高一次给足，
     渲染与否都一样高，缓存才继续成立。 */
  /* 注音开着时每个字都是一个 <ruby>，拼音串比字宽，行内容整体变宽，
     必须允许在字之间断行（缺了这两句，长行会被撑到容器外面去）。 */
  .reader.pinyin-on .line-text {
    line-height: 3;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .reader.pinyin-on ruby { ruby-align: center; -webkit-ruby-align: center; }
  /* 拼音本身不折行、不留额外间距：rt 一折行就会把行高顶穿 */
  .reader.pinyin-on rt { white-space: nowrap; }
  /* 拼音用小号无衬线（与正文的宋体拉开距离），颜色走聚焦色但压低不透明度：
     既明显区别于正文，又不抢正文字的视觉重心。 */
  .reader.pinyin-on rt {
    font-size: 0.46em;
    line-height: 1.05;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    color: var(--focus);
    opacity: 0.78;
    letter-spacing: 0;
    user-select: none;
    -webkit-user-select: none;
  }
  /* 注音开启时按钮高亮（与喜爱按钮同一套反馈） */
  #pinyinBtn.on { color: var(--focus); }

  /* 自动滚动控制：左下收起为播放按钮，点击展开速度调节面板，调节完自动收起 */
  .controls {
    position: fixed;
    /* 与右侧按钮列同理：底部让出 home 指示条，左侧让出安全区 / 折叠带 */
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    left: calc(10px + env(safe-area-inset-left, 0px) + var(--fold-l, 0px));
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 20;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  /* 向下滚动隐藏：向左滑出屏幕外 */
  .controls.hidden { transform: translateX(-130%); opacity: 0; pointer-events: none; }
  .controls.expanded .speed {
    max-width: 320px;
    opacity: 1;
    transform: translateX(0);
    padding: 0 14px;
  }
  /* 屏幕右侧按钮列（喜爱 / 字体放大 / 字体缩小）：底部固定，上下垂直排列（上=喜爱，中=加大，下=减小） */
  .font-stack {
    position: fixed;
    /* 底部/右侧都要让开安全区与折叠带：折叠设备半折时右侧就是折叠区，
       不让的话这一列会压进保留区里（点得到但看不清，也可能被系统手势截走）。 */
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px) + var(--fold-r, 0px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 30;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  /* 向下滚动隐藏：向右滑出屏幕外 */
  .font-stack.hidden { transform: translateX(130%); opacity: 0; pointer-events: none; }
  .play-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--focus);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s ease;
  }
  .play-btn:active { transform: scale(0.9); }
  /* 左下按钮列：音乐按钮（上）叠在滚动播放按钮（下）上方 */
  .ctrl-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .music-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bar-bg);
    color: var(--focus);
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px var(--shadow);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    transition: transform 0.15s ease;
  }
  .music-btn:active { transform: scale(0.9); }
  .music-btn svg { width: 20px; height: 20px; display: block; }
  /* 两种状态二选一：静止时是圆角播放三角，播放中换成电平柱条。
     图标只在 .playing 切换显示，JS 仍旧只切这一个类，不用改逻辑。 */
  .music-btn .ico-eq { display: none; }
  .music-btn.playing .ico-play { display: none; }
  .music-btn.playing .ico-eq { display: block; }
  /* 电频图标：播放时三根柱条动态跳动 */
  .eq-bar {
    transform-box: fill-box;
    transform-origin: center;
  }
  .music-btn.playing .eq-bar { animation: eq-bounce 1s ease-in-out infinite; }
  .music-btn.playing .eq-bar:nth-child(1) { animation-delay: -0.15s; animation-duration: 0.8s; }
  .music-btn.playing .eq-bar:nth-child(2) { animation-delay: -0.55s; animation-duration: 1.1s; }
  .music-btn.playing .eq-bar:nth-child(3) { animation-delay: -0.35s; animation-duration: 0.9s; }
  @keyframes eq-bounce {
    0%, 100% { transform: scaleY(0.35); }
    50%      { transform: scaleY(1); }
  }
  /* 「回到音频位置」浮标：跟随被手动滚动打断后出现，点击恢复跟随 */
  .follow-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bar-bg);
    color: var(--focus);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px var(--shadow);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    transition: transform 0.15s ease;
  }
  .follow-btn:active { transform: scale(0.9); }
  .follow-btn svg { width: 20px; height: 20px; }
  /* 分卷按钮：主体是「卷」字，卷号做成右上角小角标。
     角标宽度随内容撑开（min-width + padding，不是固定宽），
     《大般若經》600 卷、预留到 1000 都不会挤；9px 等宽数字读起来也清楚。 */
  .juan-btn { position: relative; }
  .juan-btn-label {
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
  }
  .juan-btn-num {
    position: absolute;
    top: -3px; right: -6px;
    min-width: 15px; height: 15px;
    padding: 0 3px;
    border-radius: 8px;
    background: var(--focus);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    line-height: 15px;
    text-align: center;
    font-variant-numeric: tabular-nums;   /* 数字等宽：1 / 10 / 600 / 1000 都对齐 */
    letter-spacing: -0.2px;
    box-shadow: 0 1px 3px var(--shadow);
    pointer-events: none;                 /* 角标不挡按钮点击 */
  }
  /* 深色主题下 --focus 是浅橙，白字对比不够，换深色字 */
  [data-theme="dark"] .juan-btn-num { color: #15171a; }
  /* 课堂同步浮标：老师正在上课时脉冲提示；已进入同步则实心高亮 */
  @keyframes live-pulse {
    0%, 100% { box-shadow: 0 4px 16px var(--shadow); }
    50%      { box-shadow: 0 4px 22px var(--focus); }
  }
  .follow-btn[data-live] { animation: live-pulse 1.8s ease-in-out infinite; }
  .follow-btn.on { background: var(--focus); color: var(--bar-bg); animation: none; }
  .speed {
    display: flex; align-items: center; gap: 6px;
    height: 44px;
    background: var(--bar-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-radius: 30px;
    box-shadow: 0 6px 24px var(--shadow);
    color: var(--text); font-size: 13px;
    max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
    padding: 0;
    transform: translateX(-10px);
    transition: max-width .35s ease, opacity .35s ease, transform .35s ease, padding .35s ease;
  }
  .speed input { width: 90px; accent-color: var(--focus); }
  .speed-val { flex: none; min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; color: var(--focus); font-weight: 600; }

  /* 书架 */
  .shelf {
    position: absolute;
    top: calc(54px + var(--sa-top, env(safe-area-inset-top, 0px))); bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 960px;
    /* 竖滚靠 auto；横向必须是 hidden：继续播放页的卡片左滑时会整块移出内容区，
       要让它到「屏幕左边缘」才被裁掉（.cr-row 自己不再裁剪），而不是在盒子里挪。
       顺带也挡掉这类位移带来的横向滚动。 */
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--bg);
    -webkit-overflow-scrolling: touch;
    /* 底部留白须大于 Dock 总高（56 + 18 安全距离），避免最后一行书卡被压住；
       再叠一层底部安全区与折叠屏保留区，横屏/双屏姿态下最后一行才不会被 Dock 或铰链压住 */
    padding: calc(18px + var(--fold-t, 0px))
             calc(16px + env(safe-area-inset-right, 0px) + var(--fold-r, 0px))
             calc(110px + env(safe-area-inset-bottom, 0px) + var(--fold-b, 0px))
             calc(16px + env(safe-area-inset-left, 0px) + var(--fold-l, 0px));
    align-content: start;
  }
  /* 真正承载书卡的网格（.shelf 为滚动容器，刷新指示器 ptr 同处其中） */
  .shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 20px 14px;
  }
  .shelf::-webkit-scrollbar { display: none; }
  /* 下拉刷新指示器：固定在滚动容器顶部，高度由手势控制 */
  .ptr { height: 0; overflow: hidden; color: var(--text-dim); font-size: 12px; transition: height .25s ease; }
  .ptr .ptr-text { display: flex; align-items: center; justify-content: center; height: 50px; }
  .book { cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
  .cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    /* 沿用最早一版的 10px：CBETA 封面 SVG 里那条装饰线的圆角（rx=14）就是照这个比例定的 */
    border-radius: 10px;
    box-shadow: 0 6px 18px var(--shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 12px;
    color: #fff;
    transition: transform 0.15s ease;
  }
  .book:active .cover,
  .book.is-press .cover { transform: scale(0.97); }
  /* 图片 / 占位层跟着容器用同一个半径：只靠 overflow:hidden 裁剪时，图片自己的直角边缘
     和容器圆角是两套抗锯齿，浅色封面在转角处会出现一道 1px 的接缝（看起来"不平顺"）。 */
  .cover img.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
  .cover-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg-card-hover, #18181d); color: var(--text-dim, #71717a); font-size: 12px; border-radius: inherit; }
  /* ── 封面懒加载：骨架 + 扫光 ──
     约定「封面图设了 loading="lazy" 即生效」，由 lib/cover-skeleton.js 接管，卡片构建代码不用改：
     取图期间图 .cover-lazy（透明，露出下面的骨架）、容器 .is-cover-loading（底色 + 循环扫光）；
     出图后摘掉骨架、图补 .cover-ready 淡入。class 一没动画就停，不会在出图后空转。
     扫光走 transform（合成层），不用 background-position —— 后者每帧重绘，滚动格子时容易掉帧。
     注意：骨架由脚本延迟 150ms 才亮 —— 封面是 30 天强缓存的静态图，命中缓存时不该闪。 */
  .is-cover-loading { background-color: var(--skeleton-bg); }
  .is-cover-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(100deg, transparent 30%, var(--skeleton-sheen) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: cover-sweep 1.4s ease-in-out infinite;
  }
  @keyframes cover-sweep {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
  }
  img.cover-lazy { opacity: 0; }
  img.cover-lazy.cover-ready { opacity: 1; transition: opacity 0.35s ease; }
  @media (prefers-reduced-motion: reduce) {
    .is-cover-loading::after { animation: none; }   /* 关掉扫光，只留静态骨架 */
  }
  /* 封面底部文字块：书名。部类（.cover-cat）不在这里 —— 它绝对定位固定在
     SVG「大藏經」上方，放这个流式容器里会随书名行数漂移、还会跟 SVG 文字打架。 */
  .cover-text {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  /* 大藏经分部（阿含部 / 般若部 / 密教部…）：
     统一封面的 SVG 自带「大藏經」（约 68%~74% 高度）和「CBETA」（87%+），
     部类固定钉在大藏經正上方、颜色与它一致（白），位置永远一致，
     不会因为书名换行数不同而上下漂移。（bottom 比原 34% 上移约 10px） */
  .cover-cat {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 39%;
    text-align: center;
    color: #fff;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 2px;
  }
  /* CBETA 经号（T0220）：左上角，与封面底部「CBETA」同色（描边金 #C9A86A），
     黑体、再小一点、无底色块也无阴影。 */
  .cover-no {
    position: absolute;
    top: 8px;
    left: 9px;
    z-index: 2;
    color: #C9A86A;
    font-family: "Heiti SC", "SimHei", "Microsoft YaHei", sans-serif;
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.6px;
    font-variant-numeric: tabular-nums;
  }
  .cover-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.35);
  }
  .book .meta { padding: 0 2px; text-align: center; }
  .book-title {
    font-size: 13px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .book-author { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

  /* ── 书架底部 Dock：分类（当前分类首字）/ 音频 / AI（居中）/ 喜爱 / 我的（日历入口在个人中心顶栏） ── */
  .dock {
    position: fixed;
    /* 贴底要避开 home 指示条 / 横屏底部圆角，否则 44px 圆钮有一半落在系统手势区里。
       基础距离 4px：加上底部安全区后整体比原设计更贴底（原先 18px 显得悬空）。 */
    bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    /* 居中要落在「可用区」而不是整个视口：折叠设备半折 / 横屏时左右安全区与折叠带
       往往不对称（例如折叠带只在右侧），直接 left:50% 会让 Dock 偏到被保留区压住的一侧。
       这里把左右让位各算一半当偏移量：可用区 [L, v-R] 的中心 = v/2 + (L-R)/2，
       对称时偏移为 0，与原来的 50% 完全等价。 */
    --dock-inset-l: calc(env(safe-area-inset-left, 0px) + var(--fold-l, 0px));
    --dock-inset-r: calc(env(safe-area-inset-right, 0px) + var(--fold-r, 0px));
    left: calc(50% + var(--dock-inset-l) / 2 - var(--dock-inset-r) / 2);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border-radius: 26px;
    background: var(--bar-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border: 1px solid var(--divider);
    box-shadow: 0 8px 28px var(--shadow);
    z-index: 20;
  }
  /* a / button 两种标签共用同一外观，全部圆形 */
  .dock-item {
    position: relative;
    width: 44px; height: 44px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  }
  .dock-item svg { width: 20px; height: 20px; display: block; }
  .dock-item:hover { background: var(--btn-bg); color: var(--text); }
  .dock-item:active { transform: scale(0.9); }
  /* 分类项：沿用原文字按钮外观（显示当前分类首字），点击在已有分类间循环切换 */
  .dock-item.cat {
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
  }
  /* 首次进站的引导气泡：挂在 Dock 第一个按钮（切换分类）上方，指一下「点这里切换」。
     绝对定位挂在 .dock 上（.dock 是 fixed，即定位参照），不占 flex 的位置、不影响按钮排布。
     气泡从 Dock 左边缘起算（left:0）+ 三角对准按钮中心（31px = 9px 内边距 + 44px/2），
     这样 320px 窄屏也不会被左边裁掉。 */
  .cat-hint {
    position: absolute;
    left: 0;
    bottom: calc(100% + 12px);
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--text);
    color: var(--bg);
    font-size: 12.5px;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .22s ease, transform .22s ease;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  }
  .cat-hint::after {
    content: "";
    position: absolute;
    left: 31px;
    top: 100%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text);
  }
  .cat-hint.on { opacity: 1; transform: translateY(0); }
  @media (prefers-reduced-motion: reduce) {
    .cat-hint { transition: none; }
  }
  /* 中间 AI：比其他项大一圈，强调色实心并略微上浮。点击进入 AI 对话页 */
  .dock-item.ai {
    width: 56px; height: 56px;
    margin: 0 3px;
    background: var(--focus);
    color: #fff;
    box-shadow: 0 6px 18px rgba(217, 72, 15, 0.32);
    transform: translateY(-4px);
    /* box-shadow 也参与过渡：激活态要把它从"下沉硬投影"换成"贴边柔光"，
       否则点开浮层那一下会看到阴影突跳 */
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.45s ease;
  }
  /* 图标压在釉面层（::after）之上：伪元素在子元素之后绘制，不提层会被高光盖住 */
  .dock-item.ai svg { width: 38px; height: 38px; position: relative; z-index: 1; }
  .dock-item.ai:hover { background: var(--focus); color: #fff; opacity: 0.92; }
  .dock-item.ai:active { transform: translateY(-4px) scale(0.9); }
  /* 深色下 --focus 是亮橙，白图标对比不足，改用深色图标 */
  [data-theme="dark"] .dock-item.ai {
    color: #15171a;
    box-shadow: 0 6px 18px rgba(255, 169, 77, 0.30);
  }
  /* 中心莲花：明暗呼吸（仅 opacity 起伏，不缩放）。
     动画加在内部 svg 上 —— .ai 自身有 translateY(-4px)、:active 改 transform，互不打扰。 */
  @keyframes lotus-breathe {
    0%, 100% { opacity: 0.72; }
    50%      { opacity: 1; }
  }
  .dock-item.ai svg { animation: lotus-breathe 4.2s ease-in-out infinite; }
  @media (prefers-reduced-motion: reduce) {
    .dock-item.ai svg { animation: none; }
  }
  /* 语音荐经光晕：彩光贴着莲花圆盘「后面」弥散出来。
     做法是一块虹彩圆盘（conic-gradient）+ 大模糊，再用 mask 只留贴边的一薄层：
     中心挖空（这部分本来就被不透明按钮盖住）→ 按钮边缘外 3px 起最亮 →
     到 44px 半径彻底散尽。范围一大就成"色盘"，所以宁小勿大，靠模糊做出雾感。
     按钮自身有 transform（translateY(-4px)）＝层叠上下文，::before 的 z-index:-1 只能沉到
     按钮的内容之下、背景之上；所以真正让它「不糊脸」的是中间那圈 mask，而不是层级。
     只在浮层打开时亮（body.vd-open），录音时转得更快更亮（body.vd-rec）。 */
  #voiceFab::before {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 88px; height: 88px;
    margin: -44px 0 0 -44px;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        #5b57ff, #00c8d7, #2ee6a8, #ffd23f, #ff5f8f, #b04cff, #5b57ff);
    /* 饱和度压到 145%：全彩 + 大模糊会变成一圈霓虹灯管，压下来才是「光」 */
    filter: blur(14px) saturate(145%) brightness(1.04);
    -webkit-mask-image: radial-gradient(circle at 50% 50%,
        transparent 0 26px, #000 29px, rgba(0, 0, 0, .5) 33px, transparent 44px);
    mask-image: radial-gradient(circle at 50% 50%,
        transparent 0 26px, #000 29px, rgba(0, 0, 0, .5) 33px, transparent 44px);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
    animation: vd-halo-spin 9s linear infinite;
    transition: opacity .45s ease, filter .45s ease;
  }
  body.vd-open #voiceFab::before { opacity: .62; }
  body.vd-rec #voiceFab::before {
    opacity: 1;
    filter: blur(14px) saturate(180%) brightness(1.1);
    animation-duration: 3.2s;
  }
  /* 白底上同样的亮度会发灰，压一档强度就够 */
  [data-theme="light"] body.vd-open #voiceFab::before { opacity: .45; }
  [data-theme="light"] body.vd-rec #voiceFab::before { opacity: .6; }

  /* 激活态的「釉面」：顶部一道高光 + 内侧一圈暗边，让圆盘看起来是有厚度的实体，
     而不是一块压在彩光上的扁平色片。默认不显示 —— 常驻 dock 里它只是入口，太亮会抢视线。 */
  #voiceFab::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;              /* 跟按钮一样是 50%，不写死 */
    background:
      radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 48%),
      linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(0, 0, 0, .12));
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, .55),
      inset 0 -3px 8px rgba(0, 0, 0, .16);
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    transition: opacity .45s ease;
  }
  body.vd-open #voiceFab::after,
  body.vd-rec #voiceFab::after { opacity: 1; }

  /* 激活态阴影：原来的 0 6px 18px 是一圈橙色硬投影，落在背后的彩光上就成了两层
     （实体圆片 + 背后一圈光）——这就是"按钮和光晕分层"的来源。
     换成贴边柔光、与 halo 同色系，圆盘与光晕才连成一体。 */
  body.vd-open #voiceFab,
  body.vd-rec #voiceFab {
    box-shadow:
      0 2px 8px rgba(217, 72, 15, .20),
      0 0 20px rgba(255, 138, 60, .20);
  }
  [data-theme="dark"] body.vd-open #voiceFab,
  [data-theme="dark"] body.vd-rec #voiceFab {
    box-shadow:
      0 2px 8px rgba(255, 169, 77, .16),
      0 0 20px rgba(255, 169, 77, .18);
  }

  @keyframes vd-halo-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
  }
  @media (prefers-reduced-motion: reduce) {
    #voiceFab::before { animation: none; }
  }
  /* 书架空状态（如"该分类下暂无书籍"）：跨满整行、水平居中，并适度下移避免贴顶 */
  .shelf-grid .empty-tip {
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    padding: 22vh 20px 40px;
  }

  /* ── 搜索浮层（左上角搜索按钮）：顶部输入框 + 结果网格 ── */
  .search-overlay {
    position: fixed; inset: 0;
    z-index: 40;                      /* 盖住顶栏与 Dock，但低于弹窗(50) */
    display: flex; flex-direction: column;
    background: var(--bg);
  }
  .search-bar {
    flex: none;
    height: calc(54px + var(--sa-top, env(safe-area-inset-top, 0px)));
    display: flex; align-items: center; gap: 8px;
    padding: var(--sa-top, env(safe-area-inset-top, 0px)) 14px 0;
    background: var(--bar-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--divider);
  }
  .search-ico { width: 17px; height: 17px; flex: none; color: var(--text-dim); }
  .search-bar input {
    flex: 1; min-width: 0;
    height: 36px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--btn-bg);
    color: var(--text);
    font-size: 16px;                  /* 小于 16px 时 iOS 聚焦会自动放大整页 */
    outline: none;
    -webkit-appearance: none;
  }
  .search-bar input::placeholder { color: var(--text-dim); }
  .search-bar input:focus { border-color: var(--focus); }
  /* 隐藏 Safari 原生清除按钮，避免和「取消」挤在一起 */
  .search-bar input::-webkit-search-cancel-button { -webkit-appearance: none; }
  .search-cancel {
    flex: none;
    border: none; background: none;
    color: var(--focus);
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    padding: 6px 2px;
  }
  .search-body {
    flex: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 16px 40px;
  }
  .search-body::-webkit-scrollbar { display: none; }
  /* 最近搜索：空输入时占据空态位置，点一下回填并立刻检索 */
  .search-history { margin: 0 0 20px; }
  .search-history .sh-hd {
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 2px 10px;
    font-size: 12px; letter-spacing: 1px;
    color: var(--text-dim);
  }
  .search-history .sh-clear {
    border: none; background: none; padding: 2px 4px;
    color: var(--text-dim); font-size: 12px; cursor: pointer;
  }
  .search-history .sh-list { display: flex; flex-wrap: wrap; gap: 8px; }
  .search-history .sh-item {
    max-width: 100%;
    padding: 7px 14px;
    border: 1px solid var(--divider);
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--text);
    font-size: 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: pointer;
  }
  .search-history .sh-item:active { opacity: .7; }
  /* 结果网格沿用书架样式；空状态不需要书架那样的大留白 */
  .search-grid .empty-tip { padding: 56px 20px; }

  /* 收录规模：浮层最下面一行灰字。刻意不上边框、不做底卡——
     它的作用是「让人知道这里有东西可搜」，不该和搜索结果抢注意力。 */
  .search-foot {
    flex: none;
    padding: 9px 16px calc(9px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    font-size: 11.5px;
    line-height: 1.6;
    letter-spacing: .2px;
    color: var(--text-dim);
    opacity: .8;
  }
  .search-foot b {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 0 1px;
  }

  /* 空输入引导：只留一个图标 + 一句说明，克制到不去干扰上面的搜索历史 */
  .search-empty {
    grid-column: 1 / -1;
    padding: 26px 12px 10px;
    text-align: center;
  }
  .search-empty .se-ico {
    width: 26px; height: 26px;
    margin: 0 auto 12px;
    color: var(--text-dim);
    opacity: .45;
  }
  .search-empty .se-ico svg { width: 100%; height: 100%; display: block; }
  .search-empty .se-sub {
    margin: 0 auto;
    max-width: 300px;
    font-size: 12.5px; line-height: 1.75;
    color: var(--text-dim);
  }

  /* 结果摘要：「金刚」本地书库 3 部 —— 说清命中数量，别让人自己数 */
  .search-summary {
    grid-column: 1 / -1;
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
    margin: 0 2px 14px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-dim);
  }
  .search-summary .ss-q { color: var(--text); font-weight: 600; }
  .search-summary b {
    color: var(--text); font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 0 1px;
  }

  /* CBETA 全藏检索分区标题：左标题 + 右计数 */
  .search-grid .search-sec {
    grid-column: 1 / -1;
    display: flex; align-items: baseline; gap: 8px;
    margin: 14px 2px 2px;
    padding-top: 10px;
    border-top: 1px solid var(--divider);
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--text-dim);
  }
  .search-grid .search-sec .sec-n {
    margin-left: auto;
    font-size: 11px;
    letter-spacing: .5px;
    color: var(--text-dim);
    opacity: .8;
    font-variant-numeric: tabular-nums;
  }
  /* CBETA 检索结果：与书架一致的响应式网格（自适应不同设备，不滑动） */
  .search-grid #cbetaResults {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 16px 12px;
  }
  .search-grid #cbetaResults .book { width: auto; }

  /* CBETA 卡片封面复用 cbeta-default.jpg（与书架同一张），仅叠加状态角标与进度条 */
  /* 获取状态角标：右上角小圆角矩形，与 .ingest-badge 同一语言 */
  .cbeta-get {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    padding: 3px 6px;
    background: rgba(201, 168, 106, 0.92); color: #1b1e36;
    font-family: "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
    font-size: 10px; font-weight: 600; line-height: 1; letter-spacing: 1px;
    border-radius: 5px; pointer-events: none;
  }
  .cbeta-get.is-reading { background: rgba(108, 122, 137, 0.6); color: #eef1f4; }
  .cbeta-card.busy .cbeta-get { opacity: .85; }
  .cbeta-progress {
    position: absolute; left: 18%; right: 18%; top: 50%; transform: translateY(-50%);
    height: 4px; border-radius: 2px;
    background: rgba(255, 255, 255, 0.14); opacity: 0; transition: opacity .2s ease;
  }
  .cbeta-progress.on { opacity: 1; }
  .cbeta-progress-fill {
    position: relative; height: 100%; width: 0;
    background: linear-gradient(90deg, #c9a86a, #f3e6c4); transition: width .3s ease;
  }
  .cbeta-progress.loading .cbeta-progress-fill::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: translateX(-100%); animation: cbetaShimmer 1.1s infinite;
  }
  @keyframes cbetaShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

  /* CBETA 派生书状态角标：右上角、圆角矩形、黑体小号
     四态：待获取（金）/ 拉取中（蓝，呼吸）/ 重试（红）/ NEW（绿，入库成功 7 天内） */
  .ingest-badge {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    padding: 3px 6px;
    background: rgba(201, 168, 106, 0.92);
    color: #1b1e36;
    font-family: "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
    font-size: 10px; font-weight: 600; line-height: 1; letter-spacing: 1px;
    border-radius: 5px;
  }
  .ingest-badge.is-loading {
    background: rgba(96, 137, 190, 0.92); color: #f2f6fb;
    animation: ingestBreath 1.4s ease-in-out infinite;
  }
  .ingest-badge.is-retry   { background: rgba(190, 96, 84, 0.92);  color: #fdf1ef; }
  .ingest-badge.is-new     { background: rgba(96, 158, 118, 0.92); color: #f1faf3; }
  @keyframes ingestBreath { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
  /* 尊重「减少动态效果」偏好 */
  @media (prefers-reduced-motion: reduce) {
    .ingest-badge.is-loading { animation: none; }
  }

  /* 开课按钮（盾牌图标） */

  /* 弹窗 */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 50; padding: 20px;
  }
  .modal {
    width: 100%; max-width: 320px;
    background: var(--bar-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 22px 20px;
    text-align: center;
    box-shadow: 0 12px 40px var(--shadow);
  }
  /* 开课弹窗要放下「选择课程」下拉，比通用弹窗宽一些 */
  .modal-wide { max-width: 380px; }
  .modal h3 { margin: 0 0 14px; font-size: 17px; }
  .modal-sub { font-size: 13px; color: var(--text-dim); margin: -8px 0 14px; }
  /* 选卷下拉：600 卷的《大般若經》把卷铺成按钮列表会撑出视口、下面的卷点不到，
     交给原生下拉自己滚动（移动端是系统滚轮 / 列表）。 */
  .juan-select {
    width: 100%; height: 44px; padding: 0 10px;
    border-radius: 10px; border: 1px solid var(--shadow);
    /* 16px 下限同上：iOS 聚焦会放大整页 */
    background: var(--bg); color: var(--text); font-size: 16px;
    cursor: pointer;
  }
  .juan-select:focus { border-color: var(--focus); outline: none; }
  .class-code-box { margin: 10px 0 18px; }
  .class-code {
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 34px; font-weight: 700; letter-spacing: 6px; color: var(--focus);
  }
  .class-hint { font-size: 12px; color: var(--text-dim); margin-top: 8px; }
  /* 开课弹窗：绑定书籍下拉 */
  .class-pick { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; text-align: left; }
  .class-pick > label { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
  .class-pick > select {
    flex: 1; min-width: 0; height: 40px; padding: 0 10px;
    border-radius: 10px; border: 1px solid var(--shadow);
    /* 连下拉也算：iOS 点开它会聚焦，14px 会触发整页放大 */
    background: var(--bg); color: var(--text); font-size: 16px;
  }
  .modal-input {
    width: 100%; height: 46px; box-sizing: border-box;
    border-radius: 10px; border: 1px solid var(--shadow);
    background: var(--bg); color: var(--text);
    font-size: 20px; text-align: center; letter-spacing: 4px;
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    outline: none;
  }
  .modal-input:focus { border-color: var(--focus); }
  .modal-error { color: #f87171; font-size: 13px; min-height: 18px; margin-top: 8px; }
  .modal-actions { display: flex; gap: 10px; margin-top: 16px; }

  /* ── 课堂成员名单（阅读页点右侧人数按钮弹出）──
     老师置顶、在线优先；离线的一行整体压暗，右侧标签说清身份 / 状态。
     人多时弹窗限高、只让名单内部滚动：标题与「关闭」始终钉在原位，弹窗不会越撑越高。 */
  /* 限高写两条：dvh 认就用动态视口（折叠/并排时 vh 与实际可视高不一致，弹窗会被裁） */
  .modal-cm { display: flex; flex-direction: column; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); }
  .modal-cm > h3, .modal-cm > .modal-sub, .modal-cm > .modal-actions { flex: none; }
  .cm-list {
    flex: 1 1 auto; min-height: 0; max-height: 46vh;
    overflow-y: auto; overscroll-behavior: contain;
    margin-top: 2px; text-align: left;
  }
  .cm-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--divider); }
  .cm-row:last-child { border-bottom: 0; }
  .cm-row.off { opacity: .55; }
  .cm-av {
    width: 34px; height: 34px; flex: none; border-radius: 50%; overflow: hidden;
    background: var(--focus); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  }
  .cm-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .cm-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .cm-t b { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cm-t i { font-style: normal; font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cm-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: #2fbf71; }
  .cm-row.off .cm-dot { background: var(--divider); }
  .cm-tag { flex: none; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--card-border); color: var(--text-dim); }
  .cm-tag.teacher { color: var(--focus); border-color: currentColor; }
  .cm-tag.me { color: var(--text); border-color: currentColor; }
  .cm-empty { padding: 20px 0; text-align: center; font-size: 13px; color: var(--text-dim); }
  .btn-primary, .btn-secondary {
    flex: 1; height: 44px; border: none; border-radius: 10px;
    font-size: 15px; font-weight: 600; cursor: pointer;
  }
  .btn-primary { background: var(--focus); color: #fff; }
  .btn-secondary { background: var(--btn-bg); color: var(--btn-text); }
  .btn-primary:disabled, .btn-secondary:disabled { opacity: .5; cursor: not-allowed; }
  .modal-close {
    margin-top: 22px; background: none; border: none; color: var(--text-dim);
    font-size: 13px; cursor: pointer;
  }
  /* 开课弹窗内的「加入他人的课堂」：默认折叠，点标题才展开，免得弹窗太长 */
  .class-join { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--shadow); text-align: left; }
  .class-join > summary {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; color: var(--text-dim); cursor: pointer;
    list-style: none; user-select: none;
  }
  .class-join > summary::-webkit-details-marker { display: none; }
  .join-arrow { width: 16px; height: 16px; flex: 0 0 16px; transition: transform .18s ease; }
  .class-join[open] > summary .join-arrow { transform: rotate(180deg); }
  .class-join-row { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
  .class-join-row > .modal-input { flex: 1; min-width: 0; height: 44px; font-size: 18px; }
  .class-join-row > .btn-secondary { flex: 0 0 84px; height: 44px; }
  .class-join-in { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; }
  .class-join-in > span { font-size: 13px; color: var(--text-dim); }
  .class-join-in > .btn-secondary { flex: 0 0 auto; padding: 0 16px; height: 38px; font-size: 14px; }

  /* 加载失败 / 空状态提示（不回退静态内容） */
  .empty-tip {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.6;
  }
  /* 打开书籍失败的缺省页（reader.php 的 readerFail）：说明下面给一排出口按钮。
     .btn-primary / .btn-secondary 自带 flex:1（给弹窗两列用的），这里按内容宽度排。 */
  /* 失败态不套正文排版：.reader 原本是 `padding: 40vh …`（给正文上下留呼吸），
     状态页照抄会「永远能滚」—— 390×844 上 scrollHeight 907 vs 可视 790，
     矮屏（横屏 844×390）更是把按钮顶到折线以下。这里改成 flex + margin:auto：
     空间够就垂直居中、不够才滚动，任何设备都不会被裁。左右也补成对称。 */
  .reader.is-failed {
    padding: 20px 14px;
    display: flex;
    overflow-y: auto;
  }
  .reader.is-failed > .empty-tip {
    margin: auto;            /* 双向居中；内容超高时自动退化为贴顶，可滚动 */
    width: 100%;
    max-width: 420px;
    padding: 24px 0;
  }
  .empty-tip .reader-fail-acts {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 12px;
    margin-top: 22px;
  }
  .empty-tip .reader-fail-acts .btn-primary,
  .empty-tip .reader-fail-acts .btn-secondary {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 124px; height: 42px; padding: 0 20px;
    font-size: 15px; text-decoration: none;
  }
  /* 失败态下面的「重试」：线框胶囊，与「播放全部」同一套描边语言。
     grid 容器里靠 justify-self 居中，flex / block 容器里靠 margin auto。 */
  .empty-retry {
    display: block;
    margin: -30px auto 44px;
    padding: 9px 22px;
    border: 1px solid var(--card-border); border-radius: 999px;
    background: none; color: var(--focus);
    font-size: 14px; line-height: 1; cursor: pointer;
    justify-self: center;
    transition: border-color .15s ease, transform .12s ease;
  }
  .empty-retry:active { transform: scale(0.95); }
  .empty-retry:hover { border-color: var(--focus); }

  /* ── 引导注册页（深色）── */
  body.guide-page {
    background: var(--guide-bg);
    color: var(--guide-text);
    margin: 0;
    overflow: hidden;            /* 引导页固定一屏，不滚动 */
    overscroll-behavior: none;   /* 禁下拉橡皮筋 */
  }
  .guide-wrap {
    position: relative;
    height: 100vh; height: 100dvh;   /* 固定一屏；dvh 动态视口，更适配设备与工具栏 */
    overflow: hidden;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 0 24px;
    box-sizing: border-box;
  }
  /* 中上部 Logo + 文案 */
  .guide-logo {
    position: absolute; top: 15vh; left: 0; right: 0;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    z-index: 2; pointer-events: none;
  }
  /* Logo 容器：inline-block 收缩到图片实际宽高，扫光就只扫在图标轮廓内。
     尺寸 / 圆角 / 扫光参数与 support.php（App 下载页）完全一致：
     上限 160×80，方图在两边都收成 80×80，横版字标都是 160 宽。
     原来图片固定 84×84 + object-fit:cover，横版 / 竖版 LOGO 会被裁掉两端，
     扫光挂在固定容器上还会跑到图片外面的空处。 */
  .guide-logo-mark {
    position: relative; display: inline-block;
    max-width: 160px; max-height: 80px;
    border-radius: 18px; overflow: hidden;
  }
  .guide-logo-img {
    display: block; width: auto; height: auto;
    max-width: 160px; max-height: 80px;
    border-radius: 18px;
    position: relative; z-index: 1;
  }
  /* 扫光：与 support 页同一条光带（同样 -20%/140% 的斜带、3.6s 循环、55% 处滑出），
     由容器的 18px 圆角 + overflow:hidden 裁住，不会越出图片。 */
  .guide-logo-mark::after {
    content: ""; position: absolute; top: -20%; left: -80%; width: 60%; height: 140%;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.55) 50%, transparent 100%);
    transform: skewX(-20deg); animation: guideLogoShine 3.6s ease-in-out infinite;
    z-index: 2; pointer-events: none;
  }
  @keyframes guideLogoShine { 0%{left:-80%} 55%,100%{left:130%} }
  @media (prefers-reduced-motion: reduce) {
    .guide-logo-mark::after { animation: none; }   /* 关掉扫光 */
  }
  .guide-logo-text {
    font-family: "Noto Serif SC", serif; font-size: 30px; font-weight: 700;
    letter-spacing: 4px; color: var(--guide-text);
  }
  .guide-tagline {
    font-size: 15px; letter-spacing: 3px; color: var(--guide-tagline);
  }
  /* 摘录流：占满全屏（除底部按钮区），多行从右往左滑入、停留、再滑出消失（JS 错峰生成） */
  .guide-stream {
    position: relative;
    width: 100%; max-width: 560px;
    flex: 1;
    overflow: hidden;
  }
  @keyframes guideFlow {
    0%   { opacity: 0; transform: translateX(64px); }
    15%  { opacity: 1; transform: translateX(0); }
    100% { opacity: 1; transform: translateX(0); }   /* 停留；退场交由粒子动画 */
  }
  /* 外层只负责竖向定位（按 JS 给的 top 错开，避免多条文字重叠），内层做从右往左滑入滑出 */
  .guide-line {
    position: absolute; left: 0; right: 0; top: 50%;
    transform: translateY(-50%);
    text-align: center;
    padding: 0 10%;
    pointer-events: none;
  }
  .guide-line-inner {
    display: inline-block;
    font-family: "Noto Serif SC", serif;
    font-size: 23px; line-height: 1.8; letter-spacing: 2px;
    color: var(--guide-line);
    opacity: 0;
    animation: guideFlow 4.2s ease forwards;
  }
  /* 粒子消散层：文字退场时被采样成粒子，随风（向右）向上飘散 */
  .guide-particles {
    position: fixed; inset: 0; z-index: 5; pointer-events: none;
  }
  .guide-foot {
    position: fixed; left: 0; right: 0; bottom: 0;
    padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    background: linear-gradient(to top, var(--guide-foot-grad), transparent);
  }
  /* 登录 / 注册并排，同一行同一尺寸 */
  .guide-actions {
    display: flex; gap: 12px; width: 100%; max-width: 360px;
  }
  .guide-cta {
    flex: 1 1 0; min-width: 0; height: 50px;
    border: none; border-radius: 25px;
    background: linear-gradient(135deg, #c9a36a, #e6c894);
    color: #2a1f0e; font-size: 16px; font-weight: 700; letter-spacing: 1px;
    cursor: pointer;
  }
  .guide-cta--ghost {
    background: transparent;
    border: 1px solid rgba(201, 163, 106, .7);
    color: #c9a36a;
  }
  .guide-cta:active { transform: scale(.98); }
  .guide-hint { font-size: 13px; color: var(--guide-muted); }
  .guide-hint a { color: var(--guide-link); text-decoration: none; }

  /* 注册 / 登录底部抽屉：从下往上滑出 */
  .guide-sheet-mask { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .3s ease; }
  .guide-sheet-mask.on { opacity: 1; }
  .guide-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
    background: var(--guide-sheet-bg); color: var(--guide-sheet-text);
    border-radius: 20px 20px 0 0;
    padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%); transition: transform .32s cubic-bezier(.36,.66,.04,1);
    max-height: 88dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;   /* 内部滚到边界时不把滚动传给页面 */
    box-shadow: 0 -8px 40px var(--guide-sheet-shadow);
  }
  .guide-sheet.on { transform: translateY(0); }
  /* 把手同时是「下拉关闭」的手势区：touch-action:none 让浏览器不要抢去滚页面 */
  .guide-sheet-grab {
    width: 40px; height: 4px; border-radius: 2px; background: var(--guide-grab);
    margin: 4px auto 12px; touch-action: none; cursor: grab;
    position: relative;
  }
  /* 可见的只是 4px 细条，用 ::before 把触摸区扩到 120×28，不然很难拖中 */
  .guide-sheet-grab::before {
    content: ""; position: absolute; left: 50%; top: -12px;
    width: 120px; height: 28px; transform: translateX(-50%);
  }
  .guide-sheet-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
  .guide-sheet-tab { flex: 1; padding: 10px; border: none; border-radius: 10px; background: var(--guide-tab-bg); color: var(--guide-tab-text); font-size: 14px; font-weight: 600; cursor: pointer; }
  .guide-sheet-tab.active { background: linear-gradient(135deg,#c9a36a,#e6c894); color: #2a1f0e; }
  .guide-sheet-form { display: none; }
  .guide-sheet-form.active { display: block; }
  .guide-sheet .guide-submit { width: 100%; height: 48px; margin-top: 6px; border: none; border-radius: 24px; background: linear-gradient(135deg,#c9a36a,#e6c894); color: #2a1f0e; font-size: 16px; font-weight: 700; cursor: pointer; }
  .guide-sheet .guide-submit:active { transform: scale(.98); }
  .guide-sheet .guide-submit:disabled { opacity: .6; }
  .guide-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--guide-remember); margin: 2px 0 14px; }
  .guide-remember input { width: 16px; height: 16px; accent-color: #c9a36a; }
  .guide-sheet-close { width: 100%; margin-top: 10px; background: none; border: none; color: var(--guide-muted); font-size: 13px; padding: 10px; cursor: pointer; }
  .guide-sheet-alt { text-align: center; margin-top: 12px; font-size: 13px; color: var(--guide-muted); }
  .guide-sheet-alt a { color: var(--guide-link); text-decoration: none; cursor: pointer; }
  .modal-error.ok { color: #4ade80; }

  /* 隐私政策同意行 + 底部抽屉（注册页） */
  .privacy-consent { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 16px; font-size: 13px; color: var(--text-dim); }
  .privacy-consent input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; flex: none; accent-color: var(--focus); cursor: pointer; }
  .privacy-consent-text { cursor: pointer; line-height: 1.5; }
  .privacy-consent-text .privacy-link { color: var(--focus); }
  /* 隐私政策弹窗（居中自适应，内容可滚动；不再用底部抽屉，避免无法下滑关闭） */
  .privacy-mask { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .25s ease; display: flex; align-items: center; justify-content: center; padding: 18px; }
  .privacy-mask[hidden] { display: none; }
  .privacy-mask.on { opacity: 1; }
  .privacy-sheet {
    width: 100%; max-width: 460px;
    display: flex; flex-direction: column;
    background: var(--privacy-bg); color: var(--text);
    border-radius: 16px;
    max-height: 80dvh;
    box-shadow: 0 12px 44px rgba(0,0,0,.32);
    overflow: hidden;
    transform: translateY(10px) scale(.98); opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
  }
  .privacy-mask.on .privacy-sheet { transform: translateY(0) scale(1); opacity: 1; }
  .privacy-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; border-bottom: 1px solid var(--card-border); }
  .privacy-sheet-title { font-size: 16px; font-weight: 600; }
  .privacy-sheet-x { background: none; border: none; color: var(--text-dim); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 8px; }
  .privacy-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .privacy-sheet-body .pp-back { display: none; }
  .privacy-sheet-body iframe { width: 100%; height: 100%; border: none; display: block; }
  .privacy-sheet-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--card-border); }
  .privacy-agree { width: 100%; height: 46px; border: none; border-radius: 12px; background: var(--focus); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
  .privacy-agree:active { opacity: .9; }

  /* 隐私政策文档（隐私页 + 弹窗内联共用，避免 iframe 在 iOS 上无法滑动） */
  .pp { max-width: 720px; margin: 0 auto; padding: 18px 18px 30px; line-height: 1.85; font-size: 15px; color: var(--text); }
  .pp h1 { font-size: 22px; margin: 16px 0 6px; }
  .pp .pp-updated { color: var(--text-dim); font-size: 13px; margin-bottom: 18px; }
  .pp h2 { font-size: 17px; margin: 26px 0 8px; }
  .pp p, .pp li { color: var(--text); margin: 8px 0; }
  .pp ul { padding-left: 20px; }
  .pp a { color: var(--focus); word-break: break-all; }
  .pp .pp-back { display: inline-block; margin-top: 24px; color: var(--text-dim); font-size: 14px; text-decoration: none; }
  .pp strong { color: var(--text); }
  .guide-field { text-align: left; margin-bottom: 12px; }
  .guide-field label {
    display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px;
  }
  .guide-field input {
    width: 100%; height: 44px; box-sizing: border-box;
    border-radius: 10px; border: 1px solid var(--shadow);
    background: var(--bg); color: var(--text);
    /* 输入框字号必须 ≥16px：iOS 聚焦小于 16px 的输入框会自动放大整页，退出键盘后不还原 */
    font-size: 16px; padding: 0 14px; outline: none;
  }
  .guide-field input:focus { border-color: var(--focus); }
  /* 密码框右侧的「小眼睛」：点一下在明文 / 密文之间切换 */
  .guide-field .pwd-wrap { position: relative; }
  .guide-field .pwd-wrap input { padding-right: 46px; }
  .pwd-eye {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; color: var(--text-dim); cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .pwd-eye:active { opacity: .55; }
  /* 手机号输入框右侧的「获取验证码」按钮（注册/登录抽屉） */
  .guide-field .pwd-wrap .guide-sms-btn {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
    background: rgba(0,0,0,.05); color: var(--focus);
    font-size: 13px; white-space: nowrap; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .guide-field .pwd-wrap .guide-sms-btn:disabled { color: var(--text-dim); cursor: default; }
  /* 登录方式切换（账号密码 / 手机验证码），登录页与 App 内抽屉共用 */
  .login-modes { display: flex; gap: 6px; padding: 4px; margin-bottom: 4px; border-radius: 10px; background: rgba(0,0,0,.05); }
  .login-mode {
    flex: 1; padding: 9px 0; border: none; border-radius: 8px; background: transparent;
    color: var(--text-dim); font-size: 13.5px; font-family: inherit; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: background .2s, color .2s;
  }
  .login-mode.active { background: var(--bg); color: var(--text); font-weight: 600; }
  /* 找回密码：手机号 / 邮箱 两条通道切换（登录页弹窗与 App 内抽屉共用） */
  .reset-channels { display: flex; gap: 6px; margin-bottom: 12px; padding: 3px; border-radius: 9px; background: var(--btn-bg); }
  .reset-channel {
    flex: 1; padding: 7px 0; border: none; border-radius: 7px; background: transparent;
    color: var(--text-dim); font-size: 13px; font-family: inherit; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: background .2s, color .2s;
  }
  .reset-channel.active { background: var(--bg); color: var(--text); font-weight: 600; }
  /* 注册表单下方的说明（账号由系统分配 / 资料后补） */
  .guide-tip { margin: -2px 0 12px; font-size: 12px; line-height: 1.6; color: var(--text-dim); }
  .guide-tip b { color: var(--focus); font-weight: 600; }
  .guide-field .pwd-wrap.has-sms input { padding-right: 96px; }
  .pwd-eye:active { opacity: .55; }
  .pwd-eye svg {
    width: 20px; height: 20px; fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  }
  .pwd-eye.is-on { color: var(--focus); }
  .guide-submit {
    width: 100%; height: 46px; margin-top: 4px;
    border: none; border-radius: 10px;
    background: var(--focus); color: #fff;
    font-size: 15px; font-weight: 600; cursor: pointer;
  }
  .guide-submit:disabled { opacity: .5; cursor: not-allowed; }

  /* ── 喜爱页（书 / 音频 / 合集 三个 Tab）── */
  /* 底部留白与书架一致：本页现在也有常驻 Dock（56 + 18 + 富余），最后一行才不被压住。
     顶部：不靠 top 把滚动视口整体下移 —— 那样内容会在 Tab 下方被截断，Tab 那条带永远是空的。
     改成「视口从顶栏下面就开始（top 沿用 .shelf 的 54px）+ 用 padding-top 留出让位区」：
       · 静止时内容仍从 Tab 下方开始（padding-top = 18 + 48 Tab 高，与原来的落点一致）；
       · 向上滚时内容会穿进 Tab 那条带里，因为 .bm-tabs 透明，能透过它看到下面的内容。 */
  .bm-shelf {
    padding: 66px 16px 110px;
  }
  /* 类型切换（阅读 / 音频 / 合集）：常驻在顶栏下方的一条。
     原先贴底悬浮，现按需求挪到顶部区域 —— 位置改为 top，其余口径不变：
     左右各让 12px、上限 280px（与全局迷你播放器同宽，看着像一套东西）。
     切换 Tab 除了点，还能在页面内容区左右滑动（手势见 bookmarks.php 的 SWIPE_DX）。
     外层不画底色 —— 那块底连同内边距全交给 .bm-tab-group。 */
  .bm-tabs {
    position: fixed;
    left: 50%;
    top: calc(54px + var(--sa-top, env(safe-area-inset-top, 0px)));
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    width: calc(100% - 24px);
    max-width: 280px;
    padding: 6px 0;
  }
  .bm-tab-group {
    flex: 1; min-width: 0;
    display: flex; gap: 0;              /* 三个 Tab 贴在一起，中间不再有缝 */
    padding: 3px;
    border: 1px solid var(--card-border);
    border-radius: 13px;
    background: var(--bar-bg);
    box-shadow: 0 4px 14px var(--shadow);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
  }
  .bm-tab {
    flex: 1; min-width: 0;
    height: 30px;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    border: 0;                          /* 描边由组统一给，Tab 自身不再各自画一圈 */
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    font-family: inherit; font-size: 13px;
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
  }
  .bm-tab:active { transform: scale(0.97); }
  .bm-tab.on { color: var(--focus); background: var(--btn-bg); font-weight: 600; }
  .bm-tab .n { font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums; }
  .bm-tab.on .n { opacity: 1; }
  .bm-list { display: flex; flex-direction: column; gap: 12px; }
  /* 滑动切 Tab：列表给一个跟手势方向的短滑入，让「滑动页面切 Tab」有视觉反馈 */
  @keyframes bm-swipe-l { from { opacity: .35; transform: translateX(26px); } to { opacity: 1; transform: none; } }
  @keyframes bm-swipe-r { from { opacity: .35; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
  .bm-list.swipe-l { animation: bm-swipe-l .22s ease; }
  .bm-list.swipe-r { animation: bm-swipe-r .22s ease; }
  .bm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: var(--bar-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 16px var(--shadow);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s ease;
  }
  .bm-item:active { transform: scale(0.98); }
  .bm-cover {
    flex: none;
    position: relative;   /* 扫光 ::after 的定位基准 */
    width: 52px; height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--btn-bg);
    color: var(--text-dim);
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
  }
  .bm-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  /* 音频 / 合集的封面是 1:1（播客惯例），按 3:4 会把上下裁掉一截 */
  .bm-cover.sq { width: 52px; height: 52px; }
  .bm-info { flex: 1; min-width: 0; }
  .bm-title {
    font-size: 14px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .bm-author {
    font-size: 11px; color: var(--text-dim); margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* 阅读进度条 + 百分比 */
  .bm-progress { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
  .bm-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--btn-bg);
    overflow: hidden;
  }
  .bm-bar > span {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: var(--focus);
    transition: width 0.3s ease;
  }
  .bm-pct { flex: none; font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
  .bm-pct .hl { color: var(--focus); font-weight: 600; }
  .bm-list .empty-tip { padding-top: 22vh; animation: bmEmptyIn 0.3s ease both; }
  .bm-empty-sub { font-size: 13px; }

  /* ── 喜爱按钮（爱心在上，次数在下）──
     音频播放页 / 合集详情页共用（见 lib/fav.js）。无底色、无边框、无胶囊，
     落在封面 / 氛围底上时就是一枚悬着的爱心 + 下面一行小数字。
     已喜爱：染主题色 + 把描边补成实心，1.28 倍的弹一下给点反馈 ——
     比单纯换色更能说明"这一下点到了"。 */
  .fav-btn {
    display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bar-icon);
    font-family: inherit; font-size: 13px;
    cursor: pointer;
    transition: color .15s ease, transform .12s ease;
  }
  .fav-btn svg { width: 20px; height: 20px; display: block; }
  .fav-btn:active { transform: scale(0.92); }
  .fav-btn:disabled { opacity: .55; }
  .fav-btn.on { color: var(--focus); }
  .fav-btn.on .fav-ico { fill: currentColor; animation: favPop 0.32s ease; }
  /* 次数独立一行：数字用等宽字体栈，比正文字号再小一档 */
  .fav-count {
    min-width: 0;
    font-family: var(--font-num);
    font-size: 10px;
    line-height: 1;
    letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
    opacity: .85;
  }
  .fav-count:empty { display: none; }   /* 还没数据时别占一行，爱心居中不被顶偏 */
  @keyframes favPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.28); }
    100% { transform: scale(1); }
  }
  /* 点赞抖动：图标小幅左右摆 + 轻微缩放，比单纯变色更有「点到了」的手感 */
  @keyframes likeShake {
    0%   { transform: rotate(0)      scale(1);    }
    20%  { transform: rotate(-14deg) scale(1.12); }
    40%  { transform: rotate(12deg)  scale(1.12); }
    60%  { transform: rotate(-8deg)  scale(1.06); }
    80%  { transform: rotate(5deg)   scale(1.03); }
    100% { transform: rotate(0)      scale(1);    }
  }
  .fav-btn.like-shake .fav-ico { animation: likeShake .42s ease; transform-origin: 50% 80%; }

  /* 滑动删除：.bm-row 是裁剪容器兼阴影载体，.bm-item 左滑让出右侧 .bm-del */
  .bm-row {
    position: relative;
    border-radius: 14px;
    overflow: hidden;              /* 裁掉滑出行的卡片，并在收起动画时剪掉内部内容 */
    box-shadow: 0 4px 16px var(--shadow);
  }
  .bm-row > .bm-item {
    position: relative;
    z-index: 1;
    box-shadow: none;              /* 阴影移到 .bm-row，否则会被自身 overflow 裁掉 */
    will-change: transform;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;   /* 长按不弹链接菜单，避免干扰滑动 */
    user-select: none;
  }
  /* 删除键铺满整行、文字贴右（相当于原来 84px 那一列的居中位置），
     再用 clip-path 只露出被卡片让开的那条 —— 卡片背景是半透明的（--bar-bg），
     裸露的删除键会透出粉色，所以不能靠"被遮住"，只能"裁掉"。
     左裁切量 = 卡片右边缘的位置，由 JS 写入（0 = 整行变红）。 */
  .bm-del {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 28px;
    background: #e5484d;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    clip-path: inset(0 0 0 100%);
  }

  /* 卡片消失的动画值由 JS 直接写在行 / 卡片 / 删除键的 inline 样式上
     （起点得先量一次 offsetHeight 把 auto 落成像素值，才有可过渡的起点，
     所以不写在这里），.removing 只作为"这一行正在消失"的标记：
     双击去重，并让正在消失的行吞掉点击，免得穿透到下层卡片。 */

  /* 删空后的空状态淡入，接住卡片消失的收尾 */
  @keyframes bmEmptyIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }

  /* ── 居中轻提示（Toast）── */
  .toast {
    position: fixed;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    max-width: 76vw;
    padding: 12px 20px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    z-index: 500;
    transition: opacity 0.22s ease, transform 0.22s ease;
  }
  .toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  [data-theme="dark"] .toast { background: rgba(245, 245, 247, 0.92); color: #1c1c1e; }

  /* ══════════════════════════════════════════════
     音频（播客）：列表页
     卡片直接复用书架的 .shelf-grid / .book / .cover，仅补两处差异
     ══════════════════════════════════════════════ */
  .pod-shelf { padding-bottom: 110px; }   /* 本页也有 Dock，与书架留同样高度的底部让位 */
  .pod-card { text-decoration: none; color: inherit; }
  /* 副标题取后台「副标题」字段（未填时退回简介首行），可能很长：单行截断，保证卡面高度与书籍一致 */
  .pod-card .book-author { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* ── 音频合集卡 ──
     列表页把合集排在单集之前；合集卡仍是书架 .book 结构，只把封面从 3:4 换成 1:1
     （播客封面惯例），让"合集"和"单集"一眼可分 */
  .pod-album .cover { aspect-ratio: 1 / 1; }

  /* ── 合集 / 板块卡的一行容器：全尺寸单行左右滑动（含 iPad 宽屏），不再铺成多行网格 ── */
  .pod-album-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 0 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;   /* 滑到头不再把回弹传染给整页 */
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    /* 吸附起点内缩 16px：scroll-snap-align:start 会把首卡吸到容器最左，吃掉 padding；
       只内缩起始侧，末尾侧保持 0，末卡仍能滑到贴边。改 .shelf 内边距时这里要同步。 */
    scroll-padding-inline-start: 16px;
    /* 破出 .shelf 的 16px 内边距：首卡与列表左对齐，末卡能滑到贴边。改 .shelf 内边距时同步。 */
    margin-inline: -16px;
    padding-inline: 16px;
  }
  .pod-album-row::-webkit-scrollbar { display: none; }
  /* 卡宽固定，不被 flex 压缩；与列表卡同宽，保证两侧封面成列 */
  .pod-album-row > .pod-card { flex: none; width: 108px; scroll-snap-align: start; }
  /* 横滑末尾「更多」卡：与音频卡同宽，点击跳该板块二级页；默认隐藏，滑动该行才淡入 */
  .pod-more-card {
    flex: none; width: 108px; scroll-snap-align: start;
    display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 3px;
    min-height: 120px; cursor: pointer; text-decoration: none;
    color: var(--text-dim); font-size: 14px; font-weight: 600;
    opacity: 0; transition: opacity .25s ease;
  }
  .pod-album-row.scrolled .pod-more-card { opacity: 1; }
  .pod-more-card svg { width: 22px; height: 22px; }
  .pod-more-card:active { opacity: .7; }

  /* 网格里的分区小标题（合集 / 单集）：跨满整行。
     左右不留内缩 —— 与网格列起点（也就是下方卡片封面的左边缘）严格对齐；
     窄屏下合集行靠破出 .shelf 内边距回到同一列起点（见 .pod-album-row），同样对得上。 */
  .pod-section-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text);
    margin: 6px 0 -2px;
  }
  /* 板块标题后的「查看全部」箭头图标入口（后台开启「显示更多」时显示）：无底色，紧跟标题，与标题同色 */
  .pod-more {
    flex: none;
    display: inline-flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
    margin-left: 0;
  }
  .pod-more svg { width: 16px; height: 16px; }
  .pod-more:active { opacity: 0.6; }

  /* ── 板块「图文卡」样式（card_style=list）：封面在左、标题副标题在右、纵向列表 ──
     参考「音乐播客」列表观感：整行可点，行间细分割线，最右一颗播放图标。 */
  .pod-list { grid-column: 1 / -1; display: flex; flex-direction: column; }
  .pod-list-card {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0;
    text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--divider);
  }
  .pod-list-card:last-child { border-bottom: none; }
  .pod-list-card:active { opacity: 0.7; }
  .pod-list-cover {
    flex: none; width: 88px; height: 88px; border-radius: 12px;
    overflow: hidden; position: relative;
    background: var(--bg-card, #1c1c22);
  }
  .pod-list-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .pod-list-cover .cover-placeholder {
    position: static; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--text-dim);
  }
  .pod-list-info { flex: 1; min-width: 0; }
  .pod-list-title {
    font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .pod-list-sub {
    font-size: 13px; color: var(--text-dim); margin-top: 5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .pod-list-play {
    flex: none; width: 34px; height: 34px; border-radius: 50%;
    margin-right: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
  }
  .pod-list-play svg { width: 20px; height: 20px; display: block; }
  /* 当前正在播放：播放键变电平波动图标（主题橙），暂停时冻结 */
  .pod-list-play .eq { display: none; align-items: flex-end; gap: 2px; height: 16px; }
  .pod-list-play .eq i {
    width: 3px; height: 100%; border-radius: 1px; background: var(--focus, #d9480f);
    transform-origin: bottom; animation: eq 0.9s ease-in-out infinite;
  }
  .pod-list-play .eq i:nth-child(1) { animation-delay: -0.2s; }
  .pod-list-play .eq i:nth-child(2) { animation-delay: -0.5s; }
  .pod-list-play .eq i:nth-child(3) { animation-delay: -0.35s; }
  .pod-list-card.is-playing .pod-list-play .eq { display: flex; }
  .pod-list-card.is-playing .pod-list-play svg { display: none; }
  .pod-list-card.is-paused .pod-list-play .eq i { animation-play-state: paused; }
  .pod-list-card.is-playing .pod-list-play { color: var(--focus, #d9480f); }
  /* 列表项下方：发布时间（等宽数字字体，小一号） */
  .pod-list-time {
    font-size: 11px; margin-top: 5px;
    font-family: "SF Mono", "Roboto Mono", Menlo, Consolas, "Courier New", monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: var(--text-dim, #8a8f98);
  }
  .pod-list-more {
    display: block; text-align: center; padding: 12px 0 4px;
    font-size: 13px; color: var(--focus); text-decoration: none;
  }
  .pod-list-more:active { opacity: 0.6; }

  /* 二级页「查看全部」：卡片 / 列表切换 */
  .shelf-grid.view-list { display: block; }   /* 列表模式下横向卡纵向堆叠，不再走网格列 */
  .view-toggle.on { color: var(--focus, #d9480f); }

  /* ── 首页顶部三卡（继续播放 / 每日推荐 / 我的喜爱）：无标题栏，三列固定 ── */
  .pod-featured {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }
  .pod-feat-card {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: var(--bg-card, #1c1c22);
    -webkit-tap-highlight-color: transparent;
  }
  .pod-feat-card:active { opacity: .82; }
  .pod-feat-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
  .pod-feat-ph { position: absolute; inset: 0; background: linear-gradient(135deg, #3a3a46, #1b1b21); }
  .pod-feat-grad {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.40) 44%, rgba(0,0,0,0) 72%);
  }
  /* 整卡可点层：点封面 / 标题 → 进二级列表 */
  .pod-feat-hit { position: absolute; inset: 0; z-index: 1; text-decoration: none; color: #fff; }
  /* 文字避开放射键，避免遮挡；我的喜爱（无播放键）整宽 */
  .pod-feat-body { position: absolute; left: 10px; right: 44px; bottom: 10px; z-index: 2; pointer-events: none; }
  .pod-feat-card.no-play .pod-feat-body { right: 10px; }
  .pod-feat-text { min-width: 0; }
  .pod-feat-title {
    font-size: 12px; font-weight: 700; line-height: 1.2; color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .pod-feat-sub {
    font-size: 11px; line-height: 1.3; color: rgba(255,255,255,.82); margin-top: 3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .pod-feat-meta { font-size: 10px; line-height: 1.2; color: rgba(255,255,255,.70); margin-top: 3px; }
  /* 播放键：独立可点，跳 audio.php?id=… 直接播放（不进列表） */
  .pod-feat-play {
    position: absolute; right: 10px; bottom: 10px; z-index: 3;
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; text-decoration: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.55));
    -webkit-tap-highlight-color: transparent;
  }
  .pod-feat-play:active { opacity: .8; }
  .pod-feat-play svg { width: 18px; height: 18px; display: block; }

  /* ── 每日推荐页（项目风格） ── */
  .daily-hero {
    position: relative;
    margin: -18px -16px 0;
    padding: 22px 16px 18px;
    border-radius: 0 0 18px 18px;
    overflow: hidden;
    color: var(--text, #e8e6e1);
  }
  .daily-hero-inner { position: relative; z-index: 1; }
  .daily-date { display: flex; align-items: baseline; gap: 4px; font-weight: 700; line-height: 1; font-family: "Noto Serif SC", serif; }
  .daily-date .d { font-size: 58px; letter-spacing: -2px; }
  .daily-date .sep { font-size: 28px; opacity: .55; }
  .daily-date .m { font-size: 28px; opacity: .8; }
  .daily-sub { position: relative; z-index: 1; margin-top: 8px; font-size: 13px; color: var(--text-dim, #8a8f98); }
  .daily-hero-tag {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%); z-index: 2;
    font-size: 11px; padding: 4px 10px; border-radius: 999px;
    color: var(--focus, #d9480f); background: rgba(217,72,15,.12); border: 1px solid rgba(217,72,15,.22);
  }
  .daily-reshuffle {
    font-size: 13px; font-weight: 600; color: var(--focus, #d9480f);
    background: none; border: none; padding: 4px 2px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .daily-reshuffle:active { opacity: .6; }
  .daily-bar { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; }
  .daily-playall {
    flex: none; width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: var(--focus, #d9480f); color: #fff;
    box-shadow: 0 4px 12px rgba(217,72,15,.3);
    -webkit-tap-highlight-color: transparent;
  }
  .daily-playall svg { width: 18px; height: 18px; display: block; }
  .daily-playall:active { transform: scale(.94); }
  .daily-playall-label { margin-left: auto; font-size: 16px; font-weight: 700; }
  .daily-hint {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-dim, #8a8f98); margin: 4px 2px 10px;
  }
  .daily-list { display: flex; flex-direction: column; }
  .daily-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 6px; border-radius: 12px;
    text-decoration: none; color: inherit;
    -webkit-tap-highlight-color: transparent;
  }
  .daily-row:active { background: rgba(127,127,127,.08); }
  .daily-cover {
    flex: none; width: 56px; height: 56px; border-radius: 10px;
    overflow: hidden; position: relative; background: var(--bg-card, #1c1c22);
  }
  .daily-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .daily-cover .cover-placeholder { width: 100%; height: 100%; font-size: 11px; }
  .daily-info { flex: 1; min-width: 0; }
  .daily-title {
    font-size: 15px; font-weight: 600; line-height: 1.32;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .daily-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; min-width: 0; }
  .daily-tag {
    flex: none; font-size: 10px; line-height: 1; padding: 3px 6px; border-radius: 5px;
    color: var(--focus, #d9480f); background: rgba(217,72,15,.12); border: 1px solid rgba(217,72,15,.22);
  }
  .daily-subtxt {
    font-size: 12px; color: var(--text-dim, #8a8f98);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .daily-play {
    flex: none; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim, #8a8f98);
  }
  .daily-play svg { width: 18px; height: 18px; display: block; }
  .daily-row:active .daily-play { color: var(--focus, #d9480f); }
  /* 当前正在播放：播放键变电平波动图标（主题橙），暂停时冻结 */
  .daily-play .eq { display: none; align-items: flex-end; gap: 2px; height: 16px; }
  .daily-play .eq i {
    width: 3px; height: 100%; border-radius: 1px; background: var(--focus, #d9480f);
    transform-origin: bottom; animation: eq 0.9s ease-in-out infinite;
  }
  .daily-play .eq i:nth-child(1) { animation-delay: -0.2s; }
  .daily-play .eq i:nth-child(2) { animation-delay: -0.5s; }
  .daily-play .eq i:nth-child(3) { animation-delay: -0.35s; }
  @keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
  .daily-row.is-playing .daily-play .eq { display: flex; }
  .daily-row.is-playing .daily-play svg { display: none; }
  .daily-row.is-paused .daily-play .eq i { animation-play-state: paused; }
  .daily-row.is-playing .daily-play { color: var(--focus, #d9480f); }

  /* ── 板块「图文卡·分栏滑动」样式（card_style=carousel）：
     每组 group_n 条图文卡纵向排成一列，多列横向滑动切换（与图片卡同款滑动，右侧露出下一列一角） ── */
  .pod-list-cols {
    grid-column: 1 / -1;
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* 破出 .shelf 的 16px 内边距、再内缩回 16px，使整屏滑动时内容保留 16px 边距，与图片卡横滑一致 */
    margin-inline: -16px;
    padding: 2px 16px 6px;
    scroll-padding-inline-start: 16px;
    box-sizing: border-box;
  }
  .pod-list-cols::-webkit-scrollbar { display: none; }
  .pod-list-col {
    flex: 0 0 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }
  .pod-list-col .pod-list-card { border-bottom: none; }

  /* 二级页底部滚动加载提示 */
  .pod-loadmore { color: #8a8a8a; font-size: 13px; letter-spacing: 0.04em; }

  /* ══════════════════════════════════════════════
     继续播放二级页：图左字右，字下有进度条，行间用分割线，最右有「继续播放」按钮
     ══════════════════════════════════════════════ */
  /* 左右内边距交给 .pod-shelf（与首页一致 16px），这里只留顶部间距，避免双重缩进 */
  .continue-list { padding: 4px 0 0; display: flex; flex-direction: column; gap: 12px; }
  /* 每行 = 定位载体 + 压在后面的动作层 + 可滑动的卡片。
     注意：.cr-row 不再 overflow:hidden，也不再画圆角与投影 —— 卡片要能整块滑出这个盒子，
     一直滑到屏幕边缘才被 .shelf 裁掉；被容器裁会让「滑动」看起来像在盒子里挪。
     圆角/底色/描边/投影都归卡片自己（.continue-row）。 */
  .cr-row { position: relative; }
  .cr-row.removing { pointer-events: none; }
  /* 动作层：完全脱离卡片容器，独立浮在右侧页面底色上；与卡片之间留出明显间距（见 OPEN_W）。
     卡片盖在上面（z-index），所以关着时看不见，左滑后整组按钮从卡片右侧露出来。 */
  .cr-actions {
    position: absolute; top: 0; right: 0; bottom: 0;
    display: flex; align-items: center; gap: 16px;
    padding: 0 4px 0 0;
  }
  .cr-act {
    width: 44px; height: 44px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%; padding: 0;
    background: var(--btn-bg); color: var(--text-dim);
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
  }
  .cr-act:active { transform: scale(0.92); }
  .cr-act svg { width: 20px; height: 20px; display: block; }
  /* 喜爱：未喜爱是描边灰心，已喜爱填成焦点色 */
  .cr-fav.on { color: var(--focus); }
  .cr-fav.on svg { fill: currentColor; }
  .cr-fav.like-shake svg { animation: likeShake 0.42s ease; transform-origin: 50% 80%; }
  /* 删除：红底白图标 */
  .cr-del { background: #e03131; color: #fff; }

  /* 卡片本体：圆角/底色/描边都在它身上，滑动时整体一起走 */
  .continue-row {
    position: relative; z-index: 1;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px;
    border-radius: 18px;
    background: var(--card-surface);
    border: 1px solid var(--card-border);
    /* 投影从 .cr-row 挪到卡片上：容器不再裁剪，卡片自己画阴影才不会跟着「盒边」露馅 */
    box-shadow: 0 1px 2px var(--shadow), 0 10px 24px -18px var(--shadow);
    text-decoration: none;
    color: inherit;
    will-change: transform;
  }
  .continue-row:active { opacity: 0.9; }

  /* 下拉刷新指示（移动端，在列表顶部下拉时显出） */
  .ptr {
    position: fixed; top: 54px; left: 0; right: 0;
    height: 44px; display: flex; align-items: center; justify-content: center;
    gap: 8px; color: var(--text-dim); font-size: 13px;
    opacity: 0; pointer-events: none; z-index: 50;
    transition: opacity 0.2s ease;
  }
  .ptr-spin {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--text-dim); border-top-color: transparent;
  }
  .ptr.loading .ptr-spin { animation: ptr-spin 0.7s linear infinite; }
  @keyframes ptr-spin { to { transform: rotate(360deg); } }
  /* 下拉刷新指示器·内容流内版本：作为滚动容器首个子元素，随下拉在「内容上方」展开空白并露出提示，
     区别于 continue.php 仍用 fixed 贴在导航栏下方的版本 */
  .ptr--flow {
    position: static; top: auto; left: auto; right: auto;
    height: 0; overflow: hidden; opacity: 1; pointer-events: none; z-index: auto;
    align-items: flex-start;
  }
  .ptr--flow .ptr-inner {
    height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px;
    color: var(--text-dim); font-size: 13px; white-space: nowrap;
  }
  .continue-cover {
    position: relative; flex: none; width: 88px; height: 88px; border-radius: 12px;
    overflow: hidden; background: var(--skeleton-bg);
  }
  /* 内描边：深色封面对深色卡片留一点边界感，不抢戏 */
  .continue-cover::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07); pointer-events: none;
  }
  [data-theme="dark"] .continue-cover::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
  .continue-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .continue-cover .cover-placeholder {
    width: 100%; height: 100%; font-size: 10px;
    background: var(--skeleton-bg); color: var(--text-dim);
  }
  /* 剩余时间角标：压在封面右下，不占正文行宽（与音乐类 App 一致） */
  .continue-rest {
    position: absolute; right: 6px; bottom: 6px; z-index: 2;
    padding: 2px 6px; border-radius: 999px;
    background: rgba(24, 22, 18, 0.62);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    color: #fdf8ee; font-family: var(--font-num);
    font-size: 10.5px; line-height: 1.5; letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
  }
  /* 「已下载」角标（最近阅读 / 我的喜爱共用）：压封面左上，右下留给「剩余时间」 */
  .offline-badge {
    position: absolute; left: 4px; top: 4px; z-index: 3;
    padding: 1px 5px; border-radius: 6px;
    background: rgba(24, 22, 18, 0.66);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    color: #fdf8ee; font-size: 9.5px; line-height: 1.55; letter-spacing: 0;
    white-space: nowrap; pointer-events: none;
  }
  /* 喜爱列表的封面只有 52×70，角标再按 9.5px 会压掉大半张图 */
  .bm-cover .offline-badge { left: 3px; top: 3px; padding: 0 4px; font-size: 9px; border-radius: 4px; }
  /* ⋯ → 下载 → 离线阅读：已下载时标签用主题色，一眼能看出这本书断网也能读 */
  .sheet-item.is-saved .sheet-label { color: var(--accent); }
  .continue-info { flex: 1; min-width: 0; align-self: center; }
  .continue-title {
    font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
    font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.34;
    letter-spacing: 0.01em;
    text-wrap: pretty;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .continue-sub {
    font-size: 13px; color: var(--text-dim); margin-top: 3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 进度条 + 百分比同排，百分比贴右（等宽数字不跳动） */
  .continue-meta {
    display: flex; align-items: center; gap: 8px; margin-top: 9px;
  }
  .continue-bar {
    flex: 1 1 auto; min-width: 0; height: 3px; border-radius: 999px;
    background: rgba(128, 128, 128, 0.28); overflow: hidden;
  }
  .continue-bar-fill { height: 100%; border-radius: 999px; background: var(--focus); }
  .continue-pct {
    flex: none; font-family: var(--font-num); font-size: 11.5px;
    color: var(--text-dim); font-variant-numeric: tabular-nums;
  }
  /* 续播键：去掉圆底，只留图标本身；焦点色足够表达主动作，也不跟卡片抢厚度 */
  .continue-go {
    flex: none; width: 32px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    color: var(--focus);
  }
  .continue-go svg { width: 20px; height: 20px; margin-left: 2px; }
  /* 合集行走「跳转」而非「播放」：换成安静的箭头 */
  .continue-go.is-link { color: var(--text-dim); }
  .continue-go.is-link svg { margin-left: 0; width: 18px; height: 18px; }
  /* 正在播放这一条：圆钮里的三角换成电平波动（与音频列表 / 每日推荐同一套 @keyframes eq），
     暂停时冻结成静态柱。柱色用 currentColor —— 橙底上就是白柱，深色主题下自动变深色柱。 */
  .continue-go .eq { display: none; align-items: flex-end; gap: 2px; height: 15px; }
  .continue-go .eq i {
    width: 3px; height: 100%; border-radius: 1px; background: currentColor;
    transform-origin: bottom; animation: eq 0.9s ease-in-out infinite;
  }
  .continue-go .eq i:nth-child(1) { animation-delay: -0.2s; }
  .continue-go .eq i:nth-child(2) { animation-delay: -0.5s; }
  .continue-go .eq i:nth-child(3) { animation-delay: -0.35s; }
  .continue-row.is-playing .continue-go svg { display: none; }
  .continue-row.is-playing .continue-go .eq { display: flex; }
  /* 注意要打在 i 上：animation-play-state 不继承，写在 .eq 上不会传到子元素 */
  .continue-row.is-paused .continue-go .eq i { animation-play-state: paused; }

  /* 合集页：头部（封面 + 标题 + 副标题）与集列表 */
  .album-head { display: flex; gap: 16px; align-items: flex-start; padding: 4px 2px 16px; }
  .album-cover {
    flex: none; width: 108px; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden;
    position: relative; background: var(--btn-bg); box-shadow: 0 6px 20px var(--shadow);
  }
  .album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .album-cover .cover-placeholder { font-size: 12px; }
  .album-info { flex: 1; min-width: 0; padding-top: 2px; }
  .album-info h1 { font-size: 19px; line-height: 1.4; margin: 0 0 6px; }
  .album-sub { font-size: 13px; color: var(--text-dim); }
  /* 喜爱按键 + 订阅通知：跟在集数统计下面排成一行。
     喜爱按钮无底色（爱心 + 下方次数），订阅是描边胶囊，两者之间留 16px。
     注意类名必须是 .album-notify —— .album-sub 已被上面的副标题占用。 */
  .album-fav { margin-top: 10px; display: flex; align-items: center; gap: 16px; }
  .album-notify {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    padding: 7px 12px; margin: 0; border: 1px solid var(--card-border);
    border-radius: 999px; background: none;
    color: var(--text-dim); cursor: pointer;
    font: inherit; font-size: 12px; line-height: 1;
    transition: color .15s ease, border-color .15s ease, background .15s ease, transform .12s ease;
  }
  .album-notify svg { width: 14px; height: 14px; display: block; }
  .album-notify:active { transform: scale(0.95); }
  .album-notify:hover { color: var(--focus); border-color: var(--focus); }
  /* 已订阅：填成焦点色 + 一层同色淡底，一眼看出当前是「会收到通知」的状态。
     背景用 color-mix 跟着 --focus 走，浅色/深色两套主题都不用另写一遍；
     老浏览器不支持时这条声明被忽略，退化成「只有字色和描边」，不影响可读性。 */
  .album-notify.on {
    color: var(--focus); border-color: var(--focus);
    background: color-mix(in srgb, var(--focus) 12%, transparent);
  }
  /* 集列表顶部右侧：放"播放全部"等动作 */
  .ep-head { display: flex; justify-content: space-between; margin: 2px 2px 10px; }
  /* 播放全部：线条框（描边胶囊），图标 + 文字一行 */
  .album-playall {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; margin: 0; border: 1px solid var(--card-border);
    border-radius: 999px; background: none;
    color: var(--text-dim); cursor: pointer;
    font-size: 13px; line-height: 1;
    transition: color .15s ease, border-color .15s ease, transform .12s ease;
  }
  .album-playall svg { width: 18px; height: 18px; display: block; }
  .album-playall:active { transform: scale(0.95); }
  .album-playall:hover { color: var(--focus); border-color: var(--focus); }
  .album-intro {
    font-size: 13px; line-height: 1.9; color: var(--text-dim);
    margin: 0 0 18px; padding: 0 2px;
    white-space: pre-line;   /* 简介按行保存，这里保住换行 */
  }
  /* 分页标签：每 10 集一枚线框胶囊（1-10 / 11-20 …），点一下切到那一段。
     只有一页时整行隐藏；集数多时横向滚动，不换行。scroll-margin-top 给顶栏留出位置，
     切页后 scrollIntoView 不会把第一行标题压在顶栏下面。 */
  .ep-pages {
    display: flex; gap: 8px; overflow-x: auto;
    margin: 0 2px 10px; scroll-margin-top: 70px;
    scrollbar-width: none;
  }
  .ep-pages::-webkit-scrollbar { display: none; }
  .ep-page {
    flex: none; padding: 5px 11px;
    border: 1px solid var(--card-border); border-radius: 999px;
    background: none; color: var(--text-dim);
    font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, transform .12s ease;
  }
  .ep-page:active { transform: scale(0.95); }
  .ep-page:hover { color: var(--focus); border-color: var(--focus); }
  .ep-page.active { color: var(--focus); border-color: var(--focus); background: var(--bar-bg); }
  .ep-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
  .ep-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 14px;
    background: var(--bar-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    text-decoration: none; color: var(--text);
  }
  .ep-item:active { transform: scale(0.99); }
  .ep-no { flex: none; width: 24px; text-align: center; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
  .ep-info { flex: 1; min-width: 0; }
  .ep-title { font-size: 14px; font-weight: 700; line-height: 1.45; }
  .ep-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  /* 卡片上的播放按钮：点了就地起播（不跳播放页）。
     正在播的那一条换成跳动的电平条，不再给暂停图标 —— 暂停 / 继续统一走底部迷你条。 */
  .ep-play {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    color: var(--text-dim); cursor: pointer;
    transition: transform .15s, color .15s;
  }
  .ep-play svg { width: 15px; height: 15px; display: block; }
  /* 电平：3 根竖条上下跳（正在播放的那一条）；暂停时冻结，不收回 ▶ */
  .ep-eq {
    display: none; align-items: flex-end; justify-content: center;
    gap: 2px; width: 15px; height: 14px;
  }
  /* 只有「正在响」才显示电平；暂停 / 播完退回 ▶（`.on` 只负责当前项的主题色） */
  .ep-play.playing .ep-eq { display: inline-flex; }
  .ep-play.playing .ico-play { display: none; }
  .ep-eq i {
    display: block; width: 3px; height: 5px; border-radius: 1px;
    background: currentColor;
    animation: epEq .9s ease-in-out infinite;
  }
  .ep-eq i:nth-child(2) { animation-delay: .18s; }
  .ep-eq i:nth-child(3) { animation-delay: .36s; }
  @keyframes epEq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
  @media (prefers-reduced-motion: reduce) {
    .ep-eq i { animation: none; height: 9px; }   /* 关掉跳动，保留电平外观 */
  }
  /* 单集卡片上的「加入待播」：+ 按钮，点击后短暂变 ✓，与播放按钮同排右侧 */
  .ep-add {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    color: var(--text-dim); cursor: pointer;
    transition: transform .15s, color .15s;
  }
  .ep-add svg { width: 16px; height: 16px; display: block; }
  /* 状态只改图标颜色，不套底色圆圈 */
  .ep-play:active, .ep-add:active { transform: scale(0.88); }
  .ep-play.on { color: var(--focus); }
  .ep-add.added { color: var(--focus); }
  .ep-add.added .ico-plus { display: none; }
  .ep-add.added .ico-check { display: block !important; }

  /* 加入待播的「飞入迷你播放器」动画用的飞行图标 */
  .ep-fly {
    position: fixed; z-index: 9999; pointer-events: none;
    width: 22px; height: 22px; margin: -11px 0 0 -11px;
    color: var(--focus);
    display: flex; align-items: center; justify-content: center;
    will-change: transform, opacity;
  }
  .ep-fly svg { width: 22px; height: 22px; display: block; }

  /* ══════════════════════════════════════════════
     音频（播客）：播放页
     封面居中铺满整屏 + 底部毛玻璃控制条；轻点封面切到文稿
     ══════════════════════════════════════════════ */

  /* 播放页顶栏去掉毛玻璃底与底部分割线：本页有封面模糊铺底，顶栏再糊一层会压出一条
     与氛围底色不同的横带（也和大屏下铺满的 .pod-bg 对不齐）。
     高度随 .topbar 计入 env(safe-area-inset-top)，故下方 .pod-screen 的 top 也需加 safe-top。
     选择器与 .topbar 同权重，靠「写在后面」生效，不影响其他页面的顶栏。 */
  .pod-topbar {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0;
  }

  /* .pod-topbar 复用 .topbar，高度随 .topbar 计入 env(safe-area-inset-top)，
     故 .pod-screen 的 top 也需加 safe-top，否则封面 / 文稿（含文稿顶部的金句选择按钮）被顶栏遮。 */
  .pod-screen {
    position: absolute;
    top: calc(54px + var(--sa-top, env(safe-area-inset-top, 0px))); bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    /* 底部留白 = 控制条高度，避免封面 / 文稿被压住 */
    padding: 0 16px calc(172px + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
  }
  /* 封面模糊铺底：fixed 铺满整个视口（大屏下也不留白），只做氛围；
     inset 外扩是给 46px 模糊留出过渡，否则四边会透出一条淡边。 */
  .pod-bg {
    position: fixed;
    inset: -60px;
    background-position: center;
    background-size: cover;
    filter: blur(46px) saturate(150%);
    opacity: .38;
    pointer-events: none;
    z-index: 0;
  }

  /* ── 封面视图：整屏居中 ── */
  .pod-stage {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 8px 0 10px;
    text-align: center;
    cursor: pointer;
  }
  .pod-cover-xl {
    width: min(68vw, 296px);
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 22px;
    overflow: hidden;
    background: var(--btn-bg);
    color: var(--text-dim);
    font-size: 60px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 18px 50px var(--shadow);
  }
  .pod-cover-xl img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .pod-stage-title { font-size: 21px; font-weight: 700; line-height: 1.45; margin: 6px 0 0; max-width: 94%; }
  /* 标题下方文案：用主题正文色（而非过淡的 --text-dim），保证深浅两套主题下都清晰 */
  .pod-stage-meta { font-size: 12px; color: var(--text); opacity: .82; line-height: 1.6; }
  /* 合集名做成可点的下划线（点回合集页），颜色跟随 meta 文字 */
  .pod-meta-album { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; }
  .pod-stage-hint { font-size: 12px; color: var(--text); opacity: .7; }
  .pod-stage-tip { padding: 0; font-size: 14px; }

  /* ── 文稿（歌词）视图：简介按行拆分，打点行可点击跳转 ── */
  .pod-lyrics {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    flex-direction: column;   /* display 由 JS 在 none / flex 之间切换 */
    padding-top: 6px;
  }
  .pod-notes-head {
    flex: none;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: 12px; color: var(--text-dim);
    padding: 0 4px 10px;
  }
  .pod-notes {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column; gap: 2px;
    /* 上下留出与渐隐带等高的内边距：否则滚到顶时第一行正好落在 mask 的
       透明段里，看起来被切掉一截（首段"藏"起来就是这个原因）。 */
    padding-top: 28px;
    padding-bottom: 28px;
    /* 上下滚动边缘浅隐：内容滚到顶端 / 底部时渐隐淡出。
       mask 固定于容器视口、不随内容滚动，正好得到「边缘浅隐」效果。 */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  }
  .pod-notes::-webkit-scrollbar { display: none; }
  .pod-notes .empty-tip { padding: 32px 16px; }
  .pod-note {
    display: flex; gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.25s ease;
  }
  .pod-note.plain { cursor: default; }
  .pod-note-time {
    flex: none; width: 40px;
    font-size: 11px; color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    padding-top: 4px;
  }
  .pod-note:not(.plain) .pod-note-time { color: var(--focus); }
  .pod-note-text { flex: 1; min-width: 0; font-size: 15px; line-height: 1.75; }
  .pod-note.active { background: var(--btn-bg); }
  .pod-note.active .pod-note-text { color: var(--focus); font-weight: 600; }

  /* 「回到当前」：文稿头部的小按钮，仅在手动滚动脱离跟随后出现 */
  .pod-follow-btn {
    flex: none;
    padding: 2px 12px;
    border: none;
    border-radius: 14px;
    background: var(--focus); color: #fff;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
  }
  /* display:flex 等会覆盖 hidden 的默认样式，必须显式兜回 */
  .pod-follow-btn[hidden] { display: none; }
  .pod-follow-btn[disabled] { opacity: .45; pointer-events: none; }
  .pod-follow-btn.on { background: transparent; color: var(--focus); box-shadow: inset 0 0 0 1.5px var(--focus); }
  .pod-note-actions { display: flex; gap: 8px; align-items: center; }
  /* 金句入口展开的选择 / 生成按钮：默认 hidden（由金句图标点击显示），显示时横向排开 */
  .pod-note-actions #podQuoteActions { display: flex; gap: 8px; align-items: center; }
  .pod-note-actions #podQuoteActions[hidden] { display: none; }
  .pod-note.selected { background: rgba(217,72,15,.10); }
  .pod-note.selected .pod-note-text { color: var(--focus); }

  /* 金句卡预览弹层 */
  .card-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
  .card-modal[hidden] { display: none; }
  .card-modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
  .card-modal-box { position: relative; z-index: 1; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); }
  .card-modal-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
  .card-modal-box img { width: 100%; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.4); background: #fff; -webkit-touch-callout: default; -webkit-user-select: auto; touch-action: manipulation; }
  .card-modal-tip { flex: none; color: rgba(255,255,255,.8); font-size: 12px; text-align: center; }
  .card-modal-actions { flex: none; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
  .card-modal-actions .btn {
    flex: 1 1 auto; min-width: 0;
    height: 32px; padding: 0 6px;       /* 整体缩小一点 */
    border-radius: 8px; font-size: 13px;
  }
  /* 前三个（保存 / 分享 / 复制）在深色遮罩上改为白底深字，否则与遮罩同色看不见 */
  .card-modal-actions .btn-secondary {
    background: #ffffff; color: #222222;
    border: 1px solid rgba(0,0,0,.08);
  }

  /* 进度条上方那一行：只放喜爱（贴右）。控制条没有底色，
     所以这里也不给它任何背景，留白即可 —— 加了背景反而会在封面上压出一块方块。 */
  .pod-bar-top-wrap {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    margin-top: 12px; margin-bottom: 2px;
  }
  .pod-bar-top-group { display: flex; align-items: center; gap: 28px; margin-left: auto; }
  /* 点赞按钮复用 .fav-btn 的样式（图标在上、次数在下，与收藏完全一致）：
     见 audio.php 里的 <button class="fav-btn" id="podLikeBtn">，无需单独写样式。 */
  .pod-bar-top {
    display: flex; align-items: flex-start; justify-content: flex-end;
    min-height: 36px;          /* 喜爱是「爱心在上、次数在下」两行；顶部对齐，让爱心始终贴盒子上沿，
                                   与金句框同高，不受「是否有收藏次数」影响而上下跳动 */
  }

  /* 金句图标：与收藏(爱心)同款风格——透明无底、线性描边引号图标(20px)、
     默认色用与 .fav-btn 一致的 var(--text-dim)（不能用 inherit，否则会从 dock 继承到更深的 --text，
     浅色模式下就和爱心颜色不一致）；激活态同收藏用主题色 */
  .pod-quote-ico {
    flex: none;
    display: inline-flex; align-items: flex-start; justify-content: center;
    min-height: 36px;                  /* 与收藏/点赞按钮容器同高，三个图标垂直对齐 */
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bar-icon);            /* 与收藏按钮默认色一致（高对比，浮在封面上也清楚） */
    cursor: pointer;
    transition: color .15s ease, transform .12s ease;
  }
  .pod-quote-ico svg { width: 20px; height: 20px; display: block; }   /* 与点赞/收藏图标同为 20px，大小一致 */
  .pod-quote-ico:active { transform: scale(0.92); }
  .pod-quote-ico.on { color: var(--focus); }

  /* ── 底部控制条：去掉容器底色，让进度与控件直接浮在封面上 ── */
  .pod-dock {
    position: fixed;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: calc(100% - 16px);
    max-width: 520px;
    padding: 10px 16px 12px;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 20;
  }
  .pod-bar { position: relative; height: 28px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
  .pod-bar-track { position: absolute; left: 0; right: 0; height: 5px; border-radius: 3px; background: var(--btn-bg); overflow: hidden; }
  .pod-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: var(--focus); }
  .pod-bar-knob {
    position: absolute; left: 0; top: 50%;
    width: 14px; height: 14px; margin: -7px 0 0 -7px;
    border-radius: 50%; background: #fff;
    box-shadow: 0 1px 5px var(--shadow);
    pointer-events: none;
  }
  .pod-times {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
  }
  .pod-ctrls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
  /* 图标按钮：无底色，只留图标；点按反馈靠缩放 + 变色 */
  .pod-ico {
    flex: none;
    width: 48px; height: 48px;
    padding: 0;
    position: relative;
    display: grid; place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, color 0.2s ease, opacity 0.2s ease;
  }
  .pod-ico svg { width: 25px; height: 25px; display: block; }
  .pod-ico:active { transform: scale(0.9); color: var(--focus); }
  .pod-ico:disabled { opacity: .35; }
  /* 随机 / 单曲：图标染成主题色，一眼看出不是默认顺序播放 */
  .pod-ico.on { color: var(--focus); }
  /* 定时关闭面板：与「播放列表」面板一致的底部抽屉 */
  .pod-timer-mask {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .35);
    opacity: 0; pointer-events: none;
    transition: opacity .24s ease;
    z-index: 32;
  }
  .pod-timer-mask.show { opacity: 1; pointer-events: auto; }
  .pod-timer-menu {
    position: fixed; left: 0; right: 0; bottom: 0;
    transform: translateY(calc(100% + 40px));
    width: 100%; max-width: none;
    max-height: min(70vh, 560px);
    display: flex; flex-direction: column;
    border-radius: 20px 20px 0 0;
    background: var(--bar-bg);
    border: 1px solid var(--divider); border-bottom: none;
    box-shadow: 0 -8px 34px var(--shadow);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition: transform 0.28s cubic-bezier(.32, .72, .3, 1);
    z-index: 33;
  }
  .pod-timer-menu.show { transform: translateY(0); }
  .pod-timer-head {
    flex: none;
    display: flex; align-items: center; gap: 10px;
    padding: 14px calc(16px + env(safe-area-inset-right, 0px)) 10px calc(16px + env(safe-area-inset-left, 0px));
    font-size: 13px; font-weight: 700;
    border-bottom: 1px solid var(--divider);
  }
  .pod-timer-head > span:first-child { flex: 1; }
  .pod-timer-remain { color: var(--focus); font-weight: 700; font-variant-numeric: tabular-nums; }
  .pod-timer-close {
    border: none; background: none; color: var(--text-dim);
    font-size: 20px; line-height: 1; cursor: pointer;
  }
  .pod-timer-list {
    flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 6px calc(8px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px));
  }
  .pod-timer-opt {
    display: block; width: 100%;
    padding: 14px; margin: 2px 0;
    border: none; background: transparent;
    color: var(--text); font-size: 16px;
    border-radius: 10px; cursor: pointer; text-align: left;
  }
  .pod-timer-opt:active { background: var(--btn-bg); }
  .pod-timer-opt.active { color: var(--focus); font-weight: 700; }

  /* ── 播放设置合并弹窗：倍速 / 定时 / 模式 三块 ── */
  .pod-sheet-mask {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .35);
    opacity: 0; pointer-events: none;
    transition: opacity .24s ease;
    z-index: 38;
  }
  .pod-sheet-mask.show { opacity: 1; pointer-events: auto; }
  .pod-sheet {
    position: fixed; left: 0; right: 0; bottom: 0;
    transform: translateY(calc(100% + 40px));
    width: 100%;
    max-height: min(82vh, 680px);
    display: flex; flex-direction: column;
    border-radius: 20px 20px 0 0;
    background: var(--bar-bg);
    border: 1px solid var(--divider); border-bottom: none;
    box-shadow: 0 -8px 34px var(--shadow);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition: transform 0.28s cubic-bezier(.32, .72, .3, 1);
    z-index: 39;
  }
  .pod-sheet.show { transform: translateY(0); }
  .pod-sheet { overflow: hidden; }
  .pod-sheet-grab {
    flex: none; width: 40px; height: 4px;
    margin: 10px auto 2px; border-radius: 2px;
    background: var(--divider);
  }
  .pod-sheet-sec {
    padding: 14px calc(16px + env(safe-area-inset-right, 0px)) 16px calc(16px + env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--divider);
  }
  .pod-sheet-sec:last-of-type { border-bottom: none; }
  .pod-sheet-sec-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px; font-size: 15px; font-weight: 700;
  }
  .pod-sheet-title { flex: 1; }
  .pod-sheet-title b { color: var(--focus); font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 4px; }

  /* iOS 式开关 */
  .pod-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; position: relative; }
  .pod-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
  .pod-switch em { font-style: normal; font-size: 12px; font-weight: 500; color: var(--text-dim); }
  .pod-slider {
    flex: none; width: 40px; height: 24px; border-radius: 999px;
    background: var(--divider); position: relative;
    transition: background .2s ease;
  }
  .pod-slider::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s ease;
  }
  .pod-switch input:checked + .pod-slider { background: var(--focus); }
  .pod-switch input:checked + .pod-slider::after { transform: translateX(16px); }

  .pod-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .pod-chip {
    padding: 8px 16px;
    border: 1px solid var(--divider); border-radius: 999px;
    background: transparent; color: var(--text);
    font-size: 14px; cursor: pointer; transition: all .15s ease;
  }
  .pod-chip:active { transform: scale(.95); }
  .pod-chip.active { background: var(--focus); border-color: var(--focus); color: #fff; font-weight: 700; }
  .pod-chip-solid { background: var(--btn-bg); border-color: transparent; }

  /* ── 倍速滑动刻度尺 ── */
  .rate-ruler {
    position: relative; height: 64px; margin-top: 2px;
    overflow: hidden; touch-action: none; cursor: ew-resize;
    -webkit-user-select: none; user-select: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
  }
  .rate-strip { position: absolute; top: 0; left: 0; height: 100%; will-change: transform; }
  .rate-tick {
    position: absolute; bottom: 22px; width: 2px; height: 8px; margin-left: -1px;
    background: var(--text-dim); opacity: .4; border-radius: 1px;
  }
  .rate-tick.major { height: 14px; opacity: .75; }
  .rate-tick.major span {
    position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
    font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .rate-tick.cur { background: var(--focus); opacity: 1; }
  .rate-tick.cur span { color: var(--focus); font-weight: 700; }
  .rate-indicator {
    position: absolute; left: 50%; top: 6px; bottom: 18px; width: 2px;
    margin-left: -1px; border-radius: 1px;
    background: var(--focus); opacity: .9; pointer-events: none;
  }

  /* ── 自定义定时：小时 / 分钟滚轮 ── */
  .pod-timer-custom { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
  .pod-wheel-wrap {
    position: relative; display: flex; align-items: center; gap: 8px;
    padding: 0 12px; border-radius: 14px; background: var(--bg);
  }
  .pod-wheel {
    flex: 1; height: 200px; padding: 80px 0;
    overflow-y: auto; scroll-snap-type: y mandatory;
    text-align: center; scrollbar-width: none;
  }
  .pod-wheel::-webkit-scrollbar { display: none; }
  .pod-wheel-item {
    height: 40px; line-height: 40px; scroll-snap-align: center;
    font-size: 17px; color: var(--text-dim); font-variant-numeric: tabular-nums;
    transition: font-size .12s ease, color .12s ease;
  }
  .pod-wheel-item.sel { font-size: 23px; font-weight: 700; color: var(--text); }
  .pod-wheel-unit { flex: none; font-size: 13px; color: var(--text-dim); }
  .pod-wheel-highlight {
    position: absolute; left: 12px; right: 12px; top: 50%; height: 40px;
    transform: translateY(-50%); border-radius: 10px;
    background: var(--focus); opacity: .08; pointer-events: none;
  }
  .pod-wheel-actions { display: flex; gap: 12px; }
  .pod-btn-plain {
    flex: 1; padding: 12px; border-radius: 999px;
    border: 1px solid var(--divider); background: transparent; color: var(--text);
    font-size: 15px; cursor: pointer;
  }
  .pod-btn-solid {
    flex: 1; padding: 12px; border-radius: 999px; border: none;
    background: var(--focus); color: #fff;
    font-size: 15px; font-weight: 700; cursor: pointer;
  }
  .pod-btn-plain:active, .pod-btn-solid:active { transform: scale(.97); }

  /* ── 播放模式：一行四个 ── */
  .pod-mode-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .pod-mode-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 4px 10px;
    border: 1px solid var(--divider); border-radius: 12px;
    background: transparent; color: var(--text);
    font-size: 11px; cursor: pointer; transition: all .15s ease;
  }
  .pod-mode-card svg { width: 20px; height: 20px; }
  .pod-mode-card:active { transform: scale(.97); }
  .pod-mode-card.active { background: var(--focus); border-color: var(--focus); color: #fff; }
  .pod-sheet-close {
    margin: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    padding: 14px;
    border: none; border-radius: 12px;
    background: var(--btn-bg); color: var(--text);
    font-size: 16px; font-weight: 700; cursor: pointer;
  }
  .pod-sheet-close:active { transform: scale(.98); }

  /* 主按钮：唯一带底色的实心大圆，和图标按钮形成主次 */
  .pod-play {
    flex: none;
    width: 64px; height: 64px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--focus); color: #fff;
    cursor: pointer;
    display: grid; place-items: center;
    box-shadow: 0 6px 18px var(--shadow);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease;
  }
  .pod-play:active { transform: scale(0.94); }
  .pod-play svg { width: 28px; height: 28px; display: block; }
  /* 窄屏：缩小按钮与间距，保证整排控制按钮不超过进度条宽度 */
  @media (max-width: 430px) {
    .pod-ico { width: 44px; height: 44px; }
    .pod-ico svg { width: 23px; height: 23px; }
    .pod-play { width: 54px; height: 54px; }
    .pod-play svg { width: 24px; height: 24px; }
    .pod-ctrls { gap: 6px; }
  }
  @media (max-width: 360px) {
    .pod-ico { width: 40px; height: 40px; }
    .pod-ico svg { width: 21px; height: 21px; }
    .pod-play { width: 48px; height: 48px; }
    .pod-play svg { width: 22px; height: 22px; }
    .pod-ctrls { gap: 6px; }
  }
  @media (max-width: 340px) {
    .pod-ico { width: 36px; height: 36px; }
    .pod-ico svg { width: 19px; height: 19px; }
    .pod-play { width: 44px; height: 44px; }
    .pod-play svg { width: 20px; height: 20px; }
    .pod-ctrls { gap: 4px; }
  }

  /* ── 播放列表面板：底部抽屉，从控制条上方滑出 ── */
  .pod-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
    z-index: 30;
  }
  .pod-mask.show { opacity: 1; pointer-events: auto; }
  .pod-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(calc(100% + 40px));
    width: 100%;
    max-width: none;
    max-height: min(70vh, 560px);
    display: flex;
    flex-direction: column;
    border-radius: 20px 20px 0 0;
    background: var(--bar-bg);
    border: 1px solid var(--divider);
    border-bottom: none;
    box-shadow: 0 -8px 34px var(--shadow);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition: transform 0.28s cubic-bezier(.32, .72, .3, 1);
    z-index: 31;
  }
  .pod-panel.show { transform: translateY(0); }
  .pod-panel-head {
    flex: none;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px calc(16px + env(safe-area-inset-right, 0px)) 10px calc(16px + env(safe-area-inset-left, 0px));
    font-size: 13px; font-weight: 700;
    border-bottom: 1px solid var(--divider);
  }
  .pod-panel-close {
    flex: none;
    padding: 4px 10px;
    border: none; border-radius: 12px;
    background: var(--btn-bg); color: var(--text-dim);
    font-size: 12px; font-weight: 600;
    cursor: pointer;
  }
  .pod-panel-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px calc(8px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px));
  }
  .pod-panel-list::-webkit-scrollbar { display: none; }
  .pod-panel-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
  }
  .pod-panel-item:active { background: var(--btn-bg); }
  .pod-panel-item.cur { background: var(--btn-bg); }
  .pod-panel-cover {
    flex: none;
    width: 44px; height: 44px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--btn-bg);
    color: var(--text-dim);
    font-size: 18px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
  }
  .pod-panel-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .pod-panel-info { flex: 1; min-width: 0; }
  .pod-panel-title {
    font-size: 14px; font-weight: 700; line-height: 1.45;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .pod-panel-item.cur .pod-panel-title { color: var(--focus); }
  .pod-panel-sub {
    font-size: 11px; color: var(--text-dim); line-height: 1.5;
    margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .pod-panel-list .empty-tip { padding: 32px 16px; }
  /* 待播队列分区标题（与当前播放列表之间用一条分隔线）*/
  .pod-panel-sep {
    margin: 10px 10px 4px;
    padding-top: 10px;
    border-top: 1px solid var(--divider);
    font-size: 12px; font-weight: 700; color: var(--text-dim);
  }
  /* 待播条目右侧的移除按钮 */
  .pod-panel-rm {
    flex: none;
    width: 28px; height: 28px; border: none; border-radius: 50%;
    background: var(--btn-bg); color: var(--text-dim);
    font-size: 18px; line-height: 1; cursor: pointer;
  }
  /* 当前曲目卡片右侧的「加入列表」按钮（主题色实心圆 + 加号） */
  .pod-panel-add {
    flex: none;
    width: 30px; height: 30px; border: none; border-radius: 50%;
    background: var(--focus); color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
  }
  .pod-panel-add svg { width: 18px; height: 18px; display: block; }
  .pod-panel-add:active { transform: scale(0.9); }
  /* 待播队列每行的拖动排序手柄（卡片最前，两张列表共用）；
     margin-right:-8px 让「手柄↔封面」间距收敛到 4px，其余间距仍保持 12px */
  .q-drag-handle {
    flex: none;
    width: 22px; min-height: 44px; margin-right: -8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
    cursor: grab; touch-action: none;   /* 竖向拖动不触发列表滚动 */
  }
  .q-drag-handle svg { width: 16px; height: 16px; display: block; }
  .q-drag-handle:active { cursor: grabbing; }
  /* 拖动中：被拖行抬起 + 列表禁止选中 */
  .q-dragging {
    background: var(--bg);
    box-shadow: 0 8px 22px var(--shadow);
    border-radius: 12px; opacity: .96; cursor: grabbing;
  }
  .q-dragging-on { user-select: none; -webkit-user-select: none; }
  .pod-panel-item.queue .pod-panel-title { font-weight: 600; }
  /* 待播队列里"正在播放 / 游标指向"的那一条：染主题色 + 轻微底色，循环时一眼看清播到哪 */
  .pod-panel-item.queue.current { background: var(--btn-bg); }
  .pod-panel-item.queue.current .pod-panel-title { color: var(--focus); font-weight: 700; }
  .dojo-queue-item.current { background: var(--btn-bg); }
  .dojo-queue-item.current .dojo-queue-title { color: var(--focus); font-weight: 700; }

  /* 列表面板打开时，控制条跟着沉到面板下方，避免叠在一起 */
  .pod-dock { transition: opacity 0.24s ease; }
  body.pod-panel-open .pod-dock { opacity: 0; pointer-events: none; }

  /* 文稿页向下滚动时自动隐藏底部控制条（向上滚 / 到顶 / 到底 时移除该类即显示）；
     只改 transform + opacity，沿用 .pod-dock 已有的过渡，不干扰上面的面板 / 下滑收起状态。 */
  body.pod-dock-hidden .pod-dock { transform: translateX(-50%) translateY(160%); opacity: 0; pointer-events: none; }
  /* 控件隐藏时收起这段底部留白：显示时给控制条预留 172px（文稿在其上方，透明控件浮在留白上，与封面一致）；
     隐藏时收起，文稿滚到接近屏幕底部。注：此前「滚动驱动显隐」会与此留白变化互相反翻形成抖动死循环，
     现已改为仅「自动播放 3 秒后 / 点按唤出」切换，不再由滚动驱动，故安全。 */
  body.pod-dock-hidden .pod-screen { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

  /* 下滑收起：整个播放器缩小 + 淡出（由 audio.php 下滑手势加 body.pod-collapsing 触发）。
     .pod-screen / .pod-dock 原 transform 为 translateX(-50%)，此处显式写全以免被覆盖。 */
  .pod-screen, .pod-dock, .pod-bg { transition: transform .3s cubic-bezier(.36,.66,.04,1), opacity .3s ease, padding-bottom .28s ease; }
  body.pod-collapsing .pod-bg { opacity: 0; }
  body.pod-collapsing .pod-screen { transform: translateX(-50%) scale(.86) translateY(34vh); opacity: 0; }
  body.pod-collapsing .pod-dock { transform: translateX(-50%) scale(.86) translateY(34vh); opacity: 0; }

  /* ── 迷你条占的底部留白 ──
     条的组件会在首屏之前给 <html> 挂上 .has-mini（见 lib/player.js 的 setGap），
     这里把各页滚动容器的底部内边距加上「条高 62 + 间距 12 = 74」，免得最后一行被压住。
     每条的值 = 该容器原本的 padding-bottom + 74，改容器原值时记得同步改这里：
       .shelf   110（书架 / 音频 / 合集 / 喜爱，都在给 Dock 让位） → 184
       .ai-list   6（AI）                                      →  80
       .pc-wrap  40（我的）                                    → 114
       .cal-wrap 40（日历）                                    → 114
     阅读页（.reader）故意不在这张表里，它不需要也不能加：
       · 不需要：.reader 的 padding-bottom 是 40vh（阅读区标定值，见 .reader 规则），
         约 340px，本来就远高于条占的 74px，最后一行不会被条压住。
       · 不能加：那 40vh 的作用是让「最后一行也能被滚到视口中心」——聚焦高亮和放大就发生在
         视口中心，这是逐行阅读的前提。照「原值 + 74」的算法会写成 74px，
         等于把 40vh 抹掉：末尾整屏再也滚不进阅读区，最后一行被钉死在屏幕底部
         （表现就是「书翻不到底」）。要留白也得是 calc(40vh + 74px)，但那会让
         末尾比其它位置多滚 74px，最后一行跑到中心之上，反而不如原样。
     为什么不交给 JS 逐个容器读 getComputedStyle 再写 inline padding：
     那是一次「读布局 → 写样式」的强制重排，而且落在首屏之前 —— 阅读页几千行时最贵。 */
  html.has-mini .shelf          { padding-bottom: 184px; }
  html.has-mini .ai-list        { padding-bottom:  80px; }
  html.has-mini .pc-wrap        { padding-bottom: 114px; }
  html.has-mini .cal-wrap       { padding-bottom: 114px; }

  /* ══ 全局迷你播放器（lib/player.js）══
     由组件在「非播放页」动态插入，页面本身不用写任何 DOM：
     点条身 → 回播放页；▶ → 播放 / 暂停；✕ → 结束这次播放（清掉接力状态）。
     没拖动过时停在底部，并按页面里已有的贴底元素（.dock / .ai-bar）让开；
     拖动过一次之后就吸在左 / 右某一条边上，垂直位置随用户，并收缩成半圆小标签。
     位置由 JS 写成 --mx / --my（展开态左上角的视口坐标），CSS 只负责 translate 过去：
     拖动时改的是 transform，走合成层、不触发重排，这是拖动不掉帧的关键。
     没有曲目时组件不会加 .on，整条始终不可见也不接管点击。 */
  .dojo-mini {
    position: fixed;
    left: 0;
    top: 0;
    /* 抬升时的起点是下方 18px；--mh 是条高，用来兜住底部安全区，
       免得条被拖到底时压到 home indicator 上。
       上面一条是保底写法：老 WebView 不认 min() / env() 时，整条声明会作废，
       条就会卡在左上角 —— 所以先写一个必然成立的，再让下面那条在支持时覆盖。 */
    --mh: 62px;
    transform: translate3d(var(--mx, 0px), calc(var(--my, 0px) + 18px), 0);
    transform: translate3d(var(--mx, 0px),
                           min(calc(var(--my, 0px) + 18px),
                               calc(100vh - var(--mh) - env(safe-area-inset-bottom, 0px))),
                           0);
    /* 同上，认 dvh 的用动态视口：折叠/并排时布局视口比可视区高，条会被顶到屏幕外 */
    transform: translate3d(var(--mx, 0px),
                           min(calc(var(--my, 0px) + 18px),
                               calc(100dvh - var(--mh) - env(safe-area-inset-bottom, 0px))),
                           0);
    width: calc(100% - 24px);
    /* 展开态宽度上限由 JS 写进 --mini-w（同一份常量也用来算定位，避免两处各写一个数）。
       比原先的 456px 窄一截：条是常驻浮层，浮在正文上时会挡字。 */
    max-width: var(--mini-w, 280px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 10px;
    border-radius: 18px;
    overflow: hidden;
    /* 这一条是常驻浮层，长期压在滚动内容之上，所以刻意不用 backdrop-filter。
       毛玻璃要合成器每帧重新采样背后的内容再模糊一次，页面一滚就是每帧重算，
       在 iOS / 微信 WebView 上直接掉帧（blur(20px) 比顶栏的 12px 更贵）。
       改成不透明底色后观感几乎一致，但滚动时零额外开销。
       想换回毛玻璃：把 background 换成 var(--bar-bg)，再打开下面两行 backdrop-filter，
       代价是列表滚动会明显发涩。 */
    background: var(--bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 30px var(--shadow);
    /* 过渡只留 opacity / transform —— 只有这两个是合成层属性。
       绝不能把 width、padding、border-radius 挂上来：它们都是布局属性，一旦参与过渡，
       浏览器就得在这 200ms 里逐帧重排整条 —— 连带整个 flex 子树重新分配、
       标题的 ellipsis 截断逐帧重算、30px 模糊的 box-shadow 逐帧重新栅格化。
       低端机 / 微信 WebView 上这就是「收缩展开必卡」的直接来源。
       改成瞬变后尺寸只花一帧，随后的位移交给 transform，纯合成、零重排。
       visibility 也不挂：它是离散属性，挂上去只会让元素多一份待过渡状态，没有收益。 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.24s ease;
    cursor: pointer;
    /* 拖动由组件自己接管：少了这一句，手机上按住条一滑就变成滚页面了 */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 25;
  }
  .dojo-mini.on {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
    transform: translate3d(var(--mx, 0px),
                           min(var(--my, 0px),
                               calc(100vh - var(--mh) - env(safe-area-inset-bottom, 0px))),
                           0);
    transform: translate3d(var(--mx, 0px),
                           min(var(--my, 0px),
                               calc(100dvh - var(--mh) - env(safe-area-inset-bottom, 0px))),
                           0);
  }
  /* 跟手期间任何过渡都会拖后腿 */
  .dojo-mini.dragging { transition: none; cursor: grabbing; }
  /* 换页时条本来就该在原位接着显示，JS 会在挂 .on 的那一帧临时加上这个类，
     跳过入场（淡入 + 上移）。省下的是每次跳页都要重放一遍的合成开销：
     那 0.24s 里要逐帧栅格化一条带 30px 模糊投影的浮层，正好压在新页面的首屏渲染上。 */
  .dojo-mini.instant { transition: none; }

  /* 贴边收缩：只剩封面，露出半个圆（48px 的条露 24px，半径 24px 正好是半圆；
     封面同为 42px 正圆且与条同心，露出来的那半边正好补上被切掉的那半边） */
  .dojo-mini.docked {
    --mh: 48px;
    width: 48px;
    padding: 2px;
    gap: 0;
  }
  .dojo-mini.docked.dl { border-radius: 0 24px 24px 0; }
  .dojo-mini.docked.dr { border-radius: 24px 0 0 24px; }
  .dojo-mini.docked .dojo-mini-info,
  .dojo-mini.docked .dojo-mini-btn,
  .dojo-mini.docked .dojo-mini-progress { display: none; }

  /* 封面：做成一张黑胶唱片 —— 盘面（黑圈）在播放时旋转。
     封面盒子必须保持 42px 正圆：收缩态下条是 48×48、外侧圆角 24px，而封面 42px 正好
     铺满内容区（48 - padding 2×2 - border 1×2 = 42），两圆心都落在条的中心，露出的那半个
     封面才能与条的半圆边严丝合缝（JS 里 MINI_H = 62 也是照 42 算的）。
     所以黑圈不能往外长 —— 往外长会同时破坏「同心对齐」和条高常量，还正好顶到条的
     overflow: hidden 上被切掉一圈。改成「内缩」：封面自己染成唱片黑，照片靠 padding
     缩进 3px 当唱片中心那枚圆标，外观上就是封面外围多了一圈黑。 */
  .dojo-mini-cover {
    flex: none;
    width: 42px; height: 42px;
    border-radius: 50%;
    overflow: hidden;
    /* 唱片黑 + 一道随盘面转的高光（一束光扫过黑胶的感觉，也顺便让中心对称的封面
       看得出在转）。高光单独写成 background-image：不认识 conic-gradient 的老 WebView
       只会丢掉这一层，盘面仍是黑的。 */
    background-color: #131313;
    background-image: conic-gradient(from 200deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0) 28%);
    /* 极淡的一圈内描边当盘纹，免得整块黑得死板 */
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
    /* 黑圈宽度：照片往里缩这么多 */
    padding: 3px;
    /* 没有封面时居中显示书名首字：黑盘上的字得用浅色才看得见 */
    color: rgba(255, 255, 255, .7);
    font-size: 18px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    /* 播放时匀速转。6s 一圈：真唱片 33⅓ 转是 1.8s，缩到 42px 上会转得发晕。
       动画常驻、只切 animation-play-state —— 若改成「暂停时去掉动画」，角度会立刻归零，
       唱片会「跳」回起点；这样写是停在原地，续播时接着转。
       转的是 transform：走合成层，不重排也不重绘（拖整条条时也是纯合成）。 */
    animation: dojo-spin 6s linear infinite;
    animation-play-state: paused;
  }
  .dojo-mini.playing .dojo-mini-cover { animation-play-state: running; }
  @keyframes dojo-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
  }
  /* 封面图缩成圆标：盒子被 padding 收到 36px，再自己滚圆 ——
     不滚圆的话四个角会被外圈裁成方形贴圆的怪形状 */
  .dojo-mini-cover img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
  /* 系统开了「减弱动态效果」就不转：盘面、高光、圆标都还在，只是静着 */
  @media (prefers-reduced-motion: reduce) {
    .dojo-mini-cover { animation: none; }
  }
  .dojo-mini-info { flex: 1; min-width: 0; }
  .dojo-mini-title {
    font-size: 13px; font-weight: 700; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dojo-mini-sub {
    font-size: 11px; color: var(--text-dim); line-height: 1.4; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dojo-mini-btn {
    flex: none;
    width: 36px; height: 36px;
    padding: 0;
    display: grid; place-items: center;
    position: relative;
    border: 0; border-radius: 50%;
    background: transparent; color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, color 0.2s ease;
  }
  .dojo-mini-btn:active { transform: scale(0.9); }
  .dojo-mini-btn svg { width: 20px; height: 20px; display: block; }
  /* 待播队列角标：叠在队列按钮右上角 */
  .dojo-mini-qbadge {
    position: absolute; top: -3px; right: -3px;
    min-width: 16px; height: 16px; padding: 0 4px;
    box-sizing: border-box;
    border-radius: 9px; background: var(--focus); color: #fff;
    font-size: 10px; line-height: 16px; text-align: center; font-weight: 700;
    pointer-events: none;
  }
  /* 播放是主操作：实心圆主按钮，与 ✕ 拉开主次 */
  .dojo-mini-btn.main { background: var(--focus); color: #fff; }
  .dojo-mini-btn.main:active { color: #fff; }
  /* 细进度线贴在浮动条下沿 */
  .dojo-mini-progress {
    position: absolute;
    left: 14px; right: 14px; bottom: 4px;
    height: 2px;
    border-radius: 2px;
    background: var(--btn-bg);
    overflow: hidden;
  }
  .dojo-mini-fill { height: 100%; width: 0; background: var(--focus); }

  /* ── 待播队列抽屉（迷你条「待播队列」入口打开）── */
  .dojo-queue-mask {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45);
    display: none; align-items: flex-end; justify-content: center;
    z-index: 60;
  }
  .dojo-queue-mask.show { display: flex; }
  .dojo-queue-sheet {
    width: 100%; max-width: 560px;
    max-height: 70vh;
    display: flex; flex-direction: column;
    border-radius: 20px 20px 0 0;
    background: var(--bg);
    border: 1px solid var(--divider);
    border-bottom: none;
    box-shadow: 0 -8px 34px var(--shadow);
    overflow: hidden;
  }
  .dojo-queue-head {
    flex: none;
    display: flex; align-items: center; gap: 10px;
    padding: 14px calc(16px + env(safe-area-inset-right, 0px)) 10px calc(16px + env(safe-area-inset-left, 0px));
    font-size: 13px; font-weight: 700;
    border-bottom: 1px solid var(--divider);
  }
  .dojo-queue-head > span { flex: 1; }
  .dojo-queue-clear {
    border: none; background: var(--btn-bg); color: var(--text);
    border-radius: 12px; padding: 4px 10px; font-size: 12px; cursor: pointer;
  }
  .dojo-queue-close {
    border: none; background: none; color: var(--text-dim);
    font-size: 20px; line-height: 1; cursor: pointer;
  }
  .dojo-queue-list {
    flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 6px calc(8px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px));
  }
  .dojo-queue-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px; border-radius: 12px; cursor: pointer;
  }
  .dojo-queue-item:active { background: var(--btn-bg); }
  .dojo-queue-cover {
    flex: none; width: 44px; height: 44px; border-radius: 10px;
    background: var(--btn-bg); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
  }
  .dojo-queue-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .dojo-queue-info { flex: 1; min-width: 0; }
  .dojo-queue-title {
    font-size: 14px; font-weight: 700; line-height: 1.45;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dojo-queue-sub {
    font-size: 11px; color: var(--text-dim); line-height: 1.5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dojo-queue-rm {
    flex: none; width: 28px; height: 28px; border: none; border-radius: 50%;
    background: var(--btn-bg); color: var(--text-dim);
    font-size: 18px; line-height: 1; cursor: pointer;
  }

  /* ── 阅读页选中文本后的「AI 解读」角标（去掉复制/分享浮窗，避免被 iOS 系统菜单遮挡）── */
  .ai-badge {
    position: fixed;
    z-index: 9999;
    display: none;
    padding: 7px 14px;
    background: var(--focus);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .ai-badge:active { filter: brightness(.92); }
  [data-theme="dark"] .ai-badge { box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }

  /* ── 阅读页「AI 抽屉」：半屏问答（iframe 内是 ai.php?embed=1），上拉铺满全屏 ── */
  .ai-sheet-mask {
    position: fixed; inset: 0; z-index: 9989;
    background: rgba(0, 0, 0, .38);
    opacity: 0; visibility: hidden;
    transition: opacity .22s ease;
  }
  .ai-sheet-mask.show { opacity: 1; visibility: visible; }
  .ai-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
    height: 0; max-height: 100%;
    display: flex; flex-direction: column;
    background: var(--bg);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .26);
    overflow: hidden;
    transform: translateY(102%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1), height .24s ease, border-radius .2s ease;
    will-change: transform;
  }
  .ai-sheet.show { transform: translateY(0); }
  .ai-sheet.full { border-radius: 0; }
  /* 拖拽期间关掉高度过渡，手指到哪就是哪 */
  .ai-sheet.dragging { transition: transform .26s cubic-bezier(.4, 0, .2, 1); }
  .ai-sheet-head {
    flex: 0 0 auto; height: 30px; position: relative;
    display: flex; align-items: center; justify-content: center;
    touch-action: none; cursor: grab;
  }
  .ai-sheet-head::before {
    content: ""; width: 42px; height: 4px; border-radius: 2px;
    background: var(--divider, rgba(128, 128, 128, .35));
  }
  .ai-sheet iframe {
    flex: 1 1 auto; width: 100%; border: 0; background: transparent;
    -webkit-overflow-scrolling: touch;
  }
  [data-theme="dark"] .ai-sheet { box-shadow: 0 -8px 30px rgba(0, 0, 0, .6); }
  /* 抽屉打开时锁住背后正文的滚动（阅读页本身靠 body 滚） */
  body.ai-sheet-lock { overflow: hidden; }
  /* 禁用阅读正文长按链接/图片弹出的系统条（文本选择后的系统编辑菜单无法用 Web 禁止） */
  #reader { -webkit-touch-callout: none; }

  /* ── 导出 PDF / 打印：正文由 #printRoot 渲染（封面 + 正文 + 释文），阅读器界面全部隐藏 ── */
  #printRoot { display: none; }

  /* PDF 预览弹窗（前端生成 PDF 后的下载 / 分享） */
  .pdf-modal { width: 92vw; max-width: 760px; height: 88vh; display: flex; flex-direction: column; padding: 0; }
  .pdf-modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #eee; }
  .pdf-modal-bar .pdf-name { font-size: 13px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pdf-modal-actions { display: flex; gap: 8px; flex: 0 0 auto; }
  .pdf-modal iframe { flex: 1; width: 100%; border: 0; background: #fff; }
  .pdf-hint { font-size: 12px; color: #888; text-align: center; padding: 6px 12px 10px; margin: 0; }

  /* ── 底部动作弹窗（下载 / 分享 / 喜爱，右侧列 ⋯ 唤出；图标在上、文字在下）── */
  .sheet-mask {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0; visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
  }
  .sheet-mask.open { opacity: 1; visibility: visible; }
  .sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
    background: transparent;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
    transform: translateY(105%);
    transition: transform .26s cubic-bezier(.22, .61, .36, 1);
    padding: 6px 16px calc(12px + env(safe-area-inset-bottom));
    visibility: hidden;
  }
  .sheet::before {   /* 背景完全不透明：90% 时背后的正文会隐约透出来，滚动看得出脏 */
    content: ''; position: absolute; inset: 0;
    background: #fbf8f3;
    border-radius: 18px 18px 0 0;
  }
  [data-theme="dark"] .sheet::before { background: #16191d; }
  .sheet > * { position: relative; z-index: 1; }
  .sheet.open { transform: translateY(0); visibility: visible; }
  .sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: rgba(127, 127, 127, 0.3); margin: 8px auto 10px; }
  .sheet-actions { display: flex; justify-content: flex-start; flex-wrap: wrap; }
  .sheet .btn.sheet-item {
    flex: 0 0 auto; height: 78px; border: none; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 8px 4px; background: transparent; color: inherit;
    font-size: 13px; font-weight: 600; cursor: pointer;
  }
  .sheet-actions .sheet-item { width: 25%; }        /* 主视图：字形/注音/下载/分享/喜爱/经笺/读经/反馈 八个，一行四个（4+4） */
  .sheet-sub .sheet-item { width: 33.3333%; }        /* 二级：打印版/手机版 两个，靠左不拉满 */
  .sheet .btn.sheet-item:active { background: rgba(127, 127, 127, 0.15); }
  .sheet .btn.sheet-item svg { width: 26px; height: 26px; flex: 0 0 auto; }
  /* 字形图标（简/繁、ā）：CSS 文字 + 固定盒 + flex 居中。
     以前是 SVG 里套 <text text-anchor="middle" y="18">，居中靠字体度量算 ——
     iOS 新机型（iPhone 17 系）上字宽/基线偏移会顶出 viewBox 被裁掉一半，
     而且裁剪后看着像「没居中」。换成普通文字后不依赖任何 SVG 文本布局。 */
  .sheet .btn.sheet-item .sheet-glyph {
    width: 26px; height: 26px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 700; line-height: 1;
  }
  .sheet .btn.sheet-item .sheet-glyph.is-latin { font-size: 19px; font-weight: 600; }
  /* 负向操作（反馈）弱化：颜色降一级，和上面七项区分开 */
  .sheet .btn.sheet-item.sheet-item-quiet { color: #9a958c; }

  /* ── 反馈 / 举报二级 sheet ── */
  .sheet-fb { padding: 0 16px calc(14px + env(safe-area-inset-bottom)); max-height: 82vh; display: flex; flex-direction: column; }
  .fb-head { padding: 2px 4px 10px; flex: 0 0 auto; }
  .fb-title { font-size: 16px; font-weight: 600; letter-spacing: .02em; }
  .fb-sub { margin-top: 4px; font-size: 11.5px; color: #9a958c; }
  /* 举报 / 勘误 / 建议三个 TAB：等宽分段，当前项用主色描边 */
  .fb-tabs { flex: 0 0 auto; display: flex; gap: 6px; padding: 0 2px 10px; }
  .fb-tab {
    flex: 1 1 0; padding: 8px 0; border-radius: 9px; font: inherit; font-size: 12.5px;
    color: #9a958c; cursor: pointer;
    border: 1px solid rgba(127, 127, 127, .22); background: rgba(127, 127, 127, .05);
  }
  .fb-tab.on { color: var(--focus, #b23a1a); border-color: currentColor; background: rgba(178, 58, 26, .08); font-weight: 600; }
  .fb-panel { display: none; }
  .fb-panel.on { display: block; }
  .fb-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; overscroll-behavior: contain; }
  .fb-group { font-size: 10.5px; letter-spacing: .14em; color: #9a958c; margin: 12px 4px 7px; }
  .fb-opt {
    display: block; width: 100%; text-align: left; margin-bottom: 7px;
    padding: 11px 13px; border-radius: 11px; font: inherit; font-size: 13.5px;
    color: inherit; border: 1px solid rgba(127, 127, 127, .28);
    background: rgba(127, 127, 127, .06); cursor: pointer;
  }
  .fb-opt.on { color: var(--focus, #b23a1a); border-color: currentColor; background: rgba(178, 58, 26, .08); }
  .fb-note {
    width: 100%; min-height: 62px; margin-top: 6px; padding: 10px 12px;
    /* 必须 ≥16px：iOS Safari 在聚焦 font-size < 16px 的输入框时会自动放大整页，
       反馈弹窗与个人中心「意见建议」都用这个类，改小就会一聚焦就跳缩放。 */
    font: inherit; font-size: 16px; line-height: 1.6; resize: none;
    border-radius: 11px; color: inherit;
    border: 1px solid rgba(127, 127, 127, .28); background: rgba(127, 127, 127, .06);
  }
  .fb-note:focus { outline: none; border-color: rgba(178, 58, 26, .55); box-shadow: 0 0 0 3px rgba(178, 58, 26, .10); }
  .fb-submit {
    flex: 0 0 auto; width: 100%; margin-top: 12px; padding: 13px;
    border: 0; border-radius: 12px; font: inherit; font-size: 14px; letter-spacing: .18em;
    color: #fff; background: var(--focus, #b23a1a); cursor: pointer;
  }
  .fb-submit:disabled { opacity: .38; }
  .fb-tip { flex: 0 0 auto; text-align: center; font-size: 11px; color: #9a958c; margin-top: 9px; }
  .sheet-cancel {
    width: 100%; height: 48px; margin-top: 10px;
    border: none; border-radius: 12px;
    background: rgba(127, 127, 127, 0.12); color: inherit;
    font-size: 15px; font-weight: 600; cursor: pointer;
  }
  /* 下载二级：主视图(下载/分享/喜爱) 与 子视图(打印版/手机版) 切换 */
  .sheet-main { display: flex; flex-direction: column; }
  .sheet-subwrap { display: none; flex-direction: column; }
  .sheet.sub .sheet-main { display: none; }
  .sheet.sub .sheet-subwrap { display: flex; }
  .sheet-sub { display: flex; justify-content: flex-start; }
  .sheet-back {
    width: 100%; height: 48px; margin-top: 10px;
    border: none; border-radius: 12px;
    background: rgba(127, 127, 127, 0.12); color: inherit;
    font-size: 15px; font-weight: 600; cursor: pointer;
  }
  /* 经笺 / 读经：选择模式
     选中块原来紧贴文字、四边没有留白，看起来像把字「卡」在框里。
     这里左右各加 10px 内边距，同时用等量负外边距抵掉 —— 正文的对齐、行高都不变，
     但高亮块在视觉上比文字宽出一截；上下留白靠外扩的柔光（0 0 0 4px）补，
     这样不会真的撑高行盒、把整篇正文重新排一遍。 */
  .reader.card-select .line { cursor: pointer; }
  .reader.card-select .line .line-text {
    border-radius: 10px;
    padding: 0 10px;
    margin: 0 -10px;
    transition: background .15s ease, box-shadow .15s ease;
  }
  /* 按下即时反馈：告诉用户这一行是能点的 */
  .reader.card-select .line:active .line-text { background: rgba(164, 118, 58, .12); }
  .reader.card-select .line.card-selected { opacity: 1; }   /* 选中行从「弱化的上下文」升为正文色 */
  .reader.card-select .line.card-selected .line-text {
    background: rgba(164, 118, 58, .20);
    box-shadow: inset 0 0 0 1.5px rgba(164, 118, 58, .55),
                0 0 0 4px rgba(164, 118, 58, .10);
  }
  /* 经笺 / 读经的选择条：整条落在一片毛玻璃底板上，
     主按钮（生成经笺 / 读选中的行）用暖金渐变 + 内高光，次按钮走玻璃白。
     比原来的两块纯色方块更贴阅读页的宣纸质感，也让主次一眼分得开。
     max-width 兜住 320 小屏：三键一行放得下。 */
  .card-selbar {
    position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    z-index: 55; display: flex; align-items: center; gap: 8px;
    max-width: calc(100vw - 24px);
    padding: 6px; border-radius: 18px;
    background: rgba(32, 28, 24, .62);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .16);
  }
  .card-selbar[hidden] { display: none; }
  /* 次按钮：取消 / 读整本 */
  .card-sel-cancel, .card-sel-whole {
    height: 42px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 13px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06));
    color: rgba(255, 255, 255, .94); font-size: 14px; font-weight: 500; letter-spacing: .02em;
    cursor: pointer; white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    transition: transform .14s ease, background .18s ease;
  }
  .card-sel-cancel { min-width: 68px; }
  .card-sel-whole { min-width: 62px; padding: 0 12px; font-size: 13.5px; }
  .card-sel-cancel:hover, .card-sel-whole:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .10));
  }
  .card-sel-cancel:active, .card-sel-whole:active { transform: scale(.97); }
  /* 主按钮：生成经笺 / 读选中的行 */
  .card-sel-gen {
    min-width: 104px; height: 42px; padding: 0 16px;
    border: 1px solid rgba(255, 232, 196, .32); border-radius: 13px;
    background: linear-gradient(180deg, #c89450 0%, #a97a3c 52%, #8c6129 100%);
    color: #fff8ec; font-size: 14.5px; font-weight: 600; letter-spacing: .04em;
    cursor: pointer; white-space: nowrap;
    text-shadow: 0 1px 1px rgba(88, 56, 16, .38);
    box-shadow: 0 8px 18px -9px rgba(126, 82, 26, .9),
                inset 0 1px 0 rgba(255, 255, 255, .38),
                inset 0 -1px 0 rgba(0, 0, 0, .16);
    transition: transform .14s ease, filter .18s ease, box-shadow .18s ease;
  }
  .card-sel-gen:hover:not(:disabled) { filter: brightness(1.06); }
  .card-sel-gen:active:not(:disabled) {
    transform: translateY(1px) scale(.985);
    box-shadow: 0 4px 12px -8px rgba(126, 82, 26, .95), inset 0 1px 0 rgba(255, 255, 255, .28);
  }
  /* 禁用不做成半透明幽灵，而是压暗去饱和：字还看得清，状态一眼可辨 */
  .card-sel-gen:disabled {
    cursor: default;
    filter: saturate(.45) brightness(.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  }
  #dubSelGo { min-width: 104px; }

  @media print, html.pdf-capture {
    @page { margin: 2cm; }
    html, body { background: #fff !important; height: 100%; }
    body { color: #000 !important; overflow: visible !important; }

    /* 顶栏、阅读区、按钮列、控制条、播放器、弹窗、角标、提示：全部隐藏 */
    .topbar, .reader, .font-stack, .controls, .dojo-mini, .modal-overlay, .ai-badge, .toast, .sheet, .sheet-mask { display: none !important; }

    #printRoot {
      display: block !important;
      height: 100% !important;
      font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
      color: #2b2b2b;
    }

    /* ── 封面 / 封底（封面为中式双线边框 + 四角角标，版式参考藏经封面稿，见 git 历史）── */
    .pc-cover, .pc-backcover {
      --ink: #a4763a;
      min-height: 100%;          /* 撑满一页；不支持 % 的引擎回退为内容高度，绝不溢出 */
      display: flex; flex-direction: column;
    }
    .pc-cover { page-break-after: always; break-after: page; }
    .pc-backcover { page-break-before: always; break-before: page; align-items: center; justify-content: center; }

    /* 外框 + 内框（双线），均用真实 border 保证打印可见 */
    .pc-frame {
      flex: 1;
      margin: 8mm 8mm;
      border: 1.5px solid var(--ink);
      display: flex; flex-direction: column;
      position: relative;
    }
    .pc-frame-inner {
      flex: 1;
      margin: 3mm;
      border: 0.75px solid #c9a878;
      display: flex; flex-direction: column; align-items: center;
      position: relative;
      padding: 5mm 6mm;
    }
    /* 四角 L 形角标（中式，略向框外探出） */
    .pc-frame::before, .pc-frame::after,
    .pc-frame-inner::before, .pc-frame-inner::after { content: ""; position: absolute; width: 8mm; height: 8mm; }
    .pc-frame::before { top: -3mm; left: -3mm; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
    .pc-frame::after { bottom: -3mm; right: -3mm; border-bottom: 2px solid var(--ink); border-right: 2px solid var(--ink); }
    .pc-frame-inner::before { top: -3mm; right: -3mm; border-top: 2px solid var(--ink); border-right: 2px solid var(--ink); }
    .pc-frame-inner::after { bottom: -3mm; left: -3mm; border-bottom: 2px solid var(--ink); border-left: 2px solid var(--ink); }

    /* 封面内容 */
    .pc-eyebrow { font-size: 15px; letter-spacing: 0.6em; text-indent: 0.6em; color: var(--ink); margin-top: 10mm; }
    .pc-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .pc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); margin-bottom: 10mm; }
    .pc-title { font-size: 36px; line-height: 1.5; letter-spacing: 0.16em; text-indent: 0.16em; color: var(--ink); font-weight: 700; text-align: center; margin: 0 0 10mm; }
    .pc-orn { color: var(--ink); font-size: 16px; margin-bottom: 8mm; }
    .pc-author { font-size: 14px; letter-spacing: 0.25em; text-indent: 0.25em; color: #6b6b6b; margin: 0; }
    .pc-bottom { margin-bottom: 8mm; text-align: center; }
    .pc-merit { font-size: 13px; letter-spacing: 0.35em; text-indent: 0.35em; color: #5a5a5a; margin: 0 0 6mm; }
    .pc-qr { width: 15mm; height: 15mm; margin: 0 auto; }   /* 二维码缩小一半 */
    .pc-qr img { width: 100%; height: 100%; display: block; }

    /* 封底内容（无装饰框，字号贴近参考 PDF 封底） */
    .pc-verse { font-size: 15px; letter-spacing: 0.34em; text-indent: 0.34em; color: var(--ink); margin: 6mm 0; text-align: center; }
    .pc-gap { display: inline-block; width: 0.9em; }
    .pc-backbrand { font-size: 13px; letter-spacing: 0.4em; text-indent: 0.4em; color: #5a5a5a; margin-top: 10mm; text-align: center; }

    /* ── 正文 / 释文 ── */
    /* 相邻小节之间另起一页（封面已有 page-break-after，正文首节不再加，避免空白页） */
    .pc-section + .pc-section { page-break-before: always; break-before: page; }
    .pc-heading {
      text-align: center; font-size: 20px; font-weight: 700;
      letter-spacing: 0.5em; text-indent: 0.5em; color: #a4763a;
      margin: 6mm 0 8mm;
    }
    .pc-line { font-size: 15px; line-height: 2.1; text-align: justify; }
    .pc-line strong { font-weight: 700; }
  }

  /* ── 通用侧边栏（右侧滑出抽屉：账户 / 导航）──
     触发按钮由各页顶栏自行放置（三条线图标），调用 openSidebar()。
     视觉参考方向 B（禅院空栏）：80% 宽、大留白、letter-spacing、金点选中。 */
  .sb-backdrop {
    position: fixed; inset: 0;
    background: rgba(20, 20, 22, .45);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility .25s;
    z-index: 90;
  }
  .sb-backdrop.show { opacity: 1; visibility: visible; }
  .sb-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 80%; max-width: 320px; z-index: 91;
    background: var(--bg); color: var(--text);
    box-shadow: -12px 0 40px rgba(0, 0, 0, .22);
    border-left: 1px solid var(--divider);
    transform: translateX(100%);
    /* 关闭时等位移动画走完再隐藏，避免收起瞬间消失；打开时立即可见 */
    visibility: hidden;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .3s;
    display: flex; flex-direction: column;
    padding: calc(var(--sa-top, env(safe-area-inset-top, 0px)) + 22px) 22px calc(env(safe-area-inset-bottom, 0px) + 18px);
    outline: none;
    /* 抽屉是 fixed 元素，字体显式写死：不跟随页面上可能存在的字体覆盖（朗读投稿页曾整片变黑体） */
    font-family: var(--font-serif);
  }
  .sb-drawer.show { transform: translateX(0); visibility: visible; transition: transform .3s cubic-bezier(.4, 0, .2, 1), visibility 0s; }
  /* 手势拖拽：跟手期间必须关掉过渡，否则位移会被动画拖慢；横向拖动交给脚本、纵向仍原生滚动 */
  .sb-drawer.sb-dragging, .sb-backdrop.sb-dragging { transition: none; }
  .sb-drawer { touch-action: pan-y; }
  [data-theme="dark"] .sb-drawer { box-shadow: -12px 0 44px rgba(0, 0, 0, .6); }

  /* 顶部：账户 + 当日阅读信息卡
     布局：头像 + 账号在左上、日期在右上，中间分割线下面放今日阅读 / 今日收听。
     整张卡是一个链接（<a>），点任意位置进个人中心；未登录时指向登录页。 */
  .sb-today {
    flex: none; display: block; padding: 14px;
    background: var(--card-surface); border: 1px solid var(--card-border); border-radius: 14px;
    text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent;
    transition: background .15s ease, transform .15s ease;
  }
  .sb-today:active { background: var(--btn-bg); transform: scale(.985); }
  .sb-today-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .sb-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .sb-avatar { width: 42px; height: 42px; font-size: 17px; }
  /* 账号块：昵称在上（大字）、账号在下（小字 +@），两行都按可用宽度省略 */
  .sb-who-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .sb-nick { min-width: 0; font-size: 15px; font-weight: 700; letter-spacing: .5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-acct { min-width: 0; font-size: 11.5px; letter-spacing: .5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-today-hd { display: flex; align-items: baseline; gap: 6px; flex: none; }
  .sb-today-d { font-size: 15px; font-weight: 700; letter-spacing: .5px; color: var(--text); }
  .sb-today-w { font-size: 11px; color: var(--text-dim); letter-spacing: .5px; }
  .sb-today-sep { height: 1px; background: var(--divider); margin: 12px 0; }
  /* 两列均分整卡宽度，数值/单位/标签各自居中：左右对称，和上方「头像｜日期」
     的左右分列也不会互相挤，读数据时视线落在中线上。 */
  .sb-today-row { display: flex; gap: 10px; }
  .sb-today-cell { flex: 1; min-width: 0; text-align: center; }
  .sb-today-cell b { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
  .sb-today-cell i { font-style: normal; font-size: 11px; color: var(--text-dim); margin-left: 3px; }
  .sb-today-cell span { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; letter-spacing: .5px; }

  /* 菜单（B 版：留白 + letter-spacing + 金点选中） */
  /* min-height:0 必须：否则 flex 子项按内容撑高，小屏时底部主题/设置被挤出可视区 */
  .sb-menu { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  /* font-weight 固定 400：选中态不做加粗。
     宋体没有 600 字重，浏览器会合成假粗，在缺字重的设备上还会回落到黑体，
     于是「选中的那一项」看起来像换了字体 —— 改用聚焦色 + 金点 + 图标色做区分。 */
  .sb-mi { display: flex; align-items: center; gap: 14px; padding: 13px 4px; color: var(--text); font-size: 16px; font-weight: 400; letter-spacing: 1px; text-decoration: none; position: relative; }
  .sb-mi svg { width: 20px; height: 20px; flex: none; color: var(--bar-icon); }
  .sb-mi:hover { color: var(--focus); }
  .sb-mi .sb-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; flex: none; margin-right: -6px; }
  .sb-mi.sb-on { color: var(--focus); font-weight: 400; }
  .sb-mi.sb-on svg { color: var(--focus); }
  .sb-mi.sb-on .sb-dot { background: #C9A86A; }
  .sb-chip { margin-left: auto; font-size: 11px; color: var(--focus); border: 1px solid rgba(217, 72, 15, .4); padding: 2px 9px; border-radius: 999px; white-space: nowrap; letter-spacing: 0; }
  /* Beta 角标：琥珀底比普通 chip 更醒目，但仍沿用侧边栏药丸形状 */
  .sb-chip.sb-chip-beta { background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .55); color: #b45309; }
  [data-theme="dark"] .sb-chip.sb-chip-beta { background: rgba(245, 158, 11, .18); border-color: rgba(245, 158, 11, .5); color: #fbbf24; }
  .sb-divider { height: 1px; background: var(--divider); margin: 8px 4px; }
  /* 菜单行也可以是 <button>（如「加入课堂」），与 <a> 版本的 .sb-mi 完全同款 */
  .sb-mi-btn { width: 100%; box-sizing: border-box; border: 0; background: transparent; font-family: inherit; font-size: 16px; cursor: pointer; text-align: left; }

  /* 工具区：一行固定 3 格（清单见 lib/tools.php）。小方块而非整行，工具多了就往下换行，
     不去压缩每格宽度 —— 方块太窄时工具名会折行。 */
  .sb-toolhd { font-size: 11px; letter-spacing: 1.5px; color: var(--text-dim); padding: 2px 4px 8px; }
  .sb-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 0 4px; }
  .sb-tool {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 4px; border-radius: 12px;
    background: var(--card-surface); border: 1px solid var(--card-border);
    color: var(--text); font-size: 12px; letter-spacing: .5px;
    text-decoration: none; -webkit-tap-highlight-color: transparent;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
  }
  .sb-tool:active { transform: scale(.96); background: var(--btn-bg); }
  .sb-tool svg { width: 22px; height: 22px; flex: none; color: var(--bar-icon); }
  .sb-tool span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .sb-tool.sb-on { border-color: var(--focus); color: var(--focus); }
  .sb-tool.sb-on svg { color: var(--focus); }

  /* 底部：主题切换 + 消息 + 设置
     弱化处理：原来三个按钮都是实心圆（--btn-bg）+ 选中态带投影，压在抽屉底部太抢眼。
     现在统一改成「透明底 + 弱化图标」，只有 hover / 选中才浮出一层极淡的底色；
     真正需要被看见的只有消息红点，视觉重心自然落到它上面。 */
  .sb-foot { display: flex; align-items: center; gap: 6px; padding-top: 14px; border-top: 1px solid var(--divider); flex: none; }
  /* 三个模式图标同处一个圆角容器（加一层很淡的底色做底槽） */
  .sb-theme {
    display: flex; gap: 2px; flex: none;
    padding: 3px; border-radius: 999px;
    background: rgba(127, 127, 127, .1);
  }
  .sb-theme button {
    border: 0; background: transparent; width: 32px; height: 32px; border-radius: 999px;
    cursor: pointer; color: var(--text-dim); opacity: .62;
    display: flex; align-items: center; justify-content: center; padding: 0;
    transition: opacity .15s ease, background .15s ease, color .15s ease;
  }
  .sb-theme button:hover { opacity: .9; }
  /* 选中态：浅色模式用正文黑（原先是主题红，压在抽屉底部太跳）；深色模式仍用主题色 */
  .sb-theme button.on { opacity: 1; color: var(--text); background: #fff; box-shadow: none; }
  [data-theme="dark"] .sb-theme button.on { color: var(--focus); background: rgba(255, 255, 255, .08); }
  /* 三态图标与首页顶栏 .theme-btn 同一套（ico-auto / ico-sun / ico-moon） */
  .sb-theme button svg { width: 18px; height: 18px; display: block; }
  .sb-set { display: flex; align-items: center; justify-content: center; margin-left: auto; width: 42px; height: 42px; border-radius: 50%; background: transparent; color: var(--text-dim); text-decoration: none; flex: none; opacity: .8; transition: opacity .15s ease, background .15s ease; }
  .sb-set:hover { background: rgba(127, 127, 127, .1); opacity: 1; }
  .sb-set svg { width: 20px; height: 20px; }
  /* 消息铃铛：与设置同一视觉规格，紧贴设置左侧；未读时右上角一个小红点 */
  .sb-bell { position: relative; display: flex; align-items: center; justify-content: center; margin-left: auto; width: 42px; height: 42px; border-radius: 50%; background: transparent; color: var(--text-dim); text-decoration: none; flex: none; opacity: .8; transition: opacity .15s ease, background .15s ease; }
  .sb-bell:hover { background: rgba(127, 127, 127, .1); opacity: 1; }
  .sb-bell svg { width: 20px; height: 20px; }
  .sb-bell + .sb-set { margin-left: 2px; }
  /* 未读只用一个 7px 小红点，不显示条数 */
  .sb-bell-dot {
    position: absolute; top: 7px; right: 8px; width: 7px; height: 7px;
    box-sizing: border-box; border-radius: 50%;
    background: #e2574c; border: 1px solid var(--bg, #fff);
  }
  .sb-bell-dot[hidden] { display: none; }

  /* 弹层（开课码 / 加入课堂） */
  .sb-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
  .sb-modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
  .sb-modal-card { position: relative; width: 300px; max-width: 88vw; background: var(--bg); border: 1px solid var(--divider); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
  .sb-modal-t { font-size: 17px; font-weight: 700; color: var(--text); text-align: center; letter-spacing: 1px; }
  .sb-modal-hint { font-size: 12px; color: var(--text-dim); text-align: center; margin-top: 4px; }
  .sb-modal-in { width: 100%; margin-top: 14px; padding: 11px 12px; font-size: 18px; text-align: center; letter-spacing: 4px; border: 1px solid var(--divider); border-radius: 10px; background: var(--bar-bg); color: var(--text); box-sizing: border-box; }
  .sb-modal-in:focus { outline: none; border-color: var(--focus); }
  .sb-modal-err { margin-top: 8px; font-size: 12px; color: #e5484d; text-align: center; }
  .sb-modal-actions { margin-top: 14px; display: flex; gap: 10px; }
  .sb-modal-cancel, .sb-modal-ok { flex: 1; padding: 10px; border-radius: 10px; font-size: 14px; cursor: pointer; border: 1px solid var(--divider); font-family: inherit; }
  .sb-modal-cancel { background: var(--btn-bg); color: var(--text); }
  .sb-modal-ok { background: var(--focus); color: #fff; border-color: transparent; }
  [data-theme="dark"] .sb-modal-ok { color: #14161a; }

/* ─────────────────────────────────────────────────────────────
   通用底部抽屉（运营台 / 审核台共用）
   移动端：贴底上滑抽屉；桌面 ≥700px：居中卡片。
   结构：
     .dojo-sheet.on
       > .dojo-sheet-mask
       > .dojo-sheet-panel
           > .dojo-sheet-hd  (b + .acts)
           > .dojo-sheet-bd  (可滚动主体)
   ⚠️ 挂在 .ops-wrap 之外：那个容器带 transform，fixed 会被它当定位祖先。
   ───────────────────────────────────────────────────────────── */
/* 不用 inset 简写：部分 APP 内嵌 WebView 内核还不认（不认就等于整条失效，
   弹层失去铺满视口的定位，面板会掉到页面底下而不是屏幕底部）。
   高度写两条：不认 dvh 的回落 100vh，认的用动态视口（键盘/地址栏变化也贴底）。 */
.dojo-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  /* 三层回落：100vh（老内核）→ 100dvh（认动态视口）→ JS 实测的 --app-vh
     （WebView 里 vh/dvh 常按布局视口算，比可视区高，抽屉会被撑出屏幕） */
  height: 100vh;
  height: 100dvh;
  height: var(--app-vh, 100dvh);
  /* 再补一个「可视区偏移」：fixed 的定位基准永远是 layout viewport，而用户看到的是
     visual viewport。iOS 聚焦输入框会把可视区整体上滚（offsetTop > 0），不把这
     段偏移补回来，抽屉就会停在可视区中间 —— 表现为「输入框底部被切掉、下面露出
     背后的列表盖着它」。--app-vv-top 由 inc/sidebar.php 用 visualViewport.offsetTop 写。 */
  top: var(--app-vv-top, 0px);
  /* 页面内本来就是最上层（顶栏 .topbar 是 20），抬到 9999 只是防止以后再加浮层时被压住。
     注意：APP 的原生导航栏在 WebView 之外，网页的 z-index 管不到它 —— 那个只能靠下方
     「面板最高只占 80%」来避开，不可能真的盖住。 */
  z-index: 9999; display: none;
}
.dojo-sheet.on { display: block; }
.dojo-sheet-mask {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .46);
  opacity: 0; transition: opacity .22s ease;
}
.dojo-sheet.on .dojo-sheet-mask { opacity: 1; }
.dojo-sheet-panel {
  position: absolute; left: 50%; bottom: 0;
  display: flex; flex-direction: column;
  width: 100%; max-width: 640px;
  /* 面板高度是「顶部按钮能否点到」的关键。留 20% 空档（而不是 8%）：
     APP 原生导航栏比 8% 高的时候，92% 会让标题栏正好压在导航栏底下。
     内容一律在 .dojo-sheet-bd 里滚，不再靠撑高面板。 */
  max-height: 80vh;
  max-height: 80dvh;
  max-height: calc(var(--app-vh, 100dvh) * 0.80);
  box-sizing: border-box;
  background: var(--card-surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .22);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  transition: transform .26s cubic-bezier(.22, .61, .36, 1), opacity .2s ease;
}
.dojo-sheet.on .dojo-sheet-panel { transform: translateX(-50%) translateY(0); opacity: 1; }
.dojo-sheet-hd {
  position: relative;
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 17px 16px 11px; border-bottom: 1px solid var(--divider);
}
/* 抽屉把手：告诉人这是「从底部拉上来的」，不是漂浮弹窗 */
.dojo-sheet-hd::before {
  content: ''; position: absolute; left: 50%; top: 7px; transform: translateX(-50%);
  width: 36px; height: 4px; border-radius: 2px; background: var(--divider);
}
.dojo-sheet-hd b { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.dojo-sheet-hd .acts { display: flex; gap: 14px; flex: 0 0 auto; }
.dojo-sheet-hd button {
  border: 0; background: transparent; color: var(--focus);
  font-size: 14px; font-family: inherit; cursor: pointer; padding: 3px;
}
.dojo-sheet-bd {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;    /* 滚到底别把页面一起带着滚 */
  padding: 13px 16px 16px;
}
.dojo-sheet-ft { display: flex; gap: 10px; margin-top: 14px; }
.dojo-btn {
  flex: 1; height: 42px; border-radius: 11px; cursor: pointer;
  font-family: inherit; font-size: 14.5px;
  border: 1px solid var(--divider); background: var(--btn-bg); color: var(--text);
}
.dojo-btn.primary { background: var(--focus); border-color: var(--focus); color: #fff; font-weight: 700; }
[data-theme="dark"] .dojo-btn.primary { color: #14161a; }
.dojo-btn[disabled] { opacity: .55; }
.dojo-field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; }
.dojo-field textarea, .dojo-field input {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--divider); border-radius: 11px;
  background: var(--bg); color: var(--text);
  font-size: 16px; font-family: inherit; line-height: 1.65; padding: 10px 11px;
}
.dojo-field textarea { min-height: 110px; resize: vertical; }
/* 桌面端也是底部抽屉（运营台/审核台是同一个内部工具，交互不分端）：
   只把内边距放宽一点，不再变成居中卡片 —— 换端时手的落点不用重新适应。 */
@media (min-width: 700px) {
  .dojo-sheet-hd { padding: 17px 20px 13px; }
  .dojo-sheet-bd { padding: 15px 20px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .dojo-sheet-mask, .dojo-sheet-panel { transition: none; }
}



/* ─────────────────────────────────────────────────────────────
   宽屏 / 折叠设备内屏（regular width，≥900px）
   手机的单列布局在大内屏上只是一条 960px 窄带，两侧大片留白。这里只做
   「让现有布局随可用空间长开」，不引入新的信息架构（不改路由、不加双栏）：
   - 内容带 960 → 1180，书卡网格列加宽（仍是 auto-fill，列数自己算）
   - 顶栏 / 内容带在横屏下多让一点左右安全区（前摄与圆角）
   - 折叠带保留区 --fold-* 由原生壳注入，这里保证它参与内边距计算
   ───────────────────────────────────────────────────────────── */
@media (min-width: 900px) {
  .shelf { max-width: 1180px; }
  .search-body { max-width: 1180px; }
  .shelf-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 26px 20px; }
  .dock { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  /* 只改这一个变量：顶栏内边距与标题让位同源，不会各改各的 */
  :root { --tb-pad: 22px; }
}
/* 横屏 + 宽屏（外屏横屏 / 内屏展开横放）：左右再松一档，避免正文一味贴着边缘 */
@media (min-width: 900px) and (orientation: landscape) {
  .shelf {
    padding-left: calc(28px + env(safe-area-inset-left, 0px) + var(--fold-l, 0px));
    padding-right: calc(28px + env(safe-area-inset-right, 0px) + var(--fold-r, 0px));
  }
}

/* ── 阅读页宽屏分栏（宽 ≥900 且高 ≥560，且当前书是多卷）──
   手机 / 窄窗口：左栏不显示，正文与原来一致（单列逐行居中）。
   折叠设备内屏 / iPad / 桌面：卷目录常驻左栏，正文在「剩余空间」里居中，
   把「下拉弹窗选卷」这种一层交互摊成两栏并排（对应 HIG 说的内屏可多显示一层层级）。
   ⚠️ 必须同时卡高度：手机横屏宽度也有 844~932，只按 min-width 会让手机横屏进入分栏，
   把「分卷按钮 + 弹窗」的老交互换掉。手机横屏高度只有 ~390-430，用 min-height 排除；
   iPad 竖屏 768 宽不满足 min-width，iPad 横屏 1024×768 满足，Duo 内屏展开也满足。
   显隐由 JS 挂的 body.reader-split 控制：单卷经、未拿到 juans 时不挂，左栏自然消失。 */
/* 兜底必须写在媒体查询外面：否则窄屏下 <aside> 会按默认 display:block 参与文档流，
   在正文顶部挤出一条空白（正文是 absolute 的，前面多一个块级元素会顶出高度）。 */
.reader-rail { display: none; }

@media (min-width: 900px) and (min-height: 560px) {
  body.reader-split .reader-rail {
    display: flex; flex-direction: column;
    position: fixed;
    top: calc(54px + var(--sa-top, env(safe-area-inset-top, 0px)));
    bottom: 0;
    left: calc(env(safe-area-inset-left, 0px) + var(--fold-l, 0px));
    width: 268px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    border-right: 1px solid var(--divider);
    overflow: hidden;
    z-index: 15;                    /* 低于顶栏（20），高于正文 */
  }
  /* 正文右移，但仍按「剩余宽度」居中。
     ⚠️ 必须 width:auto：基础样式是 width:100% + max-width:720px，一旦 left 被指定而
     width 不是 auto，right:0 会被忽略（过度约束），宽度仍按 100% 截到 720 ——
     在 900 这种「剩余只有 632」的宽度下正文会整块右溢，压到右侧按钮列下面。 */
  body.reader-split .reader {
    left: calc(268px + env(safe-area-inset-left, 0px) + var(--fold-l, 0px));
    width: auto;
  }

  .reader-rail .rr-hd {
    flex: none;
    padding: 6px 10px 8px;
    font-size: 12px; color: var(--text-dim);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .reader-rail .rr-list {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .reader-rail .rr-list::-webkit-scrollbar { display: none; }
  .reader-rail .rr-item {
    display: block; width: 100%; margin: 0 0 2px;
    padding: 9px 10px;
    font-family: var(--font-serif); font-size: 14px; line-height: 1.5; text-align: left;
    color: var(--text); background: transparent; border: 0; border-radius: 9px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .reader-rail .rr-item:hover { background: var(--btn-bg); }
  .reader-rail .rr-item.on { background: var(--focus); color: #fff; }
  /* 左栏已经是常驻的切卷入口，底部那个「卷」按钮在宽屏下就是重复控件 */
  body.reader-split .juan-btn { display: none !important; }
}

/* ── 语音荐经浮层（Dock 莲花唤起）─────────────────────────────
   极简：整屏压暗 + 居中的一句话（听/找/结果）。
   彩色光晕不在这一层 —— 它挂在 dock 的莲花按钮背后（见 .dock-item.ai 附近的 #voiceFab::before），
   录音时亮起，用户视线始终落在「正在说话的入口」上，不会被屏幕中央的另一个球分走。
   层级 9000：在 dock(20) 之上、既有 9999 的登录/提示层之下。 */
.vd-root { position: fixed; inset: 0; z-index: 9000; display: none; }
.vd-root.on { display: block; }
/* 浮层里没有卡片托底，辅助文字（提示行 / 识别回显）直接压在 --vd-veil 上。
   全局 --text-dim 在这个底色上只有 2:1 左右，读不清 —— 浮层范围内单独提一档，
   卡片（白底/深底）里的 meta 文字跟着一起变实，没有副作用。 */
.vd-root { --text-dim: #67625a; }
[data-theme="dark"] .vd-root { --text-dim: #8a8f97; }
/* .vd-actions 是 display:flex，会盖掉 hidden 属性自带的 display:none */
.vd-root [hidden] { display: none !important; }

/* 背景压暗/提亮：不铺这层的话书架卡片和 dock 会直接透在底下，像没切过去。
   底色用 --vd-veil（比 --bg 深一档），不直接用 --bg：
   浅色下同色等于没有层次，浮层里的字和底下的书架糊成一片（2026-11-12 用户反馈）。
   不要再加 backdrop-filter：opacity 下糊的那一点肉眼看不见，但整屏 blur(20px)
   在手机上是最贵的合成操作（点莲花那一下的卡顿就有它一份，2026-11-12）。 */
.vd-backdrop {
  position: fixed; inset: 0;
  background: var(--vd-veil);
  opacity: .97;
}

/* 浮层打开时把 dock 提到浮层之上：光效挂在莲花按钮上，按钮本身必须可见可点 */
body.vd-open .dock { z-index: 9001; }

.vd-close {
  position: fixed;
  top: calc(14px + var(--sa-top, env(safe-area-inset-top, 0px)));
  right: 14px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--divider); border-radius: 50%;
  background: var(--bar-bg); color: var(--text-dim);
  font: inherit; font-size: 16px; line-height: 1; cursor: pointer;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

.vd-stage {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  padding: 72px 24px calc(96px + env(safe-area-inset-bottom, 0px));
}

.vd-say {
  max-width: 20em; min-height: 1.7em;
  font-family: var(--font-serif);
  font-size: 19px; line-height: 1.7;
  color: var(--text); text-align: center;
}

/* 追问回答（「读心经有什么用」）：卡片先出，这段 1~2 秒后淡入。
   4 行封顶 —— 兜住模型偶尔写超（prompt 要求 80 字），别把卡片挤出屏幕。
   隐藏靠 .vd-root [hidden] 那条全局规则（display:none !important），
   这里的 display:-webkit-box 不会把它顶掉。 */
.vd-answer {
  max-width: min(84vw, 420px);
  margin-top: -4px;
  font-size: 14px; line-height: 1.75;
  color: var(--text-dim); text-align: center;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4;
  overflow: hidden;
  overflow-wrap: anywhere;
  animation: vd-answer-in .32s ease both;
}

@keyframes vd-answer-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* 识别回显：大字答案下面那行小字，显示"它听到了什么"。
   两行封顶 —— 用户一口气说一长串时，结果卡不能被这行字挤出屏幕；
   何况需要核对的只有开头那几个词。 */
.vd-heard {
  max-width: min(84vw, 360px);
  font-size: 13px; line-height: 1.65;
  color: var(--text-dim);
  text-align: center;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.vd-hint { font-size: 12px; color: var(--text-dim); text-align: center; }

/* 提示行里的文字按钮（「请在设置里打开麦克风权限 →」）：
   长得像链接、点起来是按钮；不能触发「点空白关浮层」，所以挂 .vd-hint 里面。 */
.vd-link {
  padding: 2px 4px;
  background: none; border: 0;
  font: inherit; font-size: 13px; line-height: 1.6;
  color: var(--focus);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.vd-link:active { opacity: .65; }

.vd-card {
  width: min(84vw, 360px);
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 46px var(--shadow);
  cursor: pointer;
  animation: vd-rise .4s cubic-bezier(.2, .9, .3, 1);
}
.vd-card h4 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 17px; font-weight: 600; line-height: 1.5;
  color: var(--text);
}
.vd-card .vd-meta { font-size: 12px; color: var(--text-dim); }
.vd-card .vd-why {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--divider);
  font-size: 13px; line-height: 1.6; color: var(--text); opacity: .75;
}

/* AI 卡：站内没有对得上的经、或问题复杂到浮层答不了时，给一条去 AI 助手的出口。
   强调色描边 + 标题同色，和经书卡一眼区分；不摆封面，免得看着像另一本书。 */
.vd-card.is-ai { border-color: var(--focus); }
.vd-card.is-ai h4 { color: var(--focus); }

/* 寺院卡：青绿色描边 + 标题同色，和经书卡、AI 卡（橙）区分开。
   不摆封面（寺院无固定图），保持纯文字卡，和经典卡一个骨架。 */
.vd-card.is-temple { border-color: #4a8f7b; }
.vd-card.is-temple h4 { color: #4a8f7b; }

/* 音频卡：封面在左、文字在右。经典卡没有封面，.vd-body 自然占满整宽，
   靠 has-cover 这一个类切换，不用给两种卡写两套结构。 */
.vd-body { min-width: 0; }
.vd-card.has-cover { display: flex; gap: 14px; align-items: flex-start; }
.vd-card .vd-cover {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--btn-bg);
}

@keyframes vd-rise {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.vd-actions { display: flex; gap: 10px; }

.vd-btn {
  padding: 9px 20px;
  border-radius: 20px;
  border: 1px solid var(--divider);
  background: var(--bar-bg);
  color: var(--text);
  font: inherit; font-size: 13px; cursor: pointer;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.vd-btn:hover { background: var(--btn-bg); }
.vd-btn[disabled] { opacity: .5; cursor: default; }

body.vd-open { overflow: hidden; }
