:root {
  /* 思维题库 · 视觉令牌
     思路：暖纸底色 + 深靛结构色 + 橙色行动色。
     深靛负责"稳"，橙色只出现在真正要点的东西上（主按钮、选中、进度）。 */
  --bg: #f6f5f2;
  --bg-2: #efece5;
  --card: #ffffff;
  --line: #e7e3da;
  --line-strong: #d5cfc3;
  --text: #171a21;
  --text-2: #4b5261;
  --muted: #8b909c;

  --accent: #2f4270;          /* 结构色：靛蓝 */
  --accent-2: #24345a;
  --accent-weak: #eef1f8;
  --accent-line: #c8d2e8;

  --pop: #f97316;             /* 行动色：橙 */
  --pop-2: #ea580c;
  --pop-weak: #fff4ea;
  --pop-line: #fbd0ac;

  --ink: #232d4b;
  --ok: #0e9f6e;
  --warn: #b45309;
  --bad: #e11d48;

  --r: 16px;
  --r-sm: 12px;

  /* 左侧栏宽度。236 时 232 套里有 209 套卷名被截成「GXYZ 博雅班入学数学真卷…」，
     尾巴的（一）（二）（三）全看不见，找卷子只能靠左边的三位编号。
     量下来：1366/1440 屏字号 12.5px，最长卷名 186px；1600 以上字号跳到 13px，要 194px。
     236 只给 126px，差 60～68 —— 所以给 304（还留 10px 余量）。
     底部悬浮横条（.basket）要跟正文列两端对齐，它的 left/width 也算这个值。
     ⚠️ 只有 1500 以上的屏才敢加到 304：正文再收窄，1366/1440 上「难度+题型+三个动作+
     每页/翻页」这一行，在选中卷子（多出「清除筛选」）之后就会折行；折行会改变底行高度，
     停在底行的批注条会跟着错位。所以窄屏回落到 236，见下面媒体查询。 */
  --side-w: 304px;
  --shadow: 0 1px 2px rgba(28,24,18,.04), 0 8px 22px -10px rgba(28,24,18,.14);
  --shadow-lg: 0 28px 70px -24px rgba(28,24,18,.34), 0 2px 10px rgba(28,24,18,.06);
  --ring: 0 0 0 3px rgba(249,115,22,.16);
  --ease: cubic-bezier(.22,.68,0,1);

  /* 吸顶基准线：顶栏 64 + 内容区上边距 18。
     左侧目录栏和右侧工具栏都冻在这一条线上，滚动时两者上沿永远齐平。 */
  --top-h: 64px;
  --stick-top: 82px;
}

* { box-sizing: border-box; }

/* hidden 属性必须压过组件自身的 display（.chips 用了 flex 会盖掉 hidden） */
[hidden] { display: none !important; }

body {
  margin: 0; padding: 0 0 74px;
  background: var(--bg); color: var(--text);
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 底色上的一层极淡暖光，让大块留白不发灰 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(249,115,22,.07), transparent 62%),
    radial-gradient(760px 460px at 92% 0%, rgba(47,66,112,.08), transparent 60%);
}
body > * { position: relative; z-index: 1; }
html { scroll-behavior: smooth; }
::selection { background: rgba(249,115,22,.22); }

/* 细滚动条 */
* { scrollbar-width: thin; scrollbar-color: #d8d2c6 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #d8d2c6; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #c3bbaa; background-clip: content-box; }

/* ---------------- top ---------------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 22px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(231,227,218,.9);
  transition: box-shadow .25s var(--ease), background .25s;
}
.top.scrolled { box-shadow: 0 10px 30px -18px rgba(28,24,18,.35); background: rgba(255,255,255,.9); }

.brand {
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  text-decoration: none; color: inherit;
}
.brand .logo {
  display: grid; place-items: center; flex: 0 0 auto;
  transition: transform .3s var(--ease);
}
.brand .logo img { display: block; width: 44px; height: 44px; }
.brand:hover .logo { transform: rotate(-4deg) scale(1.05); }
/* 汉字在上、英文在下摆成一列：两行并排横着放太宽，顶栏白占一百多像素，
   而且英文那串本来只是副标题，跟着主语走更像一块整体。 */
.btext {
  display: flex; flex-direction: column; align-items: flex-start;
  justify-content: center; min-width: 0;
}
.bt {
  font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; color: var(--ink);
  line-height: 1.25;
}
.bsub {
  font-size: 9px; font-weight: 600; letter-spacing: .14em;
  color: var(--muted); margin-top: 2px; line-height: 1.1;
}
/* 旧版的小方标，保留兜底 */
.mark {
  display: grid; place-items: center; width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--ink-2, #35477d), #1c2440);
  color: #fff; font-weight: 700; font-size: 14px;
  border-radius: 8px; letter-spacing: 0;
}

.searchwrap { position: relative; flex: 1; max-width: 520px; }
.searchwrap .ico {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; fill: none; stroke: var(--muted);
  stroke-width: 2; stroke-linecap: round; pointer-events: none;
  transition: stroke .2s;
}
#q {
  width: 100%; padding: 10px 16px 10px 40px; font-size: 13.5px; font-family: inherit;
  color: var(--text); background: rgba(246,245,242,.9);
  border: 1px solid transparent; border-radius: 999px; outline: none;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
#q:focus {
  background: #fff; border-color: var(--pop-line); box-shadow: var(--ring);
}
.searchwrap:focus-within .ico { stroke: var(--pop); }
#q::placeholder { color: var(--muted); }
.stat { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap;
  font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 10px; }

/* 顶栏「视频讲解」胶囊。橙色是行动色，只留给真正在更新的东西——
   老师每放一集，这里的数字和时长就往上走，客户也看得出题库还在长。 */
.st-vid {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px 3px 9px; border-radius: 999px;
  background: var(--pop-weak); color: var(--pop-2);
  border: 1px solid var(--pop-line); font-weight: 500;
}
.st-vid b { font-weight: 700; font-variant-numeric: tabular-nums; }
/* 窄屏先砍「共 N 小时」，只留条数；再窄一点连胶囊一起收起（先保住搜索框的宽度），
   最后窄到 860 整格连同 .stat 一起隐藏 */
@media (max-width: 1240px) {
  .st-min { display: none; }
}
/* 1500 以下把侧栏收回 236：正文剩不到 1180 时，工具栏第二行在「已选中一套卷」的状态下
   会折行（多一个「清除筛选」），而底行高度一变，停靠在上面的批注条就错位了。
   这里只是换变量，aside 与 .basket 会自动跟着变。 */
@media (max-width: 1500px) {
  :root { --side-w: 236px; }
}
@media (max-width: 1080px) {
  .st-vid { display: none; }
}

/* ---------------- layout ---------------- */
/* 底部 96px 留白要放在 .layout 的内容盒里（子元素的内边距），不能写成 .layout 的
   padding-bottom：sticky 侧栏只能待父容器的内容盒内，padding 会把它提前拽上去。 */
.layout {
  display: flex; gap: 20px; padding: 18px 22px; align-items: flex-start;
  max-width: 1560px; margin: 0 auto;
}

/* 左边那列。选择器写成 aside.side：批注条的 .ink-bar.side 也带 side 这个类，
   只写 .side 会把「max-height / overflow:hidden」一起套到工具条上，
   笔记本矮屏（视口 650 左右）时工具条下半截连同「关闭」按钮直接被裁掉。 */
aside.side {
  flex: 0 0 var(--side-w); position: sticky; top: var(--stick-top);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px;
  /* 一路长到视口下沿，只留 14px 呼吸（和底部横条的 bottom:14 对齐）。
     以前写的是 100vh - 166px：那是按「底部横条 56 + 距底 14 + 间隙 14」预留的，
     可横条 left: calc(50% + 128px)，本来只压右边内容区，压不到左边这栏 236px，
     等于白丢 70px，矮屏上看着就是「框短一截、底下空一块」。
     82(顶) + (100vh - 96) = 100vh - 14。 */
  max-height: calc(100vh - 96px);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow);
}
/* 上固定：tab、筛选框、单选/多选切换都不随列表滚动 */
.side-head {
  flex: 0 0 auto; padding: 14px 14px 10px;
  background: #fff; z-index: 2;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 10px -10px rgba(28,24,18,.5);
}
/* 下滚动：只有知识点 / 专题 / 套卷 列表在滚 */
.side-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 6px 10px 14px;
  overscroll-behavior: contain;
}
.seg {
  display: flex; background: rgba(246,245,242,.95); border-radius: 999px;
  padding: 4px; margin-bottom: 12px; gap: 2px;
}
.seg-btn {
  flex: 1; padding: 7px 0; font-size: 12.5px; font-family: inherit;
  color: var(--text-2); background: none; border: 0; border-radius: 999px; cursor: pointer;
  transition: all .22s var(--ease); font-weight: 500;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.on {
  background: #fff; color: var(--ink); font-weight: 700;
  box-shadow: 0 2px 8px -2px rgba(28,24,18,.18), 0 0 0 1px rgba(231,227,218,.9);
}
.side-search { margin-bottom: 10px; }
#kpq {
  width: 100%; padding: 8px 12px; font-size: 12.5px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 999px; outline: none;
  background: rgba(246,245,242,.7); transition: all .2s;
}
#kpq:focus { border-color: var(--pop-line); background: #fff; box-shadow: var(--ring); }

.chips { display: flex; flex-direction: column; gap: 2px; }
/* 知识点列表底部的进度条：还有多少没显示 / 已经到底 */
.chips-more {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  margin: 10px 2px 4px; padding: 9px 8px;
  font-size: 11px; color: var(--muted);
  background: rgba(246,245,242,.75); border: 1px dashed var(--line);
  border-radius: 10px; text-align: center;
}
.chips-more b { font-size: 11px; color: var(--pop-2); font-weight: 600; }
.chips-more.done { border-style: solid; background: none; color: var(--muted); }

/* 单选 / 多选切换 */
.side-mode { display: flex; align-items: center; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.sm-label { font-size: 11px; color: var(--muted); font-weight: 600; margin-right: 1px; white-space: nowrap; }
.sm-btn {
  font-family: inherit; font-size: 11.5px; padding: 3px 11px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
  color: var(--text-2); cursor: pointer; transition: all .18s var(--ease); font-weight: 600;
  white-space: nowrap; flex: 0 0 auto;
}
.sm-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.sm-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pickhint {
  margin-left: auto; font-size: 11px; color: var(--pop-2);
  background: var(--pop-weak); border: 1px solid var(--pop-line);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
  flex: 0 0 auto;
}
.group-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10.5px; color: var(--muted); padding: 12px 10px 4px;
  letter-spacing: .08em; font-weight: 600;
}
.group-head .n { font-size: 10.5px; opacity: .8; letter-spacing: 0; }
.chip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 7px 10px; font-size: 12.5px; font-family: inherit;
  color: var(--text-2); background: none; border: 0; border-radius: 10px;
  cursor: pointer; text-align: left; transition: all .16s var(--ease);
  position: relative;
}
.chip:hover { background: rgba(246,245,242,.95); color: var(--text); transform: translateX(2px); }
.chip.on {
  background: linear-gradient(180deg, #fff7f1, var(--pop-weak));
  color: var(--pop-2); font-weight: 700; box-shadow: inset 0 0 0 1px var(--pop-line);
}
.chip.on::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--pop);
}
.chip .n { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; flex: 0 0 auto; text-align: right; }
.chip .chip-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.on .n { color: var(--pop-2); opacity: .8; }

/* 套卷条目：编号 + 卷名（过长省略） */
.chip.paper { gap: 7px; align-items: baseline; }
/* 「这套卷讲解录完了」的小三角，位置在 001 之前。
   用 border 画的实心三角：4.5×8 像素，比字符 ▶ 稳（不受字体影响），也不吃点击区。
   align-self:center 是因为父级是 baseline 对齐，空元素按 baseline 会往下掉。 */
