/* 道枢道藏 — 前台样式（画布「定稿 · 合并版」）。
   和道枢典籍网、道枢学社官网同一套：日间（默认）用官网色板，夜间用官网夜色（#131922 等）。
   读者手动切换后 <html data-theme="day|night">；没切换过、而系统是深色模式时跟随系统。
   阅读页的横排 / 竖排·带图、逐句 / 连读、字号由 <html data-dir / data-read / data-fs> 切换，同一份页面结构。
   网站的 CSP 不许 style=""：所有颜色、尺寸都在这里。 */

:root {
  --bg: #F2ECE0; --surface: #F8F4EA; --field: #FDFBF6;
  --ink: #231F1B; --ink2: #4A443C; --body: #2E2A25; --muted: #706A5F; --faint: #6E675E;
  --rule: #CBBFA8; --rule2: #DDD3C0; --tile-border: #CBBFA8;
  --accent: #A33A2C; --accent-ink: #F8F4EA; --accent-d: #8E2F22;
  --pill-on-bg: #231F1B; --pill-on-ink: #F2ECE0;
  --logo-cover: #231F1B; --logo-line: #F2ECE0;
  --hl: rgba(163, 58, 44, .09); --sel: rgba(163, 58, 44, .16);
  --code-bg: #231F1B; --code-ink: #EDE6D8; --code-key: #E3C887;
  --ftr-bg: #1A1714; --ftr-ink: #CFC6B8; --ftr-strong: #EDE6D8; --ftr-rule: transparent; --ftr-hover: #F8F4EA;
  --seal-font: 'Ma Shan Zheng', 'Noto Serif SC', serif; --seal-size: 19px; --seal-ls: .2em;
  --fig-filter: none;
  /* 末尾几种是设备上能补扩展区冷僻字的字体（Windows 自带 SimSun-ExtB、MingLiU-ExtB），免得道藏冷僻字变方框 */
  --kai: 'LXGW WenKai TC', 'Noto Serif TC', 'Kaiti TC', 'STKaiti', 'KaiTi', 'DFKai-SB', 'BiauKai', 'SimSun-ExtB', 'MingLiU-ExtB', 'MingLiU_HKSCS-ExtB', 'Noto Serif CJK TC', 'Noto Serif CJK SC', 'Source Han Serif', 'HanaMinB', 'HanaMinA', serif;
  --serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', 'SimSun-ExtB', 'MingLiU-ExtB', 'MingLiU_HKSCS-ExtB', 'Noto Serif CJK TC', 'Noto Serif CJK SC', 'Source Han Serif', 'HanaMinB', 'HanaMinA', serif;
  --sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* 竖排：字号和每一行（竖着的一列）的宽度；格线按这个宽度画，图、页码、章题都占整数列，格线才对得齐 */
  --vfs: calc(24px * var(--rd, 1)); --vcol: calc(52px * var(--rd, 1)); --vh: min(72vh, 560px);
  color-scheme: light;
}

/* 夜间：读者手动选了夜间 */
:root[data-theme="night"] {
  --bg: #131922; --surface: #1A2130; --field: #1A2130;
  --ink: #EDE6D8; --ink2: #CFC9BC; --body: #DDD6C8; --muted: #AAB1BB; --faint: #8F96A1;
  --rule: #333F54; --rule2: #273244; --tile-border: #273244;
  --accent: #D9B96E; --accent-ink: #131922; --accent-d: #E3C887;
  --pill-on-bg: #D9B96E; --pill-on-ink: #131922;
  --logo-cover: #F2ECE0; --logo-line: #231F1B;
  --hl: rgba(217, 185, 110, .12); --sel: rgba(217, 185, 110, .22);
  --code-bg: #0E131B; --code-ink: #DDD6C8; --code-key: #D9B96E;
  --ftr-bg: transparent; --ftr-ink: #AAB1BB; --ftr-strong: #EDE6D8; --ftr-rule: #273244; --ftr-hover: #D9B96E;
  --seal-font: var(--serif); --seal-size: 16px; --seal-ls: .3em;
  /* 符图是透明底的黑线 SVG：夜间反成浅色线，朱色大致不变 */
  --fig-filter: invert(.9) hue-rotate(180deg);
  color-scheme: dark;
}

/* 夜间：没有手动选过，系统是深色模式时跟随系统 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) {
    --bg: #131922; --surface: #1A2130; --field: #1A2130;
    --ink: #EDE6D8; --ink2: #CFC9BC; --body: #DDD6C8; --muted: #AAB1BB; --faint: #8F96A1;
    --rule: #333F54; --rule2: #273244; --tile-border: #273244;
    --accent: #D9B96E; --accent-ink: #131922; --accent-d: #E3C887;
    --pill-on-bg: #D9B96E; --pill-on-ink: #131922;
    --logo-cover: #F2ECE0; --logo-line: #231F1B;
    --hl: rgba(217, 185, 110, .12); --sel: rgba(217, 185, 110, .22);
    --code-bg: #0E131B; --code-ink: #DDD6C8; --code-key: #D9B96E;
    --ftr-bg: transparent; --ftr-ink: #AAB1BB; --ftr-strong: #EDE6D8; --ftr-rule: #273244; --ftr-hover: #D9B96E;
    --seal-font: var(--serif); --seal-size: 16px; --seal-ls: .3em;
    --fig-filter: invert(.9) hue-rotate(180deg);
    color-scheme: dark;
  }
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); font-size: 16px; line-height: 1.7; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 12px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.code { font-family: var(--mono); letter-spacing: 0; color: var(--accent); }
mark { background: var(--hl); color: inherit; padding: 0 1px; }
/* 毛坯、精校两种小标签 */
.tag-mp { display: inline-block; padding: 0 7px; border: 1px dashed var(--muted); border-radius: 4px; font-size: 12px; line-height: 1.7; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.tag-jx, .tag-jx-s { display: inline-block; padding: 0 7px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); font-size: 12px; line-height: 1.7; letter-spacing: .05em; white-space: nowrap; }
a.tag-jx:hover { color: var(--accent-ink); background: var(--accent-d); }

