
:root{
  --bg:#faf8f3; --fg:#1f2320; --muted:#6b746d; --line:#e2dccf;
  --accent:#8a4f3d; --card:#f2efe8; --radius:10px;
  --fs:17px; --lh:1.85;
}
html[data-size="s"]{--fs:15px;--lh:1.8}
html[data-size="m"]{--fs:17px;--lh:1.85}
html[data-size="l"]{--fs:19.5px;--lh:1.9}
html[data-theme="dark"]{
  --bg:#14171a; --fg:#ddd8cd; --muted:#8b857a; --line:#2c3136;
  --accent:#c98f77; --card:#1c2024;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;background:var(--bg);color:var(--fg);
  width:100%;max-width:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB",
              "Microsoft YaHei","Source Han Sans SC",sans-serif;
  font-size:var(--fs);line-height:var(--lh);
  -webkit-text-size-adjust:100%;
  padding-bottom:calc(90px + env(safe-area-inset-bottom));
  transition:background .25s,color .25s;
}
header{
  position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:10px;
  padding:10px 14px;padding-top:calc(10px + env(safe-area-inset-top));
  background:var(--bg);
  border-bottom:1px solid var(--line);
  opacity:.98;
}
header .ttl{flex:1;font-size:14px;font-weight:600;letter-spacing:.02em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}
header button{
  appearance:none;border:1px solid var(--line);background:transparent;color:var(--fg);
  width:38px;height:38px;border-radius:10px;font-size:16px;line-height:1;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
}
header button:active{background:var(--card)}
#progress{position:fixed;top:0;left:0;height:2.5px;width:0;background:var(--accent);
  z-index:40;transition:width .12s linear}
#toc{
  position:fixed;inset:0 auto 0 0;width:min(84vw,360px);z-index:50;
  background:var(--bg);border-right:1px solid var(--line);
  transform:translateX(-102%);transition:transform .28s cubic-bezier(.4,0,.2,1);
  overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:calc(16px + env(safe-area-inset-top)) 0 40px;
}
#toc.open{transform:translateX(0)}
#toc .hd{padding:6px 20px 16px;border-bottom:1px solid var(--line);margin-bottom:8px}
#toc .hd b{display:block;font-size:17px;margin-bottom:4px}
#toc .hd span{font-size:12.5px;color:var(--muted)}
#toc ul{list-style:none;margin:0;padding:0}
#toc a{display:block;padding:11px 20px;color:var(--fg);text-decoration:none;font-size:15px}
#toc a:active{background:var(--card)}
#toc .part>a{font-weight:600;color:var(--accent);font-size:13px;letter-spacing:.04em;
  padding-top:18px;padding-bottom:6px}
#toc .chapters a{padding-left:34px;font-size:14.5px}
#mask{position:fixed;inset:0;background:rgba(0,0,0,.38);z-index:45;opacity:0;
  pointer-events:none;transition:opacity .25s}
#mask.open{opacity:1;pointer-events:auto}
main{max-width:760px;margin:0 auto;padding:0 18px}
article{padding-top:18px}
h1{font-size:1.55em;line-height:1.35;letter-spacing:.01em;margin:1.9em 0 .5em;
  padding-bottom:.35em;border-bottom:2px solid var(--accent)}
article>h1:first-of-type{margin-top:.4em;font-size:1.85em;border:0;padding:0}
h2{font-size:1.28em;line-height:1.4;margin:2.1em 0 .6em;
  padding-left:.6em;border-left:4px solid var(--accent)}
h3{font-size:1.08em;margin:1.6em 0 .45em;color:var(--accent)}
p{margin:0 0 1em;text-align:justify;word-break:break-word}
/* 长不可断串是全书的隐患：2026-11-10 主笔在答案里写了一串
   (0.82+0.85+…) 共 41 字符，没有空格，在 320 视口下撑出 93px 横向溢出，
   而这一串在 li 里——上面那条只盖了 p，li/td 全漏。「六宽度与顶栏」关就是被它卡住的。
   不靠作者每处加空格，这里统一给正文的 li 与 td 开断词。 */
