/* 2026-11-12 P1-1：色值统一来自 tokens.json 生成的运行时真源，先于本页规则引入。 */
@import url('/static/tokens.css');

/* 墨算学堂 · 生字字帖（/copybook）
 *
 * 令牌与口算页/主站同一套（品牌蓝 #2E7FF2、实底 #1F6AE0、CTA 橙 #FF9F43）。
 * 预览区是「一张纸」的隐喻：无论明暗主题，纸永远是白的、格线永远是浅灰 ——
 * 这里刻意不跟随主题，否则暗色下会出现"黑底格子"，与打印稿完全不同。
 */

:root {
  /* Colors now come from /static/tokens.css (load BEFORE this file); this :root keeps only non-color vars and same-name page overrides. P1-1 2026-11-12. */
  color-scheme: light;
  --success: #15803D;
  --danger: #B91C1C;
  --bg-soft: #F7F6F3;
  --border: #E4E0D9;
  --border-light: #EEEBE5;
  --text-h1: #1F1F1F;
  --radius-card: 20px;
  /* D3（2026-11-11）：input/btn 14→12、tag 10→8，与主站/口算同一套六档；
     --radius-xs 此前只在本页裸写 6px（A4 纸预览），现在补成正式档。 */
  --radius-input: 12px;
  --radius-btn: 12px;
  --radius-tag: 8px;
  --radius-xs: 4px;
  --radius-pill: 999px;
  --font-title: 16px;
  --font-body: 16px;
  --font-sm: 14px;
  --font-xs: 12px;
  --shadow-card: 0 1px 2px rgba(74, 40, 0, .04), 0 6px 20px -6px rgba(74, 40, 0, .10);
  --shadow-btn: 0 2px 8px -2px rgba(31, 106, 224, .35);
  --shell: 1180px;
  /* 楷体栈：Windows 楷体 / macOS 楷体 / 常见安卓缺省回落 serif。
     字帖的"像字帖"很大程度靠这个字体，缺字体时至少结构仍对。 */
  --kai: "KaiTi", "Kaiti SC", "STKaiti", "KaiTi_GB2312", "TW-Kai", serif;

/* A-5 楷体缺失提示：与「容量不足」同族的琥珀色小条。刻意不用红色 ——
   它不阻断出帖，只是把「预览像字帖、打印不是」这件用户看不出来的事说破。 */
.font-warn {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 12px 0 0; padding: 10px 14px;
  border: 1px solid #F3D6A6; border-radius: var(--radius-btn);
  background: #FFF8EC; color: #8A5A12;
  font-size: var(--font-xs); line-height: 1.6;
}

/* 触屏 / 移动系统（2026-11-16）：这类设备装不了桌面字体，提示里只留
   「导出 PDF」一条路。改用中性色 —— 这是设备的属性，不是用户要处理的问题，
   拿琥珀色警告条把它渲染成"故障"，手机上只会制造无谓的焦虑。 */
.font-warn--touch {
  border-color: var(--border);
  background: var(--bg-soft);
  color: var(--text-body, #4B4B4B);
}

}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --primary: #5B9BFF;
    /* P1-1：暗色 hover 回归实底蓝 #1F6AE0 —— 原覆盖回 #2E7FF2 压白字仅约 3.6:1，不过 AA 4.5。 */
    --primary-hover: #1F6AE0;
    --primary-light: #16233A;
    --success: #4ADE80;
    --danger: #F87171;
    --bg-page: #121315;
    --bg-card: #1B1D20;
    --bg-soft: #202226;
    --border: #33363B;
    --border-light: #2A2D31;
    --text-h1: #F2F2F2;
    --text-body: #D6D6D6;
    --text-aux: #A8A8A8;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px -6px rgba(0, 0, 0, .5);
    --shadow-btn: 0 2px 8px -2px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-page);
  color: var(--text-body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
a { color: var(--primary-hover); }

/* ---------------- 顶栏 ---------------- */

.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg-card); border-bottom: 1px solid var(--border-light); }
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-tag);
  background: var(--primary); color: var(--text-on-primary);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: var(--font-title); font-weight: 800; color: var(--text-h1); }
