/* ============ 设计令牌 ============
   2026-10-01 晚：**米白（light）主题已删**，默认底色 = 纯白。
   （米白 #fcfcfb 与纯白 #ffffff 肉眼分不出，切主题像没反应 —— 干脆只留两档。）
   深色档在下面 `[data-theme="dark"]`；`data-theme="white"` 与不设属性都落这套默认值。
   旧名 --text / --muted 保留为别名，其他样式表不用跟着改。 */
:root{
  --bg:#ffffff;
  --surface:#ffffff;
  --sunken:#f7f7f8;
  --line:#ebebef;
  --line-strong:#dcdce2;
  --ink:#111111;
  --ink-2:#3b3b3d;
  --ink-3:#5c5c60;

  --accent:#0e6b5c;
  --accent-hover:#0a5248;
  --accent-soft:#e6f2ee;
  --info:#2c5aa0;
  --info-soft:#eaf0fa;
  --amber:#8f5e14;
  --amber-soft:#fbf1de;
  --danger:#b23b2c;
  --danger-soft:#fbece9;

  --text:var(--ink);
  --muted:var(--ink-3);

  --r-sm:6px; --r-md:8px; --r-lg:12px; --r-pill:999px;
  --sh-1:0 1px 2px rgba(26,25,23,.04);
  --sh-2:0 4px 14px rgba(26,25,23,.07);
  --ease:cubic-bezier(.2,.8,.2,1);
  --dur:180ms;
  --mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",
         "Hiragino Sans GB","Microsoft YaHei",sans-serif;
  --topbar-bg:rgba(255,255,255,.92);
}

/* 深色：主色提亮到 #4dbfa8（深底上原色会发闷），中性反转 */
[data-theme="dark"]{
  --bg:#141513;
  --surface:#1c1b19;
  --sunken:#242320;
  --line:#302e2a;
  --line-strong:#45423c;
  --ink:#f2f0ec;
  --ink-2:#b3afa7;
  --ink-3:#948f87;
  --accent:#4dbfa8;
  --accent-hover:#6ccdb9;
  --accent-soft:#14342e;
  --info:#8fb4ec;
  --info-soft:#16283f;
  --amber:#e0b063;
  --amber-soft:#33270f;
  --danger:#e78b7c;
  --danger-soft:#3a1d17;
  --sh-1:0 1px 2px rgba(0,0,0,.3);
  --sh-2:0 4px 14px rgba(0,0,0,.4);
  --topbar-bg:rgba(20,21,19,.92);
}

/* 纯白已并入上面的 :root 默认值（米白删除后它不再是"覆盖档"）；
   `data-theme="white"` 挂上也落同一套 ⇒ 不需要单独规则。 */

*{box-sizing:border-box}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:15px/1.75 var(--font);
  -webkit-font-smoothing:antialiased;
  transition:background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.topbar{
  position:sticky; top:0; z-index:30;
  display:flex; align-items:center; justify-content:space-between;
  gap:24px; padding:13px 28px;
  background:var(--topbar-bg);
  backdrop-filter:saturate(180%) blur(8px);
  border-bottom:1px solid var(--line);
}
/* 顶栏里只有标题允许被压缩。中文没有词边界，标题一旦被挤到换行就是一个字一行，
   整条顶栏会被撑成竖排 —— 所以标题锁死单行 + 省略号，其余元素按自身内容占位。 */