li,td,dd{word-break:break-word}
strong{font-weight:600}
em{font-style:normal;background:var(--card);padding:0 .2em;border-radius:3px}
hr{border:0;border-top:1px solid var(--line);margin:2em 0}
ul,ol{margin:0 0 1.1em;padding-left:1.35em}
li{margin:.32em 0}
li::marker{color:var(--accent)}
blockquote.quote{margin:1.1em 0;padding:.85em 1em;background:var(--card);
  border-left:3px solid var(--accent);border-radius:0 var(--radius) var(--radius) 0;
  font-size:.96em;line-height:1.75}
blockquote.quote p:last-child{margin-bottom:0}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;
  margin:1.1em 0;border:1px solid var(--line);border-radius:var(--radius)}
figure.fig{margin:1.25em 0;padding:.55em .25em .35em;border:1px solid var(--line);
  border-radius:var(--radius);background:#fffdf8;text-align:center}
figure.fig svg{width:100%;height:auto;max-width:500px;display:block;margin:0 auto}
figure.fig figcaption{margin-top:.45em;font-size:.82em;color:var(--muted);line-height:1.5}
html[data-theme="dark"] figure.fig{background:#f7f4ee;border-color:#3a3f44}
html[data-theme="dark"] figure.fig figcaption{color:#5d6b5f}
/* 图内动效：默认静止（光点不可见），点击播一次、停在最后一帧。
   路径复用图里已有的箭头坐标，不另画。 */
@keyframes flowmove{from{offset-distance:0%}to{offset-distance:100%}}
.flow{opacity:0}
@supports (offset-path:path("M0 0")){
  .flow-c{offset-path:path("M163.6 38 L195.6 38 M199.6 38 L335.6 38")}
  .flow-i{offset-path:path("M218 41 L196 41 M118 41 L96 41")}
  .flow-f{offset-path:path("M296 58L335 40L380 76L425 40L458 52")}
  .flow-d{offset-path:path("M46.00 90.05 L68.56 89.30 L91.11 87.57 L113.67 84.53 L136.22 80.49 L158.78 75.98 L181.33 71.29 L271.56 52.22 L361.78 33.11 L384.33 28.33 L406.89 26.23 L429.44 24.51 L452.00 22.98")}
  .flow-play{opacity:.95;animation:flowmove 3.6s linear forwards}
}
figure.fig svg[tabindex]{cursor:pointer;-webkit-tap-highlight-color:transparent}
@media (prefers-reduced-motion:reduce){
  svg *{animation:none!important}
}
table{border-collapse:collapse;width:100%;font-size:.86em;line-height:1.6}
th,td{padding:.62em .8em;text-align:left;border-bottom:1px solid var(--line);
  white-space:nowrap}
th{background:var(--card);font-weight:600;color:var(--accent)}
tr:last-child td{border-bottom:0}
code{background:var(--card);padding:.12em .35em;border-radius:4px;font-size:.9em;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
pre{background:var(--card);padding:.9em 1em;border-radius:var(--radius);
  overflow-x:auto;font-size:.86em;line-height:1.65}
pre code{background:0;padding:0}
#topBtn{position:fixed;right:16px;bottom:calc(24px + env(safe-area-inset-bottom));
  width:44px;height:44px;border-radius:50%;border:1px solid var(--line);
  background:var(--bg);color:var(--fg);font-size:18px;z-index:25;
  opacity:0;pointer-events:none;transition:opacity .2s}
#topBtn.show{opacity:1;pointer-events:auto}
#sizeSheet{position:fixed;left:0;right:0;bottom:0;z-index:60;background:var(--bg);
  border-top:1px solid var(--line);border-radius:16px 16px 0 0;
  padding:18px 20px calc(24px + env(safe-area-inset-bottom));
  transform:translateY(102%);transition:transform .26s cubic-bezier(.4,0,.2,1)}
#sizeSheet.open{transform:translateY(0)}
#sizeSheet .row{display:flex;gap:10px;margin-top:12px}
#sizeSheet .row button{flex:1;padding:13px 0;border:1px solid var(--line);
  border-radius:10px;background:transparent;color:var(--fg);font-size:16px}
#sizeSheet .row button[aria-pressed="true"]{border-color:var(--accent);
  color:var(--accent);font-weight:600}
