/* 纫兰全站样式（首版，2026-10-18；来自手机端设计稿）
   2026-11-07 起只有浅色：旧的深色配色太粗糙，整套砍掉，以后单独设计。颜色一律走下面的变量（绿色分两用，--green 给文字、线条和细进度，
   --green-fill 给按钮等大块填充，配 --on-green），新配色只要再加一块 :root[data-theme="dark"] 覆盖这些变量。
   书页：暖白纸面、兰叶绿、宋体中文标题、旧式衬线英文原文；数字用 Cormorant Garamond。
   变量取自 纫兰/public/shuye.css，加了纸纹、金色（只给会员和里程碑）。 */
/* 品牌变量由根布局的 theme.css 提供。 */

* { box-sizing: border-box; scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; }
/* 全站只隐藏滚动条外观，保留原有的滚动方式和溢出设置。 */
/* 单独滚动区域没显示完时，上下边缘淡出提示（ClientShell 加 fade-t / fade-b，并把淡出的长度写进 --fade-t / --fade-b）。
   淡出的长度跟着离那一头还有多远走，最长 48px（2026-11-10）：原来离开 4px 就整段 48px 淡出、回到头整段消失，
   弹层滚回顶部的最后一像素，最上面那行（标题）会从半透明突然变实，看着也是“到顶闪一下” */
.sheet .body, .pr-body, .card2 .scroll, .search-view { overscroll-behavior: contain; }
.fade-b { -webkit-mask-image: linear-gradient(#000 calc(100% - var(--fade-b, 48px)), transparent); mask-image: linear-gradient(#000 calc(100% - var(--fade-b, 48px)), transparent); }
.fade-t:not(.search-view) { -webkit-mask-image: linear-gradient(transparent, #000 var(--fade-t, 48px)); mask-image: linear-gradient(transparent, #000 var(--fade-t, 48px)); }
.fade-t.fade-b:not(.search-view) { -webkit-mask-image: linear-gradient(transparent, #000 var(--fade-t, 48px), #000 calc(100% - var(--fade-b, 48px)), transparent); mask-image: linear-gradient(transparent, #000 var(--fade-t, 48px), #000 calc(100% - var(--fade-b, 48px)), transparent); }
/* 最底层和纸面同色：下拉回弹、切页时露出来的不再是一道灰（11-08）；只有 480–600 之间手机栏居中时，两侧才用深一点的底色 */
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
@media (min-width: 480.02px) and (max-width: 599.98px) { html { background: var(--sunk); } }
body {
  position: relative;
  margin: 0 auto; max-width: var(--app-w); min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font: 15px/1.6 var(--sans-ui);
  -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums tabular-nums; line-break: strict; text-autospace: normal;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 300ms var(--ease), color 300ms var(--ease);
}
/* 纸纹：极淡的颗粒，只在底色上 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: var(--grain-op);
  background-image: var(--grain-img);
}
main { position: relative; z-index: 1; }
::selection { background: var(--mark); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 8px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(input, textarea, select) { font-family: inherit; } /* 没单独设字体的输入框也跟页面字体走，不用浏览器默认的黑体 */
a { color: inherit; text-decoration: none; }
img { display: block; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.xs { width: 15px; height: 15px; }
[x-cloak] { display: none !important; }
.nb { white-space: nowrap; }
.num { font-family: var(--num); font-weight: 500; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }

/* ===== 顶栏：只放操作，不放页名 ===== */
/* 毛玻璃画在一直存在的 ::before 上，滚动时只改它的透明度：不在滚动中途开关 backdrop-filter——iOS Safari 每开关一次就重建一次
   这一层，惯性滚动、回弹时重建，顶栏会卡在页面中间的旧位置（2026-11-07 书架页实测）。
   透明度直接跟着滚动位置走（2026-11-10）：离页顶 0 → --bar-fade 之间从无到有，回到页顶那一帧已经完全透明。
   原来是“滚过 6px 加类名，再花 240ms 淡入淡出”：滚回页顶后这条偏白的带子和底下的细线还留在那里，过一会儿才淡掉，看着就是页顶闪一下。
   能用滚动时间线的浏览器整个交给 CSS（合成线程上跟着滚动走，不经脚本，主线程忙也不晚）；不支持的由 client-shell.tsx 把同一个数写进 --bar-k。
   动画范围故意写到 100000px（比哪一页都长），渐变只占开头的 0.016%（= 16px，和 --bar-fade 是同一个数，改就两处一起改）：
   这样动画永远“还在进行”。范围要是只写 0 → 16px，滚过去动画就算放完了，Chromium 不再在合成线程上跑它——页面一打开就已经滚过
   这一段时（返回上一页恢复滚动位置、课时页自动对齐当前段），再滚回页顶这层底不跟着变，会一直留在页顶（2026-11-10 逐帧实测）。
   课时页顶栏（lesson.css 的 .lbar）用的是同一套。 */
.bar { position: sticky; top: 0; z-index: 30; isolation: isolate; display: flex; align-items: center; gap: 10px; height: calc(58px + var(--safe-t)); padding: var(--safe-t) 12px 0 var(--gutter); }
.bar::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 .5px 0 var(--hair-2); opacity: var(--bar-k, 0); }
@keyframes bar-in { 0% { opacity: 0; } .016%, 100% { opacity: 1; } }
/* 时长写死 auto：文末“减少动态效果”那条规则把所有动画的时长压成 1ms，这层底跟的是滚动位置、不是时间，不该受它影响 */
@supports (animation-timeline: scroll()) {
  .bar::before { animation: bar-in linear both; animation-timeline: scroll(root block); animation-range: 0px 100000px; animation-duration: auto !important; }
}
.spacer { flex: 1; }
.icon-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--ink); transition: background-color 160ms var(--ease), transform 140ms var(--ease); }
.icon-btn:active { transform: scale(.94); background: var(--sunk); }
.search-pill { flex: 1; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 21px; background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 .5px var(--hair-2); color: var(--ink-3); font-size: 15px; }
.search-pill input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 16px var(--sans-ui); color: var(--ink); }
.search-pill input::placeholder { color: var(--ink-3); }
.search-pill input::-webkit-search-cancel-button { -webkit-appearance: none; }
/* 输入框自己去掉了焦点框，焦点画在外层容器上（同登录页输入框的描边）：搜索框、问 AI 卡、“我的”页的兑换码和用户名框。
   只认里面的输入框获得焦点；登录页的 .field 是“标签 + 输入框”，输入框自己有描边，不在这里。 */
.search-pill:has(input:focus-visible) { box-shadow: var(--shadow-1), inset 0 0 0 1.5px var(--green); }
.askcard:has(textarea:focus-visible) { box-shadow: var(--shadow-2), inset 0 0 0 1.5px var(--green); }
.field:has(> input:only-child:focus-visible) { box-shadow: inset 0 0 0 1.5px var(--green); }
@supports not selector(:has(*)) {
  .search-pill:focus-within { box-shadow: var(--shadow-1), inset 0 0 0 1.5px var(--green); }
  .askcard:focus-within { box-shadow: var(--shadow-2), inset 0 0 0 1.5px var(--green); }
}

/* ===== 底部导航：毛玻璃，当前项有一块会滑动的底 =====
   条本身和整栏一样宽（中间档铺满整屏），四个标签（2026-11-11 起：首页、课程、书架、我的）排在正中最宽 --nav-max 内；左右内边距记在 --nav-pl / --nav-pr（横屏让开刘海），
   common.js 里滑动底的位置按同样的边距算。标签列等分，角标再宽也不把相邻标签挤窄。 */
.nav {
  --nav-pl: max(8px, calc((100% - var(--nav-max)) / 2), env(safe-area-inset-left, 0px));
  --nav-pr: max(8px, calc((100% - var(--nav-max)) / 2), env(safe-area-inset-right, 0px));
  position: fixed; z-index: 40; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-w); height: calc(var(--nav-h) + var(--safe-b)); padding: 0 var(--nav-pr) var(--safe-b) var(--nav-pl);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: 0 -.5px 0 var(--hair-2);
}
.nav a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; line-height: 1; color: var(--ink-3); transition: color 240ms var(--ease); }
.nav a svg.i { transition: transform 300ms var(--pop); }
.nav a.on { color: var(--green); font-weight: 500; }
.nav a:active svg.i { transform: scale(.88); }
.nav .pill { position: absolute; z-index: 0; top: 8px; height: 30px; width: 56px; margin-left: -28px; border-radius: 15px; background: var(--green-tint); transition: left 460ms var(--slide); }
.nav .badge { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--rust); color: var(--surface); font-size: 11px; line-height: 17px; text-align: center; font-weight: 500; }
.with-nav { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 28px); }
.nav .nav-brand, .nav .nav-search, .d-only { display: none; }
.nav .nav-search kbd { margin-left: auto; padding: 1px 7px; border-radius: 6px; box-shadow: inset 0 0 0 .5px var(--hair-2); font: 12px/1.5 var(--sans-ui); color: var(--ink-3); }