.brand-sub { font-size: var(--font-xs); color: var(--text-aux); }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a { padding: 6px 12px; border-radius: var(--radius-pill); font-size: var(--font-sm); color: var(--text-body); text-decoration: none; }
.topnav a:hover { background: var(--bg-soft); }
.topnav a.is-current { color: var(--primary-hover); background: var(--primary-light); font-weight: 700; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sync-state { font-size: var(--font-xs); color: var(--text-aux); }

/* ---------------- 按钮 / 表单 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-btn);
  font-family: inherit; font-size: var(--font-sm); font-weight: 700;
  padding: 10px 18px; cursor: pointer; text-decoration: none; min-height: 42px;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--primary-hover); color: var(--text-on-primary); box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--primary); }
.btn-ghost { background: var(--bg-card); color: var(--text-body); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-hover); }
.btn-text { background: transparent; color: var(--text-aux); }
.btn-text:hover { color: var(--primary-hover); }
.btn-lg { min-height: 50px; padding: 12px 26px; font-size: var(--font-body); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: var(--font-xs); }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px;
  border-radius: var(--radius-pill); background: var(--reward); color: #4A2800;
  font-size: 11px; font-weight: 800;
}

.view { display: none; padding: 28px 0 40px; }
.view.is-active { display: block; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 800; color: var(--text-h1); margin: 0 0 4px; }
.page-sub { margin: 0; color: var(--text-aux); font-size: var(--font-sm); max-width: 52em; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-card); padding: 22px; box-shadow: var(--shadow-card);
}
.field { margin-bottom: 18px; }
.field-label { display: block; font-size: var(--font-sm); font-weight: 700; color: var(--text-h1); margin-bottom: 8px; }
.field-hint { margin: 6px 0 0; font-size: var(--font-xs); color: var(--text-aux); }

.textarea, .input, .select {
  width: 100%; font-family: inherit; font-size: var(--font-body); color: var(--text-h1);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-input); padding: 11px 14px;
}
.textarea { resize: vertical; line-height: 1.7; }
.textarea:focus, .input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--text-aux); border-bottom: 2px solid var(--text-aux);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
/* 「一行两个」改成按可用宽度自适应（2026-11-13）：
   卡片内容宽够 2×220 才并排，否则自动落成单列。
   起因是设置卡只有 378px，两个下拉各 160px，扣掉箭头与内边距只剩 110px，
   「范字 1 格（黑字）」「每页行数：自动」会被原生 select 直接切掉半截 ——
   这在 PC 上就已经发生，手机上更严重。minmax 的 220px 正好容下 9 个汉字的选项。 */
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
/* 页数估算（25.4 第 11 项）：和左边的下拉并排，是"结果"不是"说明"，
   所以用正文字号 + 等宽数字，别做成 hint 那种浅色小字。 */
.cb-estimate {
  margin: 0; align-self: center; font-size: var(--font-sm); line-height: 1.5;
  color: var(--text-body); font-variant-numeric: tabular-nums;
}
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }

.seg { display: inline-flex; background: var(--bg-soft); border-radius: var(--radius-btn); padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg-btn {
  border: 0; background: transparent; color: var(--text-body);
  font-family: inherit; font-size: var(--font-sm); font-weight: 600;
  padding: 8px 16px; border-radius: var(--radius-tag); cursor: pointer;
}
.seg-btn.is-on { background: var(--bg-card); color: var(--primary-hover); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 800; }
.seg-sm .seg-btn { padding: 6px 12px; font-size: var(--font-xs); }

/* 多选纸型（P1-1）：is-on = 已勾选要一起下载；is-current = 预览正按它渲染。
   两个状态必须能分开看 —— 勾着 4 型时用户要知道"我现在看的是哪一种"，
   只用一个高亮会让预览和下载范围混为一谈。 */
.seg-multi { display: flex; }
.seg-multi .seg-btn { position: relative; }
.seg-btn.is-current { box-shadow: inset 0 -2px 0 var(--primary); }
/* 勾上但没在预览：主色浅底，比"纯高亮"轻一档，才不会盖过 is-current 的下划线 */
.seg-multi .seg-btn.is-on:not(.is-current) { background: var(--primary-light); box-shadow: none; }
.field-hint-muted { color: var(--text-aux); opacity: .9; }

.depth-seg { margin-top: 8px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-body);
  font-family: inherit; font-size: var(--font-sm); font-weight: 600;
  padding: 8px 16px; border-radius: var(--radius-pill); cursor: pointer;
}
.chip.is-on { background: var(--primary-light); border-color: var(--primary); color: var(--primary-hover); font-weight: 800; }