#sizeSheet .lbl{font-size:13px;color:var(--muted)}
/* 搜索面板 */
#search{position:fixed;inset:0;z-index:70;background:var(--bg);
  transform:translateY(-102%);transition:transform .26s cubic-bezier(.4,0,.2,1);
  display:flex;flex-direction:column}
#search.open{transform:translateY(0)}
#search .bar{display:flex;gap:10px;align-items:center;
  padding:calc(10px + env(safe-area-inset-top)) 14px 10px;
  border-bottom:1px solid var(--line)}
#search input{flex:1;appearance:none;border:1px solid var(--line);border-radius:10px;
  background:var(--card);color:var(--fg);font-size:16px;padding:11px 13px;outline:none}
#search input:focus{border-color:var(--accent)}
#search .bar button{appearance:none;border:0;background:transparent;color:var(--accent);
  font-size:15px;padding:8px 4px;cursor:pointer}
#results{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;
  margin:0;padding:6px 0 calc(40px + env(safe-area-inset-bottom));list-style:none}
#results li{padding:12px 16px;border-bottom:1px solid var(--line);cursor:pointer}
#results li:active{background:var(--card)}
#results .rh{font-size:12px;color:var(--accent);margin-bottom:5px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#results .rt{font-size:14.5px;line-height:1.65;color:var(--fg);
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
#results mark{background:rgba(201,143,119,.35);color:inherit;border-radius:2px;padding:0 1px}
#results .empty{padding:40px 20px;text-align:center;color:var(--muted);font-size:14px}
.hit{animation:hitflash 2.2s ease-out}
@keyframes hitflash{0%,35%{background:rgba(201,143,119,.32)}100%{background:transparent}}
/* 阶段 1b：练习旁的「标记为已练」。写 gtx-progress-v1，进度页立刻能看到。 */
.mkdone{appearance:none;display:inline-block;margin:8px 0 16px;padding:9px 15px;
  border:1px solid var(--line);border-radius:99px;background:var(--card);
  color:var(--muted);font:inherit;font-size:13.5px;line-height:1;cursor:pointer}