/* ===== 文字角色 ===== */
/* 标题和短段落不留只有一两个字的末行（中文标题最后两个字单独成行很难看）；个别标题另设 balance。
   成段的正文不用 pretty：Safari 的 pretty 按整段均衡行长，窄卡片里的长段中文会每行都缩短、右边空出一大块（2026-11-07 手机导读卡），
   所以导读、译文、讲解、解析这类长段落照常换行 */
h1, h2, h3, h4, p, li, figcaption { text-wrap: pretty; }
.intro p, p.intro, .zh, .peek-z, .an-zh, .explain, .zt-block p, .wk-intro, .sd-intro p, .about p, .fa-msg .ans p, .ans p, .usage, .kb-ans p, .lookup .usage, .rd p.en, .en { text-wrap: wrap; }
/* 英文标题按行均分（文库列表里的长标题不再拖一个词到最后一行） */
h2[lang="en"], h3[lang="en"] { text-wrap: balance; }
.display { margin: 0; font: 400 28px/1.3 var(--serif-zh); letter-spacing: .01em; text-wrap: balance; }
/* 阅读设置“英文字体：无衬线”（11-08 站长）：课时页、外刊阅读页的英文正文、标题、导语换成系统无衬线；中文标题仍是花园明朝 */
body.ff-sans { --serif-en: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, "PingFang SC", "Noto Sans SC", sans-serif; }
.h1 { margin: 0; font: 400 24px/1.34 var(--serif-zh); letter-spacing: .01em; text-wrap: pretty; }
.h2 { margin: 0; font: 400 19px/1.4 var(--serif-zh); }
.h3 { margin: 0; font: 400 17px/1.42 var(--serif-zh); }
.meta { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.sep { display: inline-block; width: 3px; height: 3px; margin: 0 7px 3px; border-radius: 50%; background: currentColor; opacity: .55; vertical-align: middle; }
.meta .sep { display: inline-block; width: 3px; height: 3px; margin: 0 7px 3px; border-radius: 50%; background: currentColor; opacity: .55; vertical-align: middle; }
.label { font-size: 13px; color: var(--ink-3); }
/* 难度写 CSE 等级（lib/cse.ts，2026-11-15 起；原来的入门、进阶、挑战三档不用了）。卡片里只是字；
   课时页开头那一处是按钮（components/cse.tsx）：样子和旁边的字一样，只多一道虚线下划线，点开是说明 */
.cse { padding: 0; border: 0; background: none; font: inherit; color: inherit; letter-spacing: .01em; cursor: pointer; text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, currentColor 60%, transparent); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.cse:hover { color: var(--ink-2); }
.cse:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 3px; }
.cse-sheet .about p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.8; color: var(--ink-2); }
.cse-sheet .about .h1 { margin: 0 0 12px; }
.cse-sheet .about p.label { font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }
.cse-t { width: 100%; margin: 2px 0 10px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.cse-t th, .cse-t td { padding: 9px 6px; text-align: center; font-weight: 400; box-shadow: inset 0 -.5px 0 var(--hair-2); }
.cse-t thead th { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.cse-t th:first-child { text-align: left; padding-left: 0; color: var(--ink-2); }
.cse-t tr.on th, .cse-t tr.on td { color: var(--green); font-weight: 500; }
.cse-sheet h4 { margin: 20px 0 4px; font-size: 15px; font-weight: 500; color: var(--ink); }
.cse-sheet ul { margin: 0; padding: 0; list-style: none; }
.cse-sheet li { display: flex; gap: 12px; padding: 9px 0; font-size: 14.5px; line-height: 1.7; color: var(--ink-2); box-shadow: inset 0 -.5px 0 var(--hair-2); }
.cse-sheet li:last-child { box-shadow: none; }
.cse-sheet li b { flex: none; min-width: 3.4em; font-weight: 500; color: var(--ink); }
.cse-sheet li.on b { color: var(--green); }
.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 var(--gutter); margin: 36px 0 14px; }
.sec .more { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; color: var(--ink-2); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== 图片 ===== */
.ph { position: relative; overflow: hidden; background: var(--sunk); border-radius: 16px; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--out); }
.course-visual img { transform: none !important; transition: none; }
.enter > .course-visual { animation: none; }
.ph::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 .5px rgba(30, 20, 5, .10); pointer-events: none; }
a:active .ph img { transform: scale(1.03); }