/* ---------- 页头 ---------- */
.hdr-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 18px 32px; }
/* 标志「线装」：日间深色书衣、母标反白；夜间浅色书衣、母标原色（朱点始终是学社的朱红） */
.logo { display: flex; align-items: center; gap: 12px; padding: 6px 0; margin: 0; color: var(--ink); }
.logo-mark { display: block; flex: none; }
.xz-cover { fill: var(--logo-cover); }
.xz-thread { fill: none; stroke: var(--logo-line); }
.xz-hole, .xz-ring { fill: var(--logo-line); }
.xz-dot { fill: #A33A2C; }
/* 站名：马善政体「道枢道藏」的曲线（wordmark.svg，宽高比约 4.1），按当前文字颜色上色 */
.logo-words { display: flex; flex-direction: column; gap: 5px; }
.logo-word { display: block; width: 111px; height: 27px; background: currentColor; -webkit-mask: url(/assets/wordmark.svg) no-repeat left center / contain; mask: url(/assets/wordmark.svg) no-repeat left center / contain; }
.logo-en { display: block; font-family: var(--serif); font-size: 9px; line-height: 1; letter-spacing: .42em; color: var(--muted); white-space: nowrap; }
:root[data-theme="night"] .logo-en { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="day"]) .logo-en { color: var(--accent); } }
.hdr-nav { display: flex; flex-wrap: wrap; gap: 0 26px; font-size: 15px; letter-spacing: .1em; }
.hdr-nav a { padding: 12px 0; color: var(--ink2); }
.hdr-nav a.is-on { color: var(--accent); }
.hdr-tools { display: flex; align-items: center; gap: 8px; }
.hdr-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; border-radius: 20px; color: var(--ink2); cursor: pointer; list-style: none; }
.hdr-icon::-webkit-details-marker { display: none; }
.pill { display: flex; border: 1px solid var(--rule); border-radius: 18px; overflow: hidden; }
.pill-a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 14px; letter-spacing: 0; cursor: pointer; white-space: nowrap; }
.pill-a.is-on { background: var(--pill-on-bg); color: var(--pill-on-ink); }
.pill-a:hover { color: var(--accent); }
.pill-a.is-on:hover { color: var(--pill-on-ink); }
/* 日 / 夜哪个亮着：由 data-theme 或系统深色模式决定 */
:root:not([data-theme]) .mode-day, :root[data-theme="day"] .mode-day, :root[data-theme="night"] .mode-night { background: var(--pill-on-bg); color: var(--pill-on-ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .mode-day { background: transparent; color: var(--muted); }
  :root:not([data-theme]) .mode-night { background: var(--pill-on-bg); color: var(--pill-on-ink); }
}
.mnav { position: relative; display: none; }
.mnav-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; display: flex; flex-direction: column; min-width: 180px; padding: 8px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; }
.mnav-pop a { padding: 12px 0; border-bottom: 1px solid var(--rule2); }
.mnav-pop a:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .hdr-nav { display: none; }
  .mnav { display: block; }
}
@media (max-width: 520px) {
  .wrap, .hdr-in { padding-left: 18px; padding-right: 18px; }
  .hdr-in { gap: 8px 10px; padding-top: 14px; padding-bottom: 14px; }
  .logo { gap: 10px; }
  .logo-word { width: 91px; height: 22px; }
  .logo-en { font-size: 8px; letter-spacing: .3em; }
  .hdr-tools { gap: 6px; }
  .hdr-tools .pill-a { min-width: 34px; padding: 0 6px; }
  .mnav-btn { min-width: 36px; }
}

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 1px solid var(--rule); border-radius: 22px; background: transparent; color: var(--ink); font-size: 14px; letter-spacing: .12em; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-line-accent { border-color: var(--accent); color: var(--accent); }
.btn-accent { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-d); border-color: var(--accent-d); color: var(--accent-ink); }
.btn-ink { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.btn-ink:hover { color: var(--bg); opacity: .9; }
.btn-block { width: 100%; }
.btn-line { background: transparent; }

/* ---------- 检索框（索引台：方一些的框） ---------- */
.search { max-width: 760px; margin: 0 0 30px; }
.search-label, .hm-label { display: block; margin-bottom: 10px; font-size: 13px; letter-spacing: .3em; color: var(--accent); }
.search-box { display: flex; padding: 4px; border: 1px solid var(--rule); border-radius: 10px; background: var(--field); }
.search-box input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 17px; }
.search-box input:focus { outline: none; }
.search-box:focus-within { border-color: var(--accent); }
.search-box input::placeholder { color: var(--faint); }
.search-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 22px; border: 0; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-family: var(--seal-font); font-size: var(--seal-size); letter-spacing: var(--seal-ls); cursor: pointer; }
.search-btn:hover { background: var(--accent-d); }
.search-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- 首页 ---------- */
.page-home { padding-top: 12px; }
.home-top { display: flex; flex-wrap: wrap; gap: 16px; }
.hm-card { min-width: 0; padding: 20px 22px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
.hm-search { flex: 2 1 460px; }
.hm-dz { flex: 1 1 280px; }
.hm-under { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 14px; }
.hm-under .pill { border-radius: 8px; }
.hm-under .pill-a { min-height: 34px; padding: 0 12px; font-size: 13px; }
.hm-hint { margin: 10px 0 0; font-size: 13px; line-height: 1.8; color: var(--muted); }
.hm-under .hm-hint { margin: 0; }
.dz-go { display: flex; gap: 8px; }
.dz-pre { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--rule); border-radius: 8px; font-family: var(--mono); font-size: 15px; color: var(--muted); }
.dz-go input { flex: 1; min-width: 0; height: 48px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--field); color: var(--ink); font-family: var(--mono); font-size: 18px; }
.dz-go input:focus { outline: none; border-color: var(--accent); }
.dz-go .btn { min-height: 48px; padding: 0 16px; border-radius: 8px; letter-spacing: .05em; }
.hm-total { display: flex; flex-wrap: wrap; gap: 2px 6px; margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.hm-total b { font-family: var(--mono); font-weight: 400; color: var(--ink); }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 16px; margin: 40px 0 12px; }
.sec-title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: .3em; }
.sec-more { padding: 8px 0; font-size: 14px; letter-spacing: .1em; color: var(--accent); }
.api-band { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: flex-start; margin-top: 48px; scroll-margin-top: 16px; }
.api-text { flex: 1 1 300px; min-width: 0; }
.api-text .sec-title { margin-bottom: 12px; }
.api-text p { margin: 0 0 10px; font-size: 15px; line-height: 1.9; color: var(--ink2); }
.api-text a { color: var(--accent); }
.code-block { flex: 999 1 520px; min-width: 0; margin: 0; padding: 18px 20px; overflow-x: auto; border-radius: 10px; background: var(--code-bg); color: var(--code-ink); font-family: var(--mono); font-size: 13px; line-height: 1.7; }