.switch-row { display: flex; align-items: center; gap: 10px; font-size: var(--font-sm); color: var(--text-body); cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.status-line { min-height: 20px; margin: 10px 0 0; font-size: var(--font-xs); color: var(--text-aux); }

/* ---------------- 编辑布局 ---------------- */

.editor-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }

/* ---------------- 预览（一张纸） ---------------- */

.preview-col { min-width: 0; }
.preview-bar {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--font-sm); color: var(--text-aux); margin-bottom: 10px; gap: 10px;
}
.preview-tools { display: flex; align-items: center; gap: 6px; }
.preview-box { display: flex; flex-direction: column; gap: 18px; }
.paper {
  background: #FFFFFF;
  border-radius: var(--radius-xs);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 12px 32px -12px rgba(0, 0, 0, .18);
  padding: 4.6% 4.6% 4% 4.6%;         /* A4 边距 12mm ≈ 5.7%，略收一点给视觉留白 */
  color: #1a1a1a;
}
.paper-title {
  font-family: var(--kai);
  font-size: 15px; font-weight: 700; text-align: center;
  color: #1a1a1a; margin: 0 0 10px; letter-spacing: 1px;
}
/* align-items 必须 flex-start：默认 stretch 会把格子拉成矩形，
   aspect-ratio 1/1 直接失效（实测预览里格子宽 68、高 55）。 */
.cb-row { display: flex; align-items: flex-start; margin-bottom: 6px; }
/* 辅助点阵（P0-5）：5 个定位点，绝对定位在格内百分比位置。
   点径用 em 的替代 —— 格宽不知道，用 % + aspect-ratio 保证圆形。 */
.cb-dots { position: absolute; inset: 0; pointer-events: none; }
.cb-dots i {
  position: absolute; width: 4%; height: 4%;
  /* 3px 下限：预览格子在小屏上只有 40px 宽，3.2% 不到 1.3px，
     再浅一点就完全看不见 —— 那这个开关在屏幕上等于没有。 */
  min-width: 3px; min-height: 3px;
  background: #b9b9b9; border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cb-cell {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1 / 1;
  margin: 0 1px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  display: flex; align-items: center; justify-content: center;
}
/* 拼音单独一行（与打印稿一致：拼音在格子外侧的拼音条上，不挤占格子） */
.cb-py-row { display: flex; align-items: flex-end; height: 15px; margin-bottom: 1px; }
.cb-py-row .slot { flex: 1 1 0; min-width: 0; text-align: center; }
/* 2026-11-12 适龄字号下限：格内拼音是低年级要认读的内容，10px 在 A5/手机预览上
   笔画糊成一团。提到 11px（与 pick.css 的格标注下限一致），宁可少排一行也不牺牲可读性。 */