/* ===== 按钮 ===== */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: 25px; background: var(--green-fill); color: var(--on-green); font-size: 16px; font-weight: 500; letter-spacing: .02em; transition: background-color 160ms var(--ease), transform 160ms var(--ease); box-shadow: 0 1px 1px rgba(20, 40, 28, .12), 0 8px 18px -10px rgba(30, 60, 40, .5); }
.btn:active { transform: scale(.97); background: var(--green-press); }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), inset 0 0 0 .5px var(--hair-2); font-weight: 400; }
.btn.soft { background: var(--green-tint); color: var(--green); box-shadow: none; }
/* 并排的一组动作（主 + 次）：同高、同圆角、同字号，只靠填充与描边分主次 */
.btn.btn-line { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1px var(--green); font-weight: 500; }
.btn.btn-line:hover { background: var(--green-tint); filter: none; }
.btn.btn-line:active { background: var(--green-tint); }
.btn:focus-visible { border-radius: inherit; outline-offset: 3px; }
.btn-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
.btn-pair .btn { min-width: 0; height: 44px; padding: 0 16px; border-radius: 22px; font-size: 14px; font-weight: 500; letter-spacing: .02em; white-space: nowrap; }
.btn-pair .btn:not(.btn-line):not(.soft):not([disabled]) { box-shadow: 0 1px 2px rgba(20, 40, 28, .14); }
.btn.sm { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 19px; }
.btn[disabled] { background: var(--sunk); color: var(--ink-3); box-shadow: none; cursor: default; transform: none; }
.text-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 15px; color: var(--green); }
/* 点击区至少 44×44，看上去的大小不变：.hit 用 ::after 向四周扩到 44px（元素本来够大的方向不扩）。
   用了 .hit 的元素别再占用 ::after；“全部课程”这类小链接、分段按钮和加载失败块的“重试”（.btn.sm 高 38）直接套用。 */
.hit, .sec .more, .seg button, .load-err .btn { position: relative; }
.hit::after, .sec .more::after, .seg button::after, .load-err .btn::after { content: ""; position: absolute; top: min(0px, calc(50% - 22px)); bottom: min(0px, calc(50% - 22px)); left: min(0px, calc(50% - 22px)); right: min(0px, calc(50% - 22px)); }

/* ===== 卡片与设置组 ===== */
.card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-2); }
.group { margin: 0 12px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-1), inset 0 0 0 .5px var(--hair); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 16px; font-size: 16px; text-align: left; transition: background-color 160ms var(--ease); }
.row ~ .row { box-shadow: inset 0 .5px 0 var(--hair-2); }
.row .v { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 15px; color: var(--ink-3); white-space: nowrap; }
.row .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--sunk); color: var(--ink-2); flex: none; }
.row .ic svg.i { width: 17px; height: 17px; }
.row .t { flex: 1; min-width: 0; }
.row .t small { display: block; font-size: 13px; color: var(--ink-3); line-height: 1.4; }
.row:active { background: var(--surface-2); }
/* 设置组裁了圆角（overflow: hidden），焦点框画在行里面，不被裁掉 */
.group .row:focus-visible { outline-offset: -3px; border-radius: 14px; }

/* ===== 分段与标签 ===== */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 13px; background: var(--sunk); }
.seg button { position: relative; z-index: 1; height: 34px; font-size: 14px; color: var(--ink-2); transition: color 200ms var(--ease); }
.seg button.on { color: var(--ink); font-weight: 500; }
.seg .thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; border-radius: 10px; background: var(--surface); box-shadow: 0 1px 2px rgba(64, 48, 24, .1), 0 3px 8px -3px rgba(64, 48, 24, .14); transition: transform 380ms var(--slide); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--sunk); color: var(--ink-2); font-size: 12px; line-height: 1; white-space: nowrap; }
.tag.green { background: var(--green-tint); color: var(--green); }
.tag.gold { background: var(--gold-tint); color: var(--gold); }

/* ===== 开关 ===== */
.switch { position: relative; width: 50px; height: 30px; flex: none; border-radius: 15px; background: var(--hair-2); transition: background-color 240ms var(--ease); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform 340ms var(--pop); }
.switch.on { background: var(--green-fill); }
.switch.on::after { transform: translateX(20px); }

/* ===== 面板与提示 ===== */
.scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); animation: fade-in 260ms var(--ease) both; }
.sheet { position: fixed; z-index: 51; left: 50%; bottom: 0; width: 100%; max-width: var(--sheet-w); max-height: 88dvh; display: flex; flex-direction: column; background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-3); padding-bottom: var(--safe-b); animation: sheet-in 460ms var(--slide) both; }
.sheet .grip { width: 38px; height: 5px; border-radius: 3px; background: var(--hair-2); margin: 9px auto 4px; flex: none; }
.sheet .body { overflow-y: auto; padding: 8px var(--gutter) 20px; }
.sheet .foot { padding: 12px var(--gutter) 16px; box-shadow: 0 -.5px 0 var(--hair-2); }
/* 提示条：高于复习层 .rv（80）、低于封面转场（90）；长文字换行。位置由 --toast-b 决定：手机有底部导航的页面抬到导航之上，
   都算上 Home 指示条（--safe-b）；电脑版在底部居中 28px（见文末）。页面要避开自己的底部控件时，在 body 上改 --toast-b。
   common.js 的 toast() 用同一个元素（.lw-toast，常驻、空着时透明）；各页模板里旧的 .toast 照旧可用，内联的 bottom 仍然优先。
   提示条本身一律不挡点击（复习时压在评分按钮上、练习时压在“下一题/完成本课”上，BR-1），只有里面的动作按钮可点；长文字换行，不越出屏幕。 */