/* ---------- 书目表（索引台的表格） ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 17px; font-size: 13px; color: var(--ink2); }
.chip.is-on { border-color: var(--pill-on-bg); background: var(--pill-on-bg); color: var(--pill-on-ink); }
.chip-n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.chip.is-on .chip-n { color: inherit; opacity: .8; }
.ct-chips { margin: 0 0 12px; }
.ct-tabs { display: inline-flex; margin: 0 0 14px; border-radius: 8px; }
.ct-tabs .pill-a { padding: 0 14px; }
.ct-box { overflow-x: auto; border-top: 2px solid var(--ink2); }
.ct { min-width: 780px; }
.ct-head, .ct-row { display: grid; grid-template-columns: 96px minmax(200px, 2fr) 96px minmax(150px, 1.3fr) 110px 130px; gap: 0 12px; align-items: center; padding: 0 10px; }
.ct-head { padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.ct-head a { color: var(--muted); }
.ct-head a:hover { color: var(--accent); }
.ct-list { margin: 0; padding: 0; list-style: none; }
.ct-row { border-bottom: 1px solid var(--rule2); font-size: 15px; }
.ct-row:hover { background: var(--hl); }
.ct-code { font-family: var(--mono); font-size: 14px; color: var(--accent); white-space: nowrap; }
.ct-title { display: flex; align-items: center; min-height: 48px; font-size: 16px; }
.ct-juan, .ct-bu { color: var(--ink2); }
.ct-hfl { font-size: 13px; color: var(--muted); }
.ct-state { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct-empty { padding: 20px 10px; color: var(--muted); }
.ct-foot { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .ct { min-width: 0; }
  .ct-head { display: none; }
  .ct-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; padding: 10px 4px; }
  .ct-code { flex: none; min-width: 74px; font-size: 13px; }
  .ct-title { flex: 1 1 60%; min-height: 0; font-size: 16px; }
  .ct-juan, .ct-bu, .ct-hfl { font-size: 13px; color: var(--muted); }
  .ct-juan { margin-left: 84px; }
  .ct-juan:empty, .ct-bu:empty, .ct-hfl:empty { display: none; }
  .ct-state { margin-left: auto; }
}
.pager { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.pg { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 20px; font-size: 14px; }
.pg.is-on { border-color: var(--pill-on-bg); background: var(--pill-on-bg); color: var(--pill-on-ink); }

/* ---------- 一般页面 ---------- */
.page { padding: 8px 32px 80px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 8px 0 22px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumb-sep { color: var(--rule); }
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; font-size: 14px; }
.page-title { margin: 0 0 10px; font-size: 30px; font-weight: 600; letter-spacing: .08em; line-height: 1.4; }
.title-sub { margin-left: 12px; font-size: 16px; font-weight: 400; color: var(--muted); letter-spacing: .1em; }
.title-alt { margin: -4px 0 12px; font-size: 14px; color: var(--muted); }
.page-lead { max-width: 42em; margin: 0 0 24px; line-height: 1.9; color: var(--muted); }
.page-lead a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.page-card { max-width: 46em; }
.prose { line-height: 1.95; color: var(--body); }
.prose h2 { margin: 36px 0 12px; font-size: 18px; font-weight: 600; letter-spacing: .15em; color: var(--ink); scroll-margin-top: 24px; }
.prose h3 { margin: 24px 0 8px; font-size: 16px; font-weight: 600; color: var(--ink); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 6px 0; }
.prose code { font-family: var(--mono); font-size: .9em; }
.prose pre { overflow-x: auto; padding: 14px 16px; border-radius: 8px; background: var(--code-bg); color: var(--code-ink); font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--rule2); text-align: left; vertical-align: top; }
.prose.small { font-size: 14px; color: var(--muted); }
.preview-bar { margin: 0 0 20px; padding: 10px 14px; border-radius: 8px; background: var(--hl); font-size: 14px; }
.notice-page { padding: 80px 32px; }
.notice { max-width: 560px; }
.notice-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.read-h { margin: 40px 0 12px; font-size: 14px; font-weight: 400; letter-spacing: .4em; color: var(--accent); }
.row-empty { padding: 16px 0; color: var(--muted); }
/* 书目信息条：正统道藏 · 洞玄部 · 本文类 · 涵芬楼本 第167册 */
.shumu { margin: 0; font-size: 14px; line-height: 1.9; color: var(--muted); letter-spacing: .04em; }
.shumu > span { white-space: nowrap; }
.shumu > .shumu-dot { white-space: normal; color: var(--rule); }
.shumu-dot { color: var(--rule); }