.cb-py-row .py { font-size: 11px; color: #5B5B5B; line-height: 1; letter-spacing: .3px; }
.cb-py-row.is-bottom { align-items: flex-start; margin: 1px 0 6px; }
/* 颜色对齐打印稿（引擎 COLORS）：范字 #C7433B 深红、浅红临摹 #E8A8A8、
   浅灰临摹 #9B9B9B。早先预览用黑字，用户会以为「打印出来怎么变红了」。 */
.cb-cell .glyph {
  font-family: var(--kai);
  line-height: 1;
  color: #C7433B;
  user-select: none;
}
.cb-cell.mode-trace .glyph { color: #E8A8A8; opacity: var(--trace-alpha, .32); }
.cb-cell.mode-trace.trace-gray .glyph { color: #9B9B9B; }
.cb-cell.mode-trace.trace-hollow .glyph {
  color: transparent;
  opacity: 1;
  -webkit-text-stroke: 1px rgba(199, 67, 59, var(--trace-alpha, .6));
}
.cb-cell.mode-blank .glyph { display: none; }

.preview-note { font-size: var(--font-xs); color: var(--text-aux); margin: 12px 0 0; }

/* ---------------- 原文字帖（doc · 2026-11-14） ----------------
   一句一组：示范行 → 描红行 → 自写行。行与行之间只有 4px 的呼吸，
   组与组之间留一块明显空白 —— 否则相邻两句会连成一片，看不出"这一组是哪一句"。
   右侧补空格子是为了让每行等宽（引擎也是这么画的），少了它每组长度不一，
   在纸面上会像排坏了。 */
.doc-author {
  font-family: var(--kai);
  font-size: var(--font-xs); text-align: center;
  color: #6b6b6b; margin: -4px 0 12px;
}
.doc-row { margin-bottom: 4px; }
.doc-gap { height: 14px; }
/* 原文帖的拼音行：与汉字格同一列宽，左对齐（不居中 —— 居中会让短句的
   拼音飘到页面中间，和下面的格子对不上）。 */
.doc-pinyin { display: flex; margin-bottom: 1px; }
.doc-pinyin .doc-py-cell {
  flex: 1 1 0; min-width: 0;
  text-align: center;
  font-size: 10px; line-height: 14px;
  color: #7a7a7a;
  font-family: var(--sans, sans-serif);
}
.empty { text-align: center; color: var(--text-aux); font-size: var(--font-sm); padding: 40px 0; }

/* ---------------- 我的字帖 ---------------- */

.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.doc-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-input); padding: 14px 16px;
}
.doc-main { flex: 1; min-width: 0; }
.doc-name { font-size: var(--font-body); font-weight: 700; color: var(--text-h1); }
/* 来源角标：手机上做的那几份与电脑存档同列表，只靠这个小签区分。
   不给它单独一栏或单独一块 —— 「来自手机」是实现细节，不是另一种东西。 */
.doc-tag {
  display: inline-block; margin-left: 8px; padding: 1px 6px;
  font-size: var(--font-xs); font-weight: 400; color: var(--text-aux);
  background: var(--surface-tint);
  border-radius: var(--radius-xs); vertical-align: 2px;
}
.doc-meta { font-size: var(--font-xs); color: var(--text-aux); margin-top: 4px; }
.doc-chars {
  font-family: var(--kai); font-size: 18px; color: var(--text-body);
  margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-actions { display: flex; gap: 8px; flex: none; }

/* ---------------- 页脚 ---------------- */

.footer { border-top: 1px solid var(--border-light); margin-top: 20px; padding: 18px 0 28px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: var(--font-xs); color: var(--text-aux); }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--text-aux); text-decoration: none; }
.footer-links a:hover { color: var(--primary-hover); }

@media (max-width: 1024px) {
  .editor-grid { grid-template-columns: 1fr; }
  .preview-col { order: 2; }
}
@media (max-width: 560px) {
  .shell { padding: 0 16px; }
  .topbar-inner { height: auto; padding: 10px 0; flex-wrap: wrap; row-gap: 8px; }
  .topnav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .topbar-actions { margin-left: auto; }
  .sync-state { display: none; }
  /* .row3 已改成 auto-fit（见上文），这里不再需要硬改成两列 */
  .paper { padding: 5%; }
  .char-rows { gap: 4px; }
  /* 2026-11-12：原 7px 是全站最小字号，窄屏格内标注对低年级不可辨；下限提到 10px。 */
  .cell .py { font-size: 10px; }
  .doc-item { flex-wrap: wrap; }
}

/* ---------------- 打印（浏览器直打） ----------------
   只留预览纸：页头/设置/按钮/页脚在纸上一律不出现；每张 .paper 单独一页。
   这条路径不依赖服务端 PDF 接口（prod 受发布门禁控制时也能打印）。
   @page 的 A4 + 0 边距：边距由 .paper 的内边距控制，否则会双重留白。
   2026-11-12：下面这条 A4 只是**兜底** —— 脚本未加载/JS 被禁时仍能打出 A4；
   正常路径由 /static/print-page.js 按 #paperSel 的 A4/A5/B5 动态注入同优先级
   且位置更靠后的 @page 覆盖它，浏览器打印与服务端 PDF 才是同一套纸型。 */