.chip.paper .pvid {
  flex: 0 0 auto; align-self: center; width: 0; height: 0;
  border-left: 5px solid var(--line-strong);
  border-top: 3.6px solid transparent;
  border-bottom: 3.6px solid transparent;
  transition: border-left-color .18s ease, filter .18s ease;
}
/* 点亮：橙色行动色 + 一圈很淡的同色光晕，像刚亮起来的小灯 */
.chip.paper .pvid.on {
  border-left-color: var(--pop);
  filter: drop-shadow(0 0 3px rgba(249, 115, 22, .45));
}
.chip.paper.on .pvid:not(.on) { border-left-color: var(--pop-line); }
.chip.paper .pno {
  /* 编号统一三位（001…153）、左对齐：主列从左边起，卷名整齐地从同一处开始。
     定宽是为了让三位数都占同样的宽度，扫下来是一条直线 */
  flex: 0 0 auto; min-width: 24px; text-align: left; font-size: 10.5px; font-weight: 700;
  color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.chip.paper.on .pno { color: var(--pop-2); }
.chip.paper .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
/* 题目数：整列右对齐，个位、十位、百位从右边数起，纵向能对齐 */
.chip.paper .n { flex: 0 0 auto; text-align: right; min-width: 18px; }

/* 侧栏窄，卷名 / 专题名常被截成「GDFZ 入学数学真卷…」。
   鼠标停上去在下面弹一条完整名字（自绘，不用 title：原生气泡要等 1 秒、样式也不受控）。
   只有真被截断时才弹，短名字不弹，免得一划一片气泡。 */
.floattip {
  position: fixed; z-index: 80; max-width: 320px;
  padding: 7px 11px; font-size: 12.5px; line-height: 1.55;
  color: var(--text); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 9px;
  box-shadow: 0 14px 30px -12px rgba(28,24,18,.42), 0 2px 6px rgba(28,24,18,.06);
  pointer-events: none; overflow-wrap: anywhere;
  animation: tipIn .13s ease-out;
}
@keyframes tipIn { from { opacity: 0; transform: translateY(-3px); } }

/* ---------------- content ---------------- */
.content { flex: 1; min-width: 0; }
/* 工具条（哪套卷 / 难度星级 / 只看有图 / 每页 …）钉在顶栏下面：
   往下翻题目时它不动，随时能改筛选条件，不用滚回顶部。
   顶栏本身是 sticky top:0、高 64px，所以这里接在 64px 处。 */
/* 工具栏固定两层：第一行只放「当前范围 + 教师筛图」，
   第二行放难度／动作／翻页。这样卷名再长也只会自己省略，
   不会把「整卷加入 全选本页」顶到下一行去。 */
.toolbar {
  /* 冻在 82px（= 顶栏 64 + 内容区上边距 18），和左侧目录栏上沿是同一条线。
     以前写 top:64px，一滚动就往顶栏上贴，看着像「自己往上跑了一截」。 */
  position: sticky; top: var(--stick-top); z-index: 22;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  margin-bottom: 14px;
  padding: 10px 14px; background: rgba(255,255,255,.9);
  border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 2px rgba(28,24,18,.03);
  transition: box-shadow .2s var(--ease), background .2s;
}
.tb-top {
  display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 26px;
  padding-bottom: 8px; border-bottom: 1px solid rgba(231,227,218,.75);
}
.tb-flags { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.tb-bot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 第二行加了两颗筛选胶囊，动作按钮的内边距收窄一点，1366 也能和筛选排在同一行 */
.tb-bot .btn { padding: 8px 12px; }
/* 13xx 的笔记本（老师这台就是）宽度紧：第二行再收一档，
   保证「难度 + 题型 + 三个动作 + 每页/翻页」还是同一行，不折到第三行去 */
@media (max-width: 1400px) {
  .tb-bot { gap: 6px; }
  .dchip { width: 20px; font-size: 10px; }
  .tchip { padding: 4px 5px; font-size: 11px; }
  .diffbar .dl, .typebar .dl { margin: 0 3px 0 4px; font-size: 11px; }
  .tb-bot .btn { padding: 8px 10px; font-size: 12.5px; }
  .sizepick { font-size: 12px; gap: 4px; }
  .sizepick select { padding: 4px 4px; }
  .tb-pager .pinfo { padding: 0 4px; font-size: 12px; }
}

/* 学生版不带这两个筛图开关（老师挑题才用）：给 <html> 加 class="student" 即隐藏 */
html.student .tb-flags { display: none; }
/* 卡片和下面题目之间那条 14px 间隙也用页面底色盖住，
   不然题目会从缝里滑过去，看着像「冰住了但没冰严」 */
.toolbar::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%;
  height: 14px; background: var(--bg); pointer-events: none;
}
/* 冻在 82px 后，上方空出 18px（64~82），题目会从这条缝里往上滑过去。
   补一块同色底把整条盖掉；多盖 1px 压住自己的上边框，不留细线。 */
.toolbar::before {
  content: ""; position: absolute; left: -1px; right: -1px;
  top: calc(var(--top-h) - var(--stick-top) - 1px);
  height: calc(var(--stick-top) - var(--top-h) + 1px);
  background: var(--bg); pointer-events: none;
}
/* 真冻住的时候加一道阴影：滚动中能看出这条是浮在题目上面的 */
.toolbar.stuck {
  background: rgba(255,255,255,.96);
  box-shadow: 0 12px 24px -18px rgba(28,24,18,.55), 0 1px 0 rgba(231,227,218,.9);
}
/* 第一行的范围名：加粗大字、独占剩余宽度，太长才省略（鼠标悬停看全名） */
.crumb {
  flex: 1 1 auto; min-width: 0; max-width: none;
  font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -.01em;
}
.grow { flex: 1; }

/* 工具栏里的翻页：‹ 第 1 / 4 页 · 共 184 题 ›
   「每页 N 题」和翻页一起靠右；用 margin-left:auto 而不是塞一个占位元素，
   换行到下一行时这一组仍然贴右边缘，不会掉到左边去。 */
.tb-right {
  margin-left: auto; display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
  flex-wrap: wrap; justify-content: flex-end;
}
.tb-pager {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  padding: 2px 3px; border-radius: 999px; background: rgba(246,245,242,.9);
}
.pgbtn {
  font-family: inherit; font-size: 16px; line-height: 1; cursor: pointer;
  width: 26px; height: 26px; display: grid; place-items: center;
  color: var(--text-2); background: #fff; border: 1px solid var(--line);
  border-radius: 50%; padding: 0 0 2px; transition: all .16s var(--ease);
}
.pgbtn:hover:not(:disabled) { color: var(--pop-2); border-color: var(--pop-line); background: #fff; }
.pgbtn:disabled { opacity: .3; cursor: not-allowed; }
.tb-pager .pinfo { padding: 0 6px; white-space: nowrap; }

.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.switch input { accent-color: var(--pop); }
.switch.big { font-size: 13.5px; color: var(--text); }

/* 难度筛选 / 题型筛选：两颗胶囊长一个样，并排在第二行左端 */
.diffbar, .typebar {
  display: flex; align-items: center; gap: 2px; flex: 0 0 auto;
  background: rgba(246,245,242,.9); border-radius: 999px; padding: 3px;
}
.diffbar .dl, .typebar .dl { font-size: 11.5px; color: var(--muted); margin: 0 4px 0 6px; white-space: nowrap; font-weight: 600; }
.tchip {
  font-family: inherit; font-size: 11.5px; letter-spacing: -.5px; cursor: pointer;
  padding: 4px 6px; color: var(--muted); background: transparent;
  border: 1px solid transparent; border-radius: 999px;
  transition: all .18s var(--ease);
}

/* ---- 难度轴（1–10 级）----
   十个数字不再是十颗并排胶囊，而是一排刻度，刻度底下压着一条进度轨：
   点数字选那一级、再点一次取消、按住往左右拖可以连续换级。
   橙色 fill 从 1 级铺到当前级，"往右越难"一眼就看出来。
   数字全部等宽 22px，中心正好落在 5%、15%…95%，所以 fill 用 (lv−1)/9 算百分比
   就能严丝合缝地对上数字（见 app.js 的 renderDiffBar）。 */
.dtrack {
  position: relative; display: flex; flex-direction: column; height: 22px;
  user-select: none; touch-action: pan-y;   /* 横向拖动归我们，纵向还给页面滚动 */
}
.dtrail {
  position: absolute; left: 5%; right: 5%; bottom: 0; height: 4px;
  background: #e2dccf; border-radius: 2px; pointer-events: none;
}
.dfill {
  height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, #fbbf24, var(--pop));
  transition: width .2s var(--ease);
}
.dticks { position: relative; display: flex; flex: 0 0 auto; }
.dchip {
  width: 22px; height: 18px; padding: 0; margin: 0; border: 0; border-radius: 999px;
  font-family: inherit; font-size: 10.5px; font-weight: 600; line-height: 18px;
  font-variant-numeric: tabular-nums; letter-spacing: 0;
  color: var(--muted); background: transparent; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.dchip:hover { color: var(--ink); background: rgba(255,255,255,.95); }
/* 选中级＝滑块的头：橙色实心，比旁边略大，一眼看到现在停在哪一级 */
.dchip.on {
  color: #fff; font-weight: 700; background: var(--pop);
  transform: scale(1.14); box-shadow: 0 2px 8px -2px rgba(249,115,22,.75);
}
/* 1 级到选中级之间的数字：字染橙，和 fill 一起把"进度"接起来 */
.dchip.past { color: var(--pop-2); }
.badge.star { background: var(--pop-weak); color: var(--pop-2); letter-spacing: -.5px; }
.badge.star.ai { background: #fff; color: var(--pop-2); border: 1px dashed var(--pop-line); opacity: .85; }

/* ---- 难度徽章 ----
   一行写完「52分/6级」，跟旁边的「解答题／含答案／有解析」长得一样、一样大，
   并且用 margin-left:auto 推到这一排的最右边 —— 它是这排里最该被扫到的一个。
   底色只分三档（易／中／难），不加边框：加框就比旁边那几个高出一圈，
   在窄屏上看着像贴在题卡上的一块膏药（老师原话："好突兀"）。 */
.badge.diff {
  font-variant-numeric: tabular-nums; cursor: help; white-space: nowrap;
  border-color: transparent;
  transition: background .16s var(--ease);
}
/* 只在题卡那排徽章里推到最右；讲解页、做题页、每日一练的徽章跟着文字走，别乱飘 */
.badges > .badge.diff { margin-left: auto; }
.badge.diff.easy { background: #edf4ef; color: #2f6b4f; }
.badge.diff.mid { background: #eef1f8; color: #2f4270; }
.badge.diff.hard { background: #fdf2ea; color: #b64a12; }

/* ---- 难度悬停面板 ----
   把分数的构成摊开：八维各打了多少、为什么这么打、按什么权重加出来的。 */
.dtip {
  position: fixed; z-index: 90; width: 344px; max-width: calc(100vw - 20px);
  padding: 12px 14px 11px; background: #fff;
  border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 18px 38px -14px rgba(28,24,18,.45), 0 2px 6px rgba(28,24,18,.07);
  pointer-events: none; animation: tipIn .13s ease-out;
}
.dtip-h { display: flex; align-items: baseline; gap: 5px; }
.dtip-h b { font-size: 25px; font-weight: 700; color: var(--ink); line-height: 1; letter-spacing: -.02em; }
.dtip-h span { font-size: 12.5px; color: var(--text-2); }
.dtip-h em {
  font-style: normal; margin-left: auto; font-size: 11px; color: var(--muted);
  background: var(--bg); border-radius: 999px; padding: 2px 8px;
}
.dtip-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.dtip-why {
  font-size: 12.5px; color: var(--text); line-height: 1.6; margin: 8px 0 2px;
  padding: 7px 9px; background: #fbf8f0; border-radius: 7px;
  border-left: 3px solid var(--pop-line);
}
.dtip-grid {
  display: flex; flex-direction: column; gap: 4px;
  margin: 9px 0 2px; padding-top: 9px; border-top: 1px dashed var(--line);
}
.dtip-row {
  display: grid; grid-template-columns: 80px 52px 16px 1fr;
  align-items: center; gap: 6px;
  font-size: 11.5px; line-height: 1.45;
}
.dtip-k { color: var(--text-2); white-space: nowrap; font-size: 11px; }
.dtip-bar {
  height: 6px; border-radius: 3px; background: #eeebe2; overflow: hidden;
}
.dtip-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.dtip-bar.fix i { background: var(--pop); }
/* S6 是双向轴（−2…+4），中间那点是 0 而不是零分，所以画空轨 + 一道中线 */
.dtip-bar.s6 { position: relative; background: #f2efe6; }
.dtip-bar.s6::after {
  content: ""; position: absolute; left: 50%; top: -1px; bottom: -1px;
  width: 1px; background: var(--line-strong);
}
.dtip-v {
  font-size: 11.5px; font-weight: 700; color: var(--ink);
  text-align: center; font-variant-numeric: tabular-nums;
}
.dtip-s { color: var(--muted); }
.dtip-row.s6 .dtip-v { color: var(--pop-2); }
.dtip-rule {
  margin-top: 5px; font-size: 11px; color: var(--pop-2);
  background: var(--pop-weak); border-radius: 6px; padding: 5px 8px;
}

/* 难度配比 */
.ratiobox { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* 组卷：页面装饰（页眉页脚水印） */
.pgdec { margin: 14px 0 6px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfa; }
.pgdec > summary {
  cursor: pointer; list-style: none; padding: 10px 14px; font-size: 13px; font-weight: 600;
  color: var(--text-2); display: flex; align-items: center; gap: 6px;
}
.pgdec > summary::-webkit-details-marker { display: none; }
.pgdec > summary::before { content: "▸"; font-size: 10px; color: var(--muted); transition: transform .15s; }
.pgdec[open] > summary::before { transform: rotate(90deg); }
.pgdec[open] > summary { border-bottom: 1px solid var(--line); }
.pgdec-body { padding: 12px 14px 6px; }
.pgdec-body .switch.big { margin-bottom: 8px; }
.pgsub {
  margin: 0 0 12px 6px; padding: 10px 12px 2px;
  border-left: 2px solid var(--line); border-radius: 0 8px 8px 0; background: #fff;
}
.pgsub .field { margin-bottom: 10px; }
/* 品牌说明：告知「页眉 LOGO + 满页水印」是导出时强制加的，下面那套开关只是自定义补充 */
.pg-brandnote {
  margin: 0 0 12px; padding: 9px 12px; border-radius: 8px;
  background: rgba(47, 66, 112, .05); border: 1px solid rgba(47, 66, 112, .14);
  font-size: 12px; line-height: 1.6; color: #3c4a46;
}
.pg-brandnote b { color: var(--accent); font-weight: 600; }
.logorow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logorow input[type=file] { flex: 1 1 100%; font-size: 12px; }
.logorow select {
  flex: 1 1 110px; padding: 6px 8px; font-size: 12.5px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text);
}
.logorow .btn { flex: 0 0 auto; }
.logoprev { display: block; max-height: 44px; max-width: 160px; margin-top: 8px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 3px; }
.pgdec input[type=range] { width: 100%; accent-color: var(--pop, #f97316); }
.ratiobox #ratio-grid { margin-top: 10px; }
.rf { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.rf input {
  width: 56px; padding: 5px 7px; font-size: 12.5px; font-family: inherit;
  text-align: center; color: var(--text); background: #fbfcfd;
  border: 1px solid var(--line); border-radius: 7px; outline: none;
}
.rf input:focus { border-color: var(--accent-line); background: #fff; }
.rf:first-child input { width: 70px; }
.rrow { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0; }

/* ---------------- 学习模式 ---------------- */
.learn-box {
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg);
  animation: pop .3s cubic-bezier(.34,1.4,.64,1);
}
.learn-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; row-gap: 4px;     /* 手机上按钮多，别把标题条撑出横向滚动 */
  padding: 15px 22px; border-bottom: 1px solid var(--line); font-weight: 700;
  color: var(--ink);
}
/* 顶栏标题＝「卷名 · 第 N 题」（原来是固定的「跟着老师学」）。
   卷名长短差很多（12～25 字），所以标题可伸缩、但绝不把右边的功能按钮挤出去：
   放不下时末尾省略，鼠标停一下 title 提示看全。竖屏另有一套（见 .portrait）。 */
#l-title {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.35;
}
/* 录课文件名徽标：老师录课顶栏那枚「存 78/13.mp4」，点一下复制 videos/ 下的整条路径。
   只有机主看得到（学生看这个没用），手机上标题本身都不够放，直接不显示。 */
.lfile {
  flex: 0 0 auto; margin-left: 10px; padding: 2px 9px; border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0;
  color: var(--text-3); background: var(--bg-2); border: 1px solid var(--line);
  cursor: pointer; white-space: nowrap;
  /* 专题题没有卷号，文件名是 24 位题目 id，得截一下，不然把标题挤没 */
  max-width: 210px; overflow: hidden; text-overflow: ellipsis;
}
.lfile:hover { color: var(--ink); border-color: var(--line-strong); background: #fff; }
@media (max-width: 700px) { .lfile { display: none; } }
.learn-body { padding: 0 22px 22px; overflow: auto; flex: 1 1 auto; min-height: 0; }
/* 讲解顶上的「上一题 / 3 / 27 / 下一题」：学完一道接着往下讲，不用退出去重找 */
/* margin-right:auto 把右边的按钮组推到头，导航紧跟标题，不会悬在中间 */
.lnav { display: flex; align-items: center; gap: 6px; margin: 0 auto 0 18px; flex: 0 0 auto; }
.lnav-btn {
  padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  color: var(--text-2); background: #fff; border: 1px solid var(--line-strong);
  border-radius: 7px; transition: all .15s; white-space: nowrap;
}
.lnav-btn:hover:not(:disabled) { color: var(--pop-2); border-color: var(--pop); background: var(--pop-weak); }
.lnav-btn:disabled { opacity: .35; cursor: default; }
.lnav-pos { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 4px; }
/* 讲解模式不再单独放大翻题按钮：它已经挪进底行，尺寸统一由 .learn-foot 那套定（见下） */
@media (max-width: 720px) {
  .lnav { margin: 0 4px; gap: 3px; }
  .lnav-btn { padding: 4px 8px; font-size: 11.5px; }
  .lnav-pos { font-size: 11px; padding: 0 2px; }
}
.learn-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-top: 1px solid var(--line);
  background: #fbfcfd; border-radius: 0 0 14px 14px;
}
.learn-foot .btn { padding: 8px 18px; }
/* 底行三件套：提示在左、翻题居中、主按钮在右。翻题原来在顶栏和卷名抢一行，
   挪下来后字号压到跟提示一个量级（11.5px）—— 录课主要用 Enter / 方向键，
   鼠标点只是兜底，不该比正文还抢眼。 */
.learn-foot .kbd-hint { margin-right: 0; }
/* 翻题紧跟提示排左边，主按钮靠右 —— 中间那一大块空着留给批注工具条（它绝对定位居中）。
   三样东西各占一头，批注开不开都不会撞在一起。 */
.learn-foot .lnav { margin: 0 0 0 8px; gap: 4px; }
.learn-foot .btn { margin-left: auto; }
.learn-foot .lnav-btn { padding: 3px 9px; font-size: 11.5px; border-radius: 6px; }
.learn-foot .lnav-pos { font-size: 11px; padding: 0 3px; }
/* 批注工具条停在底行正中，占掉中间一大块（14 个图标 ≈ 456px）。
   它一出来，翻题就收成「‹ 930 / 3382 ›」—— 文字藏起来只留两个箭头，
   宽度从 196 掉到 80，1366 的笔记本上也能和工具条并排站开。工具条一关就长回去。 */
.learn-foot:has(#ink-bar.show) .lnav-btn { font-size: 0; padding: 2px 7px; }
.learn-foot:has(#ink-bar.show) .lnav-btn::before { font-size: 13px; line-height: 1; }
.learn-foot:has(#ink-bar.show) #l-prev::before { content: '‹'; }
.learn-foot:has(#ink-bar.show) #l-nextq::before { content: '›'; }
.learn-foot:has(#ink-bar.show) .lnav-pos { font-size: 10px; padding: 0 2px; }
/* 竖屏面板只有 405 宽，提示本身就不显示，翻题贴着左边，工具条居中还是会盖住它 ——
   干脆淡出（opacity 不改高度，底行高度一变笔迹就错位）；批注时照样能按 , / . 翻题。 */
#learn.teach.portrait .learn-foot:has(#ink-bar.show) .lnav { opacity: 0; pointer-events: none; }
/* 1366 这类窄屏：底行还要放「给我一点提示」「看结论」两个按钮，工具条居中后
   连收窄的翻题都塞不下。窄屏批注时直接淡出，靠 , / . 翻题；宽屏留着看得见。 */
@media (max-width: 1600px) {
  .learn-foot:has(#ink-bar.show) .lnav { opacity: 0; pointer-events: none; }
}
.kbd-hint { margin-right: auto; font-size: 11.5px; color: var(--muted); }
.kbd-hint b {
  display: inline-block; padding: 1px 5px; margin: 0 1px;
  font-weight: 600; color: var(--text-2); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 4px; font-size: 10.5px;
}
/* 顶部步进条：按步骤数分段的轨道。
   一根细横条看不出「还剩几步」，分段之后一眼就知道走到哪儿了。 */
.lprog {
  flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
  height: 12px; padding: 0 20px; background: #fff;
}
.lprog .lp { position: relative; flex: 1 1 0; min-width: 12px; height: 4px; border-radius: 99px; background: rgba(231,227,218,.9); }
.lprog .lp b {
  display: block; height: 100%; width: 100%; border-radius: 99px;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, #fdba74, var(--pop));
  transition: transform .5s cubic-bezier(.22, 1, .36, 1);
}
.lprog .lp.done b { background: linear-gradient(90deg, #fb8c3c, var(--pop-2)); }
/* 当前段：渐变缓慢流动，末端一个光点跟着走 */
.lprog .lp.cur b {
  background: linear-gradient(90deg, #fed7aa, var(--pop) 40%, #ffe4cc 55%, var(--pop-2));
  background-size: 240% 100%;
  animation: lpFlow 1.8s linear infinite;
}
.lprog .lp.cur::after {
  content: ''; position: absolute; top: 50%; left: var(--p, 0%);
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2px var(--pop), 0 0 9px 2px rgba(249,115,22,.45);
  transition: left .5s cubic-bezier(.22, 1, .36, 1);
}
@keyframes lpFlow { to { background-position: -240% 0; } }
/* 走完全程：整条点亮成绿色，轻轻跳一下 */
.lprog.done .lp b { background: linear-gradient(90deg, #34d399, #059669); }
.lprog.done { animation: lpDone .55s cubic-bezier(.22, 1, .36, 1); }
@keyframes lpDone { 0% { transform: scaleY(1); } 45% { transform: scaleY(2); } 100% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .lprog .lp.cur b { animation: none; }
  .lprog.done { animation: none; }
}
.lend { text-align: center; font-size: 12.5px; color: var(--muted); padding: 14px 0 4px; }
@keyframes lstepIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.lstep.cur { animation: lstepIn .24s ease; }
.ls-hint { animation: lstepIn .2s ease; }

.lq {
  background: linear-gradient(180deg, #fff, rgba(246,245,242,.55));
  border: 1px solid var(--line); border-radius: 16px; padding: 15px 17px; margin-bottom: 14px;
}
.lq-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.lq-stem { font-size: 14.5px; line-height: 1.9; color: var(--text); }

/* 开讲第一屏：这道题的关键（精讲标题）
   刻意做得比步骤标题还小：它只在开讲前占一会儿，高度一多就把下面的步骤挤到看不见。
   一进第 1 步它就整体滑走（.gone），把位置让给步骤。 */
#l-intro {
  max-height: 900px;
  transition: opacity .3s ease, transform .3s ease, max-height .3s ease, margin .3s ease;
}
#l-intro.gone { opacity: 0; transform: translateY(-26px); max-height: 0; margin: 0; overflow: hidden; }
.lkey {
  display: flex; align-items: baseline; gap: 8px;
  margin: 2px 0 10px; padding: 8px 13px 9px;
  background: linear-gradient(180deg, #fff8f2, var(--pop-weak));
  border: 1px solid var(--pop-line); border-left: 3px solid var(--pop);
  border-radius: 0 10px 10px 0;
}
.lkey-tag {
  flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: .12em;
  color: var(--pop-2); opacity: .9;
}
.lkey b {
  flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 1.62; color: var(--ink);
  font-weight: 700; font-family: "SimHei", "Microsoft YaHei", sans-serif;
}
.lkey-tag.lv {
  letter-spacing: 0; margin-right: 2px; padding: 0 4px;
  border: 1px solid var(--pop-line); border-radius: 4px; opacity: .85;
}
.lkey .katex { font-size: 1em; }

/* 「细说」：导语默认收起，需要时才展开 */
.lmore {
  display: inline-flex; align-items: center; margin: 0 0 12px 2px;
  padding: 3px 11px; font-family: inherit; font-size: 11.5px; font-weight: 600;
  color: var(--pop-2); background: rgba(249,115,22,.07);
  border: 1px solid var(--pop-line); border-radius: 999px; cursor: pointer;
  transition: background .15s;
}
.lmore:hover { background: rgba(249,115,22,.14); }

.lintro {
  font-size: 13px; color: var(--text-2); background: var(--pop-weak);
  border-left: 3px solid var(--pop); padding: 11px 15px;
  border-radius: 0 12px 12px 0; margin-bottom: 16px;
}

.lstep { border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; margin-bottom: 10px; transition: all .22s var(--ease); }
.lstep.done { background: rgba(246,245,242,.6); opacity: .82; }
.lstep.cur {
  border-color: var(--pop-line); background: #fffdfb;
  box-shadow: 0 10px 26px -20px rgba(249,115,22,.9), 0 0 0 1px rgba(249,115,22,.06);
}
.ls-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.ls-no {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(180deg, #fb8c3c, var(--pop)); color: #fff; font-size: 11.5px;
  font-weight: 700;
}
.lstep.done .ls-no { background: #cbd5e1; }
.ls-ok { margin-left: auto; color: var(--ok); }
.ls-total { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.ls-ask { margin-top: 10px; font-size: 14px; line-height: 1.85; color: var(--text); }
.ls-hints { margin-top: 10px; }
.ls-hint {
  font-size: 13px; color: var(--text-2); background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 8px; padding: 8px 12px; margin-bottom: 6px;
}
.ls-hint b { display: block; font-size: 11px; color: #b45309; margin-bottom: 2px; }
.ls-reveal {
  margin-top: 10px; font-size: 13.5px; line-height: 1.85; color: var(--text);
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 9px 12px;
}
.lstep.done .ls-reveal { background: transparent; border: 0; padding: 2px 0 0; color: var(--text-2); font-size: 13px; }
.ls-expr { margin-top: 8px; font-size: 13.5px; color: var(--accent); }
.ls-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: flex-end; }
.lrecap {
  margin-top: 16px; border: 1px dashed var(--accent-line); border-radius: 10px;
  padding: 14px 16px; background: #fbfdff;
}
.lrecap h4 { margin: 0 0 8px; font-size: 13px; color: var(--accent); }
.lrecap .lans { margin-top: 10px; font-weight: 600; }

.qfoot-l { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 6px; }
.learn {
  background: rgba(47,66,112,.06); border: 1px solid var(--accent-line); padding: 4px 11px;
  cursor: pointer; font-family: inherit; font-size: 12px; color: var(--accent);
  border-radius: 999px; font-weight: 600; transition: all .18s var(--ease);
}
.learn:hover { background: var(--accent-weak); transform: translateY(-1px); }
/* 自动分步：蓝色系，与手写精讲的紫色区分开 */
.learn.auto { color: #0369a1; border-color: #bae6fd; background: rgba(3,105,161,.06); }

/* 「▶ 视频」：录过视频的题才出现。红色系一眼认出是播放，和紫色精讲、蓝色自动分步都不撞 */
.vbtn {
  background: #fef2f2; border: 1px solid #fca5a5; padding: 4px 11px;
  cursor: pointer; font-family: inherit; font-size: 12px; color: #b91c1c;
  border-radius: 999px; font-weight: 600; transition: all .18s var(--ease);
}
.vbtn:hover { background: #fee2e2; transform: translateY(-1px); }

/* 「有引导」筛选按钮 */
.guide-btn { color: #7c3aed; border-color: #ddd6fe; background: #faf5ff; white-space: nowrap; }
.guide-btn b { font-weight: 600; margin-left: 2px; }
.guide-btn:hover { background: #f3e8ff; border-color: #c4b5fd; color: #6d28d9; }
.guide-btn.on { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.guide-btn.auto { color: #0369a1; border-color: #bae6fd; background: #f0f9ff; }
.guide-btn.auto:hover { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
.guide-btn.auto.on { background: #0369a1; border-color: #0369a1; color: #fff; }

/* 每页条数选择 */
.sizepick { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.sizepick select {
  font-family: inherit; font-size: 12.5px; color: var(--text-2);
  padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; outline: none; cursor: pointer;
}
.sizepick select:focus { border-color: var(--accent-line); }
.switch.sub { display: flex; margin: 9px 0 0 1px; font-size: 12.5px; color: var(--muted); }
.switch.sub input { width: 14px; height: 14px; accent-color: var(--accent); }

/* 生成结果文件卡 */
.filecard {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; text-decoration: none; color: inherit;
  transition: border-color .15s, background .15s;
}
.filecard:hover { border-color: var(--accent-line); background: var(--accent-weak); }
.fi {
  display: grid; place-items: center; width: 34px; height: 38px; flex: 0 0 auto;
  background: #fef2f2; color: #b91c1c; border-radius: 6px; font-size: 10px; font-weight: 700;
}
.fm { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.fn { font-size: 13.5px; font-weight: 600; }
.fs { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fgo { font-size: 12.5px; color: var(--accent); white-space: nowrap; }

/* 翻页挪到工具栏顶部后，列表自己兜住底部留白：
   底部横条（56px）+ 距底 14 + 余量，免得最后一张卡被题目篮盖住 */
.qlist { display: flex; flex-direction: column; gap: 12px; padding-bottom: 96px; }

/* ---------------- card ---------------- */
.qcard {
  position: relative;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
  transition: transform .28s var(--ease), border-color .2s, box-shadow .28s var(--ease);
  overflow: hidden;
  animation: cardIn .45s var(--ease) both;
}
/* 从每日一练「第 78 套 · 第 13 题」定位过来时，目标卡片闪一圈，
   否则列表一加载，眼睛根本不知道要看哪一道。 */
.qcard.flash { border-color: var(--pop-line); box-shadow: 0 0 0 3px var(--pop-weak); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
/* 前若干张错开出场，列表一进来就有层次 */
.qcard:nth-child(1) { animation-delay: .01s; }
.qcard:nth-child(2) { animation-delay: .04s; }
.qcard:nth-child(3) { animation-delay: .07s; }
.qcard:nth-child(4) { animation-delay: .10s; }
.qcard:nth-child(5) { animation-delay: .13s; }
.qcard:nth-child(6) { animation-delay: .16s; }
.qcard:nth-child(7) { animation-delay: .19s; }
.qcard:nth-child(8) { animation-delay: .22s; }
.qcard:nth-child(9) { animation-delay: .25s; }
.qcard:nth-child(10) { animation-delay: .28s; }

.qcard:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 2px 4px rgba(28,24,18,.04), 0 18px 34px -18px rgba(28,24,18,.28);
}
.qcard.on { border-color: var(--pop-line); background: #fffdfb; }
.qcard.on::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--pop), #fdba74);
}

.qmain { padding: 13px 18px 10px; cursor: pointer; }
.qhead { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.qno {
  display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px;
  font-size: 11.5px; font-weight: 700; color: var(--text-2);
  background: rgba(246,245,242,.95); border-radius: 7px; font-variant-numeric: tabular-nums;
  transition: all .2s;
}
.qcard.on .qno { background: var(--pop); color: #fff; box-shadow: 0 3px 10px -4px rgba(249,115,22,.8); }
.qtag { font-size: 11.5px; color: var(--muted); }
.qtag + .qtag::before { content: "·"; margin: 0 5px; }

.check { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--pop-2); opacity: 0; transition: opacity .2s; font-weight: 600; }
.qcard.on .check { opacity: 1; }

/* 题干正文字号：分数是竖排的（\dfrac），字号太小分数线上下就糊成一团，
   所以比旁边的小字（徽章、按钮）大一档，行高也相应放宽，别让带分数的行挤在一起。 */
.qtext { font-size: 15px; line-height: 1.95; color: var(--text); }
.qtext .em { color: var(--muted); }

/* 多小问题（(1)(2)(3)…）之间的答题空白，由 app.js 的 mdToHtml({gap:true}) 生成。
   老师 2026-11-15 的原话：几个小问挤在一块，「特别是分数这种显示挤在一块特别难看」，
   每问之间起码留三行，孩子好下笔。1 行 = 1.95em，5.4em ≈ 2.8 行，
   再加小问自己那行行高，看起来就是三行左右的空档。 */
.qgap { height: 5.4em; }

/* 口算板：每个小问一个 .qi（整块不折行），中间垫一个 .qsep。
   口算答案就写在等号后头，一排能放几个放几个，放不下整块折到下一行 ——
   再按三行留白算，一道八小题的口算能吃掉一整页（2026-11-15 老师提「口算是个特殊形态」）。
   3em ≈ 45px，写个「0.75」正好；2.4em 时一行能挤下九道，太密了，得数是写不下的。 */
.qi { display: inline-block; white-space: nowrap; vertical-align: top; padding: 0.2em 0 0.55em; }
.qsep { display: inline-block; width: 3em; }

/* 卡片正文里的原卷配图（完整题干带的图）。
   靠左、按高度收放 —— 一张扫描件能有两千像素高，直接铺开卡片就得占两屏。
   多张并排时靠 inline-block 自然换行，和原卷「几张小图横排」的样子接近。 */
.qtext .fig-card {
  display: inline-block; vertical-align: middle;
  max-width: min(100%, 520px); max-height: 210px;
  width: auto; height: auto;
  margin: 5px 12px 5px 0;
}
/* 原卷里的小矢量图是按 36~50px 存的（「从正面看到的形状」这种），
   在卡片里照原尺寸画出来只有一个指甲盖大，给个下限才看得清。
   SVG 放大会重新栅格化，不会糊。 */
.qtext .fig-card[src$=".svg"] { min-width: 78px; }

/* 图注：图下面的一行小字（老师在图面板里写的，可留空）。
   跟题干正文一样左对齐；选项图是「居中排」时图注也跟着居中，不然字和图中线错开。 */
.fig-cap {
  display: block; margin: 4px 0 2px;
  color: var(--muted); font-size: 12px; line-height: 1.5;
}
.optfig.c + .fig-cap { text-align: center; }
/* 讲解里图被搬到右栏/下方后，图注跟着图走，要和图中线对齐 */
#learn.teach .fig-cap { font-size: 15px; margin: 5px 0 3px; text-align: center; }

/* 机主在卡片里点配图 → 弹出「宽度」小面板（openFigPanel）。
   学生点图什么也不发生，所以光标和悬停提示只给机主。 */
body.owner .qtext .fig-card,
body.owner .qopts .optfig img { cursor: pointer; }
body.owner .qtext .fig-card:hover,
body.owner .qopts .optfig img:hover {
  outline: 2px dashed var(--pop-line); outline-offset: 3px; border-radius: 6px;
}
.fgp {
  position: fixed; z-index: 78; width: 268px;
  padding: 12px 13px 11px;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  font-size: 12.5px; color: var(--text);
}
.fgp-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.fgp-head b { font-size: 13px; }
.fgp-val { color: var(--pop-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.fgp-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.fgp-steps button, .fgp-pos button, .fgp-def {
  font: inherit; font-size: 12px; padding: 5px 0; cursor: pointer;
  background: #fff; color: var(--text-2);
  border: 1px solid var(--line-strong); border-radius: 9px;
  transition: all .14s var(--ease);
}
.fgp-steps button:hover, .fgp-pos button:hover, .fgp-def:hover {
  border-color: var(--pop-line); background: var(--pop-weak); color: var(--pop-2);
}
.fgp-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.fgp-num {
  width: 76px; padding: 5px 8px; font: inherit; font-size: 13px; text-align: center;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: #fff; color: var(--text);
}
.fgp-u { color: var(--muted); font-size: 11.5px; }
.fgp-def { margin-left: auto; padding: 5px 9px; }
.fgp-pos { flex-wrap: wrap; }
.fgp-lab { color: var(--muted); font-size: 11.5px; }
.fgp-pos button { flex: 1 1 0; min-width: 46px; padding: 4px 0; }
.fgp-pos button.on {
  background: var(--pop-weak); border-color: var(--pop-line);
  color: var(--pop-2); font-weight: 700;
}
.fgp-tip { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.fgp-caprow { gap: 7px; }
.fgp-cap {
  flex: 1 1 auto; min-width: 0; padding: 5px 8px;
  font: inherit; font-size: 12.5px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: #fff; color: var(--text);
}
.fgp-cap:focus { outline: none; border-color: var(--pop-line); box-shadow: 0 0 0 3px var(--pop-weak); }

/* 选项卡里的选项：短的排两列，长句 / 只有两三项时排一列。
   以前卡片只显示题干，选择题等于只看到半个题，得点开详情才知道问什么。 */
.qopts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 22px; margin-top: 7px;
  font-size: 15px; line-height: 1.85; color: var(--text);
}
.qopts.one { grid-template-columns: minmax(0, 1fr); }
/* 纯图选项（四个选项都是图）：按图片实际宽度紧凑排，图之间间距一致。
   不能用 1fr 均分——图片只有 70px 时会被拉到 200px 一列，四个选项散得满屏都是，
   看起来不像试卷。窄屏自动换行成两列，不会把图压小。 */
.qopts.grid { display: flex; flex-wrap: wrap; gap: 12px 34px; margin-top: 10px; }
.qopts.grid .qopt { flex: 0 0 auto; flex-direction: column; align-items: center; gap: 3px; }
.qopts.grid .qopt .ol { font-size: 11.5px; }
.qopts.grid .qopt .ot { text-align: center; }
.qopts.grid .optfig { margin: 0; }
/* 老师指定了「一行放几个」就固定列数。列宽用 max-content 而不是 1fr：
   1fr 会把 70px 的小图摊到 500px 一列里，A 和 B 隔得像两页书；按内容宽度排才像试卷。 */
.qopts.grid.cols {
  display: grid; justify-content: start;
  grid-template-columns: repeat(var(--ocols, 4), max-content);
  gap: 12px 34px;
}
.qopt { display: flex; gap: 6px; align-items: flex-start; min-width: 0; }
.qopt .ol { flex: 0 0 auto; color: var(--muted); font-weight: 600; }
.qopt .ot { min-width: 0; }
.qopts .optfig { display: inline-block; margin: 2px 8px 2px 0; }
.qopts .optfig img.card-optfig {
  display: inline-block; width: auto; height: auto; max-width: 100%;
}
@media (max-width: 760px) {
  .qopts { grid-template-columns: minmax(0, 1fr); }
  .qopts.grid { gap: 10px 22px; }
  .qtext .fig-card { max-height: 170px; }
  /* 手机上一行长算式的公式折不了行（KaTeX 是一整块），字号又不能小，
     所以让它横向滑一下，总比把尾巴裁掉好。 */
  .qtext { overflow-x: auto; }
}

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(246,245,242,.95); color: var(--muted);
  border: 1px solid transparent;
}
.badge.img { background: var(--pop-weak); color: var(--warn); border-color: var(--pop-line); }
.badge.vec { background: #eef1f8; color: var(--accent); font-weight: 700; border-color: var(--accent-line); }
.badge.ok { background: #edf9f3; color: var(--ok); }
.badge.miss { background: #fef2f2; color: #b91c1c; }
.badge.type { background: var(--accent-weak); color: var(--accent); }

.qfoot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; row-gap: 6px;
  padding: 8px 18px 10px; margin-top: 0;
  border-top: 1px solid rgba(231,227,218,.75);
  background: linear-gradient(180deg, rgba(246,245,242,.35), rgba(255,255,255,0));
}

/* 单题留白输入 */
.blk { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.blk input {
  width: 56px; padding: 4px 7px; font-size: 11.5px; font-family: inherit;
  text-align: center; color: var(--text-2); background: rgba(246,245,242,.85);
  border: 1px solid var(--line); border-radius: 8px; outline: none;
  transition: all .18s;
}
.blk input:focus { border-color: var(--pop-line); background: #fff; color: var(--text); box-shadow: var(--ring); }
.blk input::placeholder { color: #b6bcc7; }
.blk input::-webkit-outer-spin-button,
.blk input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.exp {
  font-size: 12px; color: var(--text-2); background: rgba(255,255,255,.9);
  border: 1px solid var(--line); padding: 4px 11px; cursor: pointer; font-family: inherit;
  border-radius: 999px; font-weight: 600; transition: all .18s var(--ease);
}
.exp:hover {
  border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px);
  box-shadow: 0 6px 14px -10px rgba(28,24,18,.6);
}

/* 展开区：只放答案和解析（题干与选项卡片上已经完整显示）。
   字号跟题干对齐（15px）：解析里也是竖排分数，比题干小一档会明显看着别扭。 */
.qdetail {
  border-top: 1px dashed var(--line); padding: 14px 16px 16px;
  background: #fcfdfe; font-size: 15px; line-height: 1.95;
}
.qdetail .dsec + .dsec { margin-top: 14px; }
.qdetail h5 {
  margin: 0 0 6px; font-size: 11.5px; font-weight: 600;
  color: var(--muted); letter-spacing: .5px;
}
/* 行距 6→14：四个选项排两行时，若都是 \dfrac 分数，上下两行会挤在一起
   （数字本身的行高就撑满了行盒，6px 只剩一条缝）。整数选项多这点空也不难看。
   2026-11-16 老师核查时提。 */
.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.opts.short { grid-template-columns: repeat(4, 1fr); }
.opt { color: var(--text); }
/* 选项整张是图：#image[w:70,p:c]{image/x.jpg} → 图 + 缺图提示 */
.optfig { display: inline-block; vertical-align: middle; line-height: 0; margin: 2px 0; }
.optfig img { display: block; height: auto; max-width: 100%; border-radius: 3px; }
.optfig.l { text-align: left; }
.optfig.c { text-align: center; }
.optmiss {
  display: inline-block; line-height: 1.7; font-size: 12px; color: #b45309;
  background: #fff7e6; border: 1px dashed #f0c48a; border-radius: 6px; padding: 0 8px;
}
#learn.teach .optfig img { min-width: 120px; }
/* 老师在图面板里定过宽度的选项图，别再被上面的 min-width 顶回去 */
#learn.teach .optfig img.has-w { min-width: 0; }
#learn.teach .optfig .optmiss { font-size: 15px; padding: 2px 12px; }
.opt b { color: var(--accent); margin-right: 4px; }
.fig { display: block; max-width: 460px; max-height: 300px; margin: 10px 0; border-radius: 6px; }
.ansbox { color: var(--text); font-weight: 600; }
/* 一道题多个空时，几个空的答案在源站是连成一串的，网页折叠空格后看不出分界
   （「5700.5万1亿」到底填两个空还是三个空）。app.js 的 ansMarkup 按题干下划线数
   把答案切段，段界渲染成 .ansgap，段内空格渲染成 .anssp —— 只加空白，一个字不改。 */
.ansgap { display: inline-block; width: 2em; }
.anssp { display: inline-block; height: 1em; vertical-align: middle; }
.solbox { color: var(--text-2); }
.solbox b { color: var(--text); }
/* 解析 = 学生卷面上的答案，公式必须左起顶格。KaTeX 的 display 模式默认居中，这里统一压回左对齐 */
.solbox .katex-display { text-align: left; margin: 4px 0; }
.solbox .katex-display > .katex { text-align: left; white-space: normal; }
/* 一行只放一条 $$…$$ 时由 mdToHtml 包成块级 .mblk，上下间距统一在这里给，避免 <br> 叠出空行。
   左对齐只在「解析」里强制——精讲页面的推导式居中展示是设计如此 */
.mblk { margin: 5px 0; }
.mblk .katex-display { margin: 0; }
.solbox .mblk .katex-display,
.solbox .mblk .katex-display > .katex { text-align: left; white-space: normal; }
.empty { color: var(--muted); font-style: normal; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 20px 0 8px; }
.pinfo { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------- buttons ---------------- */
.btn {
  font-family: inherit; font-size: 13px; border-radius: 999px; cursor: pointer;
  padding: 8px 16px; transition: all .2s var(--ease); border: 1px solid transparent;
  font-weight: 500; line-height: 1.35;
}
.btn.ghost {
  background: rgba(255,255,255,.9); border-color: var(--line); color: var(--text-2);
}
.btn.ghost:hover {
  border-color: var(--line-strong); color: var(--ink); background: #fff;
  transform: translateY(-1px); box-shadow: 0 6px 16px -10px rgba(28,24,18,.5);
}
.btn.ghost:active { transform: translateY(0); }
.btn.ghost.danger { color: #b91c1c; border-color: #fecaca; }
.btn.ghost.danger:hover { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }
.sheet-foot .grow { flex: 1; }
.btn.primary {
  background: linear-gradient(180deg, #fb8c3c, var(--pop)); color: #fff; font-weight: 700;
  box-shadow: 0 6px 16px -8px rgba(249,115,22,.9), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn.primary:hover {
  background: linear-gradient(180deg, var(--pop), var(--pop-2));
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -10px rgba(249,115,22,.95), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn.primary:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* ---------------- basket ----------------
   悬浮横条要和正文列（题目区）两端对齐，而不是和整页对齐。
   .layout 居中、max-width 1560，正文列左边缘 = 布局左边缘 + 22 + 侧栏 + 20，
   所以正文列中心相对视口中心恒偏移 (侧栏 + 间距) / 2，
   宽度 = 布局宽 - 左右内边距 - 侧栏 - 间距。
   侧栏宽度统一取 --side-w，窄屏侧栏隐藏时（见媒体查询）改回整页居中。 */
.basket {
  position: fixed; bottom: 14px; z-index: 40;
  left: calc(50% + (var(--side-w) + 20px) / 2);
  transform: translateX(-50%);
  width: min(calc(1560px - 44px - var(--side-w) - 20px),
             calc(100vw - 44px - var(--side-w) - 20px));
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 12px 0 20px;
  background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid rgba(231,227,218,.95); border-radius: 999px;
  box-shadow: 0 18px 44px -22px rgba(28,24,18,.5), 0 2px 6px rgba(28,24,18,.05);
}
.b-left { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); }
.b-left b { color: var(--pop-2); font-size: 17px; font-variant-numeric: tabular-nums; }
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--pop);
  box-shadow: 0 0 0 4px rgba(249,115,22,.16);
  animation: dotPulse 2.4s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(249,115,22,.14); }
  50% { box-shadow: 0 0 0 6px rgba(249,115,22,.06); }
}
.b-right { display: flex; gap: 8px; }

/* ---------------- modal ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
  /* 单列必须显式 minmax(0,1fr)：否则列宽被内容撑开，`.sheet` 的 max-width:100%
     在 390 宽手机上失效，弹窗右边会顶出屏幕（2026-11-16 复习本实测） */
  grid-template-columns: minmax(0, 1fr);
  background: rgba(23,20,15,.46);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .18s ease-out;
}
.modal[hidden] { display: none; }
/* 「生成完成」这一层要盖在复习本上面：两者都是 .modal（z-index 60），按 DOM 先后
   #result 写在 #wrongbook 前面，同层级时会被复习本压在下面，点了打印看不到结果。 */
#result { z-index: 70; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 460px; max-width: 100%; max-height: 86vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.6);
  animation: pop .32s cubic-bezier(.34,1.4,.64,1);
}
.sheet.wide { width: 640px; }
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 22px; border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 15px; color: var(--ink); letter-spacing: -.01em;
}
.x {
  border: 0; background: none; font-size: 15px; color: var(--muted); cursor: pointer;
  line-height: 1; width: 30px; height: 30px; border-radius: 50%; transition: all .2s;
}
.x:hover { background: rgba(246,245,242,1); color: var(--ink); transform: rotate(90deg); }
.sheet-body { padding: 20px 22px; overflow: auto; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 22px; border-top: 1px solid var(--line); }
/* 按钮文字一律不折行：390 宽下「刷新」被挤成竖排「刷/新」，「打印这 3 道」也劈成两行 */
.sheet-foot .btn { white-space: nowrap; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input, .field select {
  width: 100%; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 10px; outline: none;
  color: var(--text); background: rgba(246,245,242,.7); transition: all .2s;
}
.field input:focus, .field select:focus {
  border-color: var(--pop-line); background: #fff; box-shadow: var(--ring);
}
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.hint { font-size: 12.5px; color: var(--muted); }
/* 去重结果：算出来有重复就用暖色强调一下，没有就淡着说一句 */
.hint.dedup-hit {
  color: #b45309; font-weight: 600;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: 7px 10px;
}
.hint.dedup-flat { color: var(--muted); }

.bi { display: flex; gap: 10px; padding: 11px 4px; border-bottom: 1px solid rgba(231,227,218,.7); font-size: 13px; align-items: flex-start; cursor: pointer; border-radius: 8px; transition: background .15s; }
.bi:hover { background: rgba(246,245,242,.8); }
.bi:hover .brm { color: #b91c1c; }
.bi:last-child { border-bottom: 0; }
.bi .bn { color: var(--pop-2); font-weight: 700; min-width: 24px; padding-top: 1px; }
.bi .btx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bi-top { font-size: 12.5px; color: var(--text-2); }
.bi-top b { color: var(--text); }
.bi-pv {
  font-size: 12.5px; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bi .brm { color: var(--muted); font-size: 12px; white-space: nowrap; padding-top: 1px; }

.toast {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
  background: #16181d; color: #fff; font-size: 13px;
  padding: 9px 16px; border-radius: 8px; z-index: 70;
  box-shadow: var(--shadow-lg);
}

.katex { font-size: 1em; }
.katex-error { color: #b91c1c !important; }

@media (max-width: 860px) {
  /* 只藏左边那列；批注条也带 side 类，写成 .side 会导致窄屏上工具条整条消失 */
  aside.side { display: none; }
  .stat { display: none; }
  .bsub { display: none; }
  .layout { padding: 12px 12px 96px; }
  .top { gap: 12px; padding: 0 12px; }
  /* 手机上工具条会折成四五行、一百多像素高，冻住就吃掉半个屏幕，
     所以窄屏不冻：顶部导航已经冻了一条，再叠一条太挤 */
  .toolbar { position: static; }
  .toolbar::after { display: none; }
  .toolbar::before { display: none; }
  .opts, .opts.short { grid-template-columns: 1fr; }
  /* 侧栏没了，正文列就是整页（左右各 12px 内边距）：横条跟着贴同样的边 */
  .basket {
    left: 50%; width: calc(100vw - 24px); bottom: 10px; padding: 0 8px 0 16px;
  }
}

/* 学习模式：窄屏（平板竖屏 / 手机）适配 */
@media (max-width: 680px) {
  .modal { padding: 10px; }
  .learn-box { border-radius: 10px; }
  .learn-head { padding: 12px 14px; font-size: 14px; }
  .learn-body { padding: 0 14px 16px; }
  .lprog { margin: 0 0 10px; padding: 0 14px; }
  .learn-foot { padding: 10px 14px; gap: 8px; }
  .learn-foot .kbd-hint { display: none; }
  .learn-foot .btn { flex: 1 1 auto; padding: 9px 10px; font-size: 13px; }
  .lq { padding: 12px 13px; }
  .lq-stem, .ls-ask { font-size: 14px; line-height: 1.85; }
  .lintro { font-size: 12.5px; padding: 9px 12px; }
  .lstep { padding: 12px 13px; }
  .ls-title { font-size: 13.5px; }
  .ls-total { font-size: 11px; }
}

/* ---------------- 讲解模式（投屏 / 录课） ----------------
   思路：录屏时画面上只有这个框，所以把它做成「一页板书」：
   白底、大字号、按钮淡出，靠 Enter 推进。 */
.teach-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  color: var(--muted); cursor: pointer; font-weight: 400; margin-right: 10px; }
.teach-toggle input { accent-color: var(--accent); }
.lh-right { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
/* ↑ margin-left:auto：顶栏被挤成两行时，图标那一组自己占一行也要贴右边，
   不然会掉到标题底下左对齐（900 宽的屏上看着像漏排）。 */

/* 讲解弹窗：水平居中、**顶端对齐**。
   垂直居中的话大屏投屏时整块框会悬在半空，上方留一大片空白，
   而且不同步骤长度一变，框的位置就上下跳。顶端对齐后顶边钉住不动。 */
#learn { place-items: start center; padding: 14px 16px 16px; }
/* 非投屏的普通讲解框比较矮，往下让一点，别贴死在顶边 */
#learn:not(.teach) { padding-top: 7vh; }

#learn.teach {
  background: rgba(248, 250, 251, .965); backdrop-filter: blur(7px);
  /* 靠左上角摆，不再水平居中：居中的话左右各白扔几十像素，而书写区就在这个框里 */
  padding: 14px 0 16px; place-items: start start;
}
#learn.teach .learn-box {
  /* 投屏/录课：这块框就是书写区，所以每个像素都要用在板书上。
     批注工具条改成「停靠到底部按钮行」（见 .ink-bar.dock），不再占右侧一条通道，
     于是横向可以一路贴到屏幕边（左右各 6px）；屏很宽（>1712）时才收回到 1700 并居中，
     免得上到 2560 的屏上板书被拉成一条长横线。 */
  width: min(1700px, calc(100vw - 12px));
  margin-left: max(6px, calc((100vw - 1700px) / 2));
  height: min(1120px, calc(100vh - 30px));
  max-width: none; max-height: none;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .10), 0 0 0 1px rgba(15, 23, 42, .07);
}
/* 顶栏只放「卷名 · 第 N 题」和功能按钮一行 —— 翻题挪到底行之后不用再挤成两行，
   上下各收 3px，给正文多让出一点书写空间。 */
#learn.teach .learn-head { padding: 9px 26px; font-size: 14.5px; color: var(--text-2); }
/* 顶部对齐：内容出现时已有文字位置不动，录课画面才稳 */
#learn.teach .learn-body { padding: 22px 26px 26px; }
#learn.teach .lprog { height: 13px; padding: 0 26px; background: transparent; }

/* 题干当板书面 */
#learn.teach .lq {
  background: linear-gradient(180deg, #fff, rgba(246,245,242,.45));
  border: 1px solid var(--line); border-left: 4px solid var(--pop);
  border-radius: 16px; padding: 20px 24px; margin-bottom: 20px;
}
#learn.teach .lq-meta { font-size: 13px; margin-bottom: 10px; }
#learn.teach .lq-stem { font-size: 21px; line-height: 2.1; }
#learn.teach .fig { max-width: 64%; max-height: 320px; }   /* 以后几何题带图时别撑爆版面 */

#learn.teach .lintro {
  font-size: 18px; line-height: 1.9; padding: 15px 20px; margin-bottom: 20px;
  background: var(--pop-weak); border-left: 3px solid var(--pop);
}
/* 投屏时这句关键也只比步骤标题小一点，别抢版面 */
#learn.teach .lkey { padding: 10px 16px 11px; margin-bottom: 12px; }
#learn.teach .lkey-tag { font-size: 11.5px; }
#learn.teach .lkey b { font-size: 15px; line-height: 1.6; }
#learn.teach .lmore { font-size: 13px; padding: 4px 14px; margin-bottom: 14px; }
#learn.teach .lstep { padding: 20px 24px; margin-bottom: 14px; border-radius: 12px; }
#learn.teach .ls-title { font-size: 16.5px; }
#learn.teach .ls-no { width: 24px; height: 24px; font-size: 13px; }
#learn.teach .ls-total { font-size: 12.5px; }
#learn.teach .ls-ask { font-size: 20px; line-height: 2; margin-top: 14px; }
#learn.teach .ls-hint { font-size: 16px; line-height: 1.85; padding: 11px 15px; }
#learn.teach .ls-hint b { font-size: 12px; }
#learn.teach .ls-reveal { font-size: 18px; line-height: 1.9; padding: 14px 18px; }
#learn.teach .ls-expr { font-size: 17px; }
#learn.teach .lrecap { font-size: 16.5px; line-height: 1.9; padding: 20px 22px; }
#learn.teach .lrecap h4 { font-size: 15px; }
#learn.teach .lans { font-size: 18px; }
#learn.teach .lend { font-size: 14px; }

/* 按钮淡出：录屏时不该抢镜，键盘才是主操作 */
#learn.teach .learn-foot { background: transparent; border-top: 1px solid #eef2f7; padding: 8px 26px; }
#learn.teach .learn-foot .btn {
  padding: 5px 13px; font-size: 12px; opacity: .45; transition: opacity .15s;
  box-shadow: none;
}
#learn.teach .learn-foot .btn.primary {
  background: #fff; color: var(--accent); border: 1px solid #d7e2f5;
}
#learn.teach .learn-foot .btn:hover { opacity: 1; }
#learn.teach .kbd-hint { font-size: 12.5px; }

/* ================= 竖屏录课（📱）：板书面板锁成 9:16 =================
   为什么要有这个：老师在笔记本上录屏，录出来是 1366×768 的横屏视频。学生拿手机
   竖着看，视频宽度只占他屏幕的三分之一，21px 的题干缩到 6px 根本看不清；点全屏
   横过来也只剩 13px，勉强。这是分辨率错配，不是字号不够大。
   开了竖屏之后面板变成 9:16 竖条、四周压暗，录屏时框选这一块，学生竖屏拿手机看
   正好满屏，字可以 1:1 呈现（21px 就是 21px）。
   面板宽度由高度反推，所以 768 高的笔记本和 1080 高的外接屏都严格保持 9:16。 */
#learn.teach.portrait {
  place-items: center;
  padding: 0;
  background: #e8ecf2;      /* 中性浅灰：录屏框不准时也不突兀，框准了又看得清边界 */
}
#learn.teach.portrait .learn-box {
  --ph: min(calc(100vh - 40px), 960px);
  height: var(--ph);
  width: calc(var(--ph) * 0.5625);        /* 9:16 */
  margin-left: 0;                          /* 不是左上角贴边了，回到居中 */
  border-radius: 6px;                      /* 录课画面几乎能看到直角，别留黑圆角 */
  box-shadow: 0 8px 28px rgba(15, 23, 42, .16), 0 0 0 1px rgba(15, 23, 42, .10);
}

/* 录课构图「上题下人」（2026-11-09 老师要求）：
   面板比例**不变**（还是 9:16），OBS 里照旧缩放到 1080×1920；只是把底部 31.6% 挖空当人像位。
   1080×0.3164 = 607，正好是手机摄像头 16:9 缩到 1080 宽的高度，OBS 里一点不用裁。
   挖空用 padding 而不是新增元素：border-box 下内容（含底部按钮行、批注条）自动缩到上面 68.4%，
   批注坐标跟着 inkSyncSize() 重算，不用动别的。预览时留一条虚线 + 一行淡字，录出来被摄像头盖住。 */
#learn.teach.portrait.cam .learn-box { padding-bottom: calc(var(--ph) * 0.3164); }
#learn.teach.portrait.cam .learn-box::after {
  content: '人像区 · 录课时摄像头盖住这块';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--ph) * 0.3164);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; color: #b6bfcd; letter-spacing: .3px;
  border-top: 1px dashed #d5dbe5; pointer-events: none;
}

/* 顶栏（竖屏 405 宽）：翻题已经沉到底行，顶栏只剩「卷名 + 一排图标」，
   一行放得下 —— 不再折成两行，竖屏本来就缺竖向空间。卷名放不下就末尾省略。 */
#learn.teach.portrait .learn-head {
  padding: 7px 10px; gap: 6px; font-size: 12px;
  flex-wrap: nowrap; align-items: center;
}
#learn.teach.portrait #l-title {
  order: 1; flex: 1 1 auto; min-width: 0;
  font-size: 12px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#learn.teach.portrait .lh-right { order: 2; flex: 0 0 auto; gap: 2px; margin-left: auto; }
#learn.teach.portrait .learn-head .bt { display: none; }
#learn.teach.portrait .teach-toggle { display: none; }   /* 竖屏下讲解模式必然开着 */
#learn.teach.portrait .ink-toggle { padding: 3px 5px; font-size: 11.5px; margin-right: 0; }
/* 竖屏底行更窄，翻题按钮再收一点，别把主按钮挤到第二行
   （竖屏不显示 Enter/Esc 提示，见下，所以这行只有「翻题 + 主按钮」两样） */
#learn.teach.portrait .learn-foot .lnav-btn { padding: 2px 6px; font-size: 10.5px; }
#learn.teach.portrait .learn-foot .lnav-pos { font-size: 10px; padding: 0 2px; }

/* 正文：一列到底，题干在上面钉住，步骤区自己滚 */
#learn.teach.portrait .lprog { padding: 0 12px; }
#learn.teach.portrait .lq-wrap { padding: 12px 13px 4px; }
/* 默认规则给步骤区死留 300px，可竖屏面板总共才 480 高，题干被挤到只剩一百多像素，
   fitStem() 就把字号一路缩到 64%（20px→12.8px）—— 竖屏本来是为了字大，缩了就白搭。
   窄版面留 190px 给步骤区足够（一行标题 + 一句话），题干拿回两百多像素，
   正常长度的题就不用缩字号了。 */
#learn.teach.portrait .lq-wrap { max-height: calc(100% - 190px); }
#learn.teach.portrait .lsteps-wrap { padding: 10px 13px 14px; }
#learn.teach.portrait .lq {
  padding: 14px 15px; margin-bottom: 10px; border-radius: 12px; border-left-width: 3px;
}
#learn.teach.portrait .lq-meta { font-size: 11.5px; margin-bottom: 7px; }
#learn.teach.portrait .lq-stem { font-size: 20px; line-height: 1.95; }
#learn.teach.portrait .lq-opt { font-size: 17px; }
#learn.teach.portrait .lintro { font-size: 15.5px; line-height: 1.85; padding: 11px 13px; margin-bottom: 12px; }
#learn.teach.portrait .lkey { padding: 8px 12px 9px; }
#learn.teach.portrait .lkey b { font-size: 14px; }
#learn.teach.portrait .lstep { padding: 13px 14px; margin-bottom: 10px; }
#learn.teach.portrait .ls-title { font-size: 14.5px; }
#learn.teach.portrait .ls-ask { font-size: 18.5px; line-height: 1.9; margin-top: 10px; }
#learn.teach.portrait .ls-hint { font-size: 14.5px; line-height: 1.8; padding: 9px 12px; }
#learn.teach.portrait .ls-reveal { font-size: 16.5px; line-height: 1.85; padding: 11px 13px; }
#learn.teach.portrait .ls-expr { font-size: 15.5px; }
#learn.teach.portrait .lrecap { font-size: 15px; padding: 14px 14px; }
#learn.teach.portrait .lans { font-size: 16.5px; }
#learn.teach.portrait .fig { max-width: 88%; max-height: 240px; }

/* 竖屏 + 带图：原来沿用的是「左文右图」，可竖屏面板才 410 宽，
   图区固定 340px（实际挤到 168），题干只剩 166px —— 一行四五个字，还显示不全。
   竖屏里改成上下排：题干在上（自己滚），图在下撑满宽度、等比缩。
   注意 @media (max-width:900px) 那条救不了这里：面板窄但视口是 1366，媒体查询不触发。 */
#learn.teach.portrait .lq-wrap.has-fig { height: calc(100% - 170px); max-height: none; }
/* 还没点「开始 →」时步骤区是空的（三个空 div 加内边距），下半屏白放着。
   这一屏就是老师读题的开场画面，把空间给题干和图；第一步一出现立刻还原成固定分栏。 */
#learn.teach.portrait:has(#l-steps:empty) .lq-wrap.has-fig { height: calc(100% - 52px); }
/* 竖屏里「点图可放大」这行占 40 多像素，而题干正缺高度；点图放大的行为不变，字去掉 */
#learn.teach.portrait .lq-wrap.has-fig .fig-hint { display: none; }
/* 题干到底还有没有下文：没滚到底时最后一行渐隐，别让学生看着像掉字。
   这里用一层 sticky 的白色渐变盖住末行，**不要用 mask-image** ——
   Chromium 给可滚动的 flex 子项套 mask 时整块文字会不绘制（实测题干直接空白）。 */
#learn.teach.portrait .lq-wrap.has-fig .lq-text.can-scroll::after {
  content: ''; position: sticky; bottom: 0; display: block;
  height: 26px; margin-top: -26px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 78%);
}
#learn.teach.portrait .lq-wrap.has-fig .lq-main {
  flex-direction: column; align-items: stretch; gap: 10px;
}
#learn.teach.portrait .lq-wrap.has-fig .lq-text {
  flex: 1 1 0; min-height: 0; max-height: none; overflow: auto; padding-right: 2px;
}
/* 图按自身比例占高，最多占正文 58%（JS 里 figPortraitBox 算的也是 58%，两边要一致；
   这里的 62% 只是兜底，别比 JS 更紧，否则图会被裁掉一条） */
#learn.teach.portrait .lq-wrap.has-fig .lq-fig {
  flex: 0 0 auto; min-height: 0; max-height: 62%;
  width: 100%; max-width: 100%; justify-content: flex-start;
}
#learn.teach.portrait .lq-wrap.has-fig .lq-fig .figure-live {
  max-width: 100%; max-height: 100%; display: block;
}
#learn.teach.portrait .lq-wrap.has-fig .lq-fig img,
#learn.teach.portrait .lq-wrap.has-fig .lq-fig svg {
  max-width: 100%; max-height: 100%; height: auto; width: auto;
}
#learn.teach.portrait .lq-wrap.has-fig .lq-fig img { object-fit: contain; }
/* 题干被压短时（复刻型只留矢量图），图区别缩成一条 */
#learn.teach.portrait .lq-wrap.has-fig .lq-fig .figure-live { min-height: 0; }

/* 底部按钮行：竖屏下没地方，快捷键提示不录进去 */
#learn.teach.portrait .learn-foot { padding: 7px 12px; gap: 4px; flex-wrap: wrap; }
#learn.teach.portrait .learn-foot .btn { padding: 4px 10px; font-size: 11.5px; }
#learn.teach.portrait .kbd-hint { display: none; }

/* 批注工具条：14 个按钮 34px 一共 476，塞不进 405 的面板，缩到 26 刚好 */
#learn.teach.portrait .ink-bar.dock { max-width: calc(100% - 14px); }
#learn.teach.portrait .ink-bar.dock button { width: 26px; padding: 3px 0 2px; }
#learn.teach.portrait .ink-bar.dock button .ic { font-size: 12px; }
#learn.teach.portrait .ink-bar.dock .sep { margin: 0 2px; }

/* ================= 横屏录课（▭ / W）：16:9 铺满 + 收版心 =================
   为什么要有：学生多半是拿平板横着看录好的课，横屏铺满不留黑边，书写面积是竖屏的 10 倍。
   但原来横屏录出来"字小"——真不是字号小（21px，竖屏才 20px），而是**版心 1595 宽、
   一行 76 个字**，眼睛扫不过来就显小。竖屏好看，本质是一行只放 18 字。
   做法：面板锁 16:9（1920 屏上正好 1920×1080，一格不用裁），版心收到 71%，
   字号按「一行 40 字」反算 → 1920 屏 34px、1366 屏 24px，录出来都是 34px。
   换算到设备：iPad 10.9 上字高 4.0mm（竖屏 4.3mm，肉眼分不出），
   而一屏能放 440～575 字（竖屏 234 字）。手机上只有 1.1mm，所以手机仍走竖屏。 */
#learn.teach.wide { padding: 0; place-items: center center; }
#learn.teach.wide .learn-box {
  --fs: calc(0.71 * min(100vw, 100vh * 16 / 9) / 40);   /* 一行 40 字 */
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(calc(100vw * 9 / 16), 100vh);
  margin: 0; max-width: none; max-height: none;
  border-radius: 0;        /* 录课画面要直角，圆角会露出底色 */
  box-shadow: none;
}
/* 顶栏、进度条、正文统一按版心留边（14.5% × 2 + 71% = 100%）。
   翻题挪到底行之后顶栏只有一行，上下从 11px 收到 7px，正文多出约 8px 书写高度。 */
#learn.teach.wide .learn-head { padding: 7px 14.5%; font-size: 15.5px; }
#learn.teach.wide .lprog { padding: 0 14.5%; }
#learn.teach.wide .learn-body { padding: 16px 14.5% 18px; }
/* 底行也跟版心对齐：横屏录课时顶栏、正文、底行三条左边缘在一条竖线上，
   成片才像一份排版好的讲义（不然提示和按钮贴着成片最外沿，画面显得散）。 */
#learn.teach.wide .learn-foot { padding: 8px 14.5%; }

#learn.teach.wide .lq { padding: 22px 26px; margin-bottom: 18px; border-radius: 14px; }
#learn.teach.wide .lq-meta { font-size: calc(var(--fs) * .62); margin-bottom: 9px; }
#learn.teach.wide .lq-stem { font-size: var(--fs); line-height: 1.95; }
#learn.teach.wide .lq-opt { font-size: calc(var(--fs) * .92); line-height: 1.85; }
#learn.teach.wide .lintro {
  font-size: calc(var(--fs) * .84); line-height: 1.8; padding: 14px 20px; margin-bottom: 16px;
}
#learn.teach.wide .lstep { padding: 20px 26px; margin-bottom: 12px; }
#learn.teach.wide .ls-title { font-size: calc(var(--fs) * .78); }
#learn.teach.wide .ls-ask { font-size: calc(var(--fs) * .95); line-height: 1.9; margin-top: 12px; }
#learn.teach.wide .ls-hint { font-size: calc(var(--fs) * .78); line-height: 1.8; }
#learn.teach.wide .ls-reveal {
  font-size: calc(var(--fs) * .88); line-height: 1.85; padding: 14px 20px;
}
#learn.teach.wide .ls-expr { font-size: calc(var(--fs) * .82); }
#learn.teach.wide .lrecap {
  font-size: calc(var(--fs) * .82); line-height: 1.85; padding: 18px 22px;
}
#learn.teach.wide .lans { font-size: calc(var(--fs) * .9); }
#learn.teach.wide .lkey b { font-size: calc(var(--fs) * .75); }
/* 宽屏高度富余，图可以放大：几何题的辅助线、标注才看得清 */
#learn.teach.wide .fig { max-height: 420px; max-width: 58%; }

/* 横屏 + 人像位：底部空出 12.4% 宽（1920 屏上 = 238px，正好放 420×236 的 16:9 小窗）。
   为什么整行留白而不是只挖右下角：老师画几何图会画到右下，摄像头压上去会盖住板书。
   padding 加在 .learn-box 上（不是 .learn-body）—— 和竖屏一个道理：这样标题栏、正文、
   底部按钮行、批注工具条会整体上移，工具条不会被摄像头盖住。加在 body 上会把工具条留在
   人像带里，老师批注时看不到自己选了什么笔。 */
#learn.teach.wide.cam .learn-box { padding-bottom: 12.4%; }
/* 还没点「开始 →」时步骤区是空的，下半屏白放着。这一屏就是老师读题的开场画面，
   高度全给题干（同竖屏的处理），第一步一出现立刻还原成分栏。 */
#learn.teach.wide:has(#l-steps:empty) .lq-wrap { flex: 1 1 auto; max-height: none; }
#learn.teach.wide:has(#l-steps:empty) .lsteps-wrap { display: none; }
/* 提示框必须**和 OBS 里那个 420×236 小窗一模一样大、一模一样的位置**，否则录出来会露馅：
   横屏的摄像头只盖右边一小块，不像竖屏那样盖住整条带 —— 如果照竖屏写成横贯全宽的虚线，
   录出来的成片会在离底 238px 处留一条虚线、左下角多一行灰字。所以这里画一个「准星」：
   right 0.73%（1920 屏 = 14px）、width 21.875%（=420）、height 21.85%（=236），
   再往里收 5px 兜住舍入误差 —— 摄像头压上去正好把它整个吃掉。
   改了 CSS 里的人像比例 / OBS 里的小窗坐标，这三个数要一起改。 */
#learn.teach.wide.cam .learn-box::after {
  content: '人像区 · 摄像头盖住这块';
  position: absolute; bottom: 5px;
  right: calc(0.73% + 5px);
  width: calc(21.875% - 5px);
  height: calc(21.85% - 5px);
  border: 1px dashed #cbd5e1; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #cbd5e1; letter-spacing: .3px;
  pointer-events: none;
}

/* 新出现的段落统一做一点淡入，像 PPT 逐条飞入 */
#learn.teach .lintro, #learn.teach .ls-reveal, #learn.teach .lrecap { animation: lstepIn .26s ease; }

/* 窄屏（小笔记本、平板、手机）不要露「横屏课」：版心 = 71% 视口宽，1200 以下
   算出来的字号（1024 屏约 18px、1100 屏约 19px）还不到普通讲解模式的 21px，
   开了只会更差。1366 屏是 24px，能露。 */
@media (max-width: 1199px) {
  #l-wide { display: none !important; }
}

@media (max-width: 900px) {
  #learn.teach .learn-box { width: calc(100vw - 12px); }
}
@media (max-width: 680px) {
  #learn.teach { padding: 6px; }
  /* 手机上本来就是竖屏，竖屏录课按钮在这儿没意义（点了只会把框缩成一条） */
  #l-portrait { display: none !important; }
  #learn.teach .learn-box { width: calc(100vw - 12px); height: calc(100vh - 12px); }
  #learn.teach .learn-body { padding: 0; }
  #learn.teach .lq-wrap { padding: 14px 16px 4px; }
  #learn.teach .lsteps-wrap { padding: 12px 16px 18px; }
  #learn.teach .lprog { margin: 0; }
  /* 窄屏：问题一行、答案下一行，都靠左；答案不缩进，用满整宽才不至于折成四五行 */
  #learn.teach .lstep.done { row-gap: 1px; padding: 8px 20px 8px 12px; }
  #learn.teach .lstep.done .ls-ask { flex: 1 1 100%; max-width: none; }
  #learn.teach .lstep.done .ls-reveal {
    flex: 1 1 100%; max-width: 100%; margin-left: 0; text-align: left;
  }
  /* 手机上没键盘，按钮要能点得清 */
  #learn.teach .learn-foot .btn { opacity: .9; padding: 9px 12px; font-size: 13px; }
  #learn.teach .lq-stem { font-size: 17px; }
  #learn.teach .ls-ask { font-size: 16.5px; }
  #learn.teach .lintro { font-size: 15px; }
  #learn.teach .ls-reveal { font-size: 15.5px; }
}

/* ---------------- 讲解模式：题干钉在上方，步骤区独立滚动 ----------------
   录课时题目（尤其几何题的图）必须一直在，滚走的只能是「讲过的步骤」。 */
#learn.teach .learn-body {
  padding: 0;
  display: flex; flex-direction: column;
  overflow: hidden;                 /* 滚动交给下面两个区各自负责 */
}
#learn.teach .lq-wrap {
  flex: 0 0 auto;                   /* 题干优先，尽量完整显示 */
  max-height: calc(100% - 300px);   /* 但至少给步骤区留 300px */
  overflow: auto;
  padding: 22px 26px 4px;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
}
#learn.teach .lq-wrap .lq { margin-bottom: 14px; }
#learn.teach .lsteps-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px 26px 26px;
  scroll-behavior: smooth;
}

/* 讲完的步骤收成一行：序号 + 问题 + 答案（答案紧跟在问题后面，不推到右边）
   答案放不下就整体换到下一行左对齐，绝不用省略号截断——回顾时要能读完整句 */
#learn.teach .lstep.done {
  display: flex; flex-wrap: wrap; align-items: baseline;
  column-gap: 10px; row-gap: 1px;
  padding: 6px 22px 6px 13px; margin-bottom: 4px;
  opacity: .78; cursor: pointer; overflow: hidden;
  position: relative; transition: opacity .15s;
}
#learn.teach .lstep.done:hover { opacity: .95; }
#learn.teach .lstep.done .ls-title { flex: 0 0 auto; font-size: 14px; }
#learn.teach .lstep.done .ls-tt { display: none; }      /* 折叠默认用「问题」当行文本 */
#learn.teach .lstep.done .ls-no { width: 18px; height: 18px; font-size: 11px; }
#learn.teach .lstep.done .ls-total { display: none; }   /* 折叠时不必显示「第几/共几」 */
#learn.teach .lstep.done .ls-hints,
#learn.teach .lstep.done .ls-expr { display: none; }
/* 问题：先用满整行，只有真的超过一行宽才省略（点开能看全）。
   这里曾经写死 max-width:52%（想让问题和答案各占一半），但答案一旦换行，
   那一半就白留着，问题明明一行放得下也被提前截成省略号 —— 竖屏窄条里尤其明显。 */
#learn.teach .lstep.done .ls-ask {
  display: block; flex: 0 1 auto; min-width: 0; max-width: 100%; margin: 0;
  font-size: 13.5px; line-height: 1.6; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 折叠行里的公式略缩，避免分数把行撑高 */
#learn.teach .lstep.done .katex { font-size: .96em; }
#learn.teach .lstep.done br { display: none; }              /* 换行符在折叠行里不该生效 */
#learn.teach .lstep.done .katex-display { display: inline; margin: 0; }
/* 答案：紧跟问题；宽度不够就换行，左对齐，完整显示 */
#learn.teach .lstep.done .ls-reveal {
  display: block; flex: 1 1 auto; min-width: 0; max-width: 100%; margin: 0;
  font-size: 13.5px; line-height: 1.6; color: var(--accent); font-weight: 500;
  white-space: normal; overflow: visible; text-overflow: clip; text-align: left;
}
#learn.teach .lstep.done .ls-reveal p { display: inline; margin: 0; }
#learn.teach .lstep.done .ls-reveal br { display: none; }
#learn.teach .lstep.done::after {
  content: '›'; position: absolute; right: 9px; top: 5px;
  font-size: 13px; color: var(--muted);
}
/* 点开后恢复正常排版（能看完整的提问、提示与结论） */
#learn.teach .lstep.done.open { display: block; opacity: 1; padding: 18px 22px; }
#learn.teach .lstep.done.open .ls-title { display: flex; font-size: 16.5px; }
#learn.teach .lstep.done.open .ls-tt { display: inline; }
#learn.teach .lstep.done.open .ls-no { width: 24px; height: 24px; font-size: 13px; }
#learn.teach .lstep.done.open .ls-ask {
  white-space: normal; overflow: visible; text-overflow: clip;
  font-size: 20px; line-height: 2; color: var(--text); margin-top: 14px;
}
#learn.teach .lstep.done.open .ls-reveal {
  max-width: none; white-space: normal; color: var(--text);
  font-size: 18px; line-height: 1.9; margin-top: 10px;
}
#learn.teach .lstep.done.open::after { content: '收起'; top: 8px; }
#learn.teach .lstep.done.open .ls-reveal,
#learn.teach .lstep.done.open .ls-expr { display: block; }

/* ---------------- 邀请码登录 ---------------- */
.gate {
  position: fixed; inset: 0; z-index: 999;
  display: grid; place-items: center;
  background:
    radial-gradient(760px 520px at 50% 12%, #fff 0%, rgba(255,255,255,0) 62%),
    linear-gradient(160deg, #f8f6f1 0%, #efece4 48%, #e9e5db 100%);
  overflow: hidden;
}
/* 背后缓慢流动的两团光，避免整屏死板 */
.gate-glow { position: absolute; inset: -20%; pointer-events: none; }
.gate-glow::before,
.gate-glow::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
}
.gate-glow::before {
  width: 420px; height: 420px; left: 12%; top: 8%;
  background: radial-gradient(circle, rgba(249,115,22,.35), transparent 68%);
  animation: drift1 18s ease-in-out infinite;
}
.gate-glow::after {
  width: 480px; height: 480px; right: 10%; bottom: 6%;
  background: radial-gradient(circle, rgba(47,66,112,.32), transparent 68%);
  animation: drift2 22s ease-in-out infinite;
}
@keyframes drift1 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(40px, 26px) scale(1.08); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-46px, -30px) scale(1.06); }
}

.gate-box {
  position: relative;
  width: min(392px, calc(100vw - 40px));
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 26px;
  padding: 38px 30px 26px; text-align: center;
  box-shadow: 0 34px 80px -34px rgba(28,24,18,.5), 0 0 0 1px rgba(255,255,255,.9);
  animation: gateIn .5s cubic-bezier(.34,1.3,.64,1) both;
}
/* 卡片顶部一条极细的暖色渐变，收住整块白 */
.gate-box::before {
  content: ""; position: absolute; left: 26px; right: 26px; top: 0; height: 2px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, var(--pop), var(--ink), transparent);
  opacity: .65;
}
@keyframes gateIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.gate-logo { display: grid; place-items: center; margin: 0 auto 16px; }
.gate-logo svg { filter: drop-shadow(0 8px 18px rgba(28,24,18,.22)); }
.gate-logo img {
  display: block; width: 76px; height: 76px;
  filter: drop-shadow(0 8px 18px rgba(28,24,18,.22));
}
.gate-mark {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 13px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 22px;
}
.gate-h1 {
  font-size: 21px; font-weight: 800; margin: 0 0 4px; color: var(--ink);
  letter-spacing: -.02em;
}
.gate-sub {
  font-size: 9.5px; letter-spacing: .2em; color: var(--muted);
  font-weight: 600; margin-bottom: 20px;
}
/* 品牌 slogan「卷卷真题，题题精讲」：夹在名字和英文之间。
   字号比 h1 小一档、颜色同深色（不用橙色——橙色是按钮的行动色，放这里会抢焦点），
   只当说明书看，不做视觉主角。 */
.gate-slogan {
  font-size: 13.5px; font-weight: 700; color: var(--ink);
  letter-spacing: .04em; margin: 0 0 7px;
}
.gate-tip { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.gate-input {
  width: 100%; box-sizing: border-box; height: 50px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 14px;
  font-size: 17px; letter-spacing: 2px; text-align: center;
  font-family: inherit; color: var(--text); background: rgba(255,255,255,.9);
  transition: all .22s;
  font-variant-numeric: tabular-nums;
}
.gate-input:focus {
  outline: none; border-color: var(--pop); box-shadow: 0 0 0 4px rgba(249,115,22,.14);
  background: #fff;
}
.gate-btn {
  width: 100%; height: 50px; margin-top: 14px;
  border: 0; border-radius: 14px; cursor: pointer;
  background: linear-gradient(180deg, #fb8c3c, var(--pop)); color: #fff;
  font-size: 15px; font-family: inherit; font-weight: 700;
  box-shadow: 0 10px 24px -10px rgba(249,115,22,.95), inset 0 1px 0 rgba(255,255,255,.28);
  transition: all .22s var(--ease);
  letter-spacing: .02em;
}
.gate-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -12px rgba(249,115,22,1); }
.gate-btn:active { transform: translateY(0); }
.gate-btn:disabled { opacity: .6; cursor: default; transform: none; }
.gate-err { min-height: 18px; margin-top: 10px; font-size: 12.5px; color: var(--bad); font-weight: 500; }
.gate-foot { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
/* 没邀请码的人不该只能干站着：给一条回官网首页的路 */
.gate-back { display: inline-block; margin-top: 14px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; }
.gate-back:hover { color: var(--ink); border-bottom-color: var(--ink); }
/* 版权主体（公司全称）：登录页最底一行，只为「这是个正规产品」的信任感 */
.gate-co { margin: 18px 0 0; font-size: 11px; color: var(--muted); opacity: .72; letter-spacing: .02em; }
.gate-co a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.gate-co a:hover { color: var(--ink); border-bottom-color: currentColor; }

/* 顶栏右侧：当前使用者 */
.who {
  flex: 0 0 auto; margin-left: 8px; padding: 5px 12px;
  font-size: 12px; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 999px; white-space: nowrap;
  text-decoration: none; background: rgba(255,255,255,.7);
  transition: all .2s;
}
.who:hover { border-color: var(--line-strong); color: var(--ink); }
a.who { cursor: pointer; }
a.who:hover { color: var(--ink); border-color: var(--ink); }

/* ================= 批注层（白板笔 / 荧光笔 / 激光点） =================
   一块透明画布盖在题目区上；笔迹坐标存「正文内容坐标」，滚动时跟着题目走。 */
.learn-box { position: relative; }

#ink-canvas {
  /* 比讲解悬浮图（z-index 12）高一层：老师要能直接在图上写字填数 */
  position: absolute; z-index: 14; pointer-events: none;
  /* 光标必须隐藏。原来这里是 crosshair，本意是给批注定位，但录屏软件会把系统光标当成
     画面内容一起录进去 —— 成片里题卡上就多出一个细黑十字，压在题干文字中间不动。
     2026-11-09 老师录的前 5 题全部中招，还以为是手写板的问题。
     笔尖位置改由下面的 #ink-dot 光点指示（网页自己画，一定录得清楚，也好看）。 */
  touch-action: none; cursor: none; border-radius: 8px;
}
#ink-canvas.on { pointer-events: auto; }

/* 笔尖光点：批注时跟着鼠标/笔走的小圆环。
   存在的理由只有一个 —— 录课。有些录屏软件（含 Windows 图形捕获那一类）默认不录系统光标，
   还有些相反、把光标一起录进去；不论哪种，都不能指望系统光标，得自己画。
   颜色跟当前笔色一致；激光笔模式有它自己的大光点，这里会自动让开。 */
#ink-dot {
  position: fixed; z-index: 15; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px;
  border-radius: 50%; border: 2px solid #fff; pointer-events: none;
  opacity: 0;   /* 停笔后淡出，别在录播里留个死点 */
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .38), 0 1px 4px rgba(15, 23, 42, .30);
  transition: width .12s ease, height .12s ease, margin .12s ease, opacity .15s ease;
}
#ink-dot.on { opacity: 1; }
/* 橡皮要大一圈，让人看得出擦除范围 */
#ink-dot.big { width: 26px; height: 26px; margin: -13px 0 0 -13px; background: rgba(148, 163, 184, .28) !important; }

/* 标题栏上的开关 */
.ink-toggle {
  flex: 0 0 auto; padding: 4px 11px; margin-right: 10px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 999px;
  cursor: pointer; transition: all .15s ease;
}
.ink-toggle:hover { color: var(--accent); border-color: var(--accent-line); }
/* 选中态：深底 + 白字。文字标签 <span class="bt"> 必须跟着继承颜色和字号 ——
   .bt 本来是首页品牌块的大字（15.5px / --ink 深墨），复用到这个胶囊里就成了
   「深蓝底压深蓝字」，字几乎看不见；字号也把按钮撑得比设计宽一圈。 */
.ink-toggle .bt {
  font-size: inherit; font-weight: inherit; letter-spacing: 0;
  line-height: inherit; color: inherit;
}
.ink-toggle.on {
  color: #fff; background: var(--accent); border-color: var(--accent);
  font-weight: 600; box-shadow: 0 2px 8px rgba(47, 66, 112, .26);
}
.ink-toggle.on:hover { color: #fff; background: var(--accent-2); border-color: var(--accent-2); }

/* 工具条：两种形态，都不覆盖正文。
   .side = 竖排贴在讲解框**外侧**（宽屏首选，绝不挡字）
   .flat = 横栏插在正文区上方（窄屏兜底，占一行高度，正文区自己变矮） */
.ink-bar {
  position: absolute; z-index: 30;   /* 要压在批注画布（14）上面，不然工具条点不到 */
  display: none; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px; border-radius: 14px;
  background: rgba(255, 255, 255, .985);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 26px rgba(15, 23, 42, .16);
}
.ink-bar.show { display: flex; }
/* 竖排形态：矮屏（笔记本 650 高）时整条可能比视口还高，宁可自己能滚，也别把「关闭」裁掉 */
.ink-bar.side { max-height: calc(100vh - 30px); overflow-y: auto; overflow-x: hidden; }

/* 竖排按钮：图标在上、小字在下，宽度固定，一眼看清 */
.ink-bar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 40px; padding: 5px 0 4px;
  font-family: inherit; color: var(--text-2); background: transparent;
  border: 1px solid transparent; border-radius: 9px; cursor: pointer;
}
.ink-bar button .ic { font-size: 15px; line-height: 1.15; }
/* 粗细按钮：一个实心圆点，大小跟着档位变（细 4 / 中 6 / 粗 9 px，由 JS 设） */
.ink-bar [data-ink="size"] .ic { display: flex; align-items: center; justify-content: center; height: 17px; }
.ink-bar [data-ink="shape"] .ic { display: flex; align-items: center; justify-content: center; height: 17px; }
.ink-bar [data-ink="fill"] .ic { display: flex; align-items: center; justify-content: center; height: 17px; }
.ink-bar .dot { display: block; border-radius: 50%; background: currentColor; }

/* 形状小图标：用 CSS 画，不靠字体 —— 梯形、平行四边形没有现成的字符可用 */
.sg { display: inline-block; width: 26px; height: 19px; background: currentColor; }
.sg-ln { width: 26px; height: 2px; transform: rotate(-32deg); }
.sg-el { border-radius: 50%; }
.sg-tr { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.sg-pa { clip-path: polygon(24% 0, 100% 0, 76% 100%, 0 100%); }
.sg-tp { clip-path: polygon(24% 0, 76% 0, 100% 100%, 0 100%); }
.sg-sq { width: 19px; height: 19px; }
.sg-rt { clip-path: polygon(0 0, 76% 0, 100% 100%, 0 100%); }
.sg-ci { width: 19px; height: 19px; border-radius: 50%; }
/* 填充开关：左半实心、右半空心 */
.sg-half { width: 19px; height: 19px; background: linear-gradient(to right, currentColor 50%, transparent 50%); box-shadow: inset 0 0 0 1.6px currentColor; }

.ink-bar .sg { width: 18px; height: 13px; }
.ink-bar .sg-ln { width: 19px; height: 2px; }
.ink-bar .sg-sq, .ink-bar .sg-ci, .ink-bar .sg-half { width: 13px; height: 13px; }

/* 形状下拉面板：挂在 body 上定位（fixed），3×3 一格一种 */
.ink-shapes {
  position: fixed; z-index: 9999; display: none;
  grid-template-columns: repeat(3, 76px); gap: 2px; padding: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
}
.ink-shapes.show { display: grid; }
.ink-shapes button {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px 7px; border: 0; border-radius: 7px; background: transparent;
  color: #475569; font-family: inherit; font-size: 11px; line-height: 1.2; cursor: pointer;
}
.ink-shapes button:hover { background: #eef2f8; color: var(--text); }
.ink-shapes button.on { background: var(--accent); color: #fff; }
.ink-shapes button span { white-space: nowrap; }
.ink-bar button.open { background: #e2e8f0; color: var(--text); }
.ink-bar button .lb { font-size: 9.5px; line-height: 1.2; letter-spacing: .2px; }
.ink-bar button:hover { background: #eef2f8; color: var(--text); }
.ink-bar button.on { background: var(--accent); color: #fff; }
.ink-bar .sep { width: 26px; height: 1px; background: var(--line); margin: 3px 0; }
.ink-bar .sws { display: grid; grid-template-columns: repeat(2, 16px); gap: 4px 3px; padding: 2px 0; }
.ink-bar .sw {
  width: 16px; height: 16px; padding: 0; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong);
}
.ink-bar .sw:hover { transform: scale(1.15); }
.ink-bar .sw.on { box-shadow: 0 0 0 2px var(--accent); }

/* 停靠形态（默认）：横过来浮在底部按钮行中间。
   用绝对定位是关键——这一行的高度一个像素都不能变，一变正文就重排、
   已经画好的笔迹跟着错位；相对地，框因此可以一直占满整宽，不用在右侧常备一条通道。 */
.learn-foot.inkdock { position: relative; }
.ink-bar.dock {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 1px;
  padding: 2px 4px; max-width: calc(100% - 24px);
  border-radius: 10px; box-shadow: 0 4px 14px rgba(15, 23, 42, .10);
  overflow-x: auto; overflow-y: hidden;
}
.ink-bar.dock button { width: 34px; padding: 3px 0 2px; }
.ink-bar.dock button .ic { font-size: 13px; }
.ink-bar.dock button .lb { font-size: 9px; }
.ink-bar.dock .sep { width: 1px; height: 20px; margin: 0 4px; }
.ink-bar.dock .sws { display: flex; gap: 4px; }
.ink-bar.dock .sw { width: 16px; height: 16px; }
.ink-bar.dock .sg { width: 15px; height: 11px; }
.ink-bar.dock .sg-ln { width: 16px; height: 2px; }
.ink-bar.dock .sg-sq, .ink-bar.dock .sg-ci, .ink-bar.dock .sg-half { width: 12px; height: 12px; }

/* 横栏形态：贴着正文区顶部，不浮起来，所以不会压住任何字 */
.ink-bar.flat {
  position: static; flex-direction: row; flex-wrap: wrap; justify-content: center;
  gap: 2px; width: 100%; box-sizing: border-box; margin: 0; padding: 5px 8px;
  border-radius: 0; border: 0; border-bottom: 1px solid var(--line);
  background: #f8fafc; box-shadow: none;
}
.ink-bar.flat button { flex-direction: row; width: auto; gap: 4px; padding: 5px 9px; }
.ink-bar.flat button .ic { font-size: 13px; }
.ink-bar.flat button .lb { font-size: 12px; }
.ink-bar.flat .sep { width: 1px; height: 18px; margin: 0 3px; }
.ink-bar.flat .sws { display: flex; gap: 4px; }

/* 投屏/录课时竖排工具条大一号，站远了也点得准 */
#learn.teach .ink-bar.side { padding: 6px; gap: 3px; }
#learn.teach .ink-bar.side button { width: 46px; padding: 6px 0 5px; }
#learn.teach .ink-bar.side button .ic { font-size: 17px; }
#learn.teach .ink-bar.side button .lb { font-size: 10.5px; }
#learn.teach .ink-bar.side .sw { width: 18px; height: 18px; }
#learn.teach .ink-bar.side .sws { grid-template-columns: repeat(2, 18px); }

/* 窄屏：顶栏别被批注按钮挤爆 */
@media (max-width: 640px) {
  #learn .learn-head { padding: 10px 14px; gap: 6px; }
  #l-title { font-size: 13px; }
  .ink-toggle { margin-right: 6px; padding: 4px 8px; font-size: 12px; }
  .teach-toggle span { display: none; }
}

/* ================= 自动聚焦：题干上会呼吸的高亮框 =================
   框挂在 .learn-box 上（绝对定位），坐标每次用 Range 现量，所以换行、改字号、
   切讲解模式都不会错位。橙色，和蓝色的主色区分开，也和个人批注的笔色区分开。 */
.focus-box {
  position: absolute; z-index: 4; pointer-events: none;
  border: 2px solid rgba(234, 88, 12, .82);
  border-radius: 7px;
  background: rgba(251, 146, 60, .10);
  transform-origin: 0 50%;
  animation:
    focusGrow .38s cubic-bezier(.22, 1, .36, 1) var(--fd, 0s) both,
    focusPulse 2.3s calc(var(--fd, 0s) + .38s) ease-out infinite;
  will-change: box-shadow, transform;
}

/* 从左往右「描」出来，像老师用笔把这句话框住 */
@keyframes focusGrow {
  from { transform: scaleX(.05); opacity: 0; }
  55%  { opacity: 1; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* 呼吸：一圈光晕慢慢荡开，眼睛会自然被吸过去 */
@keyframes focusPulse {
  0%   { box-shadow: 0 0 0 0 rgba(234, 88, 12, .40); }
  68%  { box-shadow: 0 0 0 8px rgba(234, 88, 12, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}

/* 系统开了「减少动效」就别呼吸，只留静态框 */
@media (prefers-reduced-motion: reduce) {
  .focus-box { animation: focusGrow .01s linear both; }
}

/* 聚焦开关：浅橙底橙字，别用实心橙——橙色底上的红色靶心 emoji 会糊成一团 */
#l-focus.on { background: #fff3ea; color: #c2410c; border-color: #f6c6a5; }
#l-focus.on:hover { background: #ffe8d8; color: #9a3412; border-color: #eda877; }

/* 窄屏顶栏：两个按钮只留图标，不然挤出去 */
@media (max-width: 640px) {
  .ink-toggle .bt { display: none; }
  .ink-toggle { padding: 5px 9px; margin-right: 6px; min-width: 30px; }
}

/* ================= 在线编辑面板（机主专用） =================
   盖在讲解框上面的整页表单：左边改题，右边改精讲，都在同一个滚动区里。 */
.ledit {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  background: #fff; border-radius: inherit; overflow: hidden;
}
.ledit[hidden] { display: none !important; }
.ledit-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fbfcfd;
}
.ledit-head b { font-size: 14px; }
.ledit-tip { margin-right: auto; font-size: 11.5px; color: var(--muted); }
.ledit-tip code { padding: 1px 4px; background: #eef2f7; border-radius: 4px; font-size: 11px; }
.ledit-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 4px 18px 24px; }
.ledit-body h5 {
  margin: 18px 0 10px; padding-bottom: 6px; font-size: 12.5px; color: var(--accent);
  border-bottom: 1px solid var(--line);
}
.lf { display: block; margin-bottom: 12px; }
.lf > span { display: block; margin-bottom: 5px; font-size: 11.5px; color: var(--muted); }
.lf > span i { font-style: normal; color: #b6bec9; }
/* 编辑面板里的勾选项：矢量图是「原图的清晰重绘」还是「另画的辅助图」 */
.edchk {
  display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: rgba(246, 245, 242, .6); cursor: pointer;
}
.edchk:hover { border-color: var(--pop); background: var(--pop-weak); }
/* 必须写死宽高：面板里有一条通用 input{width:100%}，不写的话复选框会被撑成 850px，
   把后面的文字挤成竖排一条（试过，很难看） */
/* 选择器要压过后面那条 .lf input{width:100%}，否则复选框被撑成整行宽，
   后面的文字被挤成竖排一条（试过，很难看）。padding/border 也要清掉。 */
.lf .edchk input {
  flex: 0 0 auto; width: 15px; height: 15px; margin: 2px 0 0; padding: 0;
  border: 0; background: none; box-shadow: none;
  accent-color: var(--pop); cursor: pointer;
}
.edchk > span { display: block; min-width: 0; }
.edchk b { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.edchk em {
  display: block; font-style: normal; font-size: 11px; line-height: 1.5; color: var(--muted);
}
/* 编辑器「讲解图」三项下面的说明：选中哪项就说清后果，「关闭」要说明数据还在 */
.edrole-hint {
  margin: 7px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--muted);
}
.edrole-hint.off { color: #b26a00; }
.lf input, .lf textarea {
  display: block; width: 100%; box-sizing: border-box; padding: 8px 10px;
  font-family: inherit; font-size: 13px; line-height: 1.7; color: var(--text);
  background: #fbfcfd; border: 1px solid var(--line); border-radius: 8px;
  outline: none; resize: vertical;
}
.lf input:focus, .lf textarea:focus {
  border-color: var(--accent-line); background: #fff; box-shadow: 0 0 0 3px rgba(47, 111, 237, .08);
}
.btn.sm { padding: 4px 10px; font-size: 12px; }

.edopt { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.edopt-no { flex: 0 0 18px; text-align: center; font-size: 11.5px; color: var(--muted); }
.edopt input { flex: 1 1 auto; }
.edx {
  flex: 0 0 auto; width: 26px; height: 26px; padding: 0; font-size: 12px;
  color: var(--muted); background: #fff; border: 1px solid var(--line);
  border-radius: 7px; cursor: pointer;
}
.edx:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.edopt-empty { padding: 4px 2px 8px; font-size: 12px; color: var(--muted); }

/* 难度（编辑面板）：星级退休后只读显示分数与级别，跟题卡上那颗徽章长一样 */
.ed-diffro { display: flex; align-items: center; gap: 10px; padding: 2px 0; }
.ed-diffro .dro-say { font-size: 12px; color: var(--muted); }
.ed-diffro .dro-none { font-size: 12px; color: var(--muted); }

.eds { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 4px; margin-bottom: 10px; background: #fbfcfd; }
.eds-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.eds-head b { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.eds-no {
  display: grid; place-items: center; width: 18px; height: 18px;
  font-style: normal; font-size: 11px; color: #fff; background: var(--accent); border-radius: 50%;
}
.eds-tools { display: flex; gap: 4px; }
.eds-tools button {
  padding: 3px 8px; font-family: inherit; font-size: 11.5px; color: var(--text-2);
  background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.eds-tools button:hover:not(:disabled) { border-color: var(--accent-line); color: var(--accent); }
.eds-tools button:disabled { opacity: .35; cursor: default; }
.eds-tools button.danger:hover { color: #dc2626; border-color: #fecaca; }

.ledit-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-top: 1px solid var(--line); background: #fbfcfd;
}
.ledit-msg { margin-right: auto; font-size: 12px; color: var(--muted); }
.ledit-msg.bad { color: #dc2626; }

@media (max-width: 640px) {
  .ledit-head { padding: 10px 14px; }
  .ledit-tip { display: none; }
  .ledit-body { padding: 4px 14px 20px; }
  .ledit-foot { padding: 8px 14px; }
}

/* 讲解框里的选项：选择题讲解时学生要能看到 A/B/C/D */
.lq-opts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; }
/* 纯图选项：按图片实际宽度紧凑排（和卡片一致），字母在图上方。
   讲课时四张图位置固定、不随字数挪；窄了自然换行，不会把图压成一条。 */
.lq-opts.grid { gap: 8px 28px; align-items: start; }
.lq-opts.grid .lq-opt { flex-direction: column; align-items: center; gap: 2px; }
.lq-opts.grid .lq-opt b { font-size: 12px; }
.lq-opts.grid.cols {
  display: grid; justify-content: center;
  grid-template-columns: repeat(var(--ocols, 4), max-content);
  gap: 10px 30px;
}
.lq-opt { display: flex; align-items: baseline; gap: 5px; font-size: 14px; color: var(--text); }
.lq-opt b { font-size: 12px; font-weight: 600; color: var(--muted); }
#learn.teach .lq-opt { font-size: 18px; }
#learn.teach .lq-opt b { font-size: 14px; }
@media (max-width: 680px) {
  #learn.teach .lq-opt { font-size: 15px; }
  .lq-opts { gap: 4px 14px; }
}

/* ================= 练习闭环：刷题 / 错题本 / 我的 ================= */

.nav { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.nbtn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 8px 15px; border-radius: 999px; cursor: pointer; white-space: nowrap; flex: 0 0 auto;
  color: var(--text-2); background: rgba(255,255,255,.75); border: 1px solid var(--line);
  transition: all .2s var(--ease);
}
.nbtn:hover {
  border-color: var(--line-strong); color: var(--ink); background: #fff;
  transform: translateY(-1px); box-shadow: 0 8px 18px -12px rgba(28,24,18,.55);
}
.nbtn.primary {
  background: linear-gradient(180deg, #fb8c3c, var(--pop)); color: #fff; border-color: transparent;
  box-shadow: 0 8px 18px -10px rgba(249,115,22,.95), inset 0 1px 0 rgba(255,255,255,.25);
}
.nbtn.primary:hover {
  background: linear-gradient(180deg, var(--pop), var(--pop-2)); color: #fff;
  box-shadow: 0 14px 26px -12px rgba(249,115,22,1);
}
.nbtn b {
  font-size: 10.5px; min-width: 15px; padding: 1px 4px; border-radius: 999px;
  background: #fee2e2; color: #b91c1c; font-variant-numeric: tabular-nums;
}

/* 列表卡片：做过 / 做错 */
.badge.done { background: #ecfdf5; color: #047857; }
.badge.bad { background: #fef2f2; color: #b91c1c; }

/* 卡片上的「做这题」 */
.do {
  font-family: inherit; font-size: 12px; color: var(--pop-2);
  background: var(--pop-weak); border: 1px solid var(--pop-line);
  cursor: pointer; padding: 4px 12px; font-weight: 700;
  border-radius: 999px; transition: all .18s var(--ease);
}
.do:hover {
  background: #ffe7d2; transform: translateY(-1px);
  box-shadow: 0 8px 16px -10px rgba(249,115,22,.9);
}

/* 编辑入口（仅机主可见） */
.edt {
  font-family: inherit; font-size: 12px; color: var(--text-2);
  background: rgba(246,245,242,.9); border: 1px solid var(--line);
  cursor: pointer; padding: 4px 11px; font-weight: 600;
  border-radius: 999px; transition: all .18s var(--ease);
}
.edt:hover {
  border-color: var(--line-strong); color: var(--ink); background: #fff;
  transform: translateY(-1px); box-shadow: 0 6px 14px -10px rgba(28,24,18,.6);
}

/* 独立编辑弹窗 */
#editmodal { z-index: 80; }
.edit-shell {
  width: 920px; height: min(780px, calc(100vh - 56px)); max-width: calc(100vw - 32px);
  position: relative; overflow: hidden;
}
.ed-noguide {
  margin-top: 18px; padding: 14px 16px; font-size: 13px; color: var(--text-2);
  background: rgba(246,245,242,.85); border: 1px dashed var(--line-strong);
  border-radius: 12px; line-height: 1.75;
}

/* ---- 刷题弹窗 ---- */
/* 讲解视频：黑底大画面，尽量把屏幕给视频，别再套白卡片。
   z-index 要压过每日一练（DOM 里 #daily 在 #vidmodal 之后，同为 60 会把播放器盖住，
   表现就是「点了看讲解没反应」）。 */
.modal.vid { background: rgba(8,11,16,.88); z-index: 80; }
.vid-box {
  width: min(1320px, 96vw); max-height: 94vh; display: flex; flex-direction: column;
  background: #10161f; border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 64px rgba(0,0,0,.55);
  animation: pop .28s cubic-bezier(.34,1.4,.64,1);
}
.vid-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #e8f2ff; flex: 0 0 auto; }
.vid-title { font-size: 14px; font-weight: 500; }
.vid-meta { font-size: 12.5px; color: #7fa3c8; }
.vid-box .x { color: #cfe2f5; }
.vid-box .x:hover { background: rgba(255,255,255,.12); }
/* 竖屏录的课：盒子收窄，不然 1320 宽里两边全是黑边，画面只占中间一条。
   宽度取「580 / 92vw / 按可用高度反算的 9:16 宽度」三者最小 —— 屏幕矮的时候
   （笔记本 768 高）真正卡住画面的是高度，盒子固定 580 宽就会左右各留一条黑边。 */
.vid-box.portrait { width: min(580px, 92vw, calc((94vh - 96px) * 0.5625)); }
/* video 撑满宽、限高。object-fit:contain 是必须的：老师有竖屏录的课，
   只写 max-height 会把画面压扁变形，contain 让画面按原比例缩进去、两边留黑。 */
.vid-box video {
  width: 100%; height: auto; max-height: calc(94vh - 96px);
  background: #000; display: block; object-fit: contain;
}
.vid-foot {
  padding: 7px 14px; font-size: 12px; color: #6f8fae; border-top: 1px solid rgba(255,255,255,.07);
  font-family: ui-monospace, Consolas, monospace; word-break: break-all;
}

.modal.prac { z-index: 60; }
.prac-box {
  width: 780px; max-width: calc(100vw - 32px); max-height: 92vh;
  display: flex; flex-direction: column; position: relative;
  background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg);
  animation: pop .32s cubic-bezier(.34,1.4,.64,1);
}
.prac-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 22px; border-bottom: 1px solid var(--line);
}
.prac-title { font-weight: 700; color: var(--ink); font-size: 15px; letter-spacing: -.01em; }
.prac-prog { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prac-stat { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.prac-body { padding: 2px 22px 18px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.prac-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  padding: 11px 0 4px; font-size: 11.5px; color: var(--muted);
}
.prac-stem { font-size: 18px; line-height: 2.05; color: var(--text); }
.prac-stem img { display: block; max-width: 100%; max-height: 340px; margin: 10px auto; border-radius: 8px; }
.prac-stem .fig { max-width: 100%; max-height: 340px; margin: 10px auto; }

.prac-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin: 14px 0 4px; }
.popt {
  display: flex; align-items: flex-start; gap: 9px; text-align: left;
  font-family: inherit; font-size: 15px; line-height: 1.75; color: var(--text);
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; cursor: pointer; transition: all .18s var(--ease);
}
.popt:hover {
  border-color: var(--pop-line); background: var(--pop-weak); transform: translateY(-1px);
  box-shadow: 0 10px 20px -16px rgba(249,115,22,.9);
}
.popt.sel { border-color: var(--pop); background: var(--pop-weak); box-shadow: 0 0 0 3px rgba(249,115,22,.12); }
.popt b { color: var(--pop-2); flex: 0 0 auto; font-weight: 700; }

.ans-line { display: flex; align-items: stretch; gap: 8px; margin-top: 14px; }

#p-ans {
  flex: 1 1 auto; min-width: 0; width: 100%; margin-top: 0; padding: 13px 16px;
  font-size: 19px; font-family: inherit; color: var(--text);
  border: 2px solid var(--line); border-radius: 14px;
  outline: none; background: rgba(246,245,242,.8);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
#p-ans:focus { border-color: var(--pop); background: #fff; box-shadow: 0 0 0 4px rgba(249,115,22,.13); }
#p-ans:disabled { color: var(--muted); background: rgba(246,245,242,.5); }
.prac-hint { margin-top: 7px; font-size: 12px; color: var(--muted); min-height: 17px; }

/* ---- 多空题的答题卡：一个空一个框 ----
   为什么不用「一个框 + 空格分隔」：答案本身常带空格（`942 平方厘米`、`15.6 万`），
   学生再怎么分隔都会被拆错，只能退到自评。一个空一个框就没有这个问题。
   它和「键盘/手写」两个按钮同处 .ans-line 一行，所以自己也要 flex:1。 */
.prac-blanks {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 8px 10px;
}
.prac-blank {
  display: flex; align-items: center; gap: 7px;
  flex: 1 1 120px; min-width: 100px; max-width: 320px;
}
.pb-no {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; line-height: 1;
  color: #fff; background: var(--pop);
}
.prac-blank input {
  flex: 1 1 auto; min-width: 0; width: 100%; padding: 11px 13px;
  font-size: 18px; font-family: inherit; color: var(--text);
  border: 2px solid var(--line); border-radius: 12px; outline: none;
  background: rgba(246,245,242,.8);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.prac-blank input:focus {
  border-color: var(--pop); background: #fff;
  box-shadow: 0 0 0 3px rgba(249,115,22,.13);
}
.prac-blank input:disabled { color: var(--muted); background: rgba(246,245,242,.5); }
/* 小问标号：答案自带 (1)(2) 时贴在框左边，不再独占一行
   （独占一行时 4 个小问要吃掉 70 多像素，第 4 个框就掉到折叠线外了） */
.prac-blank.grouped { max-width: 380px; }
/* 解答题的框是「一问一格」，答案常有「20 平方厘米」这种，挤成 4 个一行放不下，
   所以让它按 2 个一行排，每个框宽一倍 */
.prac-blank.grouped.wide { flex: 1 1 240px; }
.prac-sub {
  flex: 0 0 auto; width: 34px; text-align: right;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2, var(--text-2));
  white-space: nowrap;
}
.pb-gap { flex: 0 0 34px; }

/* 多空题时按钮固定高度、贴底：不然按小问分组占了两三行，
   这两个按钮会被 align-items:stretch 拉成一整根长条 */
#p-inputwrap.multi .ans-line { align-items: flex-end; }
#p-inputwrap.multi .ans-tool { height: 46px; }

/* 手写识别的候选条：引擎给的 2~5 个写法，点一下替换答案框里刚填的那段。
   正确答案常常排在第 2~4 位，所以这条不是装饰。 */
.prac-alts {
  margin-top: 8px; display: flex; align-items: center;
  flex-wrap: wrap; gap: 6px;
}
.prac-alts .alt-lbl {
  font-size: 11.5px; color: var(--muted); margin-right: 2px;
}
.prac-alts .alt {
  font-family: inherit; font-size: 14px; line-height: 1;
  padding: 6px 11px; border-radius: 9px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; color: var(--text);
  transition: border-color .15s, background .15s, color .15s;
}
.prac-alts .alt:hover { border-color: var(--pop); }
.prac-alts .alt.on {
  border-color: var(--pop); background: rgba(249, 115, 22, .1);
  color: #b45309; font-weight: 700;
}

/* 输入框右侧的两个入口：数学键盘 / 手写 */
.ans-tool {
  flex: 0 0 auto; width: 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 4px 0; font-family: inherit; font-size: 17px; line-height: 1.15; color: var(--text-2);
  background: #fff; border: 2px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: all .16s var(--ease);
}
.ans-tool i { font-style: normal; font-size: 10.5px; letter-spacing: .02em; color: var(--muted); }
/* 键盘图标用 CSS 画：⌨ 这个字符 Win 默认字体没有字形，会显示成方块 */
.ic-key {
  position: relative; display: block; width: 22px; height: 15px;
  border: 1.6px solid currentColor; border-radius: 3.5px;
}
.ic-key::before {
  content: ''; position: absolute; left: 3px; right: 3px; top: 3.5px; height: 1.5px;
  background: currentColor; box-shadow: 0 4px 0 currentColor; border-radius: 1px;
}
.ans-tool:hover { border-color: var(--pop); background: var(--pop-weak); }
.ans-tool:hover i { color: var(--pop-2); }
.ans-tool.on { border-color: var(--pop); background: var(--pop-weak); box-shadow: 0 0 0 3px rgba(249,115,22,.1); }
.ans-tool.on i { color: var(--pop-2); font-weight: 600; }
.ans-tool[disabled] { opacity: .45; cursor: not-allowed; }

/* ---- 数学虚拟键盘 ---- */
.mkey {
  flex: 0 0 auto; padding: 8px 14px 12px;
  border-top: 1px solid var(--line); background: rgba(250,249,246,.985);
  animation: mkIn .16s ease-out;
}
@keyframes mkIn { from { transform: translateY(10px); opacity: .3 } to { transform: none; opacity: 1 } }
.mk-bar { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.mk-tab {
  padding: 4px 12px; font-family: inherit; font-size: 12.5px; color: var(--text-2);
  background: transparent; border: 1px solid transparent; border-radius: 999px; cursor: pointer;
}
.mk-tab:hover { background: rgba(15,23,42,.05); }
.mk-tab.on { color: var(--pop-2); background: #fff; border-color: var(--pop-line); font-weight: 600; }
.mk-x {
  width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font-size: 13px; cursor: pointer; font-family: inherit;
}
.mk-x:hover { background: rgba(15,23,42,.07); color: var(--text); }

.mk-grid { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: 6px; }
.mk {
  height: 40px; padding: 0 2px; font-family: inherit; font-size: 17px; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  user-select: none; -webkit-user-select: none; transition: all .1s;
  box-shadow: 0 1px 0 rgba(15,23,42,.045);
}
.mk:hover { border-color: var(--pop-line); background: var(--pop-weak); }
.mk:active { transform: translateY(1px); box-shadow: none; }
.mk.back, .mk.clear { color: var(--text-2); font-size: 14px; background: rgba(246,245,242,.92); }
.mk.unit { font-size: 12.5px; height: 34px; }
.mk.frac { font-size: 15px; }

/* ---- 手写板（盖在弹窗上） ---- */
.padwrap {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column;
  background: rgba(255,255,255,.99); border-radius: 22px; animation: padIn .16s ease-out;
}
@keyframes padIn { from { opacity: 0 } to { opacity: 1 } }
.pad-head {
  display: flex; align-items: center; gap: 9px; padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.pad-head b { font-size: 14px; color: var(--ink); }
.pad-head span { font-size: 12px; color: var(--muted); }
#p-pad-cv {
  flex: 1 1 auto; min-height: 0; margin: 12px 16px;
  border: 1.5px dashed var(--line); border-radius: 14px; background: #fff;
  /* 淡基线：字写在同一行上，识别引擎才不会把一行拆成两行 */
  background-image: repeating-linear-gradient(
    to bottom, transparent 0 59px, rgba(15, 23, 42, .07) 59px 60px);
  touch-action: none; cursor: crosshair; width: auto;
}
.pad-foot { display: flex; align-items: center; gap: 8px; padding: 0 16px 14px; }

.prac-fb { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; animation: lstepIn .18s ease-out; }
.fb-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 600; font-size: 15px; }
.fb-head.right { background: #ecfdf5; color: #047857; }
.fb-head.wrong { background: #fef2f2; color: #b91c1c; }
.fb-head.unk { background: #fffbeb; color: #b45309; }
.fb-ans { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--text-2); }
.fb-body { padding: 13px 16px; font-size: 14.5px; line-height: 1.95; color: var(--text-2); border-top: 1px solid var(--line); }
.fb-body .fb-lab { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.fb-body img { display: block; max-width: 100%; max-height: 300px; margin: 8px 0; border-radius: 6px; }
.fb-self { display: flex; align-items: center; gap: 8px; padding: 0 16px 14px; font-size: 12.5px; color: var(--muted); }

.prac-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-top: 1px solid var(--line);
  background: #fbfcfd; border-radius: 0 0 14px 14px;
}
.prac-foot .btn { padding: 8px 18px; }
.prac-foot .kbd-hint { margin-right: 4px; }

/* 错题本 */
.wb-n { color: var(--accent); }
.wb-row { display: flex; gap: 11px; align-items: flex-start; padding: 11px 2px; border-bottom: 1px solid #f1f3f5; }
.wb-row:last-child { border-bottom: 0; }
.wb-row .wbn { color: var(--accent); font-weight: 600; min-width: 26px; padding-top: 1px; }
.wb-row .wbtx { flex: 1; min-width: 0; }
.wb-row .wbtop { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wb-row .wbpv { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wb-row .wbact { display: flex; gap: 8px; flex: 0 0 auto; }
.wb-empty { padding: 34px 10px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 2; }

/* ---- 四档掌握标记：A 会做 / B 看答案能懂 / C 看视频才懂 / D 还没懂 ----
   老师 2026-11-16 定：每题让学生（家长陪着）标一个，B 起码再练 1 遍、C 两遍、D 三遍，
   复习时重新标一次来判断「毕业」。标记只决定什么时候再练，不参与判分。 */
.mk-bar { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.mk-lab { font-size: 12.5px; color: var(--muted); }
.mk-btn {
  font-family: inherit; font-size: 12.5px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px 6px 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-2);
  transition: border-color .12s, background .12s, color .12s;
}
.mk-btn b { font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.mk-btn:hover { border-color: var(--accent-line); background: var(--accent-weak); }
.mk-btn[data-on="1"] { color: #fff; border-color: transparent; }
.mk-btn[data-mk="A"][data-on="1"] { background: #2f855a; }
.mk-btn[data-mk="B"][data-on="1"] { background: #2f5fab; }
.mk-btn[data-mk="C"][data-on="1"] { background: #c2711a; }
.mk-btn[data-mk="D"][data-on="1"] { background: #c0392b; }
.mk-bar.sm .mk-btn { font-size: 11.5px; padding: 4px 9px 4px 7px; }
.mk-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.mk-hint { font-size: 12px; color: var(--muted); }
/* 状态那句自己占一行：和四个按钮挤一行时，宽屏也要读到 40 多个字，挤得慌 */
.mk-state { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.mk-state b { color: var(--text-2); font-weight: 600; }
/* 刷题反馈区：标记行是 .prac-fb 的直接子节点，父级没内边距，得自己补一条分隔线 */
.prac-fb > .mk-row { margin-top: 0; padding: 11px 16px 4px; border-top: 1px dashed var(--line); }

/* 档位小色块：复习本、列表卡片角标共用 */
.lvchip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px;
  font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.lvchip.A { background: #e6f4ec; color: #2f855a; }
.lvchip.B { background: #e8f0fb; color: #2f5fab; }
.lvchip.C { background: #fdf0e0; color: #a85d12; }
.lvchip.D { background: #fdeaea; color: #b32d22; }
.lvchip.M { background: #f1efeb; color: #6b7280; }   /* 已掌握 */
.duechip { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.duechip.now { color: #b32d22; font-weight: 600; }

/* ---- 随手标记胶囊（老师 2026-11-16 补）----
   标记跟「在网页上做题」彻底脱钩：孩子在纸上做完了，回来打开这道题就能标。
   所以这颗胶囊挂在题库卡片脚、每日一练、讲解顶栏、刷题顶栏、复习本 —— 常驻，
   不藏在「交完卷的反馈区」里。未标＝虚线灰胶囊（不抢眼，但看得见）；
   标过＝档位色块 + 下次该练的日子，一眼能看出这题排到哪天。 */
.mk-pill {
  font-family: inherit; font-size: 11.5px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 5px 10px; border-radius: 999px; flex: none;
  border: 1px dashed var(--line-strong); background: #fff; color: var(--muted);
  transition: border-color .12s, background .12s, color .12s;
}
.mk-pill b { font-weight: 600; }
.mk-pill i { font-style: normal; font-size: 11px; opacity: .85; }
.mk-pill:hover { border-color: var(--accent-line); background: var(--accent-weak); color: var(--text-2); }
.mk-pill.none b::before { content: '✎'; margin-right: 4px; opacity: .7; }
.mk-pill.lvA { border: 1px solid #bfe3cd; background: #e6f4ec; color: #2f855a; }
.mk-pill.lvB { border: 1px solid #c6d9f4; background: #e8f0fb; color: #2f5fab; }
.mk-pill.lvC { border: 1px solid #f3d9b6; background: #fdf0e0; color: #a85d12; }
.mk-pill.lvD { border: 1px solid #f6c9c4; background: #fdeaea; color: #b32d22; }
.mk-pill.lvA:hover { background: #d9eee2; }
.mk-pill.lvB:hover { background: #dbe8fa; }
.mk-pill.lvC:hover { background: #fbe6cb; }
.mk-pill.lvD:hover { background: #fbdedb; }
/* 没开通「练习」：照常显示但灰着（不藏功能，藏了客户不知道有这套复习） */
.mk-pill.locked { opacity: .55; border-style: solid; cursor: not-allowed; }
.mk-pill.locked:hover { border-color: var(--line-strong); background: #fff; color: var(--muted); }

/* 讲解页 / 刷题弹窗顶栏：标题旁边常驻一颗 */
.head-mk { display: inline-flex; align-items: center; flex: none; }
/* 顶栏这颗用实线边框：虚线在浅灰顶栏上淡得像占位符，老师根本看不出能点 */
.head-mk .mk-pill {
  font-size: 11px; padding: 4px 9px; border-style: solid;
  border-color: var(--line-strong); color: var(--text-2); background: #fff;
}
.head-mk .mk-pill i { display: none; }   /* 顶栏窄，到期日留给鼠标 title */

/* 四档浮层：一次把「A/B/C/D 各是什么意思、后面怎么练」说清 */
/* grid-template-columns: minmax(0,1fr) 是必须的：默认 auto 轨道会被内容撑宽，
   手机上 428px 的框直接顶出屏幕右边（.mks-box 的 max-width:100% 也就失效了）。 */
.mksheet { z-index: 75; grid-template-columns: minmax(0, 1fr); }
.mks-box {
  width: 428px; max-width: 100%; background: #fff; border-radius: 20px;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.6);
  animation: pop .28s cubic-bezier(.34,1.4,.64,1); overflow: hidden;
}
.mks-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 15px 18px 11px; border-bottom: 1px solid var(--line);
}
.mks-head b { font-size: 15px; color: var(--ink); letter-spacing: -.01em; }
.mks-q {
  flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mks-head .x { margin-left: auto; align-self: center; }
.mks-body { padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 7px; }
.mks-opt {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  font-family: inherit; cursor: pointer; padding: 9px 12px;
  border-radius: 13px; border: 1px solid var(--line); background: #fff;
  transition: border-color .13s, background .13s, transform .13s;
}
.mks-opt:hover { border-color: var(--accent-line); background: var(--accent-weak); }
.mks-opt:active { transform: scale(.995); }
.mks-opt.on { border-color: #2f855a; background: #f3faf6; }
.mks-badge {
  width: 27px; height: 27px; flex: none; border-radius: 9px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
}
.mks-badge.A { background: #2f855a; }
.mks-badge.B { background: #2f5fab; }
.mks-badge.C { background: #c2711a; }
.mks-badge.D { background: #c0392b; }
.mks-tx { flex: 1; min-width: 0; }
.mks-tx b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.mks-tx i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.mks-ck { flex: none; width: 14px; font-size: 14px; color: #2f855a; text-align: center; }
.mks-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px 13px; border-top: 1px solid var(--line);
}
.mks-state { flex: 1 1 auto; min-width: 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.mks-state b { color: var(--text-2); font-weight: 600; }
.mks-tip { color: var(--muted); }
.mks-foot .btn { flex: none; }
@media (max-width: 520px) {
  .mksheet { padding: 12px; }
  .mks-tx i { font-size: 11px; }
  .mks-body { padding: 10px 11px 6px; }
  /* 手机上状态那句自己占一行：和「撤销 / 完成」挤一行会把按钮顶出屏幕
     （2026-11-16 实测 390 宽「完成」被裁掉一半） */
  .mks-state { flex-basis: 100%; }
  .mks-foot { row-gap: 4px; }
  /* 复习本底栏：三个按钮在 390 宽一行放不下。打印是主行为，给它单独一行，
     刷新和「在电脑上做」退到第二行 —— 家长一眼看到的就是「打印这 N 道」。 */
  #wrongbook .sheet-foot { flex-wrap: wrap; row-gap: 6px; }
  #wrongbook .sheet-foot .grow { display: none; }
  #wrongbook .sheet-foot #wb-print { order: -1; flex: 1 0 100%; }
  #wrongbook .sheet-foot #wb-start { flex: 1 1 auto; }
  /* 复习本题行：说明语自己一行，四个档位按钮两行排开，别挤成一条 */
  .wb-row .mk-row .mk-lab { flex-basis: 100%; }
  .wb-row .mk-row { gap: 6px; }
  .wb-row .wbact .btn { padding: 5px 9px; font-size: 12px; }
  .rv-hint { padding: 0 14px 8px; font-size: 12px; }
  .rv-tabs { padding: 0 14px 9px; }
  /* 手机上题行顶部一行放不下「第 3 轮练习 + 档位 + 共 3 轮 + 轨迹」，
     先砍两个修饰词，只留「第 3 轮」和轨迹（完整说法在 title 里） */
  .rv-word, .rv-of { display: none; }
  .wb-row .wbtop { gap: 6px; }
}

/* 复习本四段切换 */
/* 复习本的日期页签（老师 2026-11-16 晚上定：按具体日期分栏，一天一栏）
   页签按到期日自动生成，多了就横向滑动 —— 家长只要认「今天 / 11 月 19 号」 */
.rv-hint { padding: 0 20px 9px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.rv-hint b { color: var(--text-2); font-weight: 600; }
.rv-hint b.hot { color: #b32d22; }
.rv-tabs {
  display: flex; gap: 6px; padding: 0 20px 10px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.rv-tabs::-webkit-scrollbar { height: 4px; }
.rv-tabs::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .14); border-radius: 4px; }
.rv-tab {
  flex: none; position: relative; font-family: inherit; font-size: 12.5px; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--text-2); white-space: nowrap;
}
.rv-tab:hover { border-color: var(--accent-line); }
.rv-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.rv-tab i { font-style: normal; opacity: .72; margin-left: 5px; }
.rv-tab.on i { opacity: .9; }
.rv-tab.is-today { border-color: var(--accent-line); color: var(--accent); font-weight: 600; }
.rv-tab.is-today.on { color: #fff; }
.rv-tab.extra { font-size: 12px; color: var(--muted); background: #fbfaf8; }
.rv-tab.extra.on { background: var(--text-2); border-color: var(--text-2); color: #fff; }
.rv-dot {
  position: absolute; top: 1px; right: 3px; width: 6px; height: 6px;
  border-radius: 50%; background: #d24b3e;
}
.rv-tab.on .rv-dot { background: #fff; }
.rv-more { font-size: 12px; color: var(--muted); padding: 6px 2px 2px; }

/* 「第几轮练习」：第一轮淡、第二轮起换实心，孩子一眼看到这是又一遍 */
.rv-round {
  font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: #eef2f7; color: #43536b; white-space: nowrap;
}
.rv-round.up { background: var(--accent); color: #fff; }
.rv-of { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
/* 刷题顶栏的「第 N 轮练习」：第一轮淡、第二轮起实心 */
.p-round {
  flex: none; font-size: 11.5px; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; background: #eef2f7; color: #43536b; white-space: nowrap;
}
.p-round.up { background: var(--accent); color: #fff; }
.wb-row.hot { background: linear-gradient(90deg, rgba(11, 74, 62, .04), rgba(11, 74, 62, 0) 62%); border-radius: 9px; }

/* 走过的档位：C → B → A */
.rv-trail { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; }
.rv-trail i {
  font-style: normal; font-weight: 700; padding: 1px 5px; border-radius: 6px;
  background: #f1efeb; color: #6b7280;
}
.rv-trail i.lvA { background: #e4f3ea; color: #1d7a4d; }
.rv-trail i.lvB { background: #eaf1fb; color: #2b5f9e; }
.rv-trail i.lvC { background: #fdf1de; color: #96651a; }
.rv-trail i.lvD { background: #fbe4e2; color: #b32d22; }
.rv-trail u { text-decoration: none; color: #c4c9d1; font-size: 10px; }

/* 我的学习 */
.mcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 10px; }
.mcard {
  background: linear-gradient(180deg, #fff, rgba(246,245,242,.7));
  border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.mcard:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -16px rgba(28,24,18,.55); }
.mcard b {
  display: block; font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums;
  color: var(--ink); letter-spacing: -.02em;
}
.mcard span { font-size: 11.5px; color: var(--muted); }
.msec { margin-top: 22px; }
.msec h4 { font-size: 13.5px; margin: 0 0 9px; color: var(--text); }
.kpbar { display: grid; grid-template-columns: minmax(90px, 1.4fr) 3fr 54px; gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 0; }
.kpbar .kname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.kpbar .ktrack { height: 7px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.kpbar .kfill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f59e0b, #ef4444); }
.kpbar.good .kfill { background: linear-gradient(90deg, #34d399, #059669); }
.kpbar .knum { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.recent-item { display: flex; gap: 9px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed #f1f3f5; font-size: 12.5px; }
.recent-item:last-child { border-bottom: 0; }
.recent-item .rt { color: var(--muted); font-size: 11px; white-space: nowrap; }
.recent-item .rp { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.recent-item .rc.right { color: #047857; }
.recent-item .rc.wrong { color: #b91c1c; }
.recent-item .rc.unk { color: var(--warn); }

#learn { z-index: 70; }        /* 讲解层要能压在刷题层上面 */

@media (max-width: 860px) {
  .nav { gap: 4px; }
  .nbtn { padding: 6px 8px; }
  .nbtn span { display: none; }        /* 窄屏只留图标，省位置 */
  .nbtn b { margin-left: 1px; }
}
@media (max-width: 680px) {
  .prac-box { max-height: 96vh; border-radius: 10px; max-width: calc(100vw - 20px); }
  .prac-head { padding: 11px 13px; gap: 8px; }
  .prac-body { padding: 0 13px 12px; }
  .prac-stem { font-size: 15.5px; line-height: 1.95; }
  .prac-opts { grid-template-columns: 1fr; }
  .prac-foot { padding: 10px 13px; gap: 8px; }
  .prac-foot .kbd-hint { display: none; }
  .prac-foot .btn { flex: 1 1 auto; padding: 9px 10px; }
  #p-ans { font-size: 17px; padding: 11px 12px; }
  .kpbar { grid-template-columns: minmax(70px, 1fr) 2fr 46px; }
}
.prac-done { padding: 46px 20px 38px; text-align: center; }
.pd-mark { font-size: 42px; line-height: 1; }
.prac-done h3 { margin: 12px 0 6px; font-size: 20px; }
.prac-done p { margin: 0 0 22px; color: var(--text-2); font-size: 14px; }
.pd-good { color: #047857; }
.pd-bad { color: #b91c1c; }
.pd-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.fb-ansv { font-size: 16px; color: var(--text); line-height: 1.9; }
.fb-head { flex-wrap: wrap; }
/* 手机顶栏：给刷题入口腾地方（品牌只留「奥」、搜索框可压）
   管理入口不能藏——老师经常用手机管账号，藏了就找不到后台，只留一个 ⚙ */
@media (max-width: 680px) {
  .top { gap: 8px; padding: 0 10px; }
  .brand .btext { display: none; }
  .searchwrap { min-width: 0; }
  #adminlnk { padding: 0 5px; }
  #adminlnk span { display: none; }
  .who { font-size: 11.5px; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* 手机顶栏：主按钮保留「刷题」二字（图标看不出是干什么的），姓名让位 */
@media (max-width: 680px) {
  .nbtn.primary span { display: inline; }
  #who { display: none; }
}
@media (max-width: 680px) {
  .nbtn.primary { padding: 6px 11px; }
}

/* ---------------- 讲解悬浮图 ----------------
   挂在精讲上的那张图：浮在正文上层、可以随手拖到不挡字的地方。
   只在讲解弹窗里出现，绝不进题干、也不会印进试卷。 */
.learn-box { position: relative; }
.lq-overlay {
  position: absolute; z-index: 12; line-height: 0;
  padding: 4px; border-radius: 10px;
  background: #fff; box-shadow: 0 10px 30px -12px rgba(15,23,42,.35), 0 0 0 1px rgba(15,23,42,.06);
  cursor: default; touch-action: none;
  /* 默认藏着：讲到「我们先画个图」再点按钮调出来 */
  opacity: 0; transform: scale(.94); pointer-events: none;
  transition: opacity .18s ease, transform .18s cubic-bezier(.34,1.3,.64,1);
}
.lq-overlay.on { opacity: 1; transform: none; pointer-events: auto; }
.lq-overlay.editable { cursor: move; }
.lq-overlay img { display: block; width: 100%; height: auto; border-radius: 7px; pointer-events: none; }
.lq-overlay.dragging { box-shadow: 0 16px 44px -12px rgba(15,23,42,.45), 0 0 0 2px var(--pop); }
.ovl-size, .ovl-close {
  position: absolute; width: 22px; height: 22px; padding: 0; line-height: 1;
  display: grid; place-items: center; font-size: 11px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-2);
  cursor: pointer; opacity: .5; transition: opacity .15s, background .15s;
}
.ovl-size { right: -8px; bottom: -8px; cursor: nwse-resize; }
.ovl-close { right: -8px; top: -8px; font-size: 10px; }
.lq-overlay:hover .ovl-size, .lq-overlay:hover .ovl-close { opacity: 1; }
.ovl-size:hover, .ovl-close:hover { background: var(--pop-weak); color: var(--pop-2); }

/* 编辑弹窗里的悬浮图一行 */
.ovlrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ovlprev {
  width: 96px; height: 68px; object-fit: contain; padding: 3px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(246,245,242,.75);
}
.ovlbtns { display: flex; gap: 6px; }
.ovlw { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.ovlw input {
  width: 76px; padding: 5px 8px; font-size: 12.5px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none;
}
.ovlw input:disabled { opacity: .45; }

/* ================= 图形标注层：图固定可见 + 元素高亮 ================= */
.lq-main { display: flex; gap: 16px; align-items: flex-start; }
.lq-text { flex: 1 1 auto; min-width: 0; }
.lq-fig { flex: 0 0 340px; min-width: 0; max-width: 48%; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.figure-live { position: relative; display: inline-block; width: auto; line-height: 0; cursor: zoom-in; border-radius: 8px; }
.figure-live img { display: block; border-radius: 8px; }
/* 讲解模式：右下角拖拽柄 + 右上角恢复默认（只有机主能看到，见 figResizeAttach）
   放在图内侧而不是外侧：讲解模式的 .lq-wrap 是 overflow:hidden，外挂会被裁掉。
   常态就显示（淡一点）：希沃一体机是触屏，没有 hover，藏起来就永远摸不到。 */
.fig-resize, .fig-reset {
  position: absolute; z-index: 4; width: 26px; height: 26px; padding: 0;
  display: grid; place-items: center; line-height: 1; font-size: 13px;
  border-radius: 50%; border: 1px solid var(--line-strong); background: #fff;
  color: var(--text-2); box-shadow: 0 3px 10px rgba(15,23,42,.18);
  cursor: ew-resize; touch-action: none; opacity: .45; transition: opacity .15s, background .15s;
}
.fig-resize { right: 6px; bottom: 6px; }
.fig-reset { right: 6px; top: 6px; cursor: pointer; font-size: 14px; }
.figure-live:hover .fig-resize,
.figure-live:hover .fig-reset,
.figure-live.resizing .fig-resize { opacity: 1; }
.fig-resize:hover, .fig-reset:hover { background: var(--pop-weak); color: var(--pop-2); opacity: 1; }
.fig-reset[hidden] { display: none !important; }
.figure-live.resizing { cursor: ew-resize; }
.figure-live.resizing img { outline: 2px dashed var(--pop); outline-offset: 2px; }
.figure-live.vector { display: inline-block; width: auto; }

/* 讲解模式：题干区不再整体滚动，改成左文右图，图始终在视野里 */
#learn.teach .lq-wrap.has-fig { overflow: hidden; padding-bottom: 12px; max-height: calc(100% - 250px); }
#learn.teach .lq-wrap.has-fig .lq { height: 100%; margin-bottom: 0; display: flex; flex-direction: column; }
#learn.teach .lq-wrap.has-fig .lq-main { flex: 1 1 auto; min-height: 0; }
#learn.teach .lq-wrap.has-fig .lq-text { max-height: 100%; overflow: auto; }
#learn.teach .lq-wrap.has-fig .lq-fig { max-height: none; }
/* 复刻型讲解图（role=replica）会把原图藏起来，题干变短 → 图区跟着缩 → 矢量图只剩一百来像素。
   给图区一个下限，保证「只留矢量图」时它至少看得清。 */
#learn .lq-wrap.has-fig .lq-fig { min-height: 300px; }
@media (max-width: 900px) { #learn .lq-wrap.has-fig .lq-fig { min-height: 180px; } }


/* 点图放大 */
.figure-live.zoom {
  position: fixed; z-index: 90; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: #fff; padding: 12px; border-radius: 12px; cursor: zoom-out;
  box-shadow: 0 24px 80px rgba(16, 24, 40, .45); max-width: 94vw; max-height: 92vh;
}
.figure-live.zoom img { max-width: 90vw; max-height: 84vh; }
.figure-live.zoom::after {
  content: '点一下收起'; position: absolute; right: 12px; bottom: -24px;
  font-size: 12px; color: #64748b; line-height: 1.2;
}

@media (max-width: 900px) {
  .lq-main { flex-direction: column; }
  /* 纵向排列时 flex-basis 变成高度：图区高度交给内容，文字给一个可滚的固定上限 */
  .lq-fig { max-width: 100%; width: 100%; flex: 0 0 auto; }
  .figure-live img { max-width: 100%; }
  #learn.teach .lq-wrap.has-fig .lq-text { max-height: 30vh; overflow: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .fg-el.on { animation: none; stroke-dashoffset: 0; }
}

.fig-hint { font-size: 11px; color: #94a3b8; text-align: center; margin-top: 7px; line-height: 1.4; }
.figure-live.zoom { width: auto; }

/* ---- 矢量图渲染 ---- */
.fg-svg { display: block; overflow: visible; }
.fg-base { stroke: #1f2937; stroke-width: .07; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fg-aux { stroke: #64748b; stroke-width: .065; stroke-dasharray: .22 .16; fill: none; opacity: 0; transition: opacity .25s; }
.fg-aux.on { opacity: 1; }
.fg-el { stroke: #e8590c; stroke-width: 0; fill: rgba(232, 89, 12, 0); stroke-linecap: round; stroke-linejoin: round; }
.fg-el.fg-poly { fill: rgba(232, 89, 12, 0); }
.fg-el.on {
  stroke-width: .19;
  animation: fgPulse 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 3px rgba(232, 89, 12, .85));
}
.fg-el.on.fg-poly {
  stroke-width: 0;
  fill: rgba(232, 89, 12, .16);
  animation: fgPulse 1.2s ease-in-out infinite;
}
.fg-pt { fill: #1f2937; }
.fg-lb { font-family: 'Times New Roman', 'Songti SC', serif; font-style: italic; font-size: .74px; fill: #111827; }
.fg-note {
  font-family: ui-monospace, Consolas, monospace; font-size: .68px; font-weight: 700; fill: #b45309;
  paint-order: stroke; stroke: #fff; stroke-width: .16; stroke-linejoin: round;
  opacity: 0; animation: fgNote .32s ease-out forwards;
}
@keyframes fgNote { from { opacity: 0; } to { opacity: 1; } }
.figure-live.zoom .fg-svg { width: 88vw !important; height: auto !important; max-height: 84vh; }

/* ---- svg 直出格式（Python 生成，坐标单位小，线宽/字号按比例缩小） ---- */
.fg-static .fg-base { stroke: #1f2937; stroke-width: .028; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fg-static .fg-el {
  opacity: 0; stroke: #e8590c; stroke-width: .055; stroke-linejoin: round; stroke-linecap: round;
  transition: opacity .2s;
}
/* figkit 会给每个图元写 inline style="stroke-width:x"，会把线宽压成 0 ——
   所以「没点亮」时一律 0 宽（只留透明），「点亮」时必须把线宽抢回来，
   否则被高亮的线段其实什么都看不见（2026-10-26 修）。 */
.fg-static .fg-el[style]:not(.on) { stroke-width: 0; }
.fg-static .fg-el.on { opacity: 1; animation: none; stroke-width: .055; }
.fg-static .fg-el.on[style] { stroke-width: .055 !important; }
.fg-static .fg-el.on[style*="stroke:none"] { stroke-width: 0 !important; }
.fg-static .fg-pt { fill: #1f2937; }
.fg-static .fg-note {
  opacity: 0; fill: #b45309; stroke: #fff; stroke-width: .045; paint-order: stroke;
  font-weight: 700; transition: opacity .2s; animation: none;
}
.fg-static .fg-note.show { opacity: 1; }
.fg-static .fg-lb { fill: #111827; }

/* ================= 思维题库 · 收尾层 ================= */
/* 大屏（一体机 / 投影）字号上调一档，远距离也看得清 */
@media (min-width: 1500px) {
  body { font-size: 14.5px; }
  .qtext { font-size: 15.5px; line-height: 2; }
  .chip { font-size: 13px; }
  .crumb { font-size: 15.5px; }
  .qno { min-width: 28px; height: 24px; font-size: 12px; }
}

.pager { padding: 26px 0 96px; }
.pinfo { color: var(--muted); }

/* 空态 */
.empty { color: var(--muted); }

/* 卡片展开区：暖色底，和外壳分开 */
.qdetail {
  border-top: 1px dashed var(--line);
  background: linear-gradient(180deg, rgba(246,245,242,.5), rgba(255,255,255,0));
}
.qdetail h5 { letter-spacing: .08em; font-weight: 700; }
.opt b { color: var(--pop-2); font-weight: 700; }

/* 日期/编号等数字统一表格数字 */
.qno, .pinfo, .stat, .group-head .n { font-variant-numeric: tabular-nums; }

/* 键盘可达性：焦点环用暖色，和整体一致 */
:focus-visible { outline: 2px solid var(--pop); outline-offset: 2px; border-radius: 6px; }

/* 系统「减弱动态效果」时全部停掉 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* ---------------- 编辑弹窗：配图 ---------------- */
.edfigs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px; margin: 4px 0 10px;
}
.edfig {
  margin: 0; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: #fff; display: flex; flex-direction: column;
}
.edfig img {
  width: 100%; height: 100px; object-fit: contain; padding: 5px;
  background: rgba(246,245,242,.75);
}
.edfig figcaption {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  border-top: 1px solid var(--line); background: #fff;
}
.edfig-n {
  flex: 1; min-width: 0; font-size: 10.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, Consolas, monospace;
}
.edfig-b {
  flex: 0 0 auto; font-family: inherit; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--pop-line);
  background: var(--pop-weak); color: var(--pop-2); cursor: pointer;
  transition: all .16s var(--ease);
}
.edfig-b:hover { background: #ffe7d2; transform: translateY(-1px); }
.edfig.bad { border-color: #fecaca; }
.edfig.bad img { opacity: .25; }
/* 配图位置三档开关（编辑面板） */
.seg3 {
  display: flex; width: fit-content; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 9px;
}
.seg3 button {
  padding: 7px 16px; font-size: 12.5px; color: var(--text-2); background: #fff;
  border: 0; border-right: 1px solid var(--line); cursor: pointer; transition: all .15s;
}
.seg3 button:last-child { border-right: 0; }
.seg3 button:hover { background: var(--pop-weak); color: var(--pop-2); }
.seg3 button.on { background: var(--pop); color: #fff; font-weight: 600; }

/* 说明：展开区不再显示题干（卡片上已经完整显示），所以原来给「详情页配图放右侧」
   用的 .dstem.img-right 一并删了；配图位置的左右/下方现在只在讲解视图里生效。 */

/* 讲解右栏里「原图 + 矢量图」上下排（只在老师选了「配图放右侧」时出现） */
.lq-rawfig {
  flex: 0 1 auto; width: 100%; min-height: 0; display: flex; flex-direction: column;
  align-items: center; gap: 4px; padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px dashed var(--line-strong);
}
.lq-rawfig img { display: block; max-width: 100%; max-height: 150px; height: auto; border-radius: 6px; }
@media (max-height: 780px) { .lq-rawfig img { max-height: 110px; } }

/* 显示宽度：一题一图，缩略图下面直接给根滑杆，不用记 px 数 */
.edfig-w {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px 7px;
  border-top: 1px dashed var(--line); background: rgba(246,245,242,.55);
}
/* 图宽改成数字框：精确输入，不再拖滑杆 */
.lf .edfig-num {
  flex: 0 0 74px; width: 74px; padding: 4px 6px;
  font-size: 12px; text-align: center; box-shadow: none;
  border: 1px solid var(--line-strong); border-radius: 6px; background: #fff;
}
.edfig-wu { font-size: 10.5px; color: var(--muted); flex: 0 0 auto; }
.edfig-w input[type="range"] {
  flex: 1 1 auto; min-width: 0; height: 14px; margin: 0;
  accent-color: var(--pop); cursor: ew-resize;
}
.edfig-wl { font-size: 10.5px; color: var(--muted); flex: 0 0 auto; }
.edfig-wv {
  flex: 0 0 auto; font-size: 10.5px; color: var(--pop-2);
  font-variant-numeric: tabular-nums; min-width: 40px; text-align: right;
}
.edfig-empty {
  grid-column: 1 / -1; font-size: 12.5px; color: var(--muted);
  padding: 16px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: 12px;
  background: rgba(246,245,242,.5);
}

/* ---------------- 账号权限：没开通的功能 ----------------
   变灰但保留在原来的位置 —— 学员看得见「还有这些」，知道加钱能开；
   直接隐藏的话，家长根本不知道还能买到什么。 */
.nbtn.need-plan,
.btn.need-plan,
.learn.need-plan,
.vbtn.need-plan {
  opacity: .5;
  filter: grayscale(1);          /* 主按钮是橙底，只降透明度看起来像「浅橙」而不是「不能用」，去色才一眼看得出 */
  cursor: not-allowed;
  box-shadow: none;
}
.nbtn.need-plan:hover,
.btn.need-plan:hover {
  border-color: var(--line-strong);
  color: inherit;
  background: #fff;
}

/* ---------------- 每日一练 ----------------
   顶栏「刷题」左边的入口 + 弹窗。选题和排期在服务端（web/daily.py），
   这里只有版式。注意 .nbtn b 是「错题数」那个小角标，红点必须用 #daily-dot
   的 id 选择器盖过去，用 .daily-btn b 会被 .nbtn b 的 padding/bg 顶掉。 */
#daily-dot {
  width: 7px; height: 7px; padding: 0; border-radius: 50%; font-size: 0;
  background: var(--bad); position: absolute; top: 5px; right: 7px;
  /* 按钮改成橙色实底后，白圈才看得出「有新题」；原来描 --card 会糊在渐变里 */
  box-shadow: 0 0 0 2px #fff;
}
.daily-btn { position: relative; }

.sheet.dl-sheet { width: 780px; max-width: 96vw; }
.dl-day { color: var(--pop-2); margin-left: 8px; letter-spacing: .02em; }
.dl-flip { font-size: 12px; color: var(--muted); margin-left: 12px; }
.dl-note {
  background: var(--accent-weak); border: 1px solid var(--accent-line);
  color: var(--accent); border-radius: var(--r-sm); padding: 9px 13px;
  font-size: 13px; line-height: 1.7; margin-bottom: 14px;
}
.dl-note code { font-size: 12px; background: #fff; padding: 1px 5px; border-radius: 5px; }
.dl-loading { color: var(--muted); font-size: 13.5px; padding: 18px 2px; }
.dl-hint { font-size: 11.5px; color: var(--muted); margin-right: 10px; }

.dlq {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
  padding: 14px 16px; margin-bottom: 14px;
}
.dlq-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.dlq-no {
  width: 21px; height: 21px; border-radius: 7px; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: 0 0 auto;
}
/* 「第 78 套 · 第 13 题」：既是归属，也是回题库定位这道题的按钮。
   做成一枚安静的胶囊，鼠标停上去才有下划线和墨色，不抢题干。 */
.dlq-src {
  margin-left: auto; font-family: inherit; font-size: 11.5px; color: var(--muted);
  background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap;
}
.dlq-src:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.dlq .qtext { font-size: 15px; line-height: 1.95; }
.dlq-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line);
}
/* 「✦ 开讲」：老师的录课入口，比「在网页上做」更重一级，所以用墨绿实底。
   学生看不到这颗按钮（要 guide 能力或机主态）。 */
.dlq-foot .teach {
  font-family: inherit; font-size: 12.5px; font-weight: 700; line-height: 1;
  color: #fff; background: var(--ink); border: 1px solid var(--ink);
  border-radius: 999px; padding: 6px 14px; cursor: pointer;
  transition: all .18s var(--ease);
}
.dlq-foot .teach:hover { background: var(--ink-2, #145243); border-color: var(--ink-2, #145243); }
/* 排期表每行的「讲」：表很窄，做成一枚小字按钮，不换行 */
.pl-play { padding: 2px 8px !important; font-size: 11.5px !important; }
.dl-novid { font-size: 12px; color: var(--muted); }
.dlq-ans {
  margin-top: 10px; padding: 10px 13px; background: var(--bg-2);
  border-radius: var(--r-sm); font-size: 14px;
}
.dlq-ans-b { font-weight: 700; color: var(--ok); margin-bottom: 6px; }
.dlq-sol { font-size: 14px; line-height: 1.9; color: var(--text-2); }

.mini {
  font-family: inherit; font-size: 12px; padding: 3px 10px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-2);
  cursor: pointer; white-space: nowrap;
}
.mini:hover { background: var(--accent-weak); color: var(--accent); border-color: var(--accent-line); }
/* 排期表里「这道题还没精讲」的那颗「讲」：置灰，别让人点了才发现打不开 */
.mini:disabled { opacity: .38; cursor: default; }
.mini:disabled:hover { background: #fff; color: var(--text-2); border-color: var(--line-strong); }

.dl-hist-h { font-size: 12px; color: var(--muted); margin: 14px 0 6px; letter-spacing: .04em; }
.dl-hist-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; font-size: 13px;
}
.dl-hist-row.on { background: var(--pop-weak); }
.dl-hist-row b { min-width: 92px; color: var(--ink); }
.dl-hist-q { color: var(--muted); font-size: 12.5px; }
.dl-hist-row .grow { flex: 1; }

.dl-plan-day {
  display: flex; align-items: flex-start; gap: 12px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px;
}
.dl-plan-day.on { border-color: var(--pop-line); background: var(--pop-weak); }
.dl-plan-date { min-width: 80px; font-weight: 700; font-size: 13px; color: var(--ink); }
.dl-plan-items { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dl-plan-q { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.dl-plan-no { font-weight: 700; color: var(--ink); min-width: 28px; }
.dl-plan-prev { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-plan-v { font-size: 11.5px; color: var(--ok); white-space: nowrap; }
.dl-plan-v.miss { color: var(--warn); }
/* 「重×3」＝这道题在题库里出现 3 处，录一次讲解能挂 3 个位置 —— 选它更划算 */
.dl-dup {
  font-size: 11px; padding: 0 5px; border-radius: 8px; white-space: nowrap;
  color: #7a5a12; background: #fdf1d8; border: 1px solid #f2ddae;
}
/* 「五星」＝这一期按比例掺了五星题，讲解比平时长，录课前看一眼好排时间 */
.dl-5 {
  font-size: 10.5px; padding: 0 4px; border-radius: 7px; white-space: nowrap;
  margin-left: 4px; vertical-align: 1px;
  color: #8a2b1e; background: #fdeae6; border: 1px solid #f3c9c0;
}
.dl-plan-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 9px 11px;
  border: 1px dashed var(--line); border-radius: 10px; background: #fff;
}
.dl-plan-tools .mini { margin: 0; }
.dl-plan-sep { font-size: 12px; color: var(--text-3); margin-left: 4px; }
.dl-plan-tools input[type="date"] {
  font: inherit; font-size: 12px; padding: 3px 6px; border-radius: 7px;
  border: 1px solid var(--line); color: var(--ink); background: #fff;
}

@media (max-width: 820px) {
  .sheet.dl-sheet { width: 100%; }
  .dl-flip { display: none; }
  .dlq .qtext { font-size: 14.5px; }
}