/* ---------- 书页 ---------- */
.work-cols { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: stretch; margin-top: 14px; }
.work-dl { flex: 1 1 420px; min-width: 0; display: grid; grid-template-columns: 96px 1fr; margin: 0; border-top: 1px solid var(--rule2); font-size: 15px; }
.work-dl dt { padding: 10px 0; border-bottom: 1px solid var(--rule2); color: var(--muted); }
.work-dl dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--rule2); min-width: 0; overflow-wrap: anywhere; }
.work-dl a { color: var(--accent); }
.jx-box { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 22px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); }
.jx-h { margin: 0; font-family: var(--seal-font); font-size: 26px; letter-spacing: .2em; }
.jx-p { margin: 8px 0 0; font-size: 15px; line-height: 1.85; opacity: .92; }
.jx-btn { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 1px solid currentColor; border-radius: 8px; font-size: 15px; letter-spacing: .1em; color: var(--accent-ink); }
.jx-btn:hover { color: var(--accent-ink); background: rgba(255, 255, 255, .1); }
/* 阅读页上的一行：本书有精校版 → 道枢典籍网 */
.jx-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: 860px; margin: 12px 0 0; padding: 8px 12px; border: 1px solid var(--accent); border-radius: 8px; font-size: 14px; color: var(--ink2); }
.jx-line a { color: var(--accent); font-weight: 600; }
.jx-seal { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); font-family: var(--seal-font); font-size: 15px; line-height: 1; }
.juan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.juan-grid a { display: flex; align-items: baseline; gap: 8px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--rule2); border-radius: 6px; }
.juan-grid a:hover, .juan-grid a:focus-visible { border-color: var(--accent); background: var(--hl); }
.juan-grid b { flex: none; min-width: 1.6em; font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--accent); }
.juan-grid span { min-width: 0; font-size: 14px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.juan-grid a.is-off { border-style: dashed; color: var(--muted); }
.work-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ---------- 阅读页：工具条 ---------- */
.read-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 18px 0 24px; }
.read-link { font-size: 14px; letter-spacing: .1em; color: var(--accent); }
button.read-link { min-height: 36px; padding: 0; border: 0; background: none; font-family: inherit; cursor: pointer; }
button.read-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.read-hint { display: none; font-size: 13px; color: var(--muted); }
:root[data-dir="v"] .read-hint, :root[data-read="lian"] .read-hint { display: inline; }
:root[data-dir="v"] .h-only { display: none; }
/* 横排 / 竖排·带图：强调色的一对按钮 */
.dir-switch { border-color: var(--accent); }
.dir-switch .pill-a { min-width: 60px; min-height: 38px; padding: 0 14px; color: var(--accent); }
:root:not([data-dir="v"]) .dir-switch [data-dir-set="h"], :root[data-dir="v"] .dir-switch [data-dir-set="v"] { background: var(--accent); color: var(--accent-ink); }
:root:not([data-read="lian"]) .read-switch [data-read-set="zhu"], :root[data-read="lian"] .read-switch [data-read-set="lian"] { background: var(--pill-on-bg); color: var(--pill-on-ink); }
:root:not([data-fs]) .fs-switch [data-fs-set=""], :root[data-fs="s"] .fs-switch [data-fs-set="s"], :root[data-fs="l"] .fs-switch [data-fs-set="l"], :root[data-fs="xl"] .fs-switch [data-fs-set="l"] { background: var(--pill-on-bg); color: var(--pill-on-ink); }
:root[data-fs="s"] { --rd: .9; }
:root[data-fs="l"] { --rd: 1.15; }
:root[data-fs="xl"] { --rd: 1.32; }

/* ---------- 阅读页：横排 · 逐句（默认）：一句一行，前面句号，句末小旗报错 ---------- */
.dz-frame { max-width: 860px; }
.dz-txt { border-top: 1px solid var(--rule2); }
.dz-txt .s { display: flex; align-items: baseline; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--rule2); scroll-margin-top: 24px; }
.dz-txt .s.p:not(:first-child) { margin-top: 10px; border-top: 1px solid var(--rule2); }
.dz-n { flex: none; min-width: 2em; font-family: var(--mono); font-size: 12px; font-style: normal; color: var(--muted); }
.dz-t { flex: 1; min-width: 0; font-family: var(--kai); font-size: calc(clamp(19px, 2.4vw, 25px) * var(--rd, 1)); line-height: 1.7; letter-spacing: .08em; }
.flag { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -8px -6px -8px 0; padding: 0; border: 0; border-radius: 20px; background: transparent; color: var(--muted); cursor: pointer; opacity: .6; align-self: center; }
.flag .ic { width: 18px; height: 18px; }
.flag:hover, .flag:focus-visible { opacity: 1; color: var(--accent); }
.dz-txt .s:target, .dz-txt .s.is-sel { background: var(--hl); }
.dz-txt .s.is-sel { box-shadow: inset 3px 0 0 var(--accent); }
/* 章题（原书的品、章名）：卷里面的小标题 */
/* 选择器带上 .dz-txt：比「.dz-txt .s」更具体，章题自己的样式才生效 */
.dz-txt h2.dz-h { margin: 0; padding-top: 22px; font-weight: 600; }
.dz-txt h2.dz-h .dz-t { font-family: var(--serif); font-size: calc(19px * var(--rd, 1)); letter-spacing: .2em; color: var(--ink); }
.dz-txt h2.dz-h::before { content: ""; flex: none; min-width: 2em; }
/* 原书换叶处：一行小字 */
.dz-ye { margin: 0; padding: 6px; border-bottom: 1px solid var(--rule2); font-size: 12px; letter-spacing: .2em; text-align: center; color: var(--muted); }
/* 原书有图处：横排只给一行提示，点「切换竖排看图」 */
.dz-fig { margin: 0; scroll-margin-top: 24px; }
.fig-mark { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 6px 12px calc(2em + 20px); border-bottom: 1px solid var(--rule2); font-size: 14px; letter-spacing: .1em; color: var(--ink2); }
.fig-go { min-height: 36px; padding: 0; border: 0; background: none; font-size: 14px; letter-spacing: .05em; color: var(--accent); cursor: pointer; }
.fig-go:hover { text-decoration: underline; text-underline-offset: 4px; }
.fig-card { display: none; }
.dz-note { max-width: 860px; margin: 22px 0 0; font-size: 14px; line-height: 1.9; color: var(--muted); }
.dz-note .muted { margin-left: 8px; }
.chap-nav { display: flex; justify-content: space-between; gap: 12px; max-width: 860px; margin-top: 32px; }
.withdrawn { max-width: 860px; padding: 28px 22px; border: 1px dashed var(--rule); border-radius: 10px; color: var(--ink2); }
.withdrawn p { margin: 0 0 6px; }

/* ---------- 横排 · 连读：句子连成段落，句号缩成小角标；点一句弹出「报错这句」 ---------- */
:root[data-read="lian"]:not([data-dir="v"]) .dz-txt { padding: 18px 0 20px; border-bottom: 1px solid var(--rule2); font-family: var(--kai); font-size: calc(clamp(19px, 2.3vw, 25px) * var(--rd, 1)); line-height: 2.1; letter-spacing: .06em; }
:root[data-read="lian"]:not([data-dir="v"]) .dz-txt .s { display: inline; padding: 0; border: 0; margin: 0; cursor: pointer; border-radius: 3px; }
:root[data-read="lian"]:not([data-dir="v"]) .dz-txt .s.p::before { content: ""; display: block; height: 12px; }
:root[data-read="lian"]:not([data-dir="v"]) .dz-txt .s.p:first-child::before { height: 0; }
:root[data-read="lian"]:not([data-dir="v"]) .dz-n { display: inline; min-width: 0; margin: 0 3px 0 6px; font-size: 11px; vertical-align: super; line-height: 1; }
:root[data-read="lian"]:not([data-dir="v"]) .dz-t { display: inline; font-size: 1em; line-height: inherit; letter-spacing: inherit; }
:root[data-read="lian"]:not([data-dir="v"]) .dz-txt .s.is-sel { box-shadow: none; background: var(--sel); }
:root[data-read="lian"] .flag { display: none; }
:root[data-read="lian"]:not([data-dir="v"]) .dz-txt h2.dz-h { display: block; padding: 18px 0 6px; font-family: var(--serif); font-size: calc(19px * var(--rd, 1)); line-height: 1.8; letter-spacing: .2em; cursor: pointer; }
:root[data-read="lian"]:not([data-dir="v"]) .dz-txt h2.dz-h::before { display: none; }
:root[data-read="lian"]:not([data-dir="v"]) .dz-ye { display: block; margin: 10px 0; border: 0; font-family: var(--serif); line-height: 1.6; }
:root[data-read="lian"]:not([data-dir="v"]) .fig-mark { margin: 10px 0; padding: 8px 0; border: 0; font-family: var(--serif); line-height: 1.6; }

/* ---------- 竖排 · 带图：古籍版式，从右往左；外框 + 格线，符图在原书的位置；点一句弹出「报错这句」 ---------- */
:root[data-dir="v"] .dz-frame { max-width: none; padding: 10px; border: 2px solid var(--ink2); border-radius: 2px; }
:root[data-dir="v"] .dz-txt {
  /* 宽度固定为框宽：不写死的话竖排的宽度按内容撑开，开头会跑到屏幕外；内容短时从最右边排起 */
  writing-mode: vertical-rl; width: 100%; max-width: 100%; height: var(--vh); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  padding: 0; border: 1px solid var(--rule); background-color: var(--surface);
  font-family: var(--kai); font-size: var(--vfs); line-height: var(--vcol); letter-spacing: .14em;
  /* 竖着的格线：每列一条，跟着内容一起滚 */
  background-image: repeating-linear-gradient(to left, transparent 0, transparent calc(var(--vcol) - 1px), var(--rule2) calc(var(--vcol) - 1px), var(--rule2) var(--vcol));
  background-attachment: local; background-position: right top;
}
:root[data-dir="v"] .dz-txt .s { display: inline; padding: 0; margin: 0; border: 0; border-radius: 3px; cursor: pointer; }
:root[data-dir="v"] .dz-txt .s.p::before { content: ""; display: block; }
:root[data-dir="v"] .dz-txt .s.p:first-child::before { display: none; }
:root[data-dir="v"] .dz-n, :root[data-dir="v"] .flag { display: none; }
:root[data-dir="v"] .dz-t { display: inline; font-size: 1em; line-height: inherit; letter-spacing: inherit; }
:root[data-dir="v"] .dz-txt .s:target, :root[data-dir="v"] .dz-txt .s.is-sel { box-shadow: none; background: var(--sel); }
:root[data-dir="v"] .dz-txt h2.dz-h { display: block; padding: 2em 0 0; font-size: 1em; line-height: var(--vcol); }
:root[data-dir="v"] .dz-txt h2.dz-h::before { display: none; }
:root[data-dir="v"] .dz-txt h2.dz-h .dz-t { font-family: var(--kai); font-size: 1em; letter-spacing: .3em; color: var(--accent); }
:root[data-dir="v"] .dz-ye { display: block; padding: 1em 0 0; border: 0; font-family: var(--serif); font-size: 13px; line-height: var(--vcol); letter-spacing: .3em; text-align: start; }
/* 符图卡片：占整数列（宽 = 5 列），卡片里面横着排 */
:root[data-dir="v"] .dz-fig { display: block; writing-mode: horizontal-tb; width: calc(var(--vcol) * 5); height: 100%; padding: 10px 8px; font-family: var(--serif); font-size: 14px; line-height: 1.7; letter-spacing: 0; cursor: default; }
:root[data-dir="v"] .fig-mark { display: none; }
:root[data-dir="v"] .fig-card { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 12px; border: 1px dashed var(--accent); border-radius: 8px; background: var(--surface); overflow: hidden; }
.fig-top b { display: block; font-size: 15px; font-weight: 600; letter-spacing: .1em; }
.fig-top small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.fig-sw { flex: none; }
.fig-sw .pill-a { flex: 1; }
.fig-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; overflow: hidden; }
.fig-svg { display: block; max-width: 100%; max-height: 100%; min-height: 0; flex: 1 1 auto; object-fit: contain; filter: var(--fig-filter); }
.fig-scan { display: block; max-width: 100%; max-height: 100%; min-height: 0; flex: 1 1 auto; object-fit: contain; }
.fig-cap { flex: none; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.fig-ph { display: flex; flex-direction: column; gap: 4px; padding: 12px; text-align: center; color: var(--muted); }
.fig-ph b { font-weight: 400; color: var(--ink2); }
.fig-ph small { font-size: 12px; line-height: 1.6; }
.fig-cui { flex: none; min-height: 42px; border: 1px solid var(--accent); border-radius: 21px; background: transparent; color: var(--accent); font-size: 14px; letter-spacing: .1em; cursor: pointer; }
.fig-cui:hover { background: var(--hl); }
.fig-cui.is-done { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 760px) {
  :root { --vfs: calc(21px * var(--rd, 1)); --vcol: calc(46px * var(--rd, 1)); --vh: min(68vh, 500px); }
  :root[data-dir="v"] .dz-frame { padding: 6px; }
  :root[data-dir="v"] .dz-fig { width: calc(var(--vcol) * 6); }
}
.dz-vnote { display: none; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
:root[data-dir="v"] .dz-vnote { display: block; }

/* 竖排、连读里选中一句后，底部弹出的一条 */
.dz-bar { position: fixed; left: 10px; right: 10px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 56; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: 640px; margin: 0 auto; padding: 10px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 10px 28px rgba(19, 17, 14, .22); font-size: 14px; }
.dz-bar-c { flex: 1 1 auto; min-width: 8em; font-family: var(--mono); font-size: 12px; color: var(--ink2); overflow-wrap: anywhere; }
.dz-bar .btn { min-height: 38px; padding: 0 14px; border-radius: 19px; letter-spacing: .05em; }
.dz-bar-x { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
html.has-dzbar .ftr-in { padding-bottom: 110px; }
html.has-dzbar .insbar { display: none; }
html.has-dzbar .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- 报错 / 催更面板 ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.sheet-mask { position: absolute; inset: 0; background: rgba(19, 17, 14, .5); }
.sheet { position: relative; width: min(500px, 100%); max-height: 88vh; overflow-y: auto; padding: 0 22px calc(24px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .22); }
@media (min-width: 700px) { .sheet-wrap { align-items: center; padding: 16px; } .sheet { border-radius: 14px; padding-bottom: 22px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 8px; }
.sheet-title { margin: 0; font-family: var(--kai); font-size: 23px; font-weight: 400; letter-spacing: .06em; }
.sheet-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; background: none; color: var(--ink2); cursor: pointer; }
.sheet-wide { width: min(560px, 100%); }
.sheet-body { padding-bottom: 6px; }
html.sheet-on { overflow: hidden; }
.dz-form { gap: 12px; }
.dz-coord-k { margin: 0; font-size: 12px; letter-spacing: .12em; color: var(--accent); }
.dz-coord { margin: -6px 0 0; font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--ink2); overflow-wrap: anywhere; }
.dz-quote { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--hl); font-family: var(--kai); font-size: 19px; line-height: 1.7; letter-spacing: .06em; }
.dz-types { gap: 8px; margin-bottom: 12px; }
.chip-r { position: relative; display: inline-flex; }
.chip-r input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip-r span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 18px; font-size: 14px; color: var(--ink2); cursor: pointer; }
.chip-r input:checked + span { border-color: var(--pill-on-bg); background: var(--pill-on-bg); color: var(--pill-on-ink); }
.chip-r input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.dz-cui-only { display: none; margin: 0; font-size: 15px; line-height: 1.8; color: var(--ink2); }
.sheet-wrap[data-kind="cui"] .dz-cui-only { display: block; }
.sheet-wrap[data-kind="cui"] .dz-err-only { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ts-box { min-height: 65px; }
.ts-box:empty { display: none; }

/* ---------- 检索结果 ---------- */
.page-search .search { margin-bottom: 26px; }
.hits { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule2); }
.hits li { padding: 14px 0; border-bottom: 1px solid var(--rule2); }
.hit-t { display: block; font-family: var(--kai); font-size: 20px; line-height: 1.7; letter-spacing: .06em; }
.hit-m { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.hit-m .code { font-size: 12px; }
.hits-jx { border-top-color: var(--accent); }
.hit-jx { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: baseline; }
.hit-jx .tag-jx-s { grid-row: span 2; }
.hit-more { margin: 10px 0 0; font-size: 14px; }
.hit-more a, .search-note a { color: var(--accent); }
.hit-works { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--rule2); border-radius: 10px; background: var(--surface); }
.hit-works a { font-size: 16px; }
.hit-works small { margin-left: 4px; font-family: var(--mono); font-size: 12px; color: var(--accent); }
.jx-mini { padding: 0 6px; border: 1px solid var(--accent); border-radius: 4px; font-size: 11px; color: var(--accent); }
.search-count { margin: -4px 0 12px; font-size: 13px; color: var(--muted); }
.search-note { margin: -4px 0 14px; font-size: 13px; color: var(--muted); }
.facet { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.facet-k { flex: none; font-size: 13px; letter-spacing: .15em; color: var(--muted); }

/* ---------- 开放接口页 ---------- */
.page-kaifang .prose code { overflow-wrap: anywhere; word-break: break-all; }
.page-kaifang .prose a { overflow-wrap: anywhere; word-break: break-all; }
.copy-line { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0 14px; padding: 10px 12px; border: 1px solid var(--rule2); border-radius: 6px; background: var(--field); }
.copy-line code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 14px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; word-break: break-all; }
.copy-btn { flex: none; min-height: 32px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 16px; background: transparent; font-size: 13px; color: var(--ink2); cursor: pointer; }
.copy-btn:hover, .copy-btn:focus-visible { border-color: var(--accent); color: var(--accent); }

/* ---------- 页脚（日间深色底，和官网一样；夜间一条细线） ---------- */
.ftr { margin-top: 24px; background: var(--ftr-bg); border-top: 1px solid var(--ftr-rule); color: var(--ftr-ink); font-family: var(--sans); }
.ftr-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 28px 32px 40px; font-size: 14px; }
.ftr-credit { color: var(--ftr-strong); letter-spacing: .3em; }
.ftr-nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
.ftr-nav a { padding: 10px 0; color: var(--ftr-ink); }
.ftr-nav a:hover { color: var(--ftr-hover); }
.ftr-note { flex-basis: 100%; margin: 0; }

/* ---------- 后台登录 ---------- */
.auth { padding: 40px 32px 80px; }
.auth-card { max-width: 460px; margin: 0 auto; padding: 28px; background: var(--surface); border: 1px solid var(--tile-border); border-radius: 12px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink2); }
.field small { color: var(--muted); }
.input { width: 100%; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--field); color: var(--ink); font: inherit; font-size: 16px; }
.input:focus { outline: none; border-color: var(--accent); }
textarea.input { resize: vertical; line-height: 1.7; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink2); }
.form-msg { margin: 0; font-size: 14px; color: var(--muted); }
.form-msg.is-error { color: var(--accent); }