@media print {
  @page { size: A4 portrait; margin: 0; }
  body { background: #fff; }
  .topbar, .footer, .preview-bar, .preview-note, .card, .page-head, .actions, .status-line { display: none !important; }
  .view:not(.is-active) { display: none !important; }
  .view.is-active { padding: 0 !important; }
  .editor-grid { display: block !important; }
  .preview-col { width: 100% !important; }
  .preview-box { gap: 0 !important; }
  .paper {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 12mm !important;
    break-after: page;
    page-break-after: always;
  }
  .paper:last-child { break-after: auto; page-break-after: auto; }
  .cb-cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ---------------- 笔顺演示（B3.1） ----------------
   点击范字格播放：逐笔画出（stroke-dashoffset 动画），播完自动复位。
   字用 #1f1f1f 实线叠加在浅红范字上，看得出「这一笔落在哪」。 */
.cb-cell .stroke-practice-layer { position: absolute; inset: 16%; pointer-events: none; }
.cb-cell .stroke-practice-layer svg { width: 100%; height: 100%; display: block; }
#strokePracticeHint[hidden] { display: none !important; }
.cb-cell.can-play { cursor: pointer; }
.cb-cell.can-play:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.cb-cell .stroke-layer {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity .15s ease;
}
.cb-cell.playing .stroke-layer, .cb-cell.played .stroke-layer { opacity: 1; }
/* 播放/播完时隐藏字体渲染的范字：笔画数据是「中线 + 线宽」，与系统楷体的字形
   本来就不可能严丝合缝地重叠（实测叠上去是一团黑疙瘩）。改成让笔画自己成字，
   这正是 hanzi-writer 的做法，也顺带把「这一笔从哪起、往哪收」说清楚了。 */
.cb-cell.playing .glyph, .cb-cell.played .glyph { opacity: 0; }
.cb-cell .stroke-layer svg { width: 100%; height: 100%; }

.cb-cell .stroke-count {
  position: absolute; right: 3px; bottom: 2px;
  font-size: 10px; color: var(--primary-hover); font-weight: 700;
}


/* ===== 重点字本 / 我的版式（2026-11-10）=====
   两列并排：左边是字、右边是版式，一眼看出它们是两件不同的东西。
   条目做成「名称 + 摘要 + 载入/套用 + 删除」，删除用文字按钮而不是图标 ——
   删除是不可逆动作，图标太容易被误点。 */
.fav-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 18px; }
.fav-card { padding: 18px 20px; }
.fav-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fav-title { margin: 0; font-size: var(--font-title); font-weight: 800; color: var(--text-h1); }
.fav-sub { font-size: var(--font-xs); color: var(--text-aux); }
.fav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-input);
  background: var(--bg-soft); border: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.fav-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fav-name { font-size: var(--font-sm); font-weight: 700; color: var(--text-h1); }
.fav-meta { font-size: var(--font-xs); color: var(--text-aux); }
.fav-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.actions-sub { margin-top: 8px; }
/* 逐笔格自动扩列到 14 列时，320px 窄屏每格只剩约 20px，字号会顶出格子。
   纸面允许横向滚动，格子保持可读的最小宽度（只影响屏幕预览，打印样式不变）。 */
@media (max-width: 560px) {
  .paper { overflow-x: auto; }
  .cb-row, .cb-py-row { min-width: 560px; }
}

/* 订正格（C-1）：只标一个很淡的角标，格内留白供重写，不印范字。
   与 PDF 上 render.js 画的角标同义 —— 预览与纸面不能一个有一个没有。 */
.cb-cell.is-correction { position: relative; }
.cb-cell.is-correction::after {
  content: '订';
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: var(--font-xs);
  color: var(--text-muted);
  opacity: .55;
  pointer-events: none;
}