.brand{display:flex; align-items:baseline; gap:14px; flex:1 1 auto; min-width:0}
.brand h1{
  margin:0; font-size:16.5px; font-weight:500; letter-spacing:-.01em;
  flex:0 1 auto; min-width:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.stat{
  font-size:13px; color:var(--muted); white-space:nowrap;
  flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis;
}
.back{
  font-size:13.5px; color:var(--muted); text-decoration:none;
  padding:3px 9px; border-radius:var(--r-sm); white-space:nowrap;
  transition:background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.back:hover{background:var(--sunken); color:var(--text)}
.library-topbar{min-height:60px;box-sizing:border-box;gap:16px}
.library-topbar .brand{align-items:center;gap:24px}
.library-topbar .brand h1{flex-shrink:0}
.library-topbar .primary-nav{display:flex;align-items:center;gap:4px;min-width:0}
.library-topbar .primary-nav .back{padding:8px 12px}
.library-topbar .primary-nav .back[aria-current="page"]{color:var(--accent);background:var(--accent-soft);font-weight:500}
.library-topbar .primary-nav .back:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.search{position:relative; flex:0 0 340px}
.search input{
  width:100%; padding:8px 32px 8px 13px;
  font:inherit; font-size:14px;
  color:var(--text); background:var(--sunken);
  border:1px solid var(--line); border-radius:var(--r-md); outline:none;
  transition:border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search input:focus{border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
.clear{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  width:22px; height:22px; line-height:1;
  font-size:17px; color:var(--muted);
  background:none; border:none; border-radius:6px; cursor:pointer;
}
.clear:hover{background:var(--sunken); color:var(--text)}

.pager{display:flex; gap:6px; flex:0 0 auto}
.pager a{
  font-size:13.5px; color:var(--muted); text-decoration:none;
  padding:5px 11px; border:1px solid var(--line);
  background:var(--surface); border-radius:var(--r-md);
  transition:all var(--dur) var(--ease);
}
.pager a:hover{color:var(--accent); border-color:var(--accent)}

/* ---------- 左侧目录 ---------- */

/* 页面靠左排：去掉 .layout 的水平居中（margin:auto），侧栏就贴住窗口左边。
   正文宽度仍由 .layout 的 max-width 限制，行宽不变。 */
.layout{display:flex; align-items:flex-start; max-width:1320px}

.sidebar{
  flex:0 0 300px; position:sticky; top:60px;
  height:calc(100vh - 60px); overflow-y:auto;
  padding:20px 10px 60px 24px;
  border-right:1px solid var(--line);
  background:var(--surface);
}
.toc-cat{margin:0 0 4px}

/* ---------- 目录箭头（全站共用这一套） ----------
   2026-09-30 用户：「笔记页与书页的目录列表风格一致」「箭头也要改大点」。
   原来各页自己印各自的字符，字号还是 9/10/11/12px 四档；而 U+25B8 ▸ 和
   U+25BE ▾ 这两个字形的名字里就带 small —— 12px 只画出 ~6px 宽，看着是个「·」。
   改成 CSS 画的实心三角：10 宽 × 8 高，尺寸不随字体变、各页一模一样。
   方向以「朝下」为基准（= 展开态），各页自己的「收起态」选择器再 rotate(-90deg)
   转成朝右 —— 那些 rotate 规则留在各自文件里，这里只管几何。
   字符仍留在 DOM 里（font-size:0 藏掉），免得测试/读屏拿到空 span。
   ⚠️ `.toc-book/.toc-head/.toc-chap` 这三条是**遗留**：它们属于已下线的题库列表页
   （`pools.html`，commit 77bb51e「题库入口全站移除」时删的）。其中 `.toc-book`
   被 `book.js` 借去当书页「目录」二字的小标题了（见 book.js::buildToc）——
   所以清理 style.css 时**别顺手删 `.toc-book`**，那会把书页的小标题样式带走。 */
.toc-arw,
.bk-ch-head .arrow,                                    /* 书页 左侧目录 */
.toc-book .arrow, .toc-head .arrow, .toc-chap .arrow,  /* 遗留：已下线题库列表页 */
.nt-toc .nt-bk .arw, .nt-tw{                           /* 笔记页 左栏书名 / 右栏章头 */
  flex:0 0 auto; position:relative;
  display:inline-flex; align-items:center; justify-content:center;
  width:16px; height:16px; font-size:0; color:var(--muted);
  border-radius:4px;
  transition:transform .18s var(--ease), background .12s, color .12s;
}
.toc-arw::before,
.bk-ch-head .arrow::before,
.toc-book .arrow::before, .toc-head .arrow::before, .toc-chap .arrow::before,
.nt-toc .nt-bk .arw::before, .nt-tw::before{
  content:''; position:absolute; inset:0; margin:auto;
  width:0; height:0;
  border-left:5px solid transparent;
  border-right:5px solid transparent;
  border-top:8px solid currentColor;
}

/* 一级分类（高联一试 / 高联二试）也可折叠，样式比二级分组更重一点 */
.toc-book{
  display:flex; align-items:center; gap:8px;
  width:100%; margin:0 0 6px; padding:7px 12px;
  font:inherit; font-size:13px; font-weight:500; letter-spacing:.02em;
  color:var(--text); background:none; border:none; border-radius:var(--r-sm);
  cursor:pointer; text-align:left;
  transition:background-color var(--dur) var(--ease);
}
.toc-book:hover{background:var(--sunken)}
.toc-book.closed .arrow{transform:rotate(-90deg)}
.toc-cat-body{margin:0 0 10px}
.toc-group{margin-bottom:2px}
.toc-head{
  display:flex; align-items:center; gap:8px;
  width:100%; padding:6px 12px;
  font:inherit; font-size:13.5px; font-weight:500; color:var(--text);
  background:none; border:none; border-radius:var(--r-sm);
  cursor:pointer; text-align:left;
  transition:background-color var(--dur) var(--ease);
}
.toc-head:hover{background:var(--sunken)}
.toc-head.closed .arrow{transform:rotate(-90deg)}

/* 培优教程·一试：一级分组下再套「章」子分组，1.1/1.2/1.3/2.1 不再平铺 */
.toc-sub{margin:2px 0}
.toc-chap{
  display:flex; align-items:center; gap:8px;
  width:100%; margin:4px 0 2px; padding:5px 12px;
  font:inherit; font-size:12.5px; font-weight:600; color:var(--accent);
  background:none; border:none; border-radius:var(--r-sm);
  cursor:pointer; text-align:left;
  transition:background-color var(--dur) var(--ease);
}
.toc-chap:hover{background:var(--sunken)}
.toc-chap.closed .arrow{transform:rotate(-90deg)}

.toc-list{
  list-style:none; margin:3px 0 12px 16px; padding:0 0 0 12px;
}
.toc-item{
  position:relative; display:block;
  margin:1px 0; padding:5px 10px;
  font-size:13.5px; line-height:1.55; color:var(--ink-2);
  text-decoration:none; border-radius:0 var(--r-sm) var(--r-sm) 0;
  transition:background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.toc-item:hover{background:var(--sunken); color:var(--text)}
.toc-item.active{background:var(--accent-soft); color:var(--accent); font-weight:500}
.toc-item.active::before{
  content:''; position:absolute; left:-12px; top:0; bottom:0;
  width:2px; background:var(--accent); border-radius:2px;
}

/* ---------- 列表页 ---------- */

.content{flex:1; min-width:0; padding:26px 38px 100px}

.paper-head{margin:0 0 4px; padding-bottom:14px; border-bottom:1px solid var(--line)}
.paper-head h2{margin:0; font-size:21px; font-weight:500; letter-spacing:-.015em}
.chips{display:flex; flex-wrap:wrap; gap:7px; margin-top:8px}
.chip{
  padding:2px 9px; font-size:12px; color:var(--muted);
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-pill);
}
.chip.on{color:var(--accent); background:var(--accent-soft); border-color:transparent}

.sec-title{margin:26px 0 2px; font-size:13px; font-weight:500; color:var(--muted)}

.prob{padding:20px 0 18px; border-bottom:1px solid var(--line)}
.prob:last-child{border-bottom:none}
.prob-row{display:flex; align-items:flex-start; gap:13px}
/* 题号走等宽：列表里竖排时数字不会左右跳。
   培优的题号可能是「例 3」这类文字标签，定宽 25px 会折行（例\n3）→
   改成 min-width + nowrap，单数字仍是小方块，文字标签自动加宽成胶囊。 */
.num{
  flex:0 0 auto; min-width:25px; height:25px; margin-top:4px; padding:0 7px;
  display:flex; align-items:center; justify-content:center;
  white-space:nowrap;
  font-family:var(--mono); font-size:12.5px; font-weight:500; color:var(--accent);
  background:var(--accent-soft); border-radius:var(--r-sm);
}
.main{flex:1; min-width:0}
.meta{margin-top:7px; font-size:12px; color:var(--muted)}

.stem{font-size:15.5px; line-height:1.95; word-break:break-word}
.stem.big{font-size:16.5px}
.stem .katex-display{margin:12px 0; overflow-x:auto; overflow-y:hidden}

.subs{list-style:none; margin:9px 0 0; padding:0}
.subs li{display:flex; gap:9px; margin-top:7px}
.subs .subs{margin:6px 0 0}
.sub-lbl{flex:0 0 auto; color:var(--muted); font-size:14.5px; line-height:1.95}
.sub-body{flex:1; min-width:0; font-size:15px; line-height:1.95; word-break:break-word}
.sub-body .katex-display{margin:10px 0; overflow-x:auto; overflow-y:hidden}

.choices{
  margin-top:11px; display:flex; flex-wrap:wrap; gap:9px 26px;
}
.choice{display:flex; align-items:baseline; gap:7px}
.choice-lbl{
  flex:0 0 auto; font-size:14px; font-weight:600; color:var(--accent);
}
.choice-body{font-size:15.5px; line-height:1.7}

.figs{margin-top:12px; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:12px}
/* 题图限宽统一在下方 .figs img / .sol-figs img 一处定义（解析页/答疑页区块），此处不重复设 */

.acts{margin-top:13px; display:flex; align-items:center; gap:16px}
.act{
  font-size:13px; color:var(--muted); text-decoration:none;
  border-bottom:1px solid transparent; padding-bottom:1px;
}
.act:hover{color:var(--accent); border-bottom-color:var(--accent)}
.act.solid{color:var(--accent)}
.act.muted{color:var(--muted); font-size:12.5px; opacity:.75; cursor:default}
.act.muted:hover{color:var(--muted); border-bottom-color:transparent}
.act-tag{
  font-size:12px; line-height:1; color:var(--muted);
  padding:4px 8px; background:var(--sunken);
  border:1px solid var(--line); border-radius:var(--r-sm); cursor:default;
}

.empty-state{padding:60px 0; text-align:center; color:var(--muted)}

/* ---------- 解析页 / 答疑页 ---------- */

.page{max-width:830px; margin:0 auto; padding:30px 36px 100px}
.block{margin-bottom:32px}
.block-label{
  margin:0 0 12px; font-size:12px; font-weight:500;
  letter-spacing:.08em; color:var(--accent);
}
.block-label.sub{margin-top:22px}

/* 答案区用下沉底色与题面分层：一眼看出哪是要想的、哪是要看的 */
.answer-body{
  font-size:17px; line-height:1.9;
  background:var(--sunken); border-radius:var(--r-lg); padding:16px 20px;
}
.solution-body{font-size:15.5px; line-height:1.95}

/* 行间公式独立成块：上下留出呼吸位，超宽时自己横向滚动。
   早先这里有一条 2px 竖线标记「推导中的一步」，现在统一去掉——
   书和题库的正文、答案区都不再画竖线，层级只靠留白和标签区分。 */
.answer-body .katex-display,
.solution-body .katex-display,
.bk-body .katex-display{
  margin:14px 0; padding:2px 0;
  overflow-x:auto; overflow-y:hidden;
}

.d-hint{font-size:13.5px; line-height:1.85; color:var(--muted)}
.d-hint code{
  display:inline-block; margin-top:7px; padding:3px 8px;
  font-size:12px; background:var(--sunken); border-radius:5px;
}
.page-acts{margin-top:6px}

textarea{
  width:100%; padding:11px 13px;
  font:inherit; font-size:14.5px; line-height:1.7; color:var(--text);
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); outline:none; resize:vertical;
  transition:border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
textarea:focus{border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}

.ask-bar{display:flex; align-items:center; gap:12px; margin-top:10px}
.ask-bar button{
  padding:7px 18px; font:inherit; font-size:14px; color:#fff;
  background:var(--accent); border:none; border-radius:var(--r-md); cursor:pointer;
  transition:background-color var(--dur) var(--ease);
}
.ask-bar button:hover{background:var(--accent-hover)}
.ask-bar .note{font-size:12px; color:var(--muted)}

.ask-list{list-style:none; margin:22px 0 0; padding:0}
.ask-empty{font-size:13.5px; color:var(--muted)}
.ask-list li{
  margin-top:12px; padding:12px 15px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
}
.ask-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:6px}
.ask-time{font-size:12px; color:var(--muted)}
.ask-del{
  font:inherit; font-size:12px; color:var(--muted);
  background:none; border:none; cursor:pointer; padding:2px 6px; border-radius:5px;
}
.ask-del:hover{background:var(--sunken); color:var(--text)}
.ask-text{font-size:14.5px; line-height:1.8; white-space:pre-wrap}

/* 窄窗口顶栏：先给右侧工具瘦身（书架下拉、搜索框），还放不下就让工具整块换到第二行，
   标题始终占满第一行，不再被挤成省略号里的一个字。
   注：.bk-shelf / .srch-form 定义在 book.css、search.css（都在本文件之后加载），
   所以这里统一加 .topbar 前缀提高优先级，否则同优先级下会被后面的文件盖掉。 */
@media (max-width:900px){
  .sidebar{display:none}
  .content{padding:18px 18px 80px}
  .page{padding:20px 18px 80px}
  .search{flex:1}
  .topbar{flex-wrap:wrap; gap:10px 14px; padding:11px 16px}
  .brand{flex:1 1 auto; min-width:190px}
  .pager{flex:0 1 auto; flex-wrap:wrap; justify-content:flex-end}
  .topbar .bk-shelf{max-width:140px}
  .topbar .srch-form input{width:130px}
  .topbar .srch-form input:focus{width:170px}
}
@media (max-width:640px){
  .topbar{padding:10px 12px}
  .brand{min-width:140px}
  .library-topbar{gap:8px}
  .library-topbar .brand{min-width:0; gap:12px; align-items:center}
  .library-topbar .primary-nav{gap:2px}
  .library-topbar .primary-nav .back{flex:none; padding:6px 8px}
  .topbar .srch-form input,
  .topbar .srch-form input:focus{width:110px}
}
/* 题图 / 题解图：居中、限宽。
   几何图原图往往 800px 以上，铺满版心能占掉大半屏，看题时不停要滚。
   这里封顶 440×360：小图不放大（width:auto），大图等比缩，版心不被撑爆。
   要看细节就点图 —— 新标签打开原图，不占版心。 */
.figs, .sol-figs{margin:10px 0; text-align:center}
.figs img, .sol-figs img{
  max-width:min(100%, 360px); max-height:320px; object-fit:contain;
  width:auto; height:auto;
  border:1px solid var(--line); border-radius:var(--r-sm);
  background:transparent; padding:4px;   /* 去掉浅色卡片底，透明图直接落在页面底色，不再有白色边缘 */
}
/* 透明图以黑墨绘制；深色主题下反色让墨迹变浅，在深背景上仍清晰可见。
   invert 只作用于 RGB，alpha 不变，透明区依旧透明，不会留下白/亮框。 */
[data-theme="dark"] .figs img,
[data-theme="dark"] .sol-figs img{
  filter: invert(1);
}
.figs a, .sol-figs a{display:inline-block; cursor:zoom-in}

@media print{
  .topbar,.sidebar,.acts,.page-acts{display:none}
  .content,.page{padding:0}
  .prob{break-inside:avoid; border-bottom:none; padding:10px 0}
}

/* 收藏按钮：题目页顶栏和题库列表共用同一颗，只是列表里小一号（.sm）。
   未登录也能点（点了去登录页）。 */
.fav-btn{
  display:inline-flex; align-items:center; gap:5px;
  font:inherit; font-size:13px; line-height:1;
  padding:6px 11px; border-radius:var(--r-pill);
  border:1px solid var(--line-strong); background:var(--surface);
  color:var(--ink-2); cursor:pointer; white-space:nowrap;
}
.fav-btn:hover{border-color:var(--accent); color:var(--accent)}
.fav-star{font-size:14px; line-height:1}
.fav-btn.on{
  border-color:var(--accent); background:var(--accent-soft); color:var(--accent);
}
/* 列表里那颗：跟着 .acts 一行的文字链接走，所以做小、做轻，别抢走视线 */
.fav-btn.sm{
  font-size:12.5px; padding:4px 10px; gap:4px;
  border-color:var(--line); background:transparent; color:var(--ink-3);
}
.fav-btn.sm:hover{border-color:var(--accent); color:var(--accent); background:var(--surface)}
.fav-btn.sm.on{
  border-color:var(--accent); background:var(--accent-soft); color:var(--accent);
}
@media (max-width:768px){
  .fav-btn{min-height:36px; padding:8px 13px}
  .fav-btn.sm{min-height:34px; padding:7px 12px}
}

/* ============ 收藏夹：位置按钮 + 弹层 ============ */
.fav-loc{
  display:inline-flex; align-items:center;
  font:inherit; font-size:12.5px; line-height:1;
  padding:6px 10px; border-radius:var(--r-pill);
  border:1px solid var(--line); background:transparent;
  color:var(--ink-3); cursor:pointer; white-space:nowrap;
}
.fav-loc:hover{ border-color:var(--accent); color:var(--accent) }
.fav-loc.on{ border-color:var(--accent-soft); background:var(--accent-soft); color:var(--accent) }
.fav-loc[hidden]{ display:none }
@media (max-width:768px){ .fav-loc{ min-height:36px } }

.fav-menu{
  position:fixed; z-index:120; width:232px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg);
  box-shadow:0 8px 28px rgba(20,18,14,.18);
  padding:6px; max-height:70vh; overflow-y:auto;
}
.fm-title{
  font-size:12px; color:var(--muted); padding:6px 10px 4px;
}
.fm-item{
  display:flex; align-items:center; gap:9px; width:100%;
  font:inherit; font-size:13px; text-align:left;
  padding:8px 10px; border:none; background:transparent;
  color:var(--text); border-radius:var(--r-md); cursor:pointer;
}
.fm-item:hover{ background:var(--sunken) }
.fm-item.on{ color:var(--accent) }
.fm-item.danger{ color:var(--danger) }
.fm-item.danger:hover{ background:var(--danger-soft) }
.fm-dot{ flex:0 0 14px; text-align:center; color:var(--accent) }
.fm-name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.fm-sub{ font-size:11.5px; color:var(--muted) }
.fm-sep{ height:1px; background:var(--line); margin:5px 6px }

/* ============ 题库列表：收藏夹组合 + 报错入口 ============ */
.fav-grp{ display:inline-flex; align-items:center; gap:7px }
.fav-loc.sm{
  font-size:12.5px; line-height:1; padding:4px 10px;
  border-color:var(--line); color:var(--ink-3);
}
.fav-loc.sm:hover{ border-color:var(--accent); color:var(--accent) }
.fav-loc.sm[hidden]{ display:none }

/* 「这题有错」：.act 原本只给链接/标签用，做成按钮时重置原生样式 */
button.act{
  font:inherit; background:none; border:none; border-bottom:1px solid transparent;
  padding:0 0 1px; cursor:pointer; line-height:1.4;
}
.act.errata{ color:var(--muted) }
.act.errata:hover{ color:var(--danger); border-bottom-color:var(--danger) }

/* ============ 勘误弹窗 ============ */
body.rp-open{ overflow:hidden }
.rp-overlay{
  position:fixed; inset:0; z-index:200;
  background:rgba(20,18,14,.42);
  display:flex; align-items:flex-start; justify-content:center;
  padding:8vh 16px; overflow-y:auto;
}
.rp-modal{
  width:100%; max-width:520px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); box-shadow:0 18px 56px rgba(20,18,14,.28);
  padding:20px 22px 18px;
}
.rp-head{ display:flex; align-items:center; justify-content:space-between; gap:12px }
.rp-title{ font-size:16px; font-weight:600; color:var(--text) }
.rp-close{
  font:inherit; font-size:18px; line-height:1; color:var(--muted);
  background:none; border:none; cursor:pointer; padding:2px 6px; border-radius:var(--r-sm);
}
.rp-close:hover{ background:var(--sunken); color:var(--text) }
.rp-sub{ margin-top:7px; font-size:12.5px; line-height:1.6; color:var(--muted) }

.rp-fields{ display:flex; flex-wrap:wrap; gap:8px; margin:15px 0 11px }
.rp-field{
  font:inherit; font-size:12.5px; line-height:1;
  padding:7px 13px; border-radius:var(--r-pill); cursor:pointer;
  border:1px solid var(--line); background:transparent; color:var(--ink-2);
}
.rp-field:hover{ border-color:var(--accent); color:var(--accent) }
.rp-field.on{ border-color:var(--accent); background:var(--accent-soft); color:var(--accent) }

.rp-text{
  width:100%; box-sizing:border-box; display:block;
  font:inherit; font-size:14px; line-height:1.75; resize:vertical;
  min-height:108px; padding:11px 13px;
  color:var(--text); background:var(--surface);
  border:1px solid var(--line); border-radius:var(--r-md); outline:none;
}
.rp-text:focus{ border-color:var(--accent) }

.rp-thumbs{ display:flex; flex-wrap:wrap; gap:9px; margin-top:11px }
.rp-thumb{
  position:relative; width:74px;
  border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden;
  background:var(--sunken);
}
.rp-thumb img{ display:block; width:74px; height:60px; object-fit:cover }
.rp-wait{
  display:flex; align-items:center; justify-content:center;
  height:60px; font-size:11.5px; color:var(--muted);
}
.rp-cap{
  display:block; font-size:10.5px; line-height:1.3; color:var(--muted);
  padding:3px 5px; max-width:74px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
}
.rp-thumb.bad{ border-color:var(--danger) }
.rp-x{
  position:absolute; top:2px; right:2px;
  width:18px; height:18px; line-height:16px; padding:0; text-align:center;
  border:none; border-radius:50%; cursor:pointer;
  background:rgba(20,18,14,.55); color:#fff; font-size:12px;
}
.rp-tools{ display:flex; align-items:center; gap:12px; margin-top:12px }
.rp-add{
  font:inherit; font-size:12.5px; cursor:pointer; white-space:nowrap;
  padding:6px 12px; border-radius:var(--r-pill);
  border:1px solid var(--line); background:transparent; color:var(--ink-2);
}
.rp-add:hover{ border-color:var(--accent); color:var(--accent) }
.rp-err{ font-size:12.5px; color:var(--danger); flex:1; min-width:0 }

.rp-foot{ display:flex; justify-content:flex-end; gap:10px; margin-top:18px }
.rp-btn{
  font:inherit; font-size:13.5px; cursor:pointer;
  padding:8px 20px; border-radius:var(--r-pill); border:1px solid var(--line);
}
.rp-btn.ghost{ background:transparent; color:var(--ink-2) }
.rp-btn.ghost:hover{ border-color:var(--accent); color:var(--accent) }
.rp-btn.primary{ background:var(--accent); border-color:var(--accent); color:#fff }
.rp-btn.primary:hover{ opacity:.9 }
.rp-btn:disabled{ opacity:.6; cursor:default }

.rp-done{ text-align:center; padding:34px 24px 26px }
.rp-okmark{
  width:46px; height:46px; margin:0 auto 14px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:24px; color:#fff; background:var(--accent);
}
.rp-done .rp-title{ display:block }
.rp-done .rp-sub{ margin:8px 0 20px }
.rp-done .rp-foot{ justify-content:center }

/* ---------- 网页端纸面/预览缩放（assets/zoom.js）----------
   ⚠️ `--bk-zoom-pad` 由 zoom.js 按"纸比视口宽出多少"设置；它同时被写成 body 的左右内边距
   （为了让纸比视口宽时两边都滚得到）—— 那会把**顶栏也一起挤进去**（顶栏也是 body 的孩子）
   ⇒ 这里用等量负边距顶回来，保证"只缩纸、顶栏纹丝不动"（2026-10-04 用户报）。
   没在缩放时该变量是 0，全站无影响。 */
.topbar, .bk-inkpage-bar {
  margin-left: calc(-1 * var(--bk-zoom-pad, 0px));
  margin-right: calc(-1 * var(--bk-zoom-pad, 0px));
}
html.qa-paper-fit { overflow-x: clip; }
.qa-zoom {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--line); border-radius: 7px; padding: 1px;
}
.qa-zoom-btn {
  display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px;
  font: inherit; cursor: pointer;
  color: var(--muted); background: none; border: 0; border-radius: 5px; padding:0;
}
.qa-zoom-btn svg { width:22px; height:22px; flex:none; }
.qa-zoom-btn:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.qa-zoom-btn:hover { color: var(--accent); background: var(--accent-soft); }
.qa-zoom-pct {
  min-width: 46px; text-align: center; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 原生 Mac 窗口中的界面字号；纸面、笔迹与 PDF 保留文档尺寸。 */
.qa-native-mac :is(.topbar .back, .topbar button, .topbar select, .hm-action, .hm-sort,
  .hm-group-name, .hm-book-title, .hm-dialog label, .hm-dialog p, .hm-dialog button,
  .lg-tabs button, .lg-field label, .lg-submit, .lg-back, .lg-return,
  .ac-side a, .st-page label, .st-page button, .st-page input, .st-page select,
  .mn-btn, .mn-sub, .nt-tabs button, .ink-menu-item) { font-size:20px; }
.qa-native-mac :is(.hm-book-meta, .hm-group-count, .hm-sync-help, .hm-name-conflict,
  .hm-conflict-fields .hm-error, #shelfSub, .mn-meta, .lg-hint, .lg-error,
  .st-message, .st-help, .share-info) { font-size:18px; }

.qa-native-mac body { font-size:20px; }
.qa-native-mac .topbar h1 { font-size:22px; }
.qa-native-mac :is(.ub-name, .ub-theme-lb, .ub-role, .ub-link, .ub-pop-i) { font-size:18px; }
.qa-native-mac :is(.hm-new > summary, .hm-sort select, .lg-main input, .lg-main label, .st-input, .st-select) { font-size:20px; }
.qa-native-mac :is(.hm-trash button, .hm-trash-caption) { font-size:20px; }
.qa-native-mac :is(.hm-storage, .hm-local-sync, .hm-trash-total, .hm-trash-selection [data-count],
  .hm-trash-caption > small, .hm-trash .hm-trash-help) { font-size:18px; }

/* 废纸篓两种视图共用窗口、工具栏与交互样式。 */
.hm-dialog.hm-trash { width:min(1000px,calc(100vw - 64px)); height:min(780px,calc(100dvh - 96px)); max-width:none; max-height:none; padding:0; border-radius:24px; overflow:hidden; background:var(--surface); }
.hm-dialog.hm-trash[open] { display:flex; flex-direction:column; }
.hm-trash::backdrop { background:rgb(0 0 0 / .35); }
.hm-trash > header { display:flex; align-items:center; padding:20px 24px 12px; gap:12px; flex:none; }
.hm-trash > header h2 { flex:none; margin:0; font-size:20px; font-weight:600; }
.hm-trash-total { flex:1; color:var(--ink-3); font-size:13px; white-space:nowrap; }
.hm-trash > header > div { display:flex; gap:8px; }
.hm-trash button { min-height:44px; min-width:44px; padding:8px 14px; border:0; background:var(--surface); color:var(--ink); border-radius:var(--r-md); cursor:pointer; font:inherit; font-size:14px; }
.hm-trash button:hover:not(:disabled), .hm-trash-menu summary:hover { background:var(--sunken); }
.hm-trash button:focus-visible, .hm-trash-menu summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.hm-trash button:disabled { opacity:.4; cursor:default; }
.hm-trash button[data-close] { background:var(--accent); color:white; }
.hm-trash button[data-close]:hover:not(:disabled) { background:var(--accent-hover); }
.hm-trash .hm-trash-danger { color:var(--danger); }
.hm-trash .hm-trash-danger:hover:not(:disabled) { background:var(--danger-soft); }
.hm-trash-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:0 24px 16px; border-bottom:1px solid var(--line); flex:none; }
.hm-trash-toolbar [role=group] { display:flex; background:var(--sunken); padding:3px; border-radius:var(--r-pill); }
.hm-trash-toolbar [data-sort] { min-height:38px; padding:6px 18px; background:transparent; border-radius:var(--r-pill); font-size:13px; }
.hm-trash-toolbar [aria-pressed=true] { background:var(--surface); color:var(--accent); box-shadow:var(--sh-1); }
.hm-trash-toolbar [data-view] { color:var(--accent); white-space:nowrap; }
.hm-trash-selection { display:flex; align-items:center; gap:12px; padding:8px 24px; background:var(--sunken); border-bottom:1px solid var(--line); flex:none; }
.hm-trash-selection[hidden] { display:none; }
.hm-trash-selection [data-count] { flex:1; color:var(--ink-3); font-size:13px; white-space:nowrap; }
.hm-trash-selection [data-restore] { color:var(--accent); }
.hm-trash-items { flex:1; min-height:0; overflow:auto; display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); align-content:start; justify-content:start; gap:28px 24px; padding:24px; overscroll-behavior:contain; }
.hm-trash-card { min-width:0; position:relative; border-radius:var(--r-md); }
.hm-trash .hm-trash-thumb { display:flex; justify-content:center; align-items:center; width:100%; height:188px; padding:0; border-radius:var(--r-sm); background:var(--sunken); position:relative; }
.hm-trash-paper { width:140px; height:188px; box-sizing:border-box; position:relative; overflow:hidden; background:white; border:1px solid var(--line-strong); box-shadow:var(--sh-1); }
.hm-trash-paper > img { width:100%; height:100%; object-fit:contain; display:block; }
.hm-trash-thumb.is-folder svg { width:120px; max-width:100%; height:100px; }
.hm-trash-thumb.is-book svg { width:100px; max-width:100%; height:120px; color:var(--accent); }
.hm-trash.is-list .hm-trash-thumb.is-book svg { width:44px; height:60px; }
.hm-trash-caption { display:grid; grid-template-columns:minmax(0,1fr) 44px; align-items:center; column-gap:6px; margin-top:8px; color:var(--ink); font-size:14px; }
.hm-trash-caption > span { min-height:42px; overflow-wrap:anywhere; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; line-height:1.5; }
.hm-trash-caption > small { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:0 8px; color:var(--ink-3); font-size:12px; line-height:1.6; }
.hm-trash-caption > small > span { white-space:nowrap; }
.hm-trash-menu[hidden] { display:none; }
.hm-trash-menu summary { display:flex; align-items:center; justify-content:center; width:44px; min-height:44px; border-radius:var(--r-md); color:var(--ink-3); cursor:pointer; list-style:none; }
.hm-trash-menu summary svg { width:20px; height:20px; }
.hm-trash-menu summary::-webkit-details-marker { display:none; }
.hm-trash-menu-panel { position:fixed; z-index:10; width:220px; box-sizing:border-box; padding:4px; border-radius:var(--r-lg); background:var(--surface); border:1px solid var(--line); box-shadow:var(--sh-2); overflow:hidden; }
.hm-trash-menu-panel button { width:100%; display:block; text-align:left; padding:12px 16px; min-height:48px; }
.hm-trash-empty { grid-column:1 / -1; text-align:center; color:var(--ink-3); padding:56px 0; }
.hm-trash .hm-trash-select { position:absolute; top:6px; right:6px; width:44px; height:44px; padding:0; display:flex; align-items:center; justify-content:center; background:transparent; border-radius:50%; }
.hm-trash-check { box-sizing:border-box; width:26px; height:26px; display:flex; align-items:center; justify-content:center; background:var(--surface); border:2px solid var(--line-strong); border-radius:50%; color:var(--accent); }
.hm-trash-card.is-selected .hm-trash-paper { outline:2px solid var(--accent); outline-offset:2px; }
.hm-trash-card.is-selected .hm-trash-check { color:white; background:var(--accent); border-color:var(--accent); }
.hm-trash.is-selecting .hm-trash-caption { grid-template-columns:minmax(0,1fr); }
.hm-trash.is-selecting .hm-trash-card { cursor:pointer; }
.hm-trash.is-list .hm-trash-items { display:flex; flex-direction:column; justify-content:flex-start; gap:0; padding:8px 24px; }
.hm-trash.is-list .hm-trash-card { display:flex; flex:none; align-items:center; gap:16px; border-bottom:1px solid var(--line); border-radius:0; padding:14px 0; }
.hm-trash.is-list .hm-trash-card:last-child { border-bottom:0; }
.hm-trash.is-list .hm-trash-thumb { flex-shrink:0; width:52px; height:70px; background:transparent; }
.hm-trash.is-list .hm-trash-paper { width:52px; height:70px; }
.hm-trash.is-list .hm-trash-caption { flex:1; min-width:0; margin:0; }
.hm-trash.is-list .hm-trash-caption > span { min-height:0; }
.hm-trash.is-list .hm-trash-caption > small { grid-column:1; }
.hm-trash.is-list .hm-trash-menu { grid-column:2; grid-row:1 / 3; }
.hm-trash.is-list .hm-trash-select { position:static; flex:none; }
.hm-trash.is-list .hm-trash-card.is-selected { background:var(--accent-soft); }
.hm-trash > .hm-error { flex:none; margin:0; padding:8px 24px; }
.hm-trash > .hm-error:empty { display:none; }
.hm-trash .hm-trash-help { flex:none; margin:0; padding:12px 24px 16px; border-top:1px solid var(--line); color:var(--ink-3); font-size:12px; line-height:1.6; }
@media(max-width:600px) {
  .hm-dialog.hm-trash { width:calc(100vw - 16px); height:calc(100dvh - 32px); border-radius:20px; }
  .hm-trash > header { padding:12px; gap:6px; flex-wrap:wrap; }
  .hm-trash > header h2 { font-size:18px; }
  .hm-trash > header > div { gap:2px; }
  .hm-trash button { padding:8px 10px; }
  .hm-trash-toolbar { padding:0 12px 12px; gap:4px; }
  .hm-trash-toolbar [data-sort] { padding:6px 12px; }
  .hm-trash-items { padding:16px 12px; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px 12px; }
  .hm-trash .hm-trash-thumb { height:164px; }
  .hm-trash-paper { width:120px; max-width:100%; height:164px; }
  .hm-trash-selection { flex-wrap:wrap; padding:8px 12px; gap:6px; }
  .hm-trash-selection [data-count] { flex:none; margin-right:auto; }
  .hm-trash.is-list .hm-trash-items { padding:0 12px; }
  .hm-trash.is-list .hm-trash-thumb { width:48px; height:64px; }
  .hm-trash.is-list .hm-trash-paper { width:48px; height:64px; }
  .hm-trash.is-list .hm-trash-card { gap:12px; }
  .hm-trash .hm-trash-help { padding:10px 12px; }
}