.toast { position: fixed; z-index: 85; left: 50%; bottom: calc(var(--toast-b, 24px) + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(var(--app-w) - 32px); padding: 12px 18px; border-radius: 22px; background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1.5; box-shadow: var(--shadow-3); white-space: normal; overflow-wrap: break-word; pointer-events: none; animation: toast-in 420ms var(--pop) both; }
.with-nav { --toast-b: calc(var(--nav-h) + 16px); }
.toast.lw-toast { animation: none; opacity: 0; transform: translate(-50%, 10px) scale(.97); transition: opacity 180ms var(--ease), transform 240ms var(--ease); }
.toast.lw-toast.on { opacity: 1; transform: translateX(-50%); transition: opacity 220ms var(--ease), transform 360ms var(--pop); }
.toast .act { pointer-events: auto; }
.toast.lw-toast:not(.on) .act { pointer-events: none; }
.toast .msg { min-width: 0; }
.toast.err .i { color: inherit; color: color-mix(in srgb, var(--rust) 55%, var(--bg)); }
/* 撤销、重试之类的动作：墨色底上一块淡底，点击区扩到 44px */
.toast .act { position: relative; flex: none; margin: -6px -8px -6px 2px; padding: 6px 10px; border-radius: 9px; background: color-mix(in srgb, currentColor 14%, transparent); font-size: 14px; font-weight: 500; white-space: nowrap; }
.toast .act::after { content: ""; position: absolute; inset: -6px -4px; }
.toast .act:active { background: color-mix(in srgb, currentColor 24%, transparent); }
/* 加载失败：一行原因 + 重试，不再一直转骨架。<div class="load-err" role="alert"><p><b>没加载出来</b>原因</p><button class="btn sm ghost">重试</button></div>
   窄处按钮换到下一行；重试中给按钮 disabled（沿用 .btn[disabled]）。 */
.load-err { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 16px 12px; padding: 16px 18px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 .5px var(--hair); font-size: 14px; line-height: 1.6; color: var(--ink-3); text-align: start; }
.load-err p { flex: 1 1 200px; min-width: 0; margin: 0; }
.load-err b { display: block; margin-bottom: 2px; font: 400 17px/1.4 var(--serif-zh); color: var(--ink); }
.load-err .btn { flex: none; }
/* 全屏浮层（复习、练习这类盖住整页的层）共用外框：手机和中间档占满视口，内容区最宽 --sheet-w、居中；
   两侧多出来的部分画成遮罩色的边，同时挡住下面页面的点击（点在两侧时 e.target 是浮层自己、e.offsetX 在内容区之外）。
   用法：浮层元素加 class="lw-full"，自己只写 z-index、背景、排版；max-width、margin、inset 交给它（这里的写法优先于页面同名规则）。
   电脑版不套，照旧由 desktop.css 改成居中对话框。 */
@media (max-width: 899.98px), (max-height: 559.98px) and (pointer: coarse) {
  :root .lw-full { position: fixed; inset: 0; width: auto; max-width: none; margin: 0; border: 0 solid var(--scrim); border-inline-width: calc((100vw - var(--sheet-w)) / 2); background-clip: padding-box; }
}
@keyframes sheet-in { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== 出场：主角先到，其余按阅读顺序跟上，带一点失焦 ===== */
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.enter > * { animation: rise 640ms var(--out) both; }
.enter > *:nth-child(2) { animation-delay: 60ms; }
.enter > *:nth-child(3) { animation-delay: 120ms; }
.enter > *:nth-child(4) { animation-delay: 180ms; }
.enter > *:nth-child(5) { animation-delay: 240ms; }
.enter > *:nth-child(n+6) { animation-delay: 300ms; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--out), transform 700ms var(--out); }
.reveal.in { opacity: 1; transform: none; }
/* 离开当前页：点下去就开始跳转，内容只淡到六成，新页提交前不出现空纸（不用 transform：会改动里面 fixed 元素的定位）。
   稍等 90ms 再淡：新页面已经预取好、马上就换的时候不闪一下 */
/* 页面切换中（html.lw-going）不做任何遮挡：原来把正文淡到六成，看着像“变灰一下”；改成进度线站长也不要（11-08） */

/* 拖窗口、转屏时宽度在变：过渡一律关掉，版式一步到位（common.js 在宽度变化时给 html 加 lw-resizing，停下 200ms 后去掉） */
.lw-resizing *, .lw-resizing *::before, .lw-resizing *::after { transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  /* 循环次数也压成 1：骨架、加载点、转圈这类 infinite 动画缩到 1ms 后不再每帧乱跳 */
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* 中间档（v2）：宽 600 以上、又不是电脑版——iPad mini 竖屏 744/756、Duo 内屏 626（或 669）与横屏 890、横屏手机 844/932。
   与 common.js 的 LW_MEDIUM 同一串查询；desktop.css 的 <link media> 不变，仍只给电脑版。
   仍是手机的交互结构（底部导航、底部面板、全屏浮层），只放宽：整页铺满不留两侧空条，正文与表单行宽 640 居中、左右留白 32，
   面板与全屏浮层最宽 640（两侧露出遮罩），导航条铺满、四个标签排在中间 560 内；字号整体上调一档，触控目标不变。
   左右留白至少让开安全区（SP-2）：横屏手机两侧的刘海、灵动岛、圆角有 47–62，留白跟着变大；iPad、Duo 的安全区是 0，仍是 32。
   面板、全屏浮层（含课时页的练习层 .pr）居中最宽 --sheet-w，两侧到屏幕边已有 (100vw − --sheet-w) / 2，只补安全区超出它的部分（实际仍是 32）。 */
@media (min-width: 600px) and (max-width: 899.98px), (min-width: 900px) and (max-height: 559.98px) and (pointer: coarse) {
  :root { --app-w: 100vw; --read-w: 640px; --safe-x: max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); --gutter: max(32px, var(--safe-x)); --sheet-w: min(100vw, 640px); --nav-max: 560px; }
  .sheet, .lw-full, .pr { --gutter: max(32px, calc(var(--safe-x) - (100vw - var(--sheet-w)) / 2)); }
  html { background: var(--bg); }
  body { font-size: 16px; }
  .display { font-size: 32px; }
  .h1 { font-size: 27px; }
  .h2 { font-size: 21px; }
  .h3 { font-size: 18px; }
  .meta, .label { font-size: 14px; }
  .sec { margin: 40px 0 16px; }
  .row { font-size: 17px; }
  .row .t small { font-size: 14px; }
  .nav a { font-size: 13px; }
  /* 设置组、加载失败块在所在的栏里按 --read-w 居中（栏本身不宽于 640 时照旧左右 12） */
  .group, .load-err { margin-inline: max(12px, calc((100% - var(--read-w)) / 2)); }
  .load-err { font-size: 15px; }
  .load-err b { font-size: 18px; }
  .toast { max-width: min(calc(100vw - 64px), 520px); font-size: 15px; }
}

/* 电脑版（与 common.js 的 LW_DESKTOP、desktop.css 的 <link media> 同一串查询）：导航在顶部，提示条落在底部居中 28px */
@media (min-width: 900px) and (min-height: 560px), (min-width: 900px) and (hover: hover) and (pointer: fine) {
  :root, .with-nav { --toast-b: 28px; }
  .toast { max-width: min(calc(100vw - 48px), 520px); }
}

/* ===== 全站搜索（components/search-overlay.tsx；2026-11-13 站长要求从零重排）=====
   手机、平板：盖住整屏（内容最宽 --sheet-w 居中）；电脑：屏幕上方居中的一栏面板。三处同一套排法：
   输入框 → 一条分段选类别、右边“筛选”钮（点开一块面板，收起后选了的条件留成小签）→ 内容。
   没输词时是三段清单（最近搜过、话题、直接看），结果一条一条用细线隔开；整个界面里圆角按钮只有输入框、分段和面板里的选项。
   结果列表、空状态的样式都写在 .gs 里，任何页面都能开 */
.gs { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: center; background: var(--bg); }
.gs[hidden] { display: none; }
.gs.on { animation: fade-in 160ms var(--ease) both; }
.gs-panel { display: flex; flex-direction: column; width: 100%; max-width: var(--sheet-w, 100%); min-height: 0; background: var(--bg); }
/* 输入框：一格白底，聚焦时描一圈淡绿（不用粗框） */
.gs-head { flex: none; display: flex; align-items: center; gap: 2px; padding: calc(10px + var(--safe-t)) 8px 10px var(--gutter); }
.gs-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 12px 0 15px; border-radius: 23px; background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 .5px var(--hair-2); color: var(--ink-3); transition: box-shadow 180ms var(--ease); }
.gs-field:focus-within { box-shadow: var(--shadow-1), inset 0 0 0 1px var(--green-soft); }
.gs-field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 17px var(--sans-ui); color: var(--ink); }
.gs-field input::placeholder { color: var(--ink-3); }
.gs-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.gs-clear { position: relative; flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sunk); color: var(--ink-2); }
.gs-clear::after { content: ""; position: absolute; inset: -10px; }
.gs-clear svg.i { width: 12px; height: 12px; stroke-width: 2.4; }
.gs-cancel { flex: none; height: 44px; padding: 0 12px; font-size: 16px; color: var(--ink-2); }
/* 类别（分段）和“筛选”钮：一样高、一样的圆角 */
.gs-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 var(--gutter) 12px; }
.gs-kinds { flex: 1; min-width: 0; }
.gs-fbtn { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--sunk); color: var(--ink-2); transition: background-color 180ms var(--ease), color 180ms var(--ease); }
.gs-fbtn > span { display: none; }
.gs-fbtn.set { color: var(--green); }
.gs-fbtn.on { background: var(--ink); color: var(--bg); }
.gs-fbtn i { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: 9px; background: var(--green-fill); color: var(--on-green); font: 500 11px/1 var(--sans-ui); font-style: normal; box-shadow: 0 0 0 2px var(--bg); }
/* 筛选面板：老师、年份、日期、话题各一组，选项是小方角按钮 */
.gs-filters { flex: none; max-height: min(56vh, 430px); overflow-y: auto; overscroll-behavior: contain; margin: 0 var(--gutter) 12px; padding: 14px 14px 12px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 .5px var(--hair-2); animation: gs-drop 240ms var(--out) both; }
@keyframes gs-drop { from { opacity: 0; transform: translateY(-6px); } }
.gs-f + .gs-f { margin-top: 13px; }
.gs-f p { margin: 0 0 7px; font-size: 12.5px; line-height: 1.4; color: var(--ink-3); }
.gs-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.gs-opts button { min-height: 32px; padding: 0 12px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 .5px var(--hair-2); font-size: 14px; color: var(--ink-2); }
.gs-opts button.on { background: var(--green-fill); color: var(--on-green); box-shadow: none; }
/* 面板里选项多了要滚：最下面“清除筛选、完成”这一行一直贴在面板底上 */
.gs-f-foot { position: sticky; bottom: -12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px -2px -12px; padding: 10px 2px 12px; background: var(--surface); box-shadow: 0 -.5px 0 var(--hair-2); }
.gs-reset { position: relative; font-size: 14px; color: var(--ink-3); }
.gs-f-foot .btn.sm { padding: 0 20px; }
.gs-tokens { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--gutter) 12px; }
.gs-token { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px 0 11px; border-radius: 10px; background: var(--green-tint); color: var(--green); font-size: 13.5px; }
.gs-token svg.i { width: 12px; height: 12px; stroke-width: 2.2; opacity: .75; }
/* 内容 */
.gs-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 calc(28px + var(--safe-b)); box-shadow: inset 0 .5px 0 var(--hair-2); }
.gs-res { transition: opacity 180ms var(--ease); }
.gs-res.busy { opacity: .55; }
html.gs-open, html.gs-open body { overflow: hidden; }
/* 没输词：三段清单。每段一行小标题，下面的行左边一个小图标、字后面一条细线 */
.gs-sec { display: flex; align-items: baseline; justify-content: space-between; margin: 18px var(--gutter) 2px; }
.gs-sec h3 { margin: 0; font-size: 12.5px; font-weight: 400; line-height: 1.5; color: var(--ink-3); }
.gs-sec button { position: relative; font-size: 12.5px; color: var(--ink-3); }
.gs-line { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0 0 0 var(--gutter); text-align: left; font-size: 15.5px; line-height: 1.4; color: var(--ink); }
.gs-line > svg.i:first-child { flex: none; width: 18px; height: 18px; color: var(--ink-3); }
.gs-line > span:nth-child(2) { flex: 1; min-width: 0; padding: 13px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-line > svg.i:last-child { flex: none; margin-right: calc(var(--gutter) - 4px); color: var(--ink-3); }
.gs-line + .gs-line { background: linear-gradient(var(--hair), var(--hair)) calc(var(--gutter) + 30px) 0 / 100% .5px no-repeat; }
button.gs-line:active { background-color: var(--surface-2); }
.gs-years { flex: none; display: flex; gap: 6px; margin-right: var(--gutter); }
.gs-years button { position: relative; height: 30px; padding: 0 10px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 .5px var(--hair-2); font-size: 13.5px; color: var(--ink-2); }
.gs-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; padding: 0 var(--gutter); }
.gs-topics button { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; padding: 12px 0; text-align: left; font-size: 15.5px; line-height: 1.4; color: var(--ink); box-shadow: inset 0 -.5px 0 var(--hair); }
.gs-topics button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-topics button i { flex: none; font-style: normal; font-size: 12.5px; color: var(--ink-3); }
.gs-topics button:active span { color: var(--green); }
/* 结果：每个类别一个衬线小标题带条数；一条结果是（配图）＋标题、搜到的那一句、一行出处，字下面一条细线 */
.gs-gh { display: flex; align-items: baseline; gap: 8px; margin: 20px var(--gutter) 0; }
.gs-gh h3 { margin: 0; font: 400 19px/1.35 var(--serif-zh); }
.gs-gh .num { font-size: 13px; color: var(--ink-3); }
.gs-gh .more { position: relative; margin-left: auto; display: inline-flex; align-items: center; gap: 1px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.gs-row { display: flex; gap: 13px; padding-left: var(--gutter); }
.gs-row:active { background: var(--surface-2); }
.gs-th { flex: none; width: 54px; height: 54px; margin-top: 14px; border-radius: 11px; }
.gs-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 13px var(--gutter) 13px 0; box-shadow: inset 0 -.5px 0 var(--hair); }
.gs-group .gs-row:last-of-type .gs-t { box-shadow: none; }
.gs-t b { font: 400 16.5px/1.42 var(--serif-zh); color: var(--ink); overflow-wrap: anywhere; }
.gs-t b[lang="en"] { font: 400 17px/1.36 var(--serif-en); }
.gs-sn { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.gs-hit { font: 400 14.5px/1.58 var(--serif-en); }
.gs-hit em { margin-right: 7px; font: 400 12px/1 var(--sans-ui); font-style: normal; color: var(--green); white-space: nowrap; }
.gs-ex { display: flex; flex-wrap: wrap; gap: 0 12px; font: italic 400 14px/1.6 var(--serif-en); color: var(--ink-2); }
/* 出处那一行只占一行，放不下的在行尾省略（学到哪一步排在最前面，不会被省掉） */
.gs-meta { margin-top: 1px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-meta span + span::before { content: "·"; margin: 0 6px; color: var(--ink-3); }
.gs-meta .st { color: var(--green); }
.gs mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.gs-more { display: flex; justify-content: center; padding: 16px 0 4px; }
.gs-none { padding: 56px 32px 24px; text-align: center; }
.gs-none b { display: block; font: 400 20px/1.4 var(--serif-zh); overflow-wrap: anywhere; }
.gs-none p { margin: 6px 0 16px; font-size: 14px; line-height: 1.7; color: var(--ink-3); }
.gs .load-err { margin: 16px var(--gutter); }
.gs-wait { display: grid; gap: 14px; padding: 18px var(--gutter); }
.gs-wait .sk { height: 62px; border-radius: 14px; background: var(--sunk); animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { 50% { opacity: .55; } }
/* 平板：字和间距上调一档，话题排三栏 */
@media (min-width: 600px) and (max-width: 899.98px), (min-width: 900px) and (max-height: 559.98px) and (pointer: coarse) {
  .gs-topics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gs-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
  .gs-f + .gs-f { margin-top: 0; }
  .gs-f-foot { grid-column: 1 / -1; margin-top: 0; }
}
@media (min-width: 900px) and (min-height: 560px), (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .gs { align-items: flex-start; padding: 72px 40px 40px; background: var(--scrim); }
  .gs-panel { --gutter: 28px; max-width: 760px; height: min(740px, calc(100vh - 112px)); border-radius: 24px; box-shadow: var(--shadow-3); overflow: hidden; }
  .gs-head { padding: 22px 14px 14px var(--gutter); }
  .gs-field { height: 48px; border-radius: 24px; }
  .gs-cancel:hover { color: var(--ink); }
  .gs-bar { padding-bottom: 16px; }
  .gs-kinds { flex: none; width: 380px; }
  .gs-fbtn { display: inline-flex; gap: 6px; width: auto; margin-left: auto; padding: 0 14px 0 12px; font-size: 14px; }
  .gs-fbtn > span { display: inline; }
  .gs-fbtn:not(.on):hover { color: var(--ink); }
  .gs-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; margin-bottom: 16px; padding: 18px 20px 16px; }
  .gs-f + .gs-f { margin-top: 0; }
  .gs-f-foot { grid-column: 1 / -1; bottom: -16px; margin: 0 -2px -16px; padding-bottom: 16px; }
  .gs-opts button:not(.on):hover { background: var(--sunk); }
  .gs-reset:hover, .gs-sec button:hover, .gs-gh .more:hover { color: var(--ink); }
  .gs-token:hover { background: var(--green-soft); }
  .gs-topics { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
  .gs-topics button:hover span, button.gs-line:hover > span { color: var(--green); }
  .gs-years button:hover { background: var(--sunk); }
  .gs-th { width: 60px; height: 60px; }
  .gs-row:hover { background: var(--surface-2); }
  .gs-row:hover b { color: var(--green); }
}

/* ===== 句子成分标注（长难句精选、动效讲解、AI 拆解、问 AI 回答，以及“我的”里的配色示例）=====
   主语、谓语与系动词、宾语与表语画记号笔式半截底色；从属连词椭圆圈出；其余成分同色虚线加编号圆标。
   默认配色「青瓷」（11-05 站长定）：艾绿、杏红、天青做底色，虚线胭脂、赭石、石青、黛蓝。学员能在“我的 → 句子成分颜色”里换，
   换的色由 lib/role-colors.ts 写到 <html> 的内联 --pa-*，这里的值是默认。--an-bga 是底色透明度，--an-lift 是线色提亮量（以后做深色配色时覆盖这两个） */
:root {
  --pa-subj: 120 168 128; --pa-pred: 226 150 98; --pa-obj: 112 160 204;
  --pa-attr: #B9797A; --pa-adv: #B08A4C; --pa-appos: #4E8E8A; --pa-paren: #5F80A0;
  --an-bga: .32; --an-lift: 0%;
  --an-ring: color-mix(in srgb, var(--ink) 45%, transparent);
  --an-subj: rgb(var(--pa-subj) / var(--an-bga)); --an-pred: rgb(var(--pa-pred) / var(--an-bga)); --an-obj: rgb(var(--pa-obj) / var(--an-bga));
  --an-attr: color-mix(in oklab, var(--pa-attr), #fff var(--an-lift)); --an-adv: color-mix(in oklab, var(--pa-adv), #fff var(--an-lift));
  --an-appos: color-mix(in oklab, var(--pa-appos), #fff var(--an-lift)); --an-paren: color-mix(in oklab, var(--pa-paren), #fff var(--an-lift));
}
.an-en { margin: 8px 0 0; font: 400 18px/2.05 var(--serif-en); color: var(--ink); }
.an-subject, .an-predicate, .an-object { -webkit-box-decoration-break: clone; box-decoration-break: clone; border-radius: 2px; }
.an-subject { background: linear-gradient(transparent 54%, var(--an-subj) 54%, var(--an-subj) 94%, transparent 94%); }
.an-predicate { background: linear-gradient(transparent 54%, var(--an-pred) 54%, var(--an-pred) 94%, transparent 94%); }
.an-object { background: linear-gradient(transparent 54%, var(--an-obj) 54%, var(--an-obj) 94%, transparent 94%); }
.an-mod { --an-k: var(--an-paren); text-decoration: underline dashed var(--an-k); text-decoration-thickness: 1.6px; text-underline-offset: 5px; }
.an-k-attr { --an-k: var(--an-attr); } .an-k-adv { --an-k: var(--an-adv); } .an-k-appos { --an-k: var(--an-appos); } .an-k-paren { --an-k: var(--an-paren); }
/* 序号圆标：数字一律用英文原文里的那种（界面英文字体 LW Latin），不用大数字的 Didot——
   原句是英文，圆标里本来就是 LW Latin；图例、分层精翻在中文里会落到 Didot，上下不居中，所以写死字体。
   句子、图例、分层精翻里同一种居中方式（图例原来被 .an-legend span 的排法盖掉，数字偏到一边） */
.an-badge, .an-legend .an-badge, .an-step .an-badge { display: inline-grid; place-items: center; box-sizing: border-box; width: 17px; height: 17px; margin: 0 4px 0 1px; padding: 0; gap: 0; border-radius: 50%; background: var(--an-k, var(--an-paren)); color: #fff; font: 600 11px/1 "LW Latin", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; vertical-align: .18em; }
.an-conj { padding: 0 .3em; border-radius: 50%; box-shadow: inset 0 0 0 1.2px var(--an-ring); }

/* 句子成分颜色设置（components/role-colors.tsx）：示例句、成分、色板、成套配色 */
.rc-demo { margin: 4px 0 18px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 .5px var(--hair); font-size: 18px; line-height: 2.1; }
.rc-roles { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-roles button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px 0 11px; border-radius: 20px; background: var(--sunk); font-size: 14px; color: var(--ink-2); transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.rc-roles button.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: inset 0 0 0 1.5px var(--green); }
.rc-roles i { flex: none; width: 18px; height: 10px; border-radius: 3px; }
.rc-roles i.fill { background: color-mix(in srgb, var(--c) 45%, transparent); }
.rc-roles i.line { height: 0; border-bottom: 2px dashed var(--c); border-radius: 0; }
.rc-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin: 16px 0 0; }
.rc-swatches > * { position: relative; display: grid; place-items: center; height: 44px; border-radius: 50%; }
.rc-swatches > *::before { content: ""; width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 .5px rgba(30, 20, 5, .14); transition: transform 200ms var(--pop), box-shadow 160ms var(--ease); }
.rc-swatches > .on::before { transform: scale(1.06); box-shadow: 0 0 0 2.5px var(--surface), 0 0 0 4.5px var(--c); }
.rc-own { cursor: pointer; }
.rc-own:not(.on)::before { background: conic-gradient(#C2573F, #D9B451, #6E9F6A, #4E8E8A, #5F80A0, #8A6A9E, #C2573F); }
.rc-own input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rc-warn { margin: 10px 2px 0; font-size: 13.5px; line-height: 1.6; color: var(--rust); }
.rc-h { margin: 22px 2px 8px; font-size: 13px; color: var(--ink-3); }
.rc-presets { display: grid; gap: 8px; }
.rc-presets button { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 4px 12px; min-height: 52px; padding: 8px 14px; border-radius: 14px; background: var(--sunk); text-align: left; transition: box-shadow 160ms var(--ease), background-color 160ms var(--ease); }
.rc-presets button.on { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--green); }
.rc-presets .dots { display: inline-flex; gap: 3px; }
.rc-presets .dots i { width: 12px; height: 12px; border-radius: 50%; }
.rc-presets b { font: 400 16px var(--serif-zh); color: var(--ink); }
.rc-presets small { font-size: 13px; color: var(--ink-3); }

/* 英文原文保持英文字体的数字（和撇号、标点一起），不换成播放器数字 */
:where([lang="en"]) {
  --serif-zh: "Hanazono Mincho", "Iowan Old Style", "Charter", "Georgia", "Songti SC", "Source Han Serif SC", serif;
  --num: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --fnum: "Didot", "Bodoni 72", "Bodoni Moda", "Libre Bodoni", "Iowan Old Style", Georgia, serif;
  --sans-ui: "LW Latin", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

/* 页面切换（视图过渡，components/client-shell.tsx）：整页淡出淡入；从课程卡进课时页时，卡上的封面放大衔接到课时页封面 */
/* 主导航全站只有一份（components/site-nav.tsx），单独成一层且不做动画：换页时纹丝不动 */
.nav { view-transition-name: lw-nav; }
::view-transition-group(lw-nav), ::view-transition-new(lw-nav) { animation: none; }
::view-transition-old(lw-nav) { display: none; }
/* 电脑切页：旧页不淡出、新页直接在上面淡入（原来旧页先淡、新页晚 60ms 才来，中间露出底色，看着闪灰） */
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: 220ms var(--ease) both lw-vt-in; }
@keyframes lw-vt-out { to { opacity: 0; } }
@keyframes lw-vt-in { from { opacity: 0; } }
.vt-cover .lesson-figure img.cover { view-transition-name: lw-cover; }
::view-transition-group(lw-cover) { z-index: 2; animation-duration: 460ms; animation-timing-function: cubic-bezier(.32, .72, 0, 1); }
::view-transition-old(lw-cover), ::view-transition-new(lw-cover) { height: 100%; object-fit: cover; animation-duration: 460ms; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

/* ===== 分区大标题版式（2026-11-11 站长在三版对比稿里挑的 C 版）=====
   首页、课程、外刊精读、真题精读、书架、我的共用（部件在 components/zone.tsx）：页面上方一个大号页名（.ptop / .phd），每个分区一个大号标题（.zone-h），
   下面一排可以横着滑的小卡（.rail），右边露出下一张；白底圆角的块是 .tile。配图一律是小图（站长：配图太大太抢）。
   书架、我的两页同一天稍后也换成了这一套（pages/ninglan.css、me.css）。电脑上 .rail 不横滑，排成网格（desktop.css）。 */
.clamp1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kick { margin: 0; font-size: 12px; line-height: 1.45; color: var(--green); }
.kick.dim { color: var(--ink-3); }
.kick .sep { display: inline-block; width: 3px; height: 3px; margin: 0 6px 3px; border-radius: 50%; background: currentColor; opacity: .55; vertical-align: middle; }
/* 一级页（首页、课程）的页头：小字日期在上，大号页名在下，右边一个圆形搜索钮；不吸顶 */
.ptop { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: calc(16px + var(--safe-t)) 14px 0 var(--gutter); }
.ptop .date { margin: 0; display: flex; align-items: center; flex-wrap: wrap; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.ptop .date .fl { display: inline-flex; align-items: center; gap: 2px; color: var(--rust); }
.ptop .date .fl svg.i { width: 14px; height: 14px; }
.ptop h1 { margin: 1px 0 0; font: 400 32px/1.25 var(--serif-zh); letter-spacing: -.01em; }
.ptop .round { flex: none; width: 40px; height: 40px; margin-bottom: 3px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 .5px var(--hair-2); color: var(--ink); transition: transform 140ms var(--ease); }
.ptop .round:active { transform: scale(.94); }
/* 二级页（外刊精读、真题精读、精品课介绍、话题页）：吸顶的顶栏里左边是“‹ 课程”，下面是页名、一句介绍和一行小数字 */
.back-link { display: inline-flex; align-items: center; height: 44px; margin-left: -12px; padding: 0 10px 0 4px; border-radius: 14px; font-size: 15px; color: var(--ink-2); transition: background-color 160ms var(--ease); }
.back-link:active { background: var(--sunk); }
.phd { padding: 0 var(--gutter); }
.phd h1 { margin: 0; font: 400 32px/1.25 var(--serif-zh); letter-spacing: -.01em; }
.phd p { margin: 3px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.phd .st { font-size: 13px; color: var(--ink-3); }
.phd .st .sep { display: inline-block; width: 3px; height: 3px; margin: 0 7px 3px; border-radius: 50%; background: currentColor; opacity: .55; vertical-align: middle; }
/* 分区标题 */
.zone-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 24px var(--gutter) 11px; }
.zone-h h2 { margin: 0; font: 400 23px/1.3 var(--serif-zh); }
.zone-h .more { position: relative; display: inline-flex; align-items: center; gap: 1px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.zone-h .pro-tag { padding: 4px 8px; border-radius: 10px; background: var(--gold-tint); color: var(--gold); font-size: 11.5px; line-height: 1; white-space: nowrap; }
.zone-sub { margin: 14px var(--gutter) 8px; font-size: 13px; color: var(--ink-3); }
/* 横着滑的一排 */
.rail { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 2px var(--gutter) 8px; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: none; scroll-snap-align: start; }
.tile { display: block; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 .5px var(--hair-2); }
a.tile { transition: background-color 160ms var(--ease); }
a.tile:active { background: var(--surface-2); }
/* 课程小卡：小图在上，一行小字、课题、老师和时长；学到一半的带一条细进度 */
.lcard { display: block; width: 140px; }
.lcard .ph { width: 100%; aspect-ratio: 140 / 92; border-radius: 12px; }
.lcard .kick { margin-top: 8px; }
.lcard h3, .lcard .h { margin: 1px 0 0; font: 400 15px/1.4 var(--serif-zh); }
.lcard .m { margin: 3px 0 0; font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.lcard .pg { display: block; height: 2px; margin-top: 8px; border-radius: 1px; background: var(--sunk); overflow: hidden; }
.lcard .pg b { display: block; height: 100%; border-radius: 1px; background: var(--green); }
.lcard.done .kick { color: var(--ink-3); }
/* 宽卡：小方图在左、字在右，下面一行是进度和按钮 */
.ltile { padding: 14px; }
.rail > .ltile { width: min(304px, calc(100vw - 2 * var(--gutter) - 46px)); }
/* 这一排只有它一张时占满整行 */
.rail > .ltile:only-child { width: 100%; }
.ltile .r1 { display: flex; gap: 12px; }
.ltile .ph { width: 72px; height: 72px; flex: none; border-radius: 12px; }
.ltile .t { flex: 1; min-width: 0; padding-top: 1px; }
.ltile h3 { margin: 2px 0 1px; font: 400 18px/1.35 var(--serif-zh); }
.ltile .r2 { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 13px; min-height: 34px; font-size: 12.5px; color: var(--ink-3); }
.ltile .btn.sm { flex: none; height: 34px; padding: 0 15px; border-radius: 17px; }
.segs { display: flex; flex: 1; gap: 4px; }
.segs i { flex: 1; height: 3px; border-radius: 2px; background: var(--sunk); }
.segs i.d { background: var(--green); }
.segs i.n { background: linear-gradient(90deg, var(--green) 30%, var(--sunk) 30%); }
/* 横条：一节课占一行。类名是 .lstrip：不能叫 .lbar，那是课时页顶栏的类名（lesson.css），撞了名这里的外边距会把课时页顶栏两边各挤掉一截
   （11-11 上午就这样撞过一次，课时页的步骤被挤得叠在一起） */
.lstrip { display: flex; align-items: center; gap: 12px; margin: 12px var(--gutter) 0; padding: 10px 12px 10px 10px; }
.lstrip .ph { width: 48px; height: 48px; flex: none; border-radius: 10px; }
.lstrip .t { flex: 1; min-width: 0; }
.lstrip h3 { margin: 0; font: 400 15.5px/1.45 var(--serif-zh); }
.lstrip > svg.i { flex: none; color: var(--ink-3); }
.lstrip .btn.sm { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; }
/* 文库文章小卡：只有字 */
.acard { width: 232px; padding: 13px 14px 14px; }
.acard h3 { margin: 3px 0 0; font: 400 16px/1.35 var(--serif-en); }
.acard .m { margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: var(--ink-3); }
/* 选项弹层（公共 Sheet 加 pick 类）：文库选话题、选刊物，真题精读选卷别、年份、篇目 */
.sheet.pick .opt-row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 50px; padding: 0 4px; box-shadow: inset 0 -.5px 0 var(--hair-2); font-size: 16px; text-align: left; }
.sheet.pick .opt-row small { color: var(--ink-3); font-size: 13px; }
.sheet.pick .opt-row.on { color: var(--green); font-weight: 500; }
@media (min-width: 600px) and (max-width: 899.98px), (min-width: 900px) and (max-height: 559.98px) and (pointer: coarse) {
  .ptop h1, .phd h1 { font-size: 36px; }
  .zone-h { margin-top: 30px; }
  .zone-h h2 { font-size: 25px; }
  .zone-h .more, .kick { font-size: 13px; }
  .rail { gap: 16px; }
  .lcard { width: 168px; }
  .lcard h3, .lcard .h { font-size: 16px; }
  .acard { width: 264px; }
  .acard h3 { font-size: 17px; }
}

/* ===== 课时页以外的小播放器（“正在听”，2026-11-11 站长）=====
   听着预听或讲解离开课时页，声音不停，页面底部浮着这一条（components/mini-player.tsx）：课程小图、课题和老师、播放暂停、关闭。
   有底部导航的页面浮在导航上面，没有的贴着底边；页面往下滚时收成左边一个小圆播放键（.mini），往回滚才展开（滚到页尾不自己展开）。
   形状和课时页的播放浮卡一样是两头全圆的胶囊（lesson.css 的 .player）。 */
.np {
  --np-w: min(456px, calc(100vw - 24px)); --np-h: 56px; --np-b: max(12px, var(--safe-b));
  position: fixed; z-index: 38; left: calc(50% - var(--np-w) / 2); bottom: var(--np-b); width: var(--np-w); height: var(--np-h);
  display: flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: calc(var(--np-h) / 2); background: var(--surface);
  box-shadow: 0 0 0 .5px var(--hair-2), 0 12px 32px -12px rgba(36, 31, 25, .34), 0 2px 6px -2px rgba(36, 31, 25, .10);
  transition: width 400ms var(--out); animation: np-in 380ms var(--out) both; view-transition-name: lw-np;
}
@keyframes np-in { from { opacity: 0; transform: translateY(14px); } }
.with-nav .np { --np-b: calc(var(--nav-h) + var(--safe-b) + 10px); }
.np.mini { width: var(--np-h); }
.np-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 100%; padding-right: 4px; transition: opacity 200ms var(--ease) 140ms; }
/* 小图是圆的（11-11 站长）：直径 40，离胶囊左边和上下都是 8，和胶囊的圆头同心，和右边的圆形播放键一样大 */
.np-open .ph { width: 40px; height: 40px; flex: none; border-radius: 50%; }
.np-open .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.np-open b { font: 400 15px/1.4 var(--serif-zh); }
.np-open .t span { font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.np-play { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--green-fill); color: var(--on-green); transition: transform 160ms var(--ease); }
.np-play:active { transform: scale(.93); }
.np-play svg.i { width: 20px; height: 20px; }
.np-play .mini-spin { display: block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .3); border-top-color: var(--on-green); animation: np-spin 800ms linear infinite; }
@keyframes np-spin { to { transform: rotate(360deg); } }
/* 进度环：收成小圆键时才出现，细线，和播放键隔 3px */
.np-play .ring { position: absolute; left: -4px; top: -4px; width: 48px; height: 48px; transform: rotate(-90deg); opacity: 0; pointer-events: none; overflow: visible; transition: opacity 160ms var(--ease); }
.np-play .ring circle { fill: none; stroke-width: 1.5; }
.np-play .ring .tr { stroke: var(--hair-2); }
.np-play .ring .fl { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset 950ms linear; }
.np.mini .np-play .ring { opacity: 1; }
.np-close { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-3); transition: opacity 200ms var(--ease) 140ms, background-color 160ms var(--ease); }
.np-close:active { background: var(--sunk); }
.np.mini .np-open, .np.mini .np-close { position: absolute; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 120ms var(--ease), visibility 0s 120ms; }
/* 这一条开着时：页尾多留一截，提示条往上让 */
.lw-np main::after { content: ""; display: block; grid-column: 1 / -1; height: 68px; }
.lw-np { --toast-b: 84px; }
.with-nav.lw-np { --toast-b: calc(var(--nav-h) + 78px); }
/* 换页时纹丝不动（同主导航） */
::view-transition-group(lw-np), ::view-transition-new(lw-np) { animation: none; }
::view-transition-old(lw-np) { display: none; }