.mkdone:active{background:var(--bg)}
.mkdone:disabled{opacity:.65;cursor:default}
html[data-theme="dark"] .mkdone{background:#1c2024;border-color:#3a4148;color:#8b857a}
/* 前置提示（非硬锁）：目录里的「前置」小标记 + 底部可关闭提示条 */
.prebadge{font-style:normal;font-size:9.5px;letter-spacing:.02em;color:var(--accent);
  border:1px solid currentColor;border-radius:3px;padding:0 3px;margin-left:6px;vertical-align:1px}
.prebox{position:fixed;left:10px;right:10px;z-index:60;
  bottom:calc(14px + env(safe-area-inset-bottom));
  background:var(--card);border:1px solid var(--line);border-radius:12px;
  padding:13px 14px 11px;box-shadow:0 10px 28px rgba(0,0,0,.22)}
.prebox-t{font-size:14px;font-weight:600;margin-bottom:5px}
.prebox-b{font-size:12.5px;color:var(--muted);line-height:1.6;margin-bottom:10px}
.prebox-a{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.prebox-a button{appearance:none;font:inherit;font-size:13px;line-height:1;border-radius:99px;
  padding:9px 13px;cursor:pointer;border:1px solid var(--line);background:var(--bg);color:var(--fg)}
.prebox-a .pb-go{border-color:var(--accent);color:var(--accent)}
.prebox-a .pb-x{margin-left:auto;border:0;background:transparent;font-size:18px;
  line-height:1;padding:4px 8px;color:var(--muted)}
html[data-theme="dark"] .prebox-a button{background:#242a2f;border-color:#3a4148}
/* Safari 11–14 兜底：这批浏览器不认 scroll-padding-top/标准名 scroll-margin-top，
   只认旧名 scroll-snap-margin-top（caniuse：Safari 11–14 用的是 scroll-snap-* 前缀名）。
   而 @supports not 命中的正是它们——所以两个名字都要写，只写标准名等于兜底没写。
   69px = 59px 顶栏 + 10px 标题留白，与启用时的总量一致；它只在「不认 scroll-padding-top」
   的浏览器里生效，支持的浏览器走 calc(59px + env(...))，两者不会叠加。 */
@supports not (scroll-padding-top: 1px) {
  article h1[id], article h2[id], article h3[id] {
    scroll-snap-margin-top: 69px;
    scroll-margin-top: 69px;
  }
}
/* 术语注释 */
.term{border-bottom:1px dashed rgba(201,143,119,.62);cursor:pointer;padding-bottom:.5px}
html[data-theme="dark"] .term{border-bottom-color:rgba(201,143,119,.55)}
#termCard{position:fixed;left:8px;right:8px;bottom:0;z-index:66;background:var(--bg);
  border:1px solid var(--line);border-bottom:0;border-radius:16px 16px 0 0;
  padding:18px 20px calc(26px + env(safe-area-inset-bottom));
  transform:translateY(104%);transition:transform .24s cubic-bezier(.4,0,.2,1);
  box-shadow:0 -10px 36px rgba(0,0,0,.14)}
#termCard.open{transform:translateY(0)}
#termCard .tt{font-size:16px;font-weight:700;color:var(--accent);margin-bottom:5px;letter-spacing:.02em}
#termCard .tf{font-size:13px;color:var(--muted);margin-bottom:11px;line-height:1.5}
#termCard .td{font-size:15px;line-height:1.72;color:var(--fg)}
#termCard .tc{position:absolute;top:12px;right:16px;font-size:20px;color:var(--muted);
  background:0;border:0;padding:4px 6px;cursor:pointer}

#sizeSheet .row button[data-theme-mode] {
white-space: nowrap;
font-size: 15px;
}
@media (prefers-color-scheme: dark) {
html:not([data-theme-mode]) {
--bg: #14171a;
--fg: #ddd8cd;
--muted: #8b857a;
--line: #2c3136;
--accent: #c98f77;
--card: #1c2024;
}
}
html {
scroll-padding-top: calc(59px + env(safe-area-inset-top, 0px));
scroll-behavior: smooth;
}
article h1[id],
article h2[id],
article h3[id] {
scroll-margin-top: 10px;
}
@media (prefers-reduced-motion: reduce) {
html { scroll-behavior: auto; }
}
#toc .secs {
list-style: none;
margin: 0;
padding: 0;
display: none;
}
#toc li.open > .secs { display: block; }
#toc .secs a {
padding: 8px 20px 8px 50px;
font-size: 13.5px;
line-height: 1.45;
color: var(--muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
#toc li.has-secs { position: relative; }
#toc .tw {
position: absolute;
left: 2px;
top: 3px;
width: 32px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
border: 0;
background: 0;
padding: 0;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
#toc .tw::before {
content: '';
width: 0;
height: 0;
border-left: 5px solid var(--muted);
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
transition: transform .18s;
}
#toc li.open > .tw::before { transform: rotate(90deg); }
#toc .tw:active { opacity: .55; }
#toc a[aria-current] {
color: var(--accent);
font-weight: 600;
position: relative;
}
#toc a[aria-current]::before {
content: '';
position: absolute;
left: 0;
top: 6px;
bottom: 6px;
width: 3px;
border-radius: 0 2px 2px 0;
background: var(--accent);
}
#toc .secs a[aria-current]::before { top: 4px; bottom: 4px; }
@media (prefers-reduced-motion: reduce) {
#toc .tw::before { transition: none; }
}
#tocSearch {
display: block;
width: 100%;
margin-top: 12px;
padding: 9px 12px;
font-size: 14px;
text-align: left;
color: var(--muted);
background: var(--card);
border: 1px solid var(--line);
border-radius: 8px;
cursor: pointer;
}
#tocSearch:active { color: var(--accent); }
html header #progress {
position: absolute;
top: auto;
bottom: -1px;
height: 3.5px;
border-radius: 0;
transition: none;
}
@media (prefers-reduced-motion: reduce) {
html header #progress { transition: none; }
}
article a[href^="#"] {
color: inherit;
text-decoration: none;
border-bottom: 1px solid rgba(138, 79, 61, .38);
padding-bottom: 1px;
}
html[data-theme="dark"] article a[href^="#"] {
border-bottom-color: rgba(201, 143, 119, .38);
}
article a[href^="#"]:active {
border-bottom-color: var(--accent);
}
@media print {
article a[href^="#"] { border-bottom: 0; }
}
@media (max-width: 560px) {
.term-table { overflow-x: visible; }
.term-table table,
.term-table tbody,
.term-table tr,
.term-table td {
display: block;
width: auto;
}
.term-table thead { display: none; }
.term-table tr {
padding: 3px 11px 4px;
border-bottom: 1px solid var(--line);
}
.term-table tr:last-child { border-bottom: 0; }
.term-table td {
display: inline;
white-space: normal;
border: 0;
padding: 0;
}
.term-table td:nth-child(1) {
font-weight: 600;
font-size: 14.5px;
}
.term-table td:nth-child(2) {
margin-right: .4em;
font-size: 13px;
color: var(--muted);
}
.term-table td:nth-child(3) {
font-size: 13.5px;
line-height: 1.45;
}
.term-table .term { padding-bottom: 1px; }
}
.pgbar {
display: flex;
gap: 4px;
padding: 7px 10px 5px;
background: var(--card);
}
.pgbar a {
display: flex;
flex: 1;
align-items: center;
height: 12px;
-webkit-tap-highlight-color: transparent;
}
.pgbar a::before {
content: '';
flex: 1;
height: 4px;
border-radius: 2px;
background: var(--line);
transition: background .15s;
}
.pgbar a.on::before { background: var(--accent); }
.pgbar a:active::before { background: var(--accent); }
@media (prefers-reduced-motion: reduce) {
.pgbar a::before { transition: none; }
}
@media print {
.pgbar { display: none; }
}
.pgnav{display:flex;gap:6px;align-items:center;padding:8px 10px;background:var(--card);border-bottom:1px solid var(--line);font-size:13px;margin:0 0 6px}.pgnav a{color:var(--accent);text-decoration:none;padding:5px 8px;border:1px solid var(--line);border-radius:8px;white-space:nowrap;font-size:12px}.pgnav .cur{flex:1;min-width:0;text-align:center;color:#5f6861;font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}html[data-theme="dark"] .pgnav .cur{color:#9a948a}.pgnav .what{padding:0 12px 8px;font-size:12px;color:var(--muted);line-height:1.6}#booktoc h3{margin-top:1.2em}#booktoc ul{margin:.4em 0 0;padding-left:1.3em}#booktoc li{margin:.25em 0}#booktoc a{color:var(--fg);text-decoration:none}#booktoc .tocnote{font-size:12px;color:var(--muted);line-height:1.7;margin:.2em 0 1em}#booktoc .cn{color:var(--muted);font-size:.86em;font-weight:400}#booktoc hr.tocsep{margin:1.8em 0 1em;border:0;border-top:1px dashed var(--line)}#booktoc li.one>a{font-weight:600}.chnav{margin:22px 0 10px;padding-top:14px;border-top:1px dashed var(--line);text-align:right;font-size:13.5px}.chnav a{color:var(--accent);text-decoration:none;font-weight:600}.chnav a:hover{text-decoration:underline}