/* 我的书房：样式照搬郑大钱会员阅读库（只保留白天模式和经典排版），自己加的部分在文件末尾 */
/* ========== 主题色 ========== */
:root {
  --bg: #F6F2EC;
  --surface: #FFFFFF;
  --surface-2: #FBF8F4;
  --text: #26211D;
  --text-2: #4D463F;
  --muted: #8C8379;
  --line: #E7DFD4;
  --accent: #9E3A46;
  --accent-soft: #F5E5E4;
  --on-accent: #FFFFFF;
  --ok: #2F7D5B; --ok-soft: #E2F1E9;
  --warn: #A86A12; --warn-soft: #FBEFD9;
  --danger: #B42318; --danger-soft: #FBE6E3;
  --shadow: 0 1px 2px rgba(45, 33, 22, .05), 0 10px 30px rgba(45, 33, 22, .07);
  --wm: rgba(70, 55, 40, .085);
  --fs: 15px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --top-h: 52px;
  --toc-w: 312px;
  color-scheme: light;
}
/* ========== 基础 ========== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: pan-x pan-y; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; transition: background-color .25s, color .25s; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-line; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .12em; color: var(--muted); }
[hidden] { display: none !important; }

.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--text-2); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-btn .i-moon { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .1s, background .2s, opacity .2s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { opacity: .92; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-ghost-danger:hover { background: var(--danger-soft); }
.btn-block { width: 100%; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .6; cursor: default; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.dot-on { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); vertical-align: 1px; }

/* ========== 授权码入口 / 提示页 ========== */
.landing { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.landing-top { display: flex; justify-content: flex-end; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 12px; }
.landing-main { flex: 1; display: grid; place-items: center; padding: 16px 16px max(48px, env(safe-area-inset-bottom)); }
.landing-card { width: 100%; max-width: 420px; padding: 36px 28px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); text-align: center; }
.seal { display: inline-grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.seal svg { width: 24px; height: 24px; }
.landing-title { margin: 6px 0 6px; font-size: 30px; line-height: 1.25; letter-spacing: .04em; }
.landing-title.small { font-size: 22px; }
.landing-sub { margin: 0 0 24px; color: var(--muted); }
.code-form { display: grid; gap: 12px; }
.code-input { width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); text-align: center; font-family: var(--mono); font-size: 19px; letter-spacing: .14em; text-transform: uppercase; outline: none; transition: border-color .2s, box-shadow .2s; }
.code-input::placeholder { font-family: var(--sans); font-size: 15px; letter-spacing: .04em; color: var(--muted); text-transform: none; }
.code-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.landing-card .btn-primary { height: 50px; font-size: 16px; }
.landing-card > .code-input { margin-bottom: 12px; letter-spacing: .04em; text-transform: none; font-family: var(--sans); }
.form-error { margin: 4px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 14px; text-align: left; white-space: pre-line; }
.landing-notes { margin: 22px 0 0; padding: 16px 0 0; border-top: 1px dashed var(--line); list-style: none; text-align: left; color: var(--muted); font-size: 13px; }
.landing-notes li { position: relative; padding-left: 14px; margin: 4px 0; }
.landing-notes li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }

/* ========== 阅读页 ========== */
.reader { background: var(--bg); }
.read-progress { position: fixed; z-index: 40; left: 0; right: 0; top: 0; height: 2px; pointer-events: none; }
.read-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
.topbar { position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 4px; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid transparent; transition: transform .28s ease, border-color .2s, background-color .25s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar.hide { transform: translateY(-100%); }
.top-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.top-doc { font-size: 11px; color: var(--muted); letter-spacing: .1em; }
.top-chap { max-width: 100%; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page { padding: calc(var(--top-h) + env(safe-area-inset-top) + 20px) max(20px, env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.article, .pager { max-width: 700px; margin: 0 auto; }
.chap-head { padding: 24px 0 28px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.chap-head h1 { margin: 10px 0 10px; font-size: calc(var(--fs) * 1.6); line-height: 1.35; letter-spacing: .02em; }
.chap-meta { margin: 0; font-size: 13px; color: var(--muted); }

.prose { font-size: var(--fs); line-height: 1.9; color: var(--text); letter-spacing: .01em; overflow-wrap: break-word; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.prose p { margin: 0 0 1.05em; text-align: justify; }
.prose h2 { margin: 2.2em 0 .8em; font-size: 1.32em; line-height: 1.45; scroll-margin-top: calc(var(--top-h) + env(safe-area-inset-top) + 16px); }
.prose h3 { margin: 1.9em 0 .7em; font-size: 1.14em; line-height: 1.5; scroll-margin-top: calc(var(--top-h) + env(safe-area-inset-top) + 16px); }
.prose h4 { margin: 1.6em 0 .6em; font-size: 1.02em; color: var(--text-2); scroll-margin-top: calc(var(--top-h) + env(safe-area-inset-top) + 16px); }
/* 小节标题上方原来有一道短横线，紧贴「一、」时容易被看成「一」，各样式都不再显示 */
.prose h2::before { content: none; }
.prose strong { color: var(--text); font-weight: 700; background: linear-gradient(transparent 62%, var(--accent-soft) 62%); }
.prose blockquote { margin: 1.3em 0; padding: .9em 1.1em; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--surface); color: var(--text-2); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose li > p { margin: 0 0 .4em; }
.prose hr { margin: 2.4em auto; width: 40%; border: 0; border-top: 1px dashed var(--line); }
.prose mark { background: var(--warn-soft); color: inherit; padding: 0 .15em; border-radius: 3px; }
.prose img { display: block; max-width: 100%; height: auto; margin: 1.4em auto; border-radius: 12px; pointer-events: none; }
.prose table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.4em 0; border-collapse: collapse; font-size: .86em; line-height: 1.65; }
.prose th, .prose td { padding: .55em .7em; border: 1px solid var(--line); text-align: left; vertical-align: top; min-width: calc(var(--fs, 15px) * 7); text-indent: 0; text-wrap: wrap; }
.prose th:first-child, .prose td:first-child { min-width: calc(var(--fs, 15px) * 6); font-weight: 600; }
.prose th { background: var(--surface-2); }
.prose code { padding: .1em .35em; border-radius: 5px; background: var(--surface-2); font-family: var(--mono); font-size: .88em; }
.prose a { color: var(--accent); }
.prose .flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-decoration: none; transition: border-color .2s, transform .15s; }
.pager-card:hover { border-color: var(--accent); }
.pager-card:active { transform: scale(.99); }
.pager-card.next { text-align: right; align-items: flex-end; }
.pager-k { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); }
.pager-k svg { width: 16px; height: 16px; }
.pager-t { max-width: 100%; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager-end { grid-column: 2; align-self: center; text-align: right; color: var(--muted); }

/* 目录 */
.toc { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(86vw, 360px); display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); transform: translateX(-102%); transition: transform .3s cubic-bezier(.2,.8,.2,1); padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); }
.toc.open { transform: none; box-shadow: var(--shadow); }
.toc-head { display: flex; align-items: flex-start; gap: 8px; padding: 22px 14px 12px 22px; }
.toc-head > div { flex: 1; min-width: 0; }
.toc-title { margin: 4px 0 4px; font-size: 20px; }
.toc-meta { margin: 0; font-size: 12px; color: var(--muted); }
.toc-overall { height: 3px; margin: 0 22px 8px; border-radius: 3px; background: var(--line); overflow: hidden; }
.toc-overall i { display: block; height: 100%; background: var(--accent); }
.toc nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 10px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.toc-list, .toc-sub { list-style: none; margin: 0; padding: 0; }
.toc-chap { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--text-2); font-size: 14.5px; line-height: 1.45; }
.toc-chap:hover { background: var(--surface-2); color: var(--text); }
.toc-n { flex: none; width: 1.8em; font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }
.toc-list .current > .toc-chap { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.toc-list .current > .toc-chap .toc-n { color: var(--accent); }
.toc-sub { margin: 4px 0 8px 2.6em; border-left: 1px solid var(--line); }
.toc-sub a { display: block; padding: 5px 10px; font-size: 13px; line-height: 1.45; color: var(--muted); text-decoration: none; border-radius: 0 8px 8px 0; }
.toc-sub a:hover { color: var(--text); background: var(--surface-2); }
.toc-sub .lv3 a { padding-left: 22px; font-size: 12.5px; }
.toc-sub a.on { color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(15, 10, 5, .38); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.open { opacity: 1; pointer-events: auto; }

/* 字号面板 */
.type-pop { position: fixed; z-index: 35; top: calc(var(--top-h) + env(safe-area-inset-top) + 6px); right: max(10px, env(safe-area-inset-right)); width: 300px; max-width: calc(100vw - 20px); padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.type-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.type-row + .type-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.type-row > span { font-size: 13px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button, .seg button { min-width: 40px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: pointer; font-size: 14px; }
.stepper output { min-width: 32px; text-align: center; font-family: var(--mono); font-size: 14px; }
.seg { display: flex; gap: 4px; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: var(--shadow); animation: up .3s ease; }
.toast span { white-space: normal; line-height: 1.5; }
.toast button { border: 0; padding: 6px 10px; border-radius: 9px; background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
@keyframes up { from { opacity: 0; transform: translate(-50%, 8px); } }
/* iPad：更宽的留白、更大的字 */
@media (min-width: 700px) {
  :root { --fs: 19px; }
  .page { padding-left: 48px; padding-right: 48px; }
  .chap-head { padding-top: 40px; }
}
/* 电脑 / iPad 横屏：目录常驻左侧 */
@media (min-width: 1180px) {
  .toc { transform: none; width: var(--toc-w); box-shadow: none; z-index: 20; }
  .toc-close, .toc-btn, .scrim { display: none; }
  .topbar { left: var(--toc-w); }
  .page { margin-left: var(--toc-w); }
  .top-title { align-items: flex-start; padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.home-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); }
.home-main { max-width: 1080px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-right)) calc(56px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.home-hero { padding: 20px 4px 22px; }
/* 阅读页目录里的「我的文档」 */
.toc-home { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 10px -4px; padding: 4px 8px 4px 2px; border-radius: 8px; font-size: 13px; color: var(--muted); text-decoration: none; }
.toc-home:hover { color: var(--accent); background: var(--surface-2); }
.toc-home svg { width: 16px; height: 16px; }
.topbar a.icon-btn { text-decoration: none; }

/* ========== 划线和笔记 ========== */
.prose mark.hl { background: none; color: inherit; padding: 0; border-radius: 0; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); text-decoration-thickness: 2px; text-underline-offset: .28em; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; background-image: linear-gradient(color-mix(in srgb, var(--accent) 9%, transparent), color-mix(in srgb, var(--accent) 9%, transparent)); cursor: pointer; }
.prose mark.hl.has-note { text-decoration-style: wavy; text-decoration-thickness: 1.5px; }
.prose mark.hl.flash { animation: flash 1.6s ease; }
.sel-menu { position: absolute; z-index: 40; display: flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--text); box-shadow: var(--shadow); }
.sel-menu[hidden], .sheet[hidden] { display: none; }
.sel-menu button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--bg); font-size: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.sel-menu button { position: relative; }
.sel-menu button + button::before { content: ""; position: absolute; left: -1px; top: 28%; bottom: 28%; width: 1px; background: color-mix(in srgb, var(--bg) 22%, transparent); }
.sel-menu button:active { background: color-mix(in srgb, var(--bg) 16%, transparent); }

.notes { position: fixed; z-index: 50; top: 0; bottom: 0; right: 0; width: min(90vw, 400px); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); transform: translateX(102%); transition: transform .3s cubic-bezier(.2,.8,.2,1); padding-top: env(safe-area-inset-top); padding-right: env(safe-area-inset-right); }
.notes.open { transform: none; box-shadow: var(--shadow); }
.notes-head { display: flex; align-items: flex-start; gap: 8px; padding: 22px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.notes-head > div { flex: 1; min-width: 0; }
.notes-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 16px 16px; overscroll-behavior: contain; }
.notes-list .empty { margin: 40px 8px; color: var(--muted); text-align: center; font-size: 14px; line-height: 1.8; }
.notes-chap { margin: 18px 4px 8px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.note-item { padding: 12px 14px 8px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.note-q { margin: 0; padding-left: 10px; border-left: 2px solid var(--accent); font-size: 14.5px; line-height: 1.75; color: var(--text); }
.note-t { margin: 8px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; }
.note-t::before { content: "笔记："; color: var(--accent); }
.note-act { display: flex; justify-content: flex-end; gap: 2px; margin-top: 6px; }
.note-act button { padding: 4px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.note-act button:hover { background: var(--surface); color: var(--text); }
.notes-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.notes-foot .btn { padding: 0 6px; }

.sheet { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: rgba(15, 10, 5, .38); }
.sheet-card { width: 100%; max-width: 560px; padding: 18px 18px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: var(--shadow); animation: up .25s ease; }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet-card { border-radius: 18px; } }
.sheet-quote { margin: 0 0 12px; padding: 2px 0 2px 12px; border-left: 2px solid var(--accent); color: var(--text-2); font-size: 14px; line-height: 1.7; max-height: 30vh; overflow-y: auto; }
.sheet textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 16px; line-height: 1.6; resize: vertical; outline: none; }
.sheet textarea:focus { border-color: var(--accent); }
.sheet-act { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.sheet-act span { flex: 1; }
@media print { .notes, .sel-menu, .sheet { display: none !important; } }
.note-row { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.7; }
.notes.open ~ .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
.sel-layer { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 15; pointer-events: none; }
.sel-layer i { position: absolute; border-radius: 3px; background: color-mix(in srgb, var(--accent) 24%, transparent); }

:root { --shelf-top: #E6D7BF; --shelf-mid: #D5C09E; --shelf-edge: #BFA77F; }
.resume { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.resume-cover { flex: none; display: grid; place-items: center; width: 44px; height: 60px; border-radius: 3px 6px 6px 3px; color: rgba(255,255,255,.92); font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 18px; background: linear-gradient(90deg, rgba(0,0,0,.22) 0 4px, rgba(255,255,255,.12) 4px 5px, transparent 5px), linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: 0 4px 10px -4px rgba(0,0,0,.35); }
.resume-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.resume-k { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.resume-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-go { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.resume-go svg, .book-lock svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.shelf { --gap-x: 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(124px, calc((100% - 2 * var(--gap-x)) / 3)), 1fr)); gap: 30px var(--gap-x); padding: 30px 22px 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.book { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.book-stand { position: relative; display: block; padding: 0 8%; }
/* 书架隔板：每本书下面一块，向两边延伸到整行，被书架容器裁掉 */
.book-stand::after { content: ""; position: absolute; left: -100vw; right: -100vw; bottom: -10px; height: 10px; background: linear-gradient(var(--shelf-top) 0 3px, var(--shelf-mid) 3px 7px, var(--shelf-edge) 7px); z-index: 0; }
.book-cover { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; aspect-ratio: 3 / 4.1; padding: 12% 10% 9%; border-radius: 3px 8px 8px 3px; color: #fff;
  background:
    linear-gradient(90deg, rgba(0,0,0,.28) 0 6%, rgba(255,255,255,.16) 6% 7%, rgba(0,0,0,.05) 7% 9%, transparent 9%),
    radial-gradient(120% 80% at 70% 10%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 10px 18px -8px rgba(30,15,5,.55), 0 2px 4px rgba(30,15,5,.18);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
.book-cover::before { content: ""; position: absolute; inset: 7% 8% 6% 13%; border: 1px solid rgba(255,255,255,.28); border-radius: 2px; pointer-events: none; }
.book-brand { position: relative; font-size: 10px; letter-spacing: .3em; opacity: .8; white-space: nowrap; }
.book-title { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; margin: 6% 0; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-weight: 700; font-size: clamp(14px, 3.8vw, 21px); letter-spacing: .06em; line-height: 1.45; text-align: center; text-wrap: wrap; text-shadow: 0 2px 8px rgba(0,0,0,.25); overflow: hidden; word-break: break-all; }
.book-foot { position: relative; font-size: 10px; letter-spacing: .2em; opacity: .75; }
.book-lock { position: absolute; z-index: 2; bottom: 6%; right: 8%; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.22); color: #fff; }
.book-lock svg { width: 15px; height: 15px; }
.book-new { position: absolute; z-index: 3; top: -9px; right: -7px; padding: 2px 8px; border-radius: 999px; background: #E8B44C; color: #4A3209; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; box-shadow: 0 3px 8px -2px rgba(0,0,0,.3); }
.book:hover .book-cover, .book:focus-visible .book-cover { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 16px 24px -10px rgba(30,15,5,.6), 0 2px 4px rgba(30,15,5,.18); }
.book:active .book-cover { transform: translateY(-1px); }
.book-info { display: flex; flex-direction: column; gap: 3px; padding: 4px 8% 0; }
.book-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.book-sub { font-size: 12px; color: var(--muted); }
.book-bar { display: block; height: 3px; margin-top: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.book-bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
/* ========== 防止只剩一两个字单独换行 ==========
   短的说明文字：各行长度均衡（balance）；正文段落：避免最后一行只剩一个字（pretty）；
   单行标签类：不换行，放不下就省略号 */
p, li, .modal-text, .contact-tip, .cel-line, .landing-sub, .code-hint, .plain-card span, .landing-notes span, .book-sub, .greet-hi, .welcome-tag { text-wrap: wrap; }
.contact-tip, .cel-line, .cel-title, .modal-text, .book-name, .modal-card h2, .landing-sub, .landing-title, .code-hint, .landing-notes span, .plain-card span, .contact-card h2, .shelf-title, .form-error, .pause-card h2, .pause-note, .empty, .toast span { text-wrap: wrap; }
.resume-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 书名固定占两行高度，一行的书名也留出第二行，这样同一排书的「已读 / 未开始」和进度条水平对齐 */
.book-name { min-height: calc(1.35em * 2); }

/* ========== 封面：经典精装（取代奶油撞色） ========== */
.book-cover.cover-a { container-type: inline-size; align-items: center; justify-content: space-between; padding: 12% 9% 9% 15%; text-align: center; color: #fff; border-radius: 2px 6px 6px 2px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.28) 0 7%, rgba(255,255,255,.16) 7% 8%, rgba(0,0,0,.05) 8% 10%, transparent 10%),
    radial-gradient(120% 80% at 75% 8%, rgba(255,255,255,.16), transparent 60%),
    linear-gradient(160deg, var(--sc), color-mix(in srgb, var(--sc) 52%, #120808));
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 10px 18px -8px rgba(30,15,5,.55), 0 2px 4px rgba(30,15,5,.18); }
.book-cover.cover-a::before { content: ""; display: block; position: absolute; inset: 6% 6% 5% 13%; border: 1px solid rgba(255,255,255,.3); border-radius: 2px; pointer-events: none; }
.ca-series { position: relative; max-width: 100%; font-size: max(7.5px, 8.5cqw); letter-spacing: .2em; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-title { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; margin: 6% 0; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-weight: 700; line-height: 1.32; letter-spacing: .03em; text-shadow: 0 2px 8px rgba(0,0,0,.25); text-wrap: wrap; word-break: break-all; overflow: hidden; }
.ca-title.t-xs { font-size: 26cqw; }
.ca-title.t-s { font-size: 18.5cqw; }
/* ========== 一行 4 本 ========== */
.shelf-books { --gap-x: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px var(--gap-x); }
.shelf-books .book-stand { padding: 0 4%; }
.shelf-books .book-info { padding: 2px 4% 0; }
.shelf-books .book-name { font-size: 13px; }
.shelf-books .book-sub { font-size: 11.5px; }
.book-new { top: -8px; right: -6px; padding: 1px 6px; font-size: 9.5px; }
@media (min-width: 720px) { .shelf-books { --gap-x: 26px; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 30px var(--gap-x); } .shelf-books .book-name { font-size: 14.5px; } }
@media (max-width: 520px) { .series-row { padding: 16px 12px 18px; } .shelf-books { --gap-x: 10px; gap: 22px var(--gap-x); } }
/* 经典精装：按封面内宽重新分配字号（4 本一行时书名也够大） */
.book-cover.cover-a { padding: 11% 7% 8% 14%; }
.book-cover.cover-a::before { inset: 5% 5% 4% 12%; }
.ca-title { margin: 4% 0; letter-spacing: 0; line-height: 1.28; }
.ca-title.t-xs { font-size: 34cqw; }
.ca-title.t-s { font-size: 24cqw; }
.ca-title.t-m { font-size: 24cqw; }
.ca-title.t-l { font-size: 23cqw; }
.ca-title.t-xl { font-size: 17cqw; line-height: 1.22; }
.ca-series, .ca-foot { font-size: max(7px, 11cqw); letter-spacing: .12em; }
.shelf-books .book-name { font-size: 12px; line-height: 1.35; }
@media (min-width: 720px) { .shelf-books .book-name { font-size: 14px; } }
/* 正文不使用「均衡/美化断行」：它会提前断行，再配合两端对齐，字距被拉散（2026-11-14 修复） */
.prose p, .prose li, .prose blockquote, .prose blockquote p { text-wrap: wrap; }
/* 换行规则见 public/static/fit.js：正常换行；只有最后一行剩 1~2 个字时，把这一句的字号略微缩小让它收回去 */
.prose h2, .prose h3, .prose h4, .reader-head h1, article h1, .toc-t, .toc-sub a, .toc-title, .book-name, .book-pre, .ca-title { text-wrap: wrap; }

/* ========== 继续阅读：书签式卡片 ========== */
.resume.rs { position: relative; align-items: stretch; gap: 16px; padding: 16px 14px 16px 16px; overflow: hidden; }
.rs-cover { flex: none; width: 66px; align-self: center; filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); }
.rs-cover .book-cover { width: 100%; }
.rs-cover .ca-series { visibility: hidden; }
.resume.rs .resume-body { gap: 0; justify-content: center; }
.rs-flag { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--sc); }
.rs-flag::before { content: ""; width: 6px; height: 9px; background: var(--sc); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
.rs-book { margin-top: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume.rs .resume-t { margin-top: 3px; font-size: 15.5px; line-height: 1.4; font-weight: 700; color: var(--text); white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.rs-prog { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.rs-prog .book-bar { flex: 1; height: 3px; margin: 0; }
.rs-prog .book-bar i { background: var(--sc); }
.rs-prog b { flex: none; font-size: 11px; font-weight: 600; color: var(--sc); font-variant-numeric: tabular-nums; }
.rs-meta { margin-top: 5px; display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rs-go { flex: none; align-self: center; display: grid; place-items: center; width: 22px; color: var(--muted); }
.rs-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.resume.rs:active { transform: scale(.99); }

/* ---------- 主页「我的笔记」入口 ---------- */
.nb-entry { display: flex; align-items: center; gap: 12px; margin: 16px 0 22px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-decoration: none; color: inherit; }
.nb-entry:active { transform: scale(.99); }
.nb-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.nb-ic svg, .nb-go svg, .nb-back svg, .nb-act a svg, .nb-blank-ic svg, .nb-search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nb-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nb-tx b { font-size: 15px; }
.nb-tx small { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nb-go { flex: none; display: grid; place-items: center; color: var(--muted); }
.nb-entry.is-empty .nb-ic { background: var(--surface-2); color: var(--muted); }

/* ---------- 我的笔记页 ---------- */
.nb-back { display: inline-flex; align-items: center; gap: 2px; padding: 6px 8px 6px 2px; color: var(--text-2); text-decoration: none; font-size: 15px; }
.nb-main { max-width: 720px; }
.nb-hero { padding: 8px 2px 4px; }
.nb-hero h1 { margin: 0; font-size: 26px; letter-spacing: .02em; }
.nb-sum { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.nb-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.nb-actions .btn { min-height: 40px; padding: 0 6px; font-size: 14px; }
.nb-tools { position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 5; display: flex; gap: 8px; align-items: center; margin: 18px -4px 6px; padding: 8px 4px; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.nb-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.nb-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nb-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; -webkit-appearance: none; appearance: none; }
.nb-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.nb-seg { flex: none; display: flex; gap: 0; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.nb-seg button { min-width: 0; height: 30px; padding: 0 11px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.nb-seg button.on { background: var(--accent); color: var(--on-accent); }
.nb-book { margin-top: 18px; padding: 16px 14px 6px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.nb-bh { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.nb-cover { flex: none; align-self: flex-start; width: 48px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.16)); }
.nb-cover .book-cover { width: 100%; }
.nb-cover .ca-series, .nb-cover .ca-title, .nb-cover .ca-lines, .nb-cover .ca-vol { visibility: hidden; }
.nb-bt { flex: 1; min-width: 0; }
.nb-name { margin: 0; font-size: 16px; line-height: 1.4; }
.nb-count { margin: 3px 0 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nb-series { margin: 0 0 2px; font-size: 11.5px; color: var(--sc); font-weight: 600; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-exp { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.nb-exp button { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 12px; cursor: pointer; }
.nb-chap { margin: 16px 2px 8px; padding-left: 9px; border-left: 3px solid var(--sc); font-size: 13px; line-height: 1.45; font-weight: 600; color: var(--text-2); }
.nb-item { margin-bottom: 10px; padding: 12px 14px 8px; border-radius: 12px; background: var(--surface-2); }
.nb-q { margin: 0; font-size: 15px; line-height: 1.8; color: var(--text); }
.nb-n { margin: 10px 0 0; padding: 8px 10px; border-radius: 9px; background: color-mix(in srgb, var(--sc) 9%, transparent); font-size: 13.5px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; }
.nb-n span { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--sc); }
.nb-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.nb-foot time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nb-act { display: flex; align-items: center; gap: 2px; }
.nb-act button, .nb-act a { display: inline-flex; align-items: center; gap: 1px; padding: 5px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12.5px; text-decoration: none; cursor: pointer; }
.nb-act a { color: var(--sc); }
.nb-act a svg { width: 14px; height: 14px; }
.nb-none { margin-top: 32px; }
.nb-tail { margin: 28px 0 0; text-align: center; font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.nb-blank { margin: 12vh auto 0; max-width: 360px; text-align: center; }
.nb-blank-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); }
.nb-blank-ic svg { width: 26px; height: 26px; }
.nb-blank h1 { margin: 16px 0 8px; font-size: 22px; }
.nb-blank p { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.8; }

.resume + .nb-entry { margin-top: -10px; }

/* ---------- 正文按语义排版（build-content.mjs 的 semantic() 加的 class） ---------- */
/* 用 :root .prose 提高优先级，盖过各阅读风格里的 .prose p 外边距 */
:root .prose h3.ph, :root .prose h4.ph { text-align: left; }
:root .prose p.h-sub { margin: -.35em 0 1.1em; font-size: .9em; color: var(--muted); text-align: left; }
:root .prose p.lead { margin-bottom: .5em; font-weight: 600; text-align: left; }
:root .prose p.scene { margin: 1.7em 0 .7em; font-weight: 600; line-height: 1.6; text-align: left; }
.prose .scene-k { display: inline-block; margin-right: .5em; padding: .05em .55em; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: .8em; letter-spacing: .04em; vertical-align: .08em; }
:root .prose p.li { position: relative; margin-bottom: .55em; padding-left: 1.1em; text-align: left; }
.prose p.li::before { content: ""; position: absolute; left: .2em; top: .82em; width: .32em; height: .32em; border-radius: 50%; background: var(--accent); opacity: .75; }
.prose .pn { color: var(--accent); font-weight: 700; }
:root .prose p.en.pt { margin: 1.4em 0 .5em; font-weight: 700; text-align: left; }
:root .prose p.en.tight { margin-bottom: .5em; text-align: left; }
/* ✅ / ❌ 正反示例：标签行和后面的内容是相邻的几个块，拼成一张卡片 */
.prose .eg-ok { --eg: #3B8B6C; }
:root .prose .eg.eg { margin: 0; padding: .3em 1em; border: 0; border-left: 3px solid var(--eg); border-radius: 0; background: color-mix(in srgb, var(--eg) 7%, transparent); box-shadow: none; text-align: left; }
:root .prose .eg-k.eg-k { margin-top: 1.2em; padding-top: .75em; border-top-right-radius: 12px; }
:root .prose .eg-end.eg-end { margin-bottom: 1.3em; padding-bottom: .8em; border-bottom-right-radius: 12px; }
:root .prose ul.eg.eg, :root .prose ol.eg.eg { padding-left: 2.4em; }
.prose .eg-tag { display: inline-flex; align-items: center; gap: .4em; color: var(--eg); font-size: .82em; font-weight: 700; letter-spacing: .06em; }
.prose .eg-tag::before { content: "✓"; display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 50%; background: var(--eg); color: #fff; font-size: .82em; letter-spacing: 0; }
.prose .eg-bad .eg-tag::before { content: "✕"; }
.prose .eg-inline { display: block; margin-top: .25em; }
:root .prose p.eg-or.eg-or { padding-top: 0; padding-bottom: 0; font-size: .82em; color: var(--muted); }

/* ================= 我的书房自己的部分 ================= */
.empty { margin: 8px 0; padding: 20px; text-align: center; color: var(--muted); }
.link-btn { padding: 4px 6px; border: 0; background: none; color: var(--accent); font-size: 13px; cursor: pointer; }

/* 登录 */
.pw-input { text-transform: none; letter-spacing: .2em; font-family: var(--sans); }
.landing-tip { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); }

/* 书架页 */
.home-title { margin: 0; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 22px; letter-spacing: .1em; }
.home-count { font-size: 13px; color: var(--muted); }
.home-main { max-width: 860px; }
.home-main > .resume { margin-top: 6px; }
.shelf-sec { margin-top: 26px; }
.sec-h { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 12px; font-size: 17px; letter-spacing: .04em; }
.sec-h small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.shelf-books .book-sub { font-variant-numeric: tabular-nums; }
.book .book-info { flex: 1; }
.book .book-sub { margin-top: auto; }
.book-name { -webkit-line-clamp: 3; }
.ca-series:empty { visibility: hidden; }
.resume.rs { margin-bottom: 0; }

/* 阅读页 */
.topbar { gap: 2px; }
.top-title { padding: 0 4px; }
.toc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 22px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.toc-foot .link-btn:only-child { margin-left: auto; }
.notes-foot { grid-template-columns: 1fr 1fr; }
.notes-foot a.btn { text-decoration: none; }
.bn { margin: 12px 0 6px; padding: 12px 14px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.bn-k { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--accent); }
.bn-t { margin: 6px 0 0; font-size: 14px; line-height: 1.75; color: var(--text); white-space: pre-wrap; }
.bn-edit { display: block; margin: 6px 0 0 auto; padding: 4px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.bn-edit:hover { background: var(--surface); color: var(--text); }
.sheet-k { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .1em; color: var(--accent); }
.sel-layer i { background: color-mix(in srgb, var(--accent) 24%, transparent); }

/* 全部笔记页 */
.nb-cover { display: block; text-decoration: none; }
.nb-whole { margin-top: 14px; background: transparent; padding: 0; }
.nb-whole .nb-n { margin: 0; }
.nb-main { margin: 0 auto; }
.home-main > .resume + .nb-entry { margin-top: 12px; }
.shelf-books .book-name { min-height: 0; }

/* =====================================================================
   日杂风（2026-11-30）：生成り色纸张、低饱和大地色、宋体正文、
   英文小标签、虚线与纸胶带、文库本书皮、荧光笔式划线
   ===================================================================== */
:root {
  --bg: #F3EEE4;
  --surface: #FBF8F1;
  --surface-2: #F6F1E6;
  --text: #3A342D;
  --text-2: #5E554A;
  --muted: #9C9182;
  --line: #E0D6C4;
  --accent: #B0694E;            /* 砖红 */
  --accent-soft: #F1E2D8;
  --on-accent: #FFFDF8;
  --matcha: #7E8A5C;
  --tape: #E9D27A;              /* 纸胶带 / 荧光笔的芥末黄 */
  --shadow: 0 1px 0 rgba(90, 70, 40, .04), 0 6px 18px -10px rgba(90, 70, 40, .18);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif", serif;
  --en: "Didot", "Bodoni 72", "Georgia", "Times New Roman", serif;
  --fs: 16px;
}
body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.home, .landing { background: none; }
.eyebrow { letter-spacing: .16em; }
.home-en, .sec-h em, .rs-flag em, .chap-no em { font-family: var(--en); font-style: italic; font-weight: 400; letter-spacing: .06em; }

/* 按钮：细边框、纸感 */
.btn { border-radius: 999px; border-color: var(--line); background: var(--surface); font-weight: 500; letter-spacing: .06em; box-shadow: none; }
.btn-primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.icon-btn { border-radius: 50%; }
.icon-btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }

/* ---------- 登录 ---------- */
.landing-card { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow); position: relative; padding-top: 44px; }
.landing-card::before { content: ""; position: absolute; top: -11px; left: 50%; width: 96px; height: 22px; transform: translateX(-50%) rotate(-3deg); background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--tape) 85%, transparent) 0 8px, color-mix(in srgb, var(--tape) 65%, transparent) 8px 16px); opacity: .85; }
.landing .seal { border-radius: 50%; background: transparent; border: 1px dashed var(--accent); color: var(--accent); }
.landing .home-en { margin: 0; font-size: 14px; color: var(--muted); }
.landing-title { font-family: var(--serif); font-weight: 600; letter-spacing: .2em; font-size: 28px; }
.landing-sub { letter-spacing: .18em; font-size: 13px; }
.code-input { border-radius: 4px; background: var(--bg); border-style: dashed; }
.code-input:focus { box-shadow: none; border-style: solid; border-color: var(--text-2); }

/* ---------- 书架页头 ---------- */
.home-top { align-items: flex-end; padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line); }
.home-brand { display: flex; flex-direction: column; gap: 0; }
.home-en { margin: 0; font-size: 13px; color: var(--accent); }
.home-title { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: .22em; line-height: 1.3; }
.home-count { font-family: var(--en); font-style: italic; font-size: 14px; color: var(--muted); padding-bottom: 4px; }
.home-count b { font-size: 22px; font-weight: 400; color: var(--text); margin-right: 3px; }
.home-main { padding-top: 22px; }

/* 继续阅读：一张贴了纸胶带的卡片 */
.resume.rs { position: relative; overflow: visible; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.resume.rs::before { content: ""; position: absolute; top: -9px; right: 22px; width: 70px; height: 18px; transform: rotate(4deg); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--matcha) 55%, transparent) 0 6px, color-mix(in srgb, var(--matcha) 35%, transparent) 6px 12px); }
.rs-flag { flex-direction: column; align-items: flex-start; gap: 0; color: var(--accent); letter-spacing: .2em; }
.rs-flag::before { display: none; }
.rs-flag em { font-size: 14px; letter-spacing: .04em; }
.resume.rs .resume-t { font-family: var(--serif); font-weight: 600; letter-spacing: .04em; }
.rs-prog .book-bar { height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 7px); }
.rs-prog .book-bar i { background: var(--accent); }
.rs-prog b { color: var(--accent); font-family: var(--en); font-style: italic; font-weight: 400; font-size: 13px; }

.nb-entry { border-radius: 4px; border: 1px dashed var(--line); background: transparent; }
.nb-ic { border-radius: 50%; background: transparent; border: 1px solid var(--accent); }
.nb-tx b { font-family: var(--serif); font-weight: 600; letter-spacing: .1em; }

/* 分区标题：英文斜体 + 中文 + 一条虚线 */
.shelf-sec { margin-top: 34px; }
.sec-h { align-items: baseline; gap: 10px; margin: 0 2px 14px; font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: .18em; }
.sec-h em { font-size: 20px; color: var(--accent); letter-spacing: .02em; }
.sec-h small { margin-left: auto; font-family: var(--en); font-style: italic; letter-spacing: .04em; }
.sec-h::after { content: none; }
.shelf-sec .sec-h { padding-bottom: 8px; border-bottom: 1px dashed var(--line); }

/* 书架：不要木板和大卡片，书直接立在纸上，每排下面一条细线 */
.shelf, .shelf.shelf-books { padding: 6px 4px 0; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
.book-stand::after { left: -30px; right: -30px; bottom: -8px; height: 1px; background: var(--text-2); opacity: .55; }
.shelf.shelf-books { overflow: hidden; padding-left: 0; padding-right: 0; }
.book-info { padding-top: 10px; }
.book-name { font-family: var(--serif); font-weight: 600; letter-spacing: .04em; }
.book-sub { font-family: var(--en); font-style: italic; font-size: 12px; letter-spacing: .02em; }
.book-bar { height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 7px); }

/* ---------- 文库本书皮：素色布面 + 米白书名标签 ---------- */
.book-cover.cover-z { container-type: inline-size; display: flex; flex-direction: column; align-items: center; justify-content: space-between; aspect-ratio: 3 / 4.2; padding: 9% 9% 8%; border-radius: 1px 3px 3px 1px; color: #FFFDF6;
  background:
    linear-gradient(90deg, rgba(0,0,0,.16) 0 4%, rgba(255,255,255,.12) 4% 5%, transparent 5%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.03) 0 1px, transparent 1px 3px),
    var(--sc);
  box-shadow: 0 1px 1px rgba(60,40,20,.12), 3px 6px 12px -6px rgba(60,40,20,.35); }
.book-cover.cover-z::before { content: none; }
.cz-no { align-self: flex-start; margin-left: 4%; font-family: var(--en); font-style: italic; font-size: max(8px, 10cqw); letter-spacing: .04em; opacity: .85; }
.cz-label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6%; width: 84%; min-height: 46%; margin-left: 4%; padding: 10% 7%; background: #FBF7EE; color: #3A342D; box-shadow: 0 0 0 1px rgba(255,255,255,.4), inset 0 0 0 3px #FBF7EE, inset 0 0 0 4px color-mix(in srgb, var(--sc) 60%, #FBF7EE); }
.cover-z .ca-title { flex: none; margin: 0; width: 100%; font-family: var(--serif); font-weight: 700; color: #3A342D; text-shadow: none; letter-spacing: .04em; line-height: 1.3; }
.cover-z .ca-title.t-xs { font-size: 24cqw; }
.cover-z .ca-title.t-s { font-size: 17cqw; }
.cover-z .ca-title.t-m { font-size: 13.5cqw; }
.cover-z .ca-title.t-l { font-size: 12cqw; }
.cover-z .ca-title.t-xl { font-size: 10.5cqw; }
.cz-au { font-size: max(7px, 7.5cqw); letter-spacing: .14em; color: #8C8172; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cz-foot { margin-left: 4%; font-family: var(--en); font-size: max(6.5px, 7cqw); letter-spacing: .16em; opacity: .8; white-space: nowrap; }
.book:hover .book-cover, .book:focus-visible .book-cover { transform: translateY(-3px) rotate(-.6deg); box-shadow: 0 1px 1px rgba(60,40,20,.12), 5px 10px 16px -8px rgba(60,40,20,.4); }
.rs-cover .cz-no, .rs-cover .cz-foot, .rs-cover .cz-au, .nb-cover .cz-no, .nb-cover .cz-foot, .nb-cover .cz-au { visibility: hidden; }
.rs-cover .cover-z .ca-title, .nb-cover .cover-z .ca-title { font-size: 15cqw; }
.nb-cover .cz-label { min-height: 40%; }
.nb-cover .ca-title { visibility: visible; }

/* ---------- 阅读页 ---------- */
.reader { background-color: var(--bg); }
.read-progress i { background: var(--accent); height: 2px; }
.topbar { background: color-mix(in srgb, var(--bg) 90%, transparent); }
.topbar.scrolled { border-bottom: 1px dashed var(--line); }
.top-doc { font-family: var(--serif); letter-spacing: .16em; }
.top-chap { font-family: var(--serif); font-weight: 600; letter-spacing: .08em; }

.article, .pager { max-width: 640px; }
.chap-head { position: relative; padding: 36px 0 30px; margin-bottom: 26px; border-bottom: 0; text-align: center; }
.chap-head::after { content: "· · ·"; display: block; margin-top: 22px; color: var(--accent); letter-spacing: .6em; font-size: 14px; }
.chap-no { font-size: 13px; letter-spacing: .14em; color: var(--accent); }
.chap-no em { font-size: 18px; margin-right: 4px; }
.chap-no span { color: var(--muted); font-family: var(--en); font-style: italic; }
.chap-head h1 { margin: 14px 0 12px; font-family: var(--serif); font-weight: 600; letter-spacing: .12em; line-height: 1.5; font-size: calc(var(--fs) * 1.5); }
.chap-meta { font-family: var(--en); font-style: italic; letter-spacing: .04em; }

/* 正文：宋体、首行缩进两字、宽松行距 */
.prose { font-family: var(--serif); line-height: 2.05; letter-spacing: .05em; color: #3A342D; }
.prose p { margin: 0 0 .9em; text-indent: 2em; }
:root .prose p.lead, :root .prose p.scene, :root .prose p.li, :root .prose p.en, :root .prose p.h-sub, :root .prose p.eg, :root .prose li p, :root .prose blockquote p, :root .prose p:has(> img:only-child) { text-indent: 0; }
.prose h2 { margin: 2.6em 0 1em; font-size: 1.22em; font-weight: 600; letter-spacing: .1em; text-align: center; }
.prose h2::before { content: ""; display: block; width: 26px; height: 1px; margin: 0 auto .9em; background: var(--accent); }
.prose h3 { margin: 2.1em 0 .8em; padding-left: .7em; font-size: 1.08em; font-weight: 600; letter-spacing: .06em; border-left: 3px solid var(--matcha); line-height: 1.5; }
.prose h4 { font-weight: 600; letter-spacing: .04em; color: var(--accent); }
:root .prose h3.ph, :root .prose h4.ph { text-align: left; }
.prose strong { font-weight: 700; color: #2E2924; background: linear-gradient(transparent 64%, color-mix(in srgb, var(--tape) 55%, transparent) 64% 94%, transparent 94%); }
.prose blockquote { position: relative; margin: 1.6em 0; padding: 1.1em 1.3em 1em 1.3em; border: 1px dashed color-mix(in srgb, var(--text-2) 35%, transparent); border-left: 1px dashed color-mix(in srgb, var(--text-2) 35%, transparent); border-radius: 3px; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text-2); }
.prose blockquote::before { content: "“"; position: absolute; top: -.32em; left: .45em; padding: 0 .15em; font-family: var(--en); font-size: 2.2em; line-height: 1; color: var(--accent); background: var(--bg); }
.prose ul, .prose ol { padding-left: 1.6em; }
.prose ul li::marker { color: var(--accent); }
.prose ol li::marker { color: var(--accent); font-family: var(--en); font-style: italic; }
.prose hr { width: auto; border: 0; text-align: center; margin: 2.4em 0; }
.prose hr::after { content: "✻"; color: var(--accent); font-size: .9em; letter-spacing: 1em; }
.prose mark { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--tape) 60%, transparent) 55%); padding: 0; border-radius: 0; }
.prose img { border-radius: 2px; box-shadow: 0 6px 16px -10px rgba(60,40,20,.4); }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose th, .prose td { border-color: var(--line); }
.prose code { background: var(--surface-2); border: 1px solid var(--line); }
.prose .scene-k { border-radius: 2px; background: transparent; border: 1px solid var(--accent); }
.prose p.li::before { border-radius: 0; width: .38em; height: .38em; transform: rotate(45deg); background: var(--matcha); opacity: .8; }

/* 划线：荧光笔；有笔记的再加一条点线 */
.prose mark.hl { text-decoration: none; background-image: linear-gradient(transparent 52%, color-mix(in srgb, var(--tape) 70%, transparent) 52% 92%, transparent 92%); }
.prose mark.hl.has-note { text-decoration: underline dotted var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: .32em; }
.sel-layer i { background: color-mix(in srgb, var(--tape) 45%, transparent); }
.sel-menu { border-radius: 999px; padding: 4px 6px; }
.sel-menu button { border-radius: 999px; letter-spacing: .06em; }

/* 翻页 */
.pager { border-top: 1px dashed var(--line); }
.pager-card { border-radius: 4px; border: 1px solid var(--line); background: var(--surface); }
.pager-card:hover { border-color: var(--text-2); }
.pager-t { font-family: var(--serif); letter-spacing: .04em; }

/* 目录 / 笔记抽屉 / 弹层 */
.toc, .notes { background: var(--surface); }
.toc-title { font-family: var(--serif); font-weight: 600; letter-spacing: .1em; }
.toc-overall { height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 7px); }
.toc-t { font-family: var(--serif); letter-spacing: .03em; }
.toc-list .current > .toc-chap { background: transparent; color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 6px 6px 0; }
.toc-chap { border-radius: 6px; }
.type-pop { border-radius: 4px; }
.stepper button { border-radius: 999px; background: transparent; }
.bn { border-radius: 3px; background: color-mix(in srgb, var(--tape) 14%, var(--surface)); border-color: color-mix(in srgb, var(--tape) 70%, var(--line)); }
.bn-k { color: #9A7A1E; }
.note-item { border-radius: 4px; background: var(--bg); }
.note-q { border-left-color: var(--tape); border-left-width: 3px; font-family: var(--serif); }
.note-t::before { color: var(--accent); }
.sheet-card { border-radius: 6px 6px 0 0; }
@media (min-width: 600px) { .sheet-card { border-radius: 6px; } }
.sheet-quote { border-left: 3px solid var(--tape); font-family: var(--serif); }
.sheet textarea { border-radius: 4px; background: var(--bg); }
.toast { border-radius: 999px; padding-left: 18px; }

/* ---------- 全部笔记页 ---------- */
.nb-hero .home-en { font-size: 15px; }
.nb-hero h1 { font-family: var(--serif); font-weight: 600; letter-spacing: .18em; }
.nb-sum { font-family: var(--en); font-style: italic; }
.nb-search { border-radius: 999px; border-style: dashed; background: transparent; }
.nb-search:focus-within { box-shadow: none; border-style: solid; border-color: var(--text-2); }
.nb-seg { border-radius: 999px; background: transparent; }
.nb-seg button { border-radius: 999px; }
.nb-seg button.on { background: var(--text); color: var(--bg); }
.nb-book { position: relative; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.nb-book::before { content: ""; position: absolute; top: -9px; left: 26px; width: 64px; height: 18px; transform: rotate(-3deg); background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--sc) 45%, transparent) 0 7px, color-mix(in srgb, var(--sc) 28%, transparent) 7px 14px); }
.nb-bh { border-bottom: 1px dashed var(--line); }
.nb-name { font-family: var(--serif); font-weight: 600; letter-spacing: .08em; }
.nb-chap { border-left-width: 2px; font-family: var(--serif); letter-spacing: .06em; }
.nb-item { border-radius: 3px; background: var(--bg); }
.nb-q { font-family: var(--serif); letter-spacing: .04em; line-height: 1.95; }
.nb-n { border-radius: 3px; background: color-mix(in srgb, var(--tape) 16%, transparent); }
.nb-n span { color: #9A7A1E; }
.nb-whole .nb-n { background: color-mix(in srgb, var(--tape) 22%, transparent); border: 1px dashed color-mix(in srgb, var(--tape) 80%, var(--line)); }
.nb-blank h1 { font-family: var(--serif); letter-spacing: .14em; }
.nb-blank-ic { border-radius: 50%; background: transparent; border: 1px dashed var(--accent); }
.empty { font-family: var(--serif); }
.book-stand::after { left: -100vw; right: -100vw; }
.cover-z .ca-title { text-align: center; justify-content: center; }
.cover-z .ca-title.t-xs { font-size: 20cqw; }
.cover-z .ca-title.t-s { font-size: 13.5cqw; letter-spacing: .02em; }
.cover-z .ca-title.t-m { font-size: 11.5cqw; letter-spacing: 0; }
.cover-z .ca-title.t-l { font-size: 10.5cqw; letter-spacing: 0; }
.cover-z .ca-title.t-xl { font-size: 9cqw; letter-spacing: 0; }
.rs-cover .cover-z .ca-title, .nb-cover .cover-z .ca-title { font-size: 11cqw; }
/* 第五、六级小标题（如「（一）严男女之大防」）：和正文同大，加粗，砖红 */
.prose h5, .prose h6 { margin: 1.6em 0 .6em; font-size: 1em; font-weight: 600; letter-spacing: .06em; color: var(--accent); line-height: 1.6; }
.prose h6 { color: var(--text-2); }