/* ---------- 装到桌面、断网 ---------- */
.app-hero { max-width: 46em; }
.app-icon { display: block; margin: 8px 0 18px; border-radius: 18px; }
.app-done { margin: 0 0 20px; padding: 10px 14px; border-radius: 8px; background: var(--hl); }
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.app-sec { padding: 22px 24px; background: var(--surface); border: 1px solid var(--tile-border); border-radius: 12px; }
.app-eyebrow { margin: 0 0 6px; font-size: 13px; color: var(--accent); }
.app-h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; letter-spacing: .06em; }
.app-steps { margin: 0; padding: 0; list-style: none; }
.app-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule2); }
.app-steps li:last-child { border-bottom: 0; }
.app-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 13px; background: var(--pill-on-bg); color: var(--pill-on-ink); font-size: 13px; }
.app-t { flex: 1; font-size: 15px; line-height: 1.7; }
.app-ico { flex: none; color: var(--ink2); }
.app-blue, .app-add { color: #2F6FD6; }
.app-add { font-weight: 600; }
.app-p { margin: 0 0 12px; font-size: 15px; line-height: 1.8; color: var(--ink2); }
.app-small { margin-top: 12px; font-size: 13px; color: var(--muted); }
.app-qr { width: 180px; margin: 8px 0; padding: 10px; background: #FDFBF6; border-radius: 10px; }
.app-qr svg { display: block; width: 100%; height: auto; }
.app-url { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.app-wx { margin: 18px 0 0; padding: 12px 14px; border-radius: 8px; background: var(--hl); font-size: 14px; }
@media (max-width: 760px) { .app-desk { display: none; } }
.offline-mark { display: block; margin-bottom: 16px; }
.offline-list { margin: 0 0 8px; padding-left: 1.2em; line-height: 2; }
.offline-list a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* 打开网站时的「放到手机桌面」提示条，和点「添加」后的说明面板（和学社官网一样） */
.insbar { position: fixed; left: 10px; right: 10px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 55; display: flex; align-items: center; gap: 12px; padding: 12px 6px 12px 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 10px 28px rgba(19, 17, 14, .22); transform: translateY(16px); opacity: 0; transition: transform .25s, opacity .25s; }
.insbar.is-on { transform: none; opacity: 1; }
.insbar img { flex: none; width: 44px; height: 44px; border-radius: 11px; }
.insbar-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.insbar-main strong { font-size: 15px; line-height: 1.4; }
.insbar-main span { font-family: var(--sans); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insbar-add { flex: none; height: 40px; padding: 0 16px; border: 0; border-radius: 20px; background: var(--accent); color: var(--accent-ink); font-family: var(--seal-font); font-size: 17px; letter-spacing: .12em; cursor: pointer; }
.insbar-x { flex: none; width: 40px; height: 44px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
html.has-insbar .ftr-in { padding-bottom: 110px; }
html.has-insbar .toast { bottom: calc(112px + env(safe-area-inset-bottom)); }
.ins-head { display: flex; gap: 14px; align-items: flex-start; }
.ins-head img { flex: none; border-radius: 14px; }
.ins-head p { margin: 0; font-size: 15px; line-height: 1.8; color: var(--ink2); }
.ins-steps { margin: 14px 0 0; padding: 0; list-style: none; }
.ins-steps li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--rule2); font-size: 15px; line-height: 1.6; }
.ins-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 12px; background: var(--pill-on-bg); color: var(--pill-on-ink); font-size: 13px; }
.ins-p { margin: 14px 0 0; font-size: 15px; line-height: 1.8; }
.ins-wx { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--hl); font-size: 13px; line-height: 1.7; }
.ins-btns { margin-top: 18px; }

/* ---------- 提示条 ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 20px; border-radius: 22px; background: var(--ink); color: var(--bg); font-size: 14px; }

@media (max-width: 520px) {
  .page, .auth, .notice-page { padding-left: 18px; padding-right: 18px; }
  .ftr-in { padding: 28px 18px 36px; }
  .page-title { font-size: 25px; }
  .title-sub { display: block; margin: 2px 0 0; font-size: 15px; }
  .search-box input { height: 46px; padding: 0 12px; font-size: 16px; }
  .search-btn { padding: 0 16px; }
  .hm-card { padding: 16px; }
  .dz-txt .s { gap: 10px; padding: 12px 2px; }
  .fig-mark { padding-left: calc(2em + 12px); }
  .read-tools { gap: 10px 14px; }
  .work-dl { grid-template-columns: 80px 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .insbar { transition: none; } }

/* ---------- 打印（阅读页印出来读）：一律横排、黑字白底，夜间也一样 ---------- */
@media print {
  :root, :root[data-theme], :root:not([data-theme="day"]) {
    --bg: #fff !important; --surface: #fff !important; --field: #fff !important;
    --ink: #111 !important; --ink2: #333 !important; --body: #222 !important; --muted: #555 !important; --faint: #666 !important;
    --rule: #bbb !important; --rule2: #ddd !important; --accent: #8E2F22 !important; --accent-d: #8E2F22 !important;
    --hl: transparent !important; --sel: transparent !important; --fig-filter: none !important;
    color-scheme: light;
  }
  body { background: #fff; }
  .hdr, .ftr, .skip, .read-tools, .flag, .chap-nav, .crumbs, .insbar, .sheet-wrap, .toast, .search, .dz-bar, .fig-go, .work-acts, .preview-bar { display: none !important; }
  :root[data-dir="v"] .dz-frame { padding: 0 !important; border: 0 !important; }
  .dz-vnote { display: none !important; }
  :root[data-dir="v"] .dz-txt { writing-mode: horizontal-tb !important; height: auto !important; overflow: visible !important; border: 0 !important; background: none !important; }
  :root[data-dir="v"] .fig-mark { display: flex !important; }
  :root[data-dir="v"] .fig-card { display: none !important; }
  :root[data-dir="v"] .dz-fig { width: auto !important; height: auto !important; }
  .wrap { max-width: none; padding-left: 0; padding-right: 0; }
  a { color: inherit; text-decoration: none; }
  .dz-txt .s, .dz-fig { break-inside: avoid; }
  .read-h, h2.dz-h { break-after: avoid; }
}
