/* doc-scan web · 统一视觉
   浅色为主，跟随系统深色。配色走变量，页面里不写死色值。
   布局：左侧固定导航 + 右侧内容区（顶栏 + 滚动主体），
   列表页用表格，详情页用卡片，尽量贴近常见后台/教育产品的操作习惯。 */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f4f8;
  --border: #e6e9ef;
  --border-strong: #d3d8e2;
  --text: #17202b;
  --text-2: #55606f;
  --text-3: #8b95a5;
  --primary: #2f6bff;
  --primary-600: #1f56e0;
  --primary-soft: #eef3ff;
  --violet: #7c5cff;
  --green: #0e9f6e;
  --green-soft: #e7f8f0;
  --amber: #b45309;
  --amber-soft: #fff6e5;
  --red: #e02424;
  --red-soft: #fdeaea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --side-w: 236px;
  /* 表单控件统一高度：一行里 input / 下拉框 / 按钮必须一样高。
     以前 input 用 padding 撑（约 36px）、下拉框套了 .selshell（约 28px），
     同一张卡里「第几讲」比「学科」高一截 —— 全站都按这两个变量走。 */
  --ctl-h: 34px;
  --ctl-h-sm: 28px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151a;
    --surface: #191d24;
    --surface-2: #1f242c;
    --surface-3: #242a33;
    --border: #2a303a;
    --border-strong: #39414d;
    --text: #e9ecf1;
    --text-2: #a7b0be;
    --text-3: #76808f;
    --primary: #5b8cff;
    --primary-600: #7aa2ff;
    --primary-soft: #1d2942;
    --violet: #9b85ff;
    --green: #34c48c;
    --green-soft: #15312a;
    --amber: #f0b429;
    --amber-soft: #33280f;
    --red: #ff6b5e;
    --red-soft: #3a1e1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(47,107,255,.07), transparent 62%),
    radial-gradient(760px 380px at 96% 4%, rgba(124,92,255,.06), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }

/* ── 整体布局 ─────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side-w);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 40;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
  font-weight: 700;
  letter-spacing: .2px;
}
.brand .logo {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2f6bff, #7c5cff);
  color: #fff; font-size: 15px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(47, 107, 255, .35);
}
.brand .t1 { line-height: 1.15; font-size: 15px; }
.brand .t2 { display: block; font-size: 11px; color: var(--text-3); font-weight: 500; }

.nav-label {
  padding: 12px 10px 6px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .4px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item.on {
  background: linear-gradient(90deg, var(--primary-soft), color-mix(in srgb, var(--primary-soft) 40%, transparent));
  color: var(--primary);
  font-weight: 650;
  box-shadow: inset 3px 0 0 var(--primary);
}
.nav-item .ico { width: 18px; height: 18px; display: flex; align-items: center;
  justify-content: center; opacity: .9; flex: 0 0 18px; }
.nav-item .ico svg { display: block; }
/* 按钮里的图标：跟文字基线对齐，别把行高撑开 */
.btn .ic, .ed-act .ic, .tp-btn .ic { vertical-align: -3px; margin-right: 5px; }
.btn .ic:only-child { margin-right: 0; }

.nav-item .cnt {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-3);
  padding: 1px 7px;
  border-radius: 999px;
}
.nav-item.on .cnt { background: rgba(47, 107, 255, .14); color: var(--primary); }

.sidebar .grow { flex: 1; }

.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
}
.side-user:hover { border-color: var(--border-strong); }

/* 侧栏：分组可滚动 + 折叠成图标条（状态记 ds_side_min）
   分组是按「老师平时干什么」切的：教学 / 学员 / 教务 / 系统，别再平铺一长条。 */
.sidebar .nav-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  margin: 0 -4px; padding: 0 4px;
}
.sidebar .nav-group + .nav-group { margin-top: 2px; }
.sidebar .nav-group:first-child .nav-label { padding-top: 2px; }
.side-toggle {
  flex: 0 0 auto; margin: 6px 4px 2px; height: 28px; border-radius: 8px;
  border: 1px dashed var(--border-strong); background: transparent;
  color: var(--text-3); font: inherit; font-size: 12px; cursor: pointer;
}
.side-toggle:hover { color: var(--primary); border-color: var(--primary); }
body.side-min { --side-w: 64px; }
body.side-min .sidebar { padding: 16px 8px; }
body.side-min .brand { justify-content: center; padding: 4px 0 10px; }
body.side-min .brand .t1,
body.side-min .nav-item .lbl,
body.side-min .nav-item .cnt,
body.side-min .side-user > div:last-child { display: none; }
body.side-min .nav-item { justify-content: center; padding: 0; }
body.side-min .nav-label {
  height: 1px; padding: 0; margin: 8px 6px; font-size: 0; color: transparent;
  background: var(--border); overflow: hidden;
}
body.side-min .nav-scroll { margin: 0; padding: 0; }
body.side-min .side-toggle { margin: 6px 0 2px; }
body.side-min .side-user { justify-content: center; padding: 7px; }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2f6bff, #7c5cff);
  color: #fff; font-size: 13px; font-weight: 700;
  flex: 0 0 28px;
}
.side-user .nm { font-size: 13px; font-weight: 600; line-height: 1.2; }
.side-user .rl { font-size: 11px; color: var(--text-3); }
/* 「我的范围」：一行显示校区 · 学科 · 年级，长了省略；鼠标停上去看全（title 里是分行明细） */
.side-user .sc {
  font-size: 11px; color: var(--text-3); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: help;
}

/* 账号弹窗里的「数据范围」 */
.acc-scope {
  margin-top: 4px; padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; gap: 8px;
}
.acc-scope-h { font-size: 12px; font-weight: 650; color: var(--text-2); }
.acc-scope-row { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; }
.acc-scope-row > span { flex: 0 0 34px; color: var(--text-3); padding-top: 3px; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.sc-chip {
  padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
}
.sc-chip.off { color: var(--text-3); background: none; border-style: dashed; }

.content {
  flex: 1;
  min-width: 0;
  margin-left: var(--side-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.pagebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 26px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.pagebar h1 { font-size: 18px; letter-spacing: -.2px; }
.pagebar .sub { color: var(--text-3); font-size: 12px; }
.pagebar .spacer { flex: 1; }
.pagebar .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.pagebody { padding: 20px 26px 60px; }

/* ── 双栏工作页：页面本身不滚，只让「栏内」滚 ────────────────────────
   强规则：同一个页面不要出现两条同方向的滚动条（分栏除外）。
   给 <body class="split"> 的页面（课程 / 班级 / 作业 / 角色）用这套：
   顶栏固定、pagebody 撑满剩余高度、左右两栏各自滚动。 */
body.split { height: 100vh; overflow: hidden; }
body.split .layout,
body.split .content { height: 100vh; min-height: 0; }
body.split .pagebar { flex: 0 0 auto; }
body.split .pagebody {
  flex: 1; min-height: 0; overflow: hidden;
  padding: 16px 26px 18px; display: flex;
}
body.split .role-layout {
  flex: 1; min-height: 0; width: 100%;
  grid-template-columns: 300px minmax(0, 1fr); align-items: stretch;
}
body.split .role-layout > .card {
  min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
/* 栏内滚动区：左栏列表 / 右栏正文都套这个（或 .cl-list，效果一样） */
body.split .cl-list { max-height: none; flex: 1; min-height: 0; overflow: auto; }
body.split .pane-scroll { flex: 1; min-height: 0; overflow: auto; }
/* 书详情的工作台不用 pagebody，直接把三栏撑满剩余高度（否则 body 也会跟着滚一条） */
body.split .workbench {
  height: auto; flex: 1; min-height: 0;
  grid-template-rows: minmax(0, 1fr);   /* 不给行高，栅格会按内容撑，栏内滚动条就"没铺满" */
  overflow: hidden;
}
body.split .workbench > .pane { min-height: 0; height: 100%; }
/* 窄屏（<900px）双栏会堆成一列，这时候还给页面滚动，别锁死高度 */
@media (max-width: 900px) {
  body.split, body.split .layout, body.split .content { height: auto; overflow: visible; }
  body.split .pagebody { display: block; overflow: visible; padding: 14px; }
  body.split .role-layout { display: block; }
  body.split .cl-list, body.split .pane-scroll { max-height: 46vh; overflow: auto; }
}

/* ── 按钮 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(135deg, #3b74ff, var(--primary));
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(47, 107, 255, .25);
}
.btn.primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--border)); }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 40px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }

/* ── 表单 ─────────────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
/* 统一高度（textarea 不限高；带 .sm 的走小号，和 .btn.sm 一条线）。
   下拉框的高度挂在外壳 .selshell 上，所以三处一起写。 */
input.input, select.input, select.select, select.ui-select, .selshell {
  height: var(--ctl-h);
}
input.input.sm, select.select.sm, .selshell.sm { height: var(--ctl-h-sm); }
select.select, select.ui-select { padding-top: 0; padding-bottom: 0; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; font-family: var(--mono); font-size: 13px; }
.field { display: grid; gap: 6px; }
.field > label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.hint { font-size: 12px; color: var(--text-3); }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); }

/* ── 卡片 / 面板 ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.card.hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.panel > h3 {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel > h3 .right { margin-left: auto; font-weight: 500; }

/* ── 徽章 ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-2);
}
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.violet { background: #f2efff; color: var(--violet); }
@media (prefers-color-scheme: dark) { .badge.violet { background: #2a2140; } }

/* ── 富文本编辑框（题干 / 答案 / 选项）─────────────────── */
.rbox { position: relative; min-width: 0; width: 100%; }
.rbox-ed {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.95;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  transition: border-color .15s, box-shadow .15s;
}
.rbox-ed:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.rbox-ed:empty::before {
  content: attr(data-ph);
  color: var(--text-3);
  pointer-events: none;
}
.rbox-ed .rb-tok {
  cursor: pointer;
  border-radius: 4px;
  padding: 0 1px;
  transition: background .12s;
}
.rbox-ed .rb-tok:hover {
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 34%, transparent);
}
.rbox-ed .katex { font-size: 1.12em; }
.rbox-ed .rb-line {
  display: inline-block;
  border-bottom: 1.5px solid currentColor;
  height: 1em;
  vertical-align: -0.15em;
  margin: 0 1px;
}
.rbox-ed .rb-img {
  max-height: 110px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  vertical-align: middle;
}
.rbox-ed .rb-py { font-size: 11px; color: var(--text-3); }
.rbox-ed .rb-tex { font-family: "Cambria Math", Cambria, serif; font-style: italic; }

.rb-pal { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 12px; }
.rb-pv {
  min-height: 42px; padding: 8px 10px; border: 1px dashed var(--border);
  border-radius: 8px; background: var(--surface-2); font-size: 15px;
}
.rb-row { display: flex; gap: 16px; align-items: flex-end; }
.rb-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; padding-bottom: 9px; white-space: nowrap;
}
.rb-imgwrap { text-align: center; margin-bottom: 10px; }
.rb-imgwrap img {
  max-width: 100%; max-height: 240px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff;
}

/* ── 编辑工具条 ───────────────────────────────────────── */
.tb-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  margin-bottom: 6px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.tb {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  min-width: 28px;
  height: 26px;
  padding: 0 7px;
  font-size: 12.5px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-2);
}
.tb:hover { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.tb:active { transform: translateY(1px); }
.tb-sep { width: 1px; height: 16px; background: var(--border-strong); margin: 0 4px; }
.tb-lbl {
  font-size: 11px; color: var(--text-3); font-weight: 600;
  padding: 0 6px 0 2px; white-space: nowrap; letter-spacing: .02em;
}
.tb-bar.compact { padding: 3px; }
.tb-bar.compact .tb { min-width: 24px; height: 24px; font-size: 12px; padding: 0 6px; }

/* ── 表格 ─────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* 别用 hidden：列多了会把「操作」列整列切掉，按钮看着像没做（踩过） */
  overflow-x: auto;
  overflow-y: hidden;
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.tbl th {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  font-size: 12px;
  color: var(--text-2);
  font-weight: 650;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl td.num { color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl td.name { font-weight: 600; }
table.tbl td.name a { color: var(--text); }
table.tbl td.name a:hover { color: var(--primary); text-decoration: none; }
table.tbl td.nowrap { white-space: nowrap; }
table.tbl .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty-row { padding: 48px 20px; text-align: center; color: var(--text-3); }

/* ── 进度条 ───────────────────────────────────────────── */
.progress { height: 5px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--violet));
  border-radius: 999px;
  transition: width .4s ease;
}
.progress.pulse > i { animation: shimmer 1.4s infinite; }
@keyframes shimmer { 50% { opacity: .55; } }

/* ── 空状态 ───────────────────────────────────────────── */
.empty {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 56px 24px;
  text-align: center;
  color: var(--text-2);
}
.empty .big { font-size: 34px; margin-bottom: 8px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; }

/* ── 对话框 ───────────────────────────────────────────── */
.mask {
  position: fixed; inset: 0;
  background: rgba(12, 16, 24, .45);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 60;
  padding: 24px;
}
.mask.on { display: flex; }
.dialog {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.dialog-head h2 { font-size: 17px; }
.dialog-body { padding: 20px 22px; display: grid; gap: 16px; }
.dialog-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--surface);
}

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .big { font-size: 30px; }
.dropzone b { display: block; margin: 6px 0 2px; }

.filelist {
  display: grid; gap: 4px;
  max-height: 160px; overflow: auto;
  font-size: 12px; color: var(--text-2);
  font-family: var(--mono);
}
.filelist div { display: flex; justify-content: space-between; gap: 12px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ── toast ────────────────────────────────────────────── */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 90; }
.toast {
  min-width: 200px; max-width: 380px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: slidein .2s ease;
}
.toast.err { border-color: color-mix(in srgb, var(--red) 50%, var(--border)); color: var(--red); }
.toast.ok { border-color: color-mix(in srgb, var(--green) 50%, var(--border)); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }

/* 全屏遮罩：退出登录等会跳走的动作，先糊一层，别让人看见「还登录着」的页面 */
.ds-veil {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(3px);
}
.ds-veil.on { display: flex; }
.ds-veil-box {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: 13px; color: var(--text);
}
.ds-veil-spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--primary) 28%, transparent);
  border-top-color: var(--primary);
  animation: vspin .7s linear infinite;
}
@keyframes vspin { to { transform: rotate(360deg); } }

/* ── 工作台（书详情） ─────────────────────────────────── */
.workbench {
  display: grid;
  grid-template-columns: 240px 320px minmax(0, 1fr);
  height: calc(100vh - 61px);
}
.pane {
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.pane:last-child { border-right: none; background: var(--bg); }
.pane-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  font-weight: 650; font-size: 13px;
}
.tree { padding: 8px 8px 24px; }
.tree-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 7px;
  cursor: pointer; color: var(--text-2); font-size: 13px; line-height: 1.35;
}
.tree-item:hover { background: var(--surface-3); color: var(--text); }
.tree-item.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.tree-item .n { color: var(--text-3); font-size: 11px; margin-left: auto; }
.tree-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .lv2 { padding-left: 20px; }
.tree .lv3 { padding-left: 34px; }

.qlist { padding: 6px 8px 32px; display: grid; gap: 2px; }
.qitem {
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  display: grid; gap: 3px;
}
.qitem:hover { background: var(--surface-3); }
.qitem.on { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 28%, transparent); }
.qitem .top { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.qitem .no { font-weight: 700; color: var(--text-2); }
.qitem .txt {
  font-size: 13px; color: var(--text-2);
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.qitem.on .txt { color: var(--text); }
.qitem .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.qitem .dot.verified { background: var(--green); }
.qitem .dot.edited { background: var(--amber); }
.qitem .dot.rejected { background: var(--red); }

.editor { padding: 20px 24px 80px; max-width: 1000px; }
.editor-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.editor-head h2 { font-size: 18px; }
.editor-head .right { margin-left: auto; display: flex; gap: 8px; }

.opt-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.opt-row .lbl { width: 46px; flex: 0 0 46px; margin-top: 2px; }
/* 右边一列：工具条在上、编辑框在下（工具条由 attachToolbar 插进 .opt-body） */
.opt-row .opt-body { flex: 1; min-width: 0; }
.opt-row .opt-body .tx, .opt-row .txt { width: 100%; }
.opt-row .opt-body .tb-bar { margin-bottom: 6px; }
.opt-row .opt-del { margin-top: 2px; }
.meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.figstrip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.figstrip figure {
  margin: 0; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  background: var(--surface-2); cursor: zoom-in;
}
.figstrip img { display: block; max-width: 140px; max-height: 100px; object-fit: contain; }

.preview-frame { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.tabs { display: flex; gap: 4px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.tab { padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.tab:hover { background: var(--surface-3); }
.tab.on { background: var(--primary-soft); color: var(--primary); font-weight: 650; }

.logbox {
  font-family: var(--mono); font-size: 12px;
  white-space: pre-wrap; word-break: break-all;
  background: #0f1216; color: #cfd6e4;
  border-radius: 8px; padding: 12px;
  max-height: 60vh; overflow: auto;
}
.modal-img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: var(--shadow-lg); }

/* ── 登录页 ───────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 600px at 20% 0%, #e8efff 0%, transparent 55%),
              radial-gradient(900px 500px at 90% 100%, #f1ecff 0%, transparent 50%),
              var(--bg);
  padding: 24px;
}
@media (prefers-color-scheme: dark) {
  .login-wrap {
    background: radial-gradient(1200px 600px at 20% 0%, #16213c 0%, transparent 55%),
                radial-gradient(900px 500px at 90% 100%, #241c3d 0%, transparent 50%),
                var(--bg);
  }
}
.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 34px 30px 28px;
}
.login-card .brand { justify-content: center; padding: 0 0 22px; }
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.login-card .tip { text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { margin-top: 6px; }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 4px; }
.login-err.ok { color: var(--green); }

/* ── 组卷 ─────────────────────────────────────────────── */
.compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 16px;
  align-items: start;
}
.pick-list { max-height: calc(100vh - 300px); overflow: auto; }
.pick-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.pick-row:last-child { border-bottom: none; }
.pick-row:hover { background: var(--surface-2); }
.pick-row .body { min-width: 0; flex: 1; }
.pick-row .stem {
  font-size: 13px; color: var(--text-2);
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pick-row .meta { font-size: 11.5px; color: var(--text-3); display: flex; gap: 8px; margin-top: 3px; }

.paper-items { display: grid; gap: 8px; }
.pitem {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 64px 30px;
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}
.pitem .idx { color: var(--text-3); font-size: 12px; padding-top: 2px; text-align: right; }
.pitem .stem { font-size: 13px; color: var(--text-2); }
.pitem .grp { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.pitem .score { width: 60px; padding: 4px 6px; text-align: center; }
.pitem .del { color: var(--text-3); cursor: pointer; border: 0; background: none; font-size: 15px; }
.pitem .del:hover { color: var(--red); }

.group-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.total-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--surface-2);
  border-radius: 9px; margin-bottom: 10px; font-size: 13px;
}

/* ── 多角色选择 ───────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.chip.role { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
/* 未交名单里「已经催过」的人：淡绿底 + 前面的小点，别再用一句"提醒过了"占地方 */
.chip.reminded {
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--green) 35%, var(--border));
  color: color-mix(in srgb, var(--green) 70%, var(--text));
}
.chip.reminded::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: .7;
}
/* 可点选的 chip（科目/年级/校区多选） */
.chips button.chip { cursor: pointer; font-family: inherit; }
.chips button.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.role-picks { display: grid; gap: 6px; }
.role-picks .pick {
  display: grid; grid-template-columns: 18px 1fr; gap: 4px 10px;
  align-items: center; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 9px; cursor: pointer; background: var(--surface);
}
.role-picks .pick:hover { border-color: var(--border-strong); background: var(--surface-2); }
.role-picks .pick input { accent-color: var(--primary); width: 15px; height: 15px; }
.role-picks .pick .pn { font-size: 13px; font-weight: 650; }
.role-picks .pick .pd { grid-column: 2; font-size: 11.5px; color: var(--text-3); margin-top: -2px; }

/* ── 角色与权限 ───────────────────────────────────────── */
.role-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.role-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
}
.role-item:hover { background: var(--surface-2); }
.role-item.on { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 26%, transparent); }
.role-item .rn { font-weight: 650; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.role-item .rc { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.perm-group { margin-bottom: 18px; }
.perm-gh {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 8px;
}
.perm-gh .btn { margin-left: auto; }
.perm-row {
  display: grid;
  grid-template-columns: 18px 150px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 6px;
  border-radius: 7px;
  cursor: pointer;
}
.perm-row:hover { background: var(--surface-2); }
.perm-row.dis { opacity: .65; cursor: default; }
.perm-row input { accent-color: var(--primary); width: 15px; height: 15px; }
.perm-row .pn { font-size: 13px; font-weight: 600; }
.perm-row .pd { font-size: 12px; color: var(--text-3); }

/* 权限树按子系统分组：本系统可勾，其它模块只读 */
.mod-head,
.mod-other > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.mod-head { margin-bottom: 12px; }
.mod-self { margin-bottom: 4px; }
.mod-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 1px 7px;
}
.mod-tag.on { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 32%, transparent);
  background: var(--primary-soft); }
.mod-n { font-size: 11.5px; font-weight: 500; color: var(--text-3); margin-left: auto; }
.mod-others-t {
  margin: 22px 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: .02em;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.mod-other { margin-bottom: 8px; }
.mod-other > summary { cursor: pointer; list-style: none; }
.mod-other > summary::-webkit-details-marker { display: none; }
.mod-other > summary::before {
  content: '▸';
  color: var(--text-3);
  font-size: 11px;
  transform: translateY(-1px);
}
.mod-other[open] > summary::before { content: '▾'; }
.mod-other[open] > summary { margin-bottom: 10px; }
.mod-note {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.65;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
}

/* ── 去重 ─────────────────────────────────────────────── */
.dup-group { margin-bottom: 16px; }
.dup-main, .dup-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.dup-main { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); }
.dup-item { margin-top: 8px; }
.dup-stem { font-size: 13px; color: var(--text); white-space: pre-wrap; }
.dup-meta { font-size: 11.5px; color: var(--text-3); margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; }
.dup-figs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.dup-figs img {
  max-height: 96px; max-width: 180px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; padding: 2px; display: block;
}
.dup-actions { display: flex; gap: 6px; align-items: flex-start; }

/* ── 小屏 ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .compose { grid-template-columns: 1fr; }
  .workbench { grid-template-columns: 210px 280px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --side-w: 64px; }
  .sidebar { padding: 12px 8px; align-items: center; }
  .sidebar .brand .t1, .sidebar .brand .t2, .nav-label,
  .nav-item span.lbl, .nav-item .cnt, .side-user .nm, .side-user .rl { display: none; }
  .nav-item { justify-content: center; padding: 0; width: 44px; }
  .side-user { justify-content: center; }
  .pagebody { padding: 14px; }
  .pagebar { padding: 10px 14px; }
  .workbench { grid-template-columns: 1fr; height: auto; }
  .pane { max-height: 42vh; border-right: none; border-bottom: 1px solid var(--border); }
  .meta-grid, .row3 { grid-template-columns: 1fr 1fr; }
}

/* ── 上课模式（/teach）──────────────────────────────────
   整页放映 + 批注。刻意不用 .pagebody / 左侧导航那套骨架：
   上课时屏幕就那么大，除了一条顶栏，其余全给书页。
   配色照旧走变量，深色模式下自动跟着变。 */
body.teach { overflow: hidden; height: 100vh; }

.tp { display: flex; flex-direction: column; height: 100vh; background: var(--bg); }

/* 顶栏 */
.tp-bar {
  flex: 0 0 auto; height: 52px; display: flex; align-items: center; gap: 6px;
  padding: 0 10px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); z-index: 30;
  transition: opacity .25s;
}
body.tp-idle .tp-bar { opacity: .32; }
body.tp-idle .tp-bar:hover { opacity: 1; }
.tp-brand {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px;
  border-radius: 8px; color: var(--text-2); font-size: 13px; text-decoration: none; white-space: nowrap;
}
.tp-brand:hover { background: var(--surface-3); color: var(--text); }
.tp-title {
  font-weight: 650; font-size: 13.5px; max-width: 24vw; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; margin-right: 2px;
}
.tp-nav { display: flex; align-items: center; gap: 4px; }
.tp-page {
  width: 52px; height: 30px; text-align: center; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13px;
}
.tp-total { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.tp-sp { flex: 1; }

.tp-btn {
  height: 30px; min-width: 30px; padding: 0 9px; display: inline-flex; align-items: center;
  gap: 5px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.tp-btn:hover { background: var(--surface-3); color: var(--text); }
.tp-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tp-btn.ghost { border-color: transparent; background: transparent; }
.tp-btn.ghost:hover { background: var(--surface-3); }
.tp-btn:disabled { opacity: .42; cursor: default; }
.tp-btn .k { font-size: 11px; opacity: .55; }

/* 主区：目录 | 书页 | 题目 */
.tp-main {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 214px minmax(0, 1fr) 336px;
}
body.tp-no-left .tp-main { grid-template-columns: 0 minmax(0, 1fr) 336px; }
body.tp-no-right .tp-main { grid-template-columns: 214px minmax(0, 1fr) 0; }
body.tp-no-left.tp-no-right .tp-main { grid-template-columns: 0 minmax(0, 1fr) 0; }
body.tp-no-left .tp-side.left, body.tp-no-right .tp-side.right { display: none; }

.tp-side {
  min-width: 0; display: flex; flex-direction: column;
  background: var(--surface); overflow: hidden;
}
.tp-side.left { border-right: 1px solid var(--border); }
.tp-side.right { border-left: 1px solid var(--border); }
.tp-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); }
.tp-tab {
  flex: 1; height: 28px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer;
}
.tp-tab.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.tp-scroll { flex: 1; overflow: auto; padding: 8px; }

/* 缩略图 */
.tp-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp-thumb {
  border: 2px solid transparent; border-radius: 7px; overflow: hidden; cursor: pointer;
  background: var(--surface-3); position: relative; padding: 0; line-height: 0;
}
.tp-thumb img { width: 100%; display: block; }
.tp-thumb .no {
  position: absolute; left: 3px; bottom: 3px; background: rgba(20, 26, 36, .72); color: #fff;
  font-size: 10.5px; line-height: 1; padding: 2px 4px; border-radius: 4px;
}
.tp-thumb.on { border-color: var(--primary); }
.tp-thumb.on .no { background: var(--primary); }

/* 目录 */
.tp-outline { display: flex; flex-direction: column; gap: 1px; }
.tp-oi {
  display: flex; align-items: baseline; gap: 6px; padding: 6px 8px; border-radius: 6px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; border: none; background: none;
  font-family: inherit; text-align: left; width: 100%;
}
.tp-oi:hover { background: var(--surface-3); color: var(--text); }
.tp-oi.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.tp-oi .p { margin-left: auto; font-size: 11px; color: var(--text-3); }
.tp-oi.lv1 { padding-left: 20px; }
.tp-oi.lv2 { padding-left: 32px; }

/* 舞台 */
.tp-stage { overflow: auto; padding: 16px; background: var(--surface-3); position: relative; }
.tp-sheet {
  position: relative; margin: 0 auto; width: fit-content;
  box-shadow: 0 6px 26px rgba(16, 24, 40, .14); border-radius: 3px; background: #fff;
  transition: width .12s;
}
.tp-pg { display: block; width: 100%; height: 100%; object-fit: contain;
  user-select: none; -webkit-user-drag: none; }
.tp-ink {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; touch-action: none;
}
body.pen .tp-ink { pointer-events: auto; cursor: crosshair; }
body.pen .tp-sheet { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 当前题的高亮带 */
.tp-hot {
  position: absolute; left: 2%; width: 96%; border-radius: 6px; pointer-events: none;
  border: 2px solid var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
  animation: hotpulse 1.1s ease 2;
  display: none;
}
.tp-hot.on { display: block; }
@keyframes hotpulse {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

/* 右侧题目 */
.tp-q {
  border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; margin-bottom: 8px;
  background: var(--surface); cursor: pointer;
}
.tp-q:hover { border-color: var(--border-strong); }
.tp-q.on { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 14%, transparent); }
.tp-q-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.tp-q-no {
  font-weight: 700; font-size: 12px; color: var(--primary); background: var(--primary-soft);
  border-radius: 5px; padding: 1px 6px; min-width: 22px; text-align: center;
}
.tp-q-type { font-size: 11px; color: var(--text-3); }
.tp-q-stem { font-size: 13px; line-height: 1.6; color: var(--text); word-break: break-word; }
.tp-q-opts { margin-top: 4px; font-size: 12.5px; color: var(--text-2); line-height: 1.65; }
.tp-q-opts b { color: var(--text); margin-right: 3px; }
.tp-blk { margin-top: 6px; font-size: 12.5px; line-height: 1.65; border-radius: 6px; padding: 6px 8px; white-space: pre-wrap; }
.tp-blk b { display: block; font-size: 11px; margin-bottom: 2px; opacity: .8; }
.tp-blk.ans { background: var(--green-soft); color: var(--text); border-left: 3px solid var(--green); }
.tp-blk.exp { background: color-mix(in srgb, var(--violet) 8%, var(--surface)); border-left: 3px solid var(--violet); }
.tp-blk.none { background: var(--surface-3); color: var(--text-3); border-left: 3px solid var(--border-strong); }
body.tp-hide-ans .tp-blk.ans { display: none; }
body.tp-hide-exp .tp-blk.exp { display: none; }

.tp-empty { color: var(--text-3); font-size: 12.5px; text-align: center; padding: 28px 10px; line-height: 1.8; }

/* 画笔条 */
.tp-penbar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(80px);
  display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px;
  background: rgba(22, 28, 38, .93); color: #fff; z-index: 60; font-size: 12.5px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none;
  transition: transform .2s, opacity .2s;
}
body.pen .tp-penbar { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.tp-penbar .c {
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; flex: 0 0 auto;
}
.tp-penbar .c.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.tp-penbar .w {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .4);
  background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer;
}
.tp-penbar .w.on { background: rgba(255, 255, 255, .22); }
.tp-penbar .w i { display: block; background: #fff; border-radius: 50%; }
.tp-penbar button {
  background: transparent; border: 1px solid rgba(255, 255, 255, .35); color: #fff;
  border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 12.5px;
}
.tp-penbar button:hover { background: rgba(255, 255, 255, .14); }
.tp-penbar button.on { background: rgba(255, 255, 255, .28); }
.tp-penbar .sp { width: 1px; height: 20px; background: rgba(255, 255, 255, .25); margin: 0 2px; }

/* 聚光灯 */
.tp-spot {
  position: fixed; inset: 0; z-index: 45; display: none; pointer-events: none;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 40%),
    transparent 0, transparent var(--r, 150px), rgba(8, 12, 18, .62) calc(var(--r, 150px) + 60px));
}
body.spot .tp-spot { display: block; }
body.spot .tp-bar, body.spot .tp-side, body.spot .tp-penbar { opacity: .18; }

/* 帮助浮层 */
.tp-help {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center; background: rgba(10, 14, 20, .55);
}
.tp-help.on { display: flex; }
.tp-help-box {
  background: var(--surface); border-radius: 14px; padding: 20px 24px; width: min(560px, 92vw);
  box-shadow: var(--shadow-lg); max-height: 82vh; overflow: auto;
}
.tp-help-box h3 { margin: 0 0 12px; font-size: 15px; }
.tp-help-box table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tp-help-box td { padding: 5px 0; color: var(--text-2); }
.tp-help-box td:first-child { width: 130px; }
.tp-help-box kbd {
  display: inline-block; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--border-strong); background: var(--surface-2); font: inherit;
  font-size: 11.5px; color: var(--text); margin-right: 3px;
}

/* 开课时压暗，聚焦在书页 */
@media (max-width: 1100px) {
  .tp-main { grid-template-columns: 0 minmax(0, 1fr) 300px; }
  .tp-side.left { display: none; }
  .tp-title { max-width: 20vw; }
}
@media (max-width: 820px) {
  .tp-main { grid-template-columns: minmax(0, 1fr); }
  .tp-side.right { display: none; }
  .tp-title, .tp-total { display: none; }
}

/* 书库卡片里的「上课」入口：稳稳待在卡片右下角 */
.card-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

/* 整页都没答案时的一句提示（比每张卡上一条灰条清爽） */
.tp-hint {
  font-size: 12px; line-height: 1.65; color: var(--text-2); background: var(--amber-soft);
  border-radius: 8px; padding: 7px 10px; margin-bottom: 10px;
}
.tp-blk.none { background: transparent; border-left-color: var(--border); color: var(--text-3); padding: 2px 8px; }

/* ── 站内确认框（替代 window.confirm）────────────────── */
.ask-mask { z-index: 120; }
.ask {
  width: min(432px, 92vw); display: grid; grid-template-columns: 36px minmax(0, 1fr);
  gap: 0 12px; padding: 20px 22px 16px; background: var(--surface); border-radius: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px) scale(.985);
  transition: opacity .18s ease, transform .18s ease;
}
.ask-mask.on .ask.in { opacity: 1; transform: none; }
.ask-ico {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 15px; background: var(--primary-soft); color: var(--primary);
}
.ask.danger .ask-ico { background: var(--red-soft); color: var(--red); }
.ask-title { font-size: 14.5px; font-weight: 650; margin: 2px 0 5px; }
.ask-text { font-size: 13px; line-height: 1.72; color: var(--text-2); word-break: break-word; }
.ask-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.ask .btn { min-width: 68px; }
/* 带输入的弹窗（替代原生 prompt） */
.ask-form .ask-main { min-width: 0; }
.ask-fields { display: grid; gap: 10px; margin-top: 12px; }
.ask-f { display: grid; gap: 5px; font-size: 12.5px; color: var(--text-3); }
.ask-f .input, .ask-f .textarea { width: 100%; }
.ask-f .textarea { min-height: 68px; }
.btn.primary.red { background: var(--red); border-color: var(--red); }
.btn.primary.red:hover { background: color-mix(in srgb, var(--red) 88%, #000); }

/* ── 上课模式：逐题讲解 ────────────────────────────────── */
body.one .tp-main { grid-template-columns: 214px minmax(0, 1fr) 430px; }
body.one.tp-no-left .tp-main { grid-template-columns: 0 minmax(0, 1fr) 430px; }

.tp-one { display: flex; flex-direction: column; gap: 10px; }
.tp-one-bar {
  display: flex; align-items: center; gap: 6px; justify-content: space-between;
  padding: 2px 2px 8px; border-bottom: 1px dashed var(--border);
}
.tp-one-pos { font-size: 12px; color: var(--text-3); }
.tp-card {
  border: 1px solid var(--border); border-radius: 11px; padding: 12px 13px;
  background: var(--surface);
}
.tp-card .tp-q-stem { font-size: 14px; line-height: 1.75; }

/* 解析步骤：一条一条滑进来 */
.tp-steps { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.tp-step {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px;
  padding: 9px 11px; border-radius: 10px; background: var(--surface-2);
  border-left: 3px solid var(--primary);
  opacity: 0; animation: stepin .42s cubic-bezier(.22, .9, .3, 1) forwards;
}
@keyframes stepin {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}
.tp-step .n {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-size: 11.5px; font-weight: 700;
}
.tp-step .tx { font-size: 13px; line-height: 1.72; color: var(--text); }
.tp-step .tx b { display: block; font-size: 12px; color: var(--primary); margin-bottom: 1px; }
.tp-step.tip { background: var(--amber-soft); border-left-color: var(--amber); }
.tp-step.tip .n { background: var(--amber); }
.tp-step.tip .tx b { color: var(--amber); }

/* 目录：单元 + 展开的大题 */
.tp-oi-group { display: flex; flex-direction: column; }
.tp-oi .caret {
  width: 12px; flex: 0 0 12px; font-size: 9px; color: var(--text-3);
  transition: transform .15s; display: inline-block;
}
.tp-oi-sub { display: none; }
.tp-oi-group.open .tp-oi-sub { display: flex; flex-direction: column; }
.tp-oi-sub .tp-oi { padding-left: 26px; font-size: 12px; color: var(--text-3); }
.tp-oi-sub .tp-oi:hover { color: var(--text); }
/* 逐题模式里解析受「解析」开关控制 */
body.tp-hide-exp .tp-steps { display: none; }

/* 逐题卡里的「题面截图」：用页图现场裁，比识别出来的文字可靠 */
.tp-shot {
  position: relative; overflow: hidden; margin: 8px 0 2px;
  max-height: 300px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.tp-shot img {
  position: absolute; max-width: none; display: block;
}
.tp-q-crop {
  display: block; max-width: 100%; margin: 8px 0 2px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}

/* 位置是「估」出来的：虚线框，别让人以为很准 */
.tp-hot.guess { border-style: dashed; border-color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, transparent); }

/* ── 解析分步 ─────────────────────────────────────────────
   默认一步一停：讲一步点一下，右栏不会一上来糊满整屏解析。 */
.tp-steps-bar {
  display: flex; align-items: center; gap: 6px; padding: 2px 2px 6px;
}
.tp-steps-pos { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.tp-steps-bar .tp-btn { height: 26px; font-size: 12px; padding: 0 8px; }
.tp-step.done { opacity: 1; animation: none; transform: none; }

.tp-card-foot {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border);
}
.tp-src { font-size: 11.5px; color: var(--text-3); }

/* ── 题干里的配图（〔图N〕 → 真图）──────────────────────────
   列表里给小的，逐题卡给大一点；点一下看原图。 */
.ifig {
  display: inline-block; vertical-align: middle; margin: 3px 5px 3px 0;
  line-height: 0; border-radius: 5px;
}
.ifig img {
  max-height: 58px; max-width: 190px; border: 1px solid var(--border);
  border-radius: 5px; background: #fff; object-fit: contain;
}
.ifig:hover img { border-color: var(--primary); }
.tp-q-stem .ifig img { max-height: 104px; max-width: 300px; }
.qitem .txt .ifig img { max-height: 52px; max-width: 150px; }
.paper-pick .ifig img { max-height: 46px; max-width: 130px; }

/* ── 逐题：解析/答案都等老师动手 ────────────────────────
   一上来就铺满解析，讲课时反而被剧透，节奏也乱。 */
.tp-gate { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.tp-gate .btn.block { width: 100%; height: 40px; font-size: 13.5px; }
.tp-gate-hint { font-size: 11.5px; line-height: 1.6; color: var(--text-3); text-align: center; }

.tp-ans-btn {
  width: 100%; height: 34px; margin-top: 4px; border-radius: 9px;
  border: 1px dashed var(--border-strong); background: var(--surface-2);
  color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.tp-ans-btn:hover { border-color: var(--primary); color: var(--primary); }
.tp-ans-btn .k {
  font-size: 10.5px; opacity: .55; border: 1px solid currentColor;
  border-radius: 4px; padding: 0 3px; margin-left: 4px;
}
.tp-linkbtn {
  background: none; border: 0; color: var(--text-3); font: inherit;
  font-size: 11.5px; cursor: pointer; padding: 3px 0; text-align: left;
}
.tp-linkbtn:hover { color: var(--text-2); text-decoration: underline; }

/* ── 班级 / 作业 ─────────────────────────────────────── */
.cl-list { max-height: calc(100vh - 250px); overflow: auto; }
.cl-item { padding: 10px 12px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; }
.cl-item:hover { background: var(--surface-2); }
.cl-item.on { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 26%, transparent); }
.cl-item .t { font-weight: 650; font-size: 13.5px; }
.cl-item .m { font-size: 11.5px; color: var(--text-3); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv .k { color: var(--text-3); }
.kv .v { min-width: 0; }

.qpick { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.qpick-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
/* 注意：只给「选题」那块加高度限制。书工作台的题目列表也用 .qlist，
   以前这条没限定作用域，结果中间那栏被锁在 320px、还多出一条滚动条。 */
.qpick .qlist { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.qrow { display: grid; grid-template-columns: 22px 52px minmax(0, 1fr) 46px; gap: 8px; align-items: start;
  padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.qrow:last-child { border-bottom: 0; }
.qrow:hover { background: var(--surface-2); }
.qrow .no { color: var(--text-3); font-size: 12px; }
.qrow .tx { min-width: 0; color: var(--text-2); line-height: 1.5; }
.qrow .tx img { max-height: 64px; max-width: 100%; border-radius: 4px; margin: 2px 4px 2px 0; vertical-align: middle; }
.qrow .qview { align-self: start; }
.qrow input { margin-top: 2px; accent-color: var(--primary); }
.picked-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

.qcard { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; background: var(--surface); }
.qcard .qh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.qcard .stem { font-size: 14px; line-height: 1.7; }
.qcard .stem img { max-width: 100%; border-radius: 6px; margin: 4px 0; }
.qcard .opts { margin: 8px 0 2px; display: grid; gap: 4px; font-size: 13.5px; color: var(--text-2); }
.ansbox { margin-top: 10px; background: var(--surface-2); border-radius: 9px; padding: 10px 12px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.ansbox .lab { font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; }
.ansbox img { max-width: 100%; border-radius: 6px; margin: 4px 0; }
.ansbox.empty { color: var(--text-3); font-style: italic; }
.refbox { margin-top: 8px; font-size: 13px; color: var(--text-2); }
.refbox .lab { font-size: 11.5px; color: var(--text-3); }
.mark { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px;
  padding-top: 10px; border-top: 1px dashed var(--border); }
.mark label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.mark input[type=number] { width: 74px; }
.mark .cmt { flex: 1; min-width: 180px; }

/* 题目详情弹窗里的配图（选项图/题干图） */
.qcard .opts img, .dialog-body .stem img, .dialog-body .opts img {
  max-width: 100%; max-height: 260px; border-radius: 6px; margin: 4px 6px 4px 0;
  vertical-align: middle; cursor: zoom-in;
}

/* ── 作答 / 答案的「所见即所得」 ──────────────────────── */
.mk-blank {
  display: inline-block; vertical-align: baseline; height: 1em;
  border-bottom: 1.5px solid currentColor; margin: 0 .28em;
}
.mk-dot { text-emphasis: dot; text-emphasis-position: under right; -webkit-text-emphasis: dot; }
.mk-wl { text-decoration: underline wavy #d92d20; text-underline-offset: 3px; }
.mk-py { font-size: .82em; color: var(--text-3); }

.ansbox .ansimg, .refbox .ansimg {
  display: block; max-width: 100%; max-height: 420px; width: auto;
  margin: 8px 0; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; cursor: zoom-in;
}
.ansbox, .refbox { line-height: 1.75; }
.ansbox .katex-display, .refbox .katex-display { margin: .4em 0; }

/* 解析里的视频（![视](…)）：和图片一样最多占 420px 高，别把面板撑爆 */
.ansbox .ansvideo, .refbox .ansvideo, .qpv-body .ansvideo {
  display: block; width: 100%; max-width: 560px; max-height: 420px;
  margin: 8px 0; border: 1px solid var(--border); border-radius: 8px;
  background: #000;
}
/* 解析里的动图（![动图](…)）：会自己动，给个浅边框看得清范围 */
.ansbox .ansimg[src$=".gif"], .qpv-body .ansimg[src$=".gif"] { border-color: var(--primary); }

/* 口语题的录音（作答里的 ![音](…)） */
.ansbox .ansaudio, .refbox .ansaudio {
  display: block; width: 100%; max-width: 420px; height: 38px; margin: 8px 0;
  border-radius: 8px;
}

/* ── 口语自动评分 ───────────────────────────────────── */
.speak-box { margin-top: 10px; padding: 10px 12px; border: 1px dashed #cfe0ff; border-radius: 10px; background: #f8fbff; }
.speak-bar { display: flex; align-items: center; gap: 10px; }
.speak-res { margin-top: 8px; font-size: 13px; color: var(--text-2); }
.sp-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sp-total { font-size: 26px; font-weight: 750; color: var(--primary); line-height: 1; }
.sp-unit { font-size: 12px; color: var(--text-3); }
.sp-dims { display: flex; gap: 12px; flex-wrap: wrap; }
.sd { font-size: 12px; color: var(--text-3); }
.sd b { font-size: 15px; color: var(--text); margin-right: 2px; }
.sp-text, .sp-ops { margin-top: 6px; line-height: 1.9; }
.sp-text .lab, .sp-ops .lab {
  font-size: 11px; color: var(--text-3); background: var(--surface-2);
  padding: 1px 6px; border-radius: 4px; margin-right: 8px;
}
.sp-noref { color: #9a6700; background: #fff8e6; border-radius: 6px; padding: 4px 8px; margin-bottom: 6px; font-size: 12px; }
.sp-sum { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.sr-m { color: var(--text-2); }
.sr-s { color: #d92d20; background: #fdecec; border-radius: 3px; padding: 0 2px; cursor: help; }
.sr-d { color: #d92d20; text-decoration: underline wavy #d92d20; cursor: help; }
.sr-i { color: var(--text-3); text-decoration: line-through; cursor: help; }
.sp-wer { margin-top: 6px; font-size: 12px; color: var(--text-3); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.sp-wer .lab {
  font-size: 11px; color: var(--text-3); background: var(--surface-2);
  padding: 1px 6px; border-radius: 4px;
}
.sp-wer b { font-size: 14px; color: var(--text); }
.sp-wer .sep { color: var(--border); }

/* 书库分页条：一排全是小号（.btn.sm 28px），下拉框跟着降到小号，
   否则「每页 12」比旁边的「下一页」高一截（分页条最容易看出来）。 */
.pager { display: none; gap: 10px; align-items: center; justify-content: flex-end;
  padding: 14px 4px 4px; }
.pager .hint { white-space: nowrap; }
.pager .selshell, .pager .input, .pager .select { height: var(--ctl-h-sm); }
.pager .selshell > select { font-size: 12.5px; }

/* 侧栏列表的「加载更多」：固定高度滚动区底部的类分页 */
.more-box { display: flex; gap: 8px; align-items: center; justify-content: center;
  padding: 10px 6px 14px; }
.more-box .hint { font-size: 12px; }

/* ── 课程 / 报名 / 签到 ─────────────────────────────── */
.pick-list { margin-top: 6px; max-height: 190px; overflow: auto; }
.pick-item {
  padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 13px;
  border: 1px solid transparent;
}
.pick-item:hover { background: var(--surface-2); border-color: var(--border); }

/* 点名册 */
.att-row {
  display: grid; grid-template-columns: 26px minmax(0,1fr) auto; gap: 10px;
  align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.att-row:last-child { border-bottom: 0; }
.att-row .nm { min-width: 0; }
.att-row .nm b { font-weight: 650; }
.att-row .meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.att-btns { display: flex; gap: 6px; }
.att-b {
  min-width: 46px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); font-size: 12.5px; color: var(--text-2); cursor: pointer;
}
.att-b:hover { border-color: var(--border-strong); }
.att-b.on.present { background: #e9f7ee; border-color: #1f8a44; color: #1f8a44; font-weight: 650; }
.att-b.on.leave { background: #fff8e6; border-color: #b7791f; color: #9a6700; font-weight: 650; }
.att-b.on.absent { background: #fdecec; border-color: #d92d20; color: #d92d20; font-weight: 650; }
.att-b.on.stop { background: var(--surface-2); border-color: var(--border-strong); font-weight: 650; }
.att-sum { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.att-sum b { color: var(--text); }
/* 合同模板：科目明细行（科目 / 课次 / 单价 / 删） */
.tp-items { display: flex; flex-direction: column; gap: 8px; }
.tp-item { display: grid; grid-template-columns: 1.4fr 1fr 1fr 34px; gap: 8px; align-items: center; }
.tp-item .input, .tp-item .select { height: var(--ctl-h); }
/* 合同模板：正文编辑 + 动态字段小标签 */
.tk-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.tk {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px;
  padding: 2px 9px; font-size: 11.5px; color: var(--text-2); cursor: pointer;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.tk:hover { border-color: var(--primary); color: var(--primary); }
.tk.a { color: #2f6bff; border-color: #cfe0ff; background: #f2f7ff; }
.tk.b { color: #1a8f4c; border-color: #cdecd9; background: #f2fbf6; }
.tk.s { color: #6b7889; }
/* 合同模板：自定义动态字段行（字段名 / 谁填 / 固定内容 / 删） */
.tp-vars { display: flex; flex-direction: column; gap: 8px; }
.tp-var { display: grid; grid-template-columns: 1.1fr 110px 1.6fr 34px; gap: 8px; align-items: center; }
.tp-var .input, .tp-var .select { height: var(--ctl-h); }
textarea.code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.85; min-height: 260px;
}

/* ── 电子印章 ─────────────────────────────────────────── */
.seal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.seal-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.seal-card.off { opacity: .6; }
.seal-img {
  position: relative;
  height: 120px;
  border-radius: 9px;
  border: 1px dashed var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.seal-img img { max-width: 110px; max-height: 110px; object-fit: contain; }
.seal-badge {
  position: absolute; top: 6px; right: 6px;
  background: var(--primary); color: #fff;
  font-size: 11px; border-radius: 999px; padding: 1px 8px;
}
.seal-name { font-weight: 650; font-size: 13.5px; }
.seal-ops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.seal-pick { display: flex; gap: 14px; align-items: flex-start; }
.seal-pv {
  width: 110px; height: 110px; flex-shrink: 0;
  border: 1px dashed var(--border); border-radius: 10px; background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.seal-pv img { max-width: 100px; max-height: 100px; object-fit: contain; }
.seal-pv.big { width: 150px; height: 150px; margin: 10px auto 0; }
.seal-pv.big img { max-width: 136px; max-height: 136px; }
.seal-def { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
/* 合同纸面上的甲方印章 */
.sign .seal-stamp { width: 96px; height: 96px; object-fit: contain; margin: -6px 0 -10px 4px; }

/* 合同流程条：建单 → 学员签署 → 甲方用章 → 收费完成 */
.csteps { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; flex-wrap: wrap; }
.cstep {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-3);
}
.cstep i {
  width: 18px; height: 18px; border-radius: 50%; font-style: normal;
  border: 1px solid var(--border-strong); display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px;
}
.cstep.ok { color: var(--text); }
.cstep.ok i { background: var(--primary); border-color: var(--primary); color: #fff; }
.cstep-line { width: 18px; height: 1px; background: var(--border-strong); }
.seal-line {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); padding: 10px 12px;
}
.seal-thumb { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; }

/* 上课时段：手填 + 从校区时段里选 */
.tp-teach { display: grid; grid-template-columns: minmax(0,1fr) 190px; gap: 8px; }
.tp-teach .input, .tp-teach .select { height: var(--ctl-h); }

/* 合同确认弹窗里的明细输入框（窄一点才放得下四列） */
.tbl .input.sm { height: var(--ctl-h-sm); padding: 0 8px; font-size: 13px; }

/* 作业提交列表：批量 AI 批改工具条 */
.hw-ai-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.hw-ai-bar .btn:disabled { opacity: .5; }
.tbl input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; }

/* ── 电子印章页：开关 + 列表头 + 分区标题 ─────────────────────── */
.seal-set {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 18px; margin-bottom: 16px;
}
.seal-set-txt { min-width: 0; flex: 1; }
.seal-set-h { font-weight: 650; font-size: 13.5px; margin-bottom: 4px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0; }
.seal-set.readonly .switch { opacity: .72; }
.seal-set.readonly .switch-track { background: #cfd6e0; }
.switch input { display: none; }
.switch-track {
  width: 46px; height: 26px; border-radius: 999px; background: #d7dee9;
  position: relative; transition: background .18s ease; display: block;
}
.switch-dot {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(20,40,70,.25);
  transition: transform .18s ease;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(20px); }
.switch-lab { font-size: 13px; color: var(--text-2); }

.tbl-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
}
.tbl-title { font-weight: 650; font-size: 13.5px; }

.sec-head { display: flex; align-items: center; gap: 8px; margin: 20px 2px 12px; }
.sec-title { font-weight: 650; font-size: 14px; }

/* 分段切换（印章页「待确认 / 已用章」等）：胶囊底 + 选中白块 */
.seg {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface-3, #f1f4f9); border-radius: 10px;
  margin: 20px 2px 12px;
}
.seg-i {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-3); transition: all .15s ease;
}
.seg-i:hover { color: var(--text); }
.seg-i.on {
  background: var(--surface); color: var(--text); font-weight: 650;
  box-shadow: 0 1px 4px rgba(20, 40, 70, .08);
}
.seg-n {
  min-width: 18px; padding: 0 6px; height: 18px; line-height: 18px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-3);
  font-size: 11px; text-align: center;
}
.seg-i.on .seg-n { background: var(--primary-soft); color: var(--primary); }

/* 校区 chip：随上级选中的「继承」态（不可点，视觉上弱一档） */
.chips button.chip.inh {
  background: var(--primary-soft); color: var(--primary);
  border-color: transparent; opacity: .75; cursor: default;
}

/* ── 统一的下拉框外观（原生 select 保留交互，只换皮）───────────── */
select.select, select.ui-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  /* 右边留够 30px 给箭头：以前留 32px 但文字太长时 Chrome 会把文字排进
     内边距里，看起来像「箭头压在字上」。加上 ellipsis + 不换行，超长就省略号。 */
  padding-right: 30px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23808fa6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
/* ══════════ 题目「实时预览」卡（题库工作台 /book）════════════════
   一边改题干/选项/答案/解析，一边看到学生看到的样子；解析按「一行一步」，
   点「▶ 下一步」逐条亮起来，提前演示上课时怎么讲。 */
.qpv .qpv-body {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  background: var(--surface-2); max-height: 480px; overflow: auto;
  font-size: 14.5px; line-height: 1.75;
}
.qpv.fold .qpv-body { display: none; }
.qpv-body img { max-width: 100%; border-radius: 6px; }
.qpv-body .qpv-stem { font-weight: 500; }
.qpv-opts { margin-top: 8px; display: grid; gap: 3px; }
.qpv-opt { display: flex; gap: 6px; align-items: flex-start; }
.qpv-opt > b { flex: 0 0 20px; color: var(--text-2); font-weight: 600; }
.qpv-sec { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.qpv-lab {
  display: inline-block; font-style: normal; font-size: 11px; font-weight: 600;
  color: var(--primary); background: var(--primary-soft);
  border-radius: 5px; padding: 1px 6px; margin-bottom: 4px;
}
.qpv-steps { display: grid; gap: 4px; }
.qpv-step { opacity: .12; filter: blur(1.5px); transition: opacity .25s ease, filter .25s ease; }
.qpv-step.on { opacity: 1; filter: none; }

/* 下拉框外面那层：**边框画在外壳上**，select 缩在外壳的内容区里，
   右边留 22px 给箭头。这样不管浏览器怎么排 select 的文字，
   文字都不可能越过内容区跑到箭头底下（之前用遮罩盖，会盖掉半个字/边框）。
   focus / hover 的描边也挂在外壳上，视觉上还是一个输入框。 */
.selshell {
  position: relative; display: inline-flex; align-items: stretch;
  min-width: 0; box-sizing: border-box; padding-right: 22px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.selshell > select {
  width: 100%; min-width: 0; height: 100%;
  border: 0 !important; border-radius: 0; background: transparent !important;
  box-shadow: none !important; outline: none;
  padding: 0 4px 0 9px; font: inherit; font-size: 12.5px;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.selshell:hover { border-color: var(--text-3); }
.selshell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.selshell::after {
  content: ''; position: absolute; top: 0; right: 2px; bottom: 0; width: 18px;
  pointer-events: none;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23808fa6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 2px center;
  background-size: 14px 14px;
}
.sefield > .selshell { flex: 1 1 auto; min-width: 0; height: var(--ctl-h); }
.hier .selshell, .row .selshell, .spseg .selshell { flex: 0 0 auto; }
.tb-sel .selshell, .pager .selshell { flex: 0 0 auto; }

select.select:hover { border-color: var(--border-strong); }
select.select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

/* ── 图片弹窗预览 ─────────────────────────────────────────── */
.img-viewer {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center;
  background: rgba(12, 20, 32, .82); backdrop-filter: blur(3px);
}
.img-viewer.on { display: flex; }
.img-viewer .iv-img {
  max-width: min(92vw, 1200px); max-height: 88vh; border-radius: 10px;
  background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.img-viewer button {
  position: absolute; border: 0; background: rgba(255, 255, 255, .14);
  color: #fff; border-radius: 50%; width: 42px; height: 42px; font-size: 20px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.img-viewer button:hover { background: rgba(255, 255, 255, .28); }
.iv-close { top: 22px; right: 26px; }
.iv-prev { left: 26px; top: 50%; transform: translateY(-50%); }
.iv-next { right: 26px; top: 50%; transform: translateY(-50%); font-size: 24px; }
.iv-count { position: absolute; bottom: 22px; color: rgba(255, 255, 255, .8); font-size: 13px; }

/* ── 首页看板 ─────────────────────────────────────────────── */
/* 顶部问候台：左边问候 + 操作，右边 7 天课次条 */
.dhero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--primary-soft), var(--surface) 62%);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 20px 22px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.dhero-main { min-width: 240px; flex: 1; }
.dhero-hey { font-size: 12.5px; color: var(--text-3); letter-spacing: .4px; }
.dhero-name { font-size: 21px; font-weight: 700; margin: 4px 0 0; letter-spacing: .2px; }
.dhero-sub { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.dhero-acts { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.dhero-acts .btn { height: 32px; padding: 0 14px; font-size: 13px; }

.dweek { display: flex; gap: 6px; flex-shrink: 0; }
.dweek-i {
  width: 54px; padding: 8px 0 9px; border-radius: 11px; text-align: center;
  background: var(--surface-2); border: 1px solid transparent;
}
.dweek-i.has { background: var(--surface); border-color: var(--border); }
.dweek-i.today {
  background: var(--primary); color: #fff; border-color: transparent;
  box-shadow: 0 8px 20px rgba(47, 107, 255, .28);
}
.dweek-w { font-size: 11px; color: var(--text-3); }
.dweek-i.today .dweek-w, .dweek-i.today .dweek-n { color: rgba(255, 255, 255, .82); }
.dweek-d { font-size: 17px; font-weight: 700; line-height: 1.4; }
.dweek-n { font-size: 10.5px; color: var(--text-3); }
.dweek-i.has .dweek-n { color: var(--primary); font-weight: 600; }
@media (max-width: 860px) { .dweek { display: none; } }

/* 数字卡 */
.dstats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.dstat {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px 15px; transition: transform .15s, box-shadow .15s, border-color .15s;
}
a.dstat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.dstat-top { display: flex; align-items: center; gap: 7px; }
.dstat-ico {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.dstat-ico svg { width: 14px; height: 14px; stroke: currentColor; }
.dstat-l { font-size: 12.5px; color: var(--text-2); }
.dstat-v { font-size: 27px; font-weight: 700; line-height: 1.25; margin-top: 8px; letter-spacing: .5px; }
.dstat-s { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.dstat.warn .dstat-v { color: var(--amber); }
.dstat.warn .dstat-ico { background: var(--amber-soft); color: var(--amber); }
.dstat.ok .dstat-v { color: var(--green); }
.dstat.ok .dstat-ico { background: var(--green-soft); color: var(--green); }

/* 两栏：主列表 + 右栏卡片 */
.dcols { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .dcols { grid-template-columns: 1fr; } }
.dcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  margin-bottom: 16px;
}
.dcard-h {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.dcard-t { font-weight: 650; font-size: 13.5px; }
.dside .dcard:last-child { margin-bottom: 0; }

/* 课程时间线：按天分组 */
.dday { padding: 4px 0 2px; }
.dday + .dday { border-top: 1px dashed var(--border); }
.dday-h { display: flex; align-items: center; gap: 8px; padding: 10px 16px 4px; }
.dday-l { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.dday.is-today .dday-l { color: var(--primary); }
.dday.is-today .dday-l::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); margin-right: 6px; vertical-align: 2px;
}
.dlesson { display: flex; align-items: center; gap: 14px; padding: 8px 16px; }
.dlesson:hover { background: var(--surface-2); }
.dlesson-t {
  width: 96px; flex-shrink: 0; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.dlesson-t .tiny { display: block; font-weight: 400; margin-top: 1px; }
.dlesson-m { min-width: 0; flex: 1; }
.dlesson-n { font-size: 13px; font-weight: 600; }

/* 待办清单 */
.dtodo { padding: 6px 10px 10px; }
.dtodo-i {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  padding: 9px 10px; border-radius: 9px; transition: background .15s;
}
.dtodo-i:hover { background: var(--surface-2); }
.dtodo-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: var(--amber-soft); color: var(--amber);
  display: inline-flex; align-items: center; justify-content: center;
}
.dtodo-ico svg { width: 15px; height: 15px; stroke: currentColor; }
.dtodo-l { flex: 1; font-size: 13px; }
.dtodo-n { font-size: 15px; font-weight: 700; color: var(--amber); }

/* 我的班 */
.dclass { padding: 6px 10px 10px; }
.dclass-i {
  display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit;
  padding: 9px 10px; border-radius: 9px; font-size: 13px;
}
.dclass-i:hover { background: var(--surface-2); }
.dclass-n { font-weight: 600; flex-shrink: 0; }
.dclass-s { color: var(--text-3); font-size: 11.5px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dclass-c { color: var(--text-2); font-size: 12px; flex-shrink: 0; }

/* 快捷入口 */
.dlinks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px; }
.dlink {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 9px; text-decoration: none;
  background: var(--surface-2); color: var(--text-2); font-size: 13px;
  border: 1px solid transparent; transition: all .15s;
}
.dlink:hover { background: var(--primary-soft); color: var(--primary); }

/* 看板左栏：作业批改进度 */
.dhw { padding: 4px 0 6px; }
.dhw-i {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; text-decoration: none; color: inherit;
  border-bottom: 1px dashed var(--border);
}
.dhw-i:last-child { border-bottom: 0; }
.dhw-i:hover { background: var(--surface-2); }
.dhw-m { flex: 1; min-width: 0; }
.dhw-t { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dhw-bar { height: 4px; border-radius: 999px; background: var(--surface-3); margin-top: 7px; overflow: hidden; }
.dhw-bar i { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.dhw-badge {
  flex-shrink: 0; font-size: 11.5px; font-weight: 600;
  color: var(--amber); background: var(--amber-soft);
  border-radius: 999px; padding: 3px 9px;
}

/* 看板左栏容器：让两张卡自成一组（否则 aside 会被挤到下一行） */
.dmain .dcard:last-child { margin-bottom: 0; }

/* ── 校区树（schooltree.js）────────────────────────────────── */
.school-tree {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2);
  max-height: 240px; overflow: auto; padding: 4px 0;
}
.st-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; cursor: pointer; font-size: 13px; line-height: 1.5;
  border-radius: 6px; margin: 0 4px;
}
.st-row:hover { background: var(--surface-3); }
.st-arrow {
  width: 14px; flex-shrink: 0; text-align: center;
  color: var(--text-3); font-size: 11px;
}
.st-arrow.leaf { visibility: hidden; }
.st-cb {
  width: 16px; height: 16px; flex-shrink: 0; border-radius: 4px;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  font-size: 11px; line-height: 1; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.st-row.on .st-cb { background: var(--primary); border-color: var(--primary); }
.st-row.half .st-cb { border-color: var(--primary); color: var(--primary); background: var(--surface); }
.st-row.on .st-name { font-weight: 650; color: var(--primary); }
.st-row.inh { color: var(--text-3); }
.st-row.inh .st-cb { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.st-row.inh .st-name { color: var(--text-3); }
.st-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-n {
  flex-shrink: 0; min-width: 18px; height: 18px; line-height: 18px;
  text-align: center; border-radius: 999px;
  background: var(--surface-3); color: var(--text-3); font-size: 11px;
}

/* ── 课件库 / 去上课 ───────────────────────────────────────── */
.cw-preview {
  border: 1px dashed var(--border-strong); border-radius: 10px;
  background: var(--surface-2); padding: 12px 14px; max-height: 260px; overflow: auto;
}
.cw-pv-sec + .cw-pv-sec { border-top: 1px dashed var(--border); margin-top: 10px; padding-top: 10px; }
.cw-pv-tag { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }

/* 课件正文（预览 / 上课共用一个渲染结果） */
.cw-body { font-size: 15px; line-height: 1.75; color: var(--text); }
.cw-body h3 { font-size: 22px; margin: 0 0 10px; font-weight: 700; }
.cw-body h4 { font-size: 17px; margin: 16px 0 8px; font-weight: 650; }
.cw-body p { margin: 8px 0; }
.cw-body ul, .cw-body ol { margin: 8px 0 8px 20px; padding: 0; }
.cw-body li { margin: 3px 0; }
.cw-body blockquote {
  margin: 10px 0; padding: 8px 12px; border-left: 3px solid var(--primary);
  background: var(--primary-soft); border-radius: 0 8px 8px 0; color: var(--text-2);
}
.cw-body code {
  font-family: var(--mono); font-size: 13px;
  background: var(--surface-3); padding: 1px 5px; border-radius: 4px;
}
.cw-body .cw-img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.cw-tbl { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 14px; }
.cw-tbl th, .cw-tbl td {
  border: 1px solid var(--border); padding: 6px 10px; text-align: left;
}
.cw-tbl th { background: var(--surface-2); font-weight: 650; }

/* 课件预览弹层 */
.cw-dialog { width: min(880px, 100%); }
.cw-slide { min-height: 46vh; max-height: 64vh; overflow: auto; }
.cw-modal .dialog-body { padding: 18px 26px; }

/* 去上课：选课件 */
.lesson-body { background: var(--bg); }
.ls-pick { max-width: 1080px; margin: 0 auto; padding: 20px 18px 40px; }
.ls-pick-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ls-pick-head h1 { font-size: 20px; margin: 0; }
.ls-pick-body { display: grid; grid-template-columns: 280px 1fr; gap: 14px; }
@media (max-width: 820px) { .ls-pick-body { grid-template-columns: 1fr; } }
.ls-classes {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 66vh; overflow: auto; padding-bottom: 6px;
}
.ls-class { padding: 10px 14px; cursor: pointer; border-left: 3px solid transparent; }
.ls-class:hover { background: var(--surface-2); }
.ls-class.on { background: var(--primary-soft); border-left-color: var(--primary); }
.ls-class .name { font-size: 13px; font-weight: 600; }
.ls-cws {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.ls-cws-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 650; font-size: 13.5px; }
.ls-cw-list { max-height: 62vh; overflow: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ls-cw {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  cursor: pointer; transition: all .15s; background: var(--surface);
}
.ls-cw:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.ls-cw.match { border-color: var(--primary-soft); background: linear-gradient(180deg, var(--primary-soft), var(--surface) 60%); }
.ls-cw-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ls-cw-t .name { font-weight: 650; font-size: 13.5px; }
.ls-cw-f { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.ls-go { font-size: 12px; color: var(--primary); font-weight: 600; }

/* 去上课：舞台 */
.ls { height: 100vh; display: grid; grid-template-rows: 54px minmax(0, 1fr) 4px auto; background: var(--bg); }
.ls-bar {
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.ls-back { text-decoration: none; color: var(--text-2); font-size: 18px; }
.ls-title { font-size: 14px; font-weight: 650; }
.ls-sub { font-size: 11.5px; color: var(--text-3); }
.ls-btn {
  height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 13px; text-decoration: none; display: inline-flex; align-items: center;
}
.ls-btn:hover { border-color: var(--border-strong); }
.ls-btn:disabled { opacity: .4; cursor: default; }
.ls-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.ls-pos { font-size: 13px; color: var(--text-2); min-width: 52px; text-align: center; }
.ls-sep { width: 1px; height: 20px; background: var(--border); }
.ls-stage {
  overflow: auto; padding: 36px 48px;
  display: flex; align-items: flex-start; justify-content: center;
}
.ls-cw {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
  width: min(1000px, 100%); padding: 40px 48px; min-height: 100%;
  font-size: 18px;
}
.ls-cw h3 { font-size: 28px; }
.ls-cw h4 { font-size: 22px; }
.ls-progress { background: var(--surface-3); }
.ls-progress i { display: block; height: 100%; background: var(--primary); transition: width .2s; }
.ls-dots { display: flex; gap: 6px; justify-content: center; padding: 10px 0 14px; flex-wrap: wrap; }
.ls-dots i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong);
  cursor: pointer; transition: all .15s;
}
.ls-dots i.on { background: var(--primary); transform: scale(1.35); }

/* ── 积分养成 ─────────────────────────────────────────────── */
.sc-rank { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.sc-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
}
.sc-card.top { border-color: var(--primary-soft); }
.sc-medal { font-size: 20px; width: 30px; text-align: center; color: var(--text-3); font-weight: 700; }
.sc-main { flex: 1; min-width: 0; }
.sc-name { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sc-cup { font-size: 11.5px; color: var(--amber); }
.sc-bar { height: 5px; border-radius: 999px; background: var(--surface-3); margin: 8px 0 4px; overflow: hidden; }
.sc-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--violet)); }
.sc-points { text-align: right; flex-shrink: 0; }
.sc-points b { font-size: 22px; font-weight: 700; color: var(--primary); }
.sc-points span { display: block; font-size: 11px; color: var(--text-3); }
/* 宠物头像：饿的时候灰掉（和 v2.0 积分后台一个观感） */
.sc-pet {
  width: 42px; height: 42px; border-radius: 12px; object-fit: contain;
  background: var(--surface-3); flex-shrink: 0;
}
.sc-pet.hungry, .sc-pet.ph { filter: grayscale(1); opacity: .55; }
.sc-pet.ph { display: flex; align-items: center; justify-content: center; font-size: 20px; }
.sc-prize-img {
  width: 100%; height: 96px; object-fit: contain; border-radius: 10px;
  background: var(--surface-3); margin-bottom: 2px;
}
.sc-prize-img.ph { display: flex; align-items: center; justify-content: center; font-size: 28px; }
.chips button.chip.red.on { background: var(--red); border-color: var(--red); }


.sc-award { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 940px) { .sc-award { grid-template-columns: 1fr; } }
.tbl-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
}
.tbl-title { font-weight: 650; font-size: 13.5px; }
.sc-stu { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; max-height: 46vh; overflow: auto; }
.sc-stu-i {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px 6px 8px;
  font-size: 13px; background: var(--surface);
}
.sc-stu-i:hover { border-color: var(--border-strong); }
.sc-stu-i.on { border-color: var(--primary); background: var(--primary-soft); }
.sc-stu-i.on .st-cb { background: var(--primary); border-color: var(--primary); color: #fff; }
.sc-stu-p { color: var(--text-3); font-size: 12px; }
.sc-panel { padding: 16px 18px; }

.sc-prizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sc-prize {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
}
.sc-prize.off { opacity: .62; }
.sc-prize-t { font-weight: 650; font-size: 14px; }
.sc-prize-f { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.sc-cost { font-weight: 700; color: var(--primary); font-size: 15px; }
.sc-prize-op { display: flex; gap: 6px; margin-top: 6px; }

/* ── 备课讲次 ─────────────────────────────────────────────────── */
.unit-wrap { display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.4fr); gap: 14px; align-items: start; }
@media (max-width: 1080px) { .unit-wrap { grid-template-columns: 1fr; } }
.unit-list .tbl td, .unit-list .tbl th { padding: 9px 12px; }
.unit-list tr.on { background: var(--primary-soft); }
.unit-detail { min-width: 0; }
.unit-detail .card { margin-bottom: 12px; }
/* 知识点：文本域下面把切好的词排成小标签（多个知识点不用挤一行） */
.kp-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.kp-chip {
  font-size: 12px; line-height: 1; padding: 4px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
}
.unit-detail textarea.input { height: auto; padding: 8px 12px; line-height: 1.7; resize: vertical; }

/* 上课页：讲次分组 */
.ls-group {
  font-size: 12px; font-weight: 650; color: var(--text-3);
  padding: 10px 4px 4px; letter-spacing: .5px;
}
.ls-unit {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.ls-unit:hover { border-color: var(--primary); box-shadow: var(--shadow); }

/* 上课页：文档课件（PDF）与只能下载的老格式 */
.ls-pdf { width: 100%; height: calc(100vh - 190px); border: 0; border-radius: 12px; background: #fff; }
.ls-file {
  max-width: 520px; margin: 12vh auto; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 24px; box-shadow: var(--shadow);
}
.ls-file-t { font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.ls-file .btn { margin-top: 18px; }

/* ── 课堂工具（点名 + 积分）───────────────────────────────── */
.ct-dialog { width: min(720px, 100%); }
.ct-body { padding: 16px 20px 20px; max-height: 72vh; overflow: auto; }
.ct-hint { font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.ct-list { display: flex; flex-direction: column; gap: 6px; }
.ct-stu {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px;
}
.ct-name { width: 92px; flex-shrink: 0; font-size: 13px; font-weight: 600; }
.ct-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.ct-opt {
  height: 28px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 12px; color: var(--text-2);
}
.ct-opt.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ct-students { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-chip {
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text); display: flex; flex-direction: column; align-items: flex-start;
}
.ct-chip i { font-style: normal; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.ct-chip.on { border-color: var(--primary); background: var(--primary-soft); }
.ct-rules { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-rule {
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 12.5px; color: var(--text-2);
}
.ct-rule.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ct-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }

/* 校区树底部：已选数量 + 清空 */
.st-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 2px 0;
}
.school-tree { max-height: 260px; }

/* 看板课程行：上课按钮 */
.dlesson-go { flex-shrink: 0; margin-left: 8px; }

/* ── 积分养成 2.0：统计条 / 排行卡 / 奖品卡 ───────────────────── */
.sc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 860px) { .sc-stats { grid-template-columns: repeat(2, 1fr); } }
.sc-stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 13px 16px; box-shadow: var(--shadow);
}
.sc-stat::after {
  content: ''; position: absolute; right: -26px; bottom: -46px;
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--primary-soft); opacity: .75;
}
.sc-stat b { position: relative; display: block; font-size: 25px; line-height: 1.15; font-weight: 750; }
.sc-stat span { position: relative; font-size: 11.5px; color: var(--text-3); }
.sc-stat.warn { border-color: #f5d9a8; background: var(--amber-soft); }
.sc-stat.warn b { color: var(--amber); }

.sc-card { border-radius: 14px; transition: transform .16s ease, box-shadow .16s ease; }
.sc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.sc-medal {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-3); font-size: 15px; font-weight: 700;
}
.sc-card.top .sc-medal { background: linear-gradient(140deg, #fff3cd, #ffd66e); color: #7a5300; }
.sc-card.top:nth-child(2) .sc-medal { background: linear-gradient(140deg, #f4f7fb, #cfd9e6); color: #5b6675; }
.sc-card.top:nth-child(3) .sc-medal { background: linear-gradient(140deg, #ffe8d6, #f3bd93); color: #8a4a1c; }
.sc-pet { width: 46px; height: 46px; border-radius: 14px; border: 2px solid var(--primary-soft); object-fit: contain; }
.sc-pet.hungry { border-color: #f0c9c9; }
.sc-bar { height: 6px; }
.sc-name .tag { padding: 1px 7px; font-size: 11px; }

/* 加减分面板 */
.sc-panel .h3 { font-size: 15px; }
#ruleChips .chip { padding: 7px 12px; border-radius: 999px; font-size: 13px; }
#ruleChips .chip.red { color: var(--red); border-color: #f3d0d0; background: var(--red-soft); }
#ruleChips .chip.red.on { color: #fff; }
#btnAward { height: 42px; font-size: 14px; }

/* 奖品 / 宠物卡片 */
.sc-prize { border-radius: 14px; transition: transform .16s ease, box-shadow .16s ease; }
.sc-prize:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.sc-prize-img { height: 108px; background: linear-gradient(160deg, var(--surface-2), var(--surface-3)); }
.sc-prize-img.ph { color: var(--text-3); }
.sc-prize-t { font-size: 14.5px; }
.sc-prize-f .sc-cost { font-size: 16px; }

/* 成长设置表 */
#lvBody input.input { width: 100%; text-align: right; }
#lvBody td { padding: 8px 10px; }

/* 上课页：讲次优先，散料折叠 */
.ls-more { margin-top: 10px; }
.ls-more > summary {
  cursor: pointer; font-size: 12px; color: var(--text-3);
  padding: 8px 4px; list-style: none;
}
.ls-more > summary::-webkit-details-marker { display: none; }
.ls-more > summary::before { content: '▸ '; }
.ls-more[open] > summary::before { content: '▾ '; }
.ls-more-body { padding-top: 6px; }

/* ── 积分动效（课堂工具 / 积分页共用）──────────────────────────── */
.fx-float {
  position: fixed; z-index: 90; transform: translate(-50%, 0);
  font-weight: 800; font-size: 20px; color: var(--green);
  pointer-events: none; text-shadow: 0 2px 10px rgba(14, 159, 110, .35);
  animation: fx-float-up 1.05s cubic-bezier(.22, .9, .3, 1) forwards;
}
.fx-float.minus { color: var(--red); text-shadow: 0 2px 10px rgba(224, 36, 36, .3); }
.fx-float.coin { color: var(--amber); }
@keyframes fx-float-up {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); }
  18% { opacity: 1; transform: translate(-50%, -6px) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -56px) scale(1); }
}
.fx-pop { animation: fx-pop .68s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes fx-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.09); box-shadow: 0 0 0 4px rgba(47, 107, 255, .18); }
  100% { transform: scale(1); }
}
.fx-shake { animation: fx-shake .6s; }
@keyframes fx-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-1.5deg); }
  45% { transform: translateX(5px) rotate(1.5deg); }
  70% { transform: translateX(-3px); }
}
.fx-spark {
  position: fixed; z-index: 91; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle, #ffe9a8, #f5b418);
  pointer-events: none;
  animation: fx-spark .85s ease-out forwards;
}
@keyframes fx-spark {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.2); }
}
.fx-banner {
  position: fixed; z-index: 92; left: 50%; top: 22%;
  transform: translate(-50%, -8px) scale(.92);
  background: linear-gradient(135deg, #2f6bff, #7c5cff);
  color: #fff; padding: 14px 26px; border-radius: 16px;
  box-shadow: 0 18px 44px rgba(47, 107, 255, .32);
  text-align: center; pointer-events: none;
  animation: fx-banner-in .42s cubic-bezier(.2, 1.5, .4, 1) forwards;
}
.fx-banner.down { background: linear-gradient(135deg, #6b7280, #4b5563); }
.fx-banner b { display: block; font-size: 22px; letter-spacing: 1px; }
.fx-banner span { font-size: 13px; opacity: .9; }
.fx-banner.out { animation: fx-banner-out .5s forwards; }
@keyframes fx-banner-in {
  to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}
@keyframes fx-banner-out {
  to { transform: translate(-50%, -14px) scale(.96); opacity: 0; }
}

/* 课堂工具里的养成卡片 */
.ct-students { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.ct-card {
  position: relative; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px;
  background: var(--surface); transition: .15s; overflow: hidden;
}
.ct-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.ct-card.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(47, 107, 255, .12); }
.ct-card .pet { width: 34px; height: 34px; border-radius: 10px; object-fit: contain; background: var(--surface-3); float: right; }
.ct-card .pet.hungry { filter: grayscale(1); opacity: .6; }
.ct-card .nm { font-size: 13.5px; font-weight: 650; }
.ct-card .lv { font-size: 11px; color: var(--text-3); }
.ct-card .bar { height: 4px; border-radius: 999px; background: var(--surface-3); margin-top: 7px; overflow: hidden; }
.ct-card .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--violet)); }
.ct-card .st { font-size: 10.5px; color: var(--text-3); margin-top: 3px; display: flex; justify-content: space-between; }
.ct-card.feed .pet { animation: fx-feed .7s ease; }
@keyframes fx-feed {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-6px) rotate(-6deg) scale(1.1); }
  60% { transform: translateY(0) rotate(5deg) scale(1.04); }
}
.ct-rules { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-rule {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--text-2);
}
.ct-rule b { color: var(--green); margin-left: 2px; }
.ct-rule.bad b { color: var(--red); }
.ct-rule.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.ct-rule.bad.on { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.ct-rule:hover { border-color: var(--border-strong); }

/* ══ 积分养成 3.0：分层 tab + 宠物形象 + 成长动画 ═══════════════════ */
.sc-tabs { width: 100%; margin-bottom: 14px; }
.sc-tabs .seg-i { flex: 1; text-align: center; padding: 9px 0; font-size: 13.5px; }
.sc-subtabs { margin: 0 0 14px; }
.sc-subtabs .seg-n {
  display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-3); font-size: 11px; line-height: 17px;
}
.sc-subtabs .seg-i.on .seg-n { background: var(--primary-soft); color: var(--primary); }
.sc-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

/* 宠物形象：没有可用的图就用 emoji，形态随等级变 */
.petface {
  position: relative; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--border);
  font-size: 22px; line-height: 1; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.petface img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 2;
}
.petface b { font-weight: 400; }
.petface.big { width: 52px; height: 52px; border-radius: 16px; font-size: 27px; }
.petface.hungry { filter: grayscale(.75); opacity: .72; }
/* 形态：蛋 → 幼崽 → 成长 → 成年 → 神化（尺寸 / 光晕逐步加强） */
.petface.s0 { background: linear-gradient(160deg, #fdfdfb, #f0eee6); }
.petface.s1 { background: linear-gradient(160deg, #f2f9f2, #e2f0e2); }
.petface.s2 { background: linear-gradient(160deg, #eef5ff, #dde9ff); border-color: #cfe0ff; }
.petface.s3 {
  background: linear-gradient(160deg, #fff7e6, #ffe9bf); border-color: #f4d79b;
  box-shadow: 0 0 0 3px rgba(245, 180, 24, .12);
}
.petface.s4 {
  background: radial-gradient(circle at 30% 25%, #fff, #ffe9f3 45%, #e6dcff 100%);
  border-color: #e3d3ff; box-shadow: 0 0 12px rgba(124, 92, 255, .35);
}
.petface.s4::after {
  content: ''; position: absolute; inset: -30%; z-index: 1;
  background: conic-gradient(from 0deg, transparent 0 40%, rgba(255, 255, 255, .85) 48%, transparent 56% 100%);
  animation: pet-aura 3.2s linear infinite;
}
@keyframes pet-aura { to { transform: rotate(360deg); } }
/* 喂食：咀嚼 + 蹦两下 */
.petface.fx-eat { animation: pet-eat .9s cubic-bezier(.3, 1.2, .4, 1); }
@keyframes pet-eat {
  0% { transform: scale(1); }
  15% { transform: scaleY(.82) scaleX(1.16); }
  30% { transform: scale(1) translateY(-4px) rotate(-5deg); }
  45% { transform: scaleY(.9) scaleX(1.08); }
  60% { transform: translateY(-14px) rotate(5deg) scale(1.08); }
  80% { transform: translateY(0) rotate(-2deg) scale(1); }
  100% { transform: none; }
}
/* 破壳：抖动 + 白光 + 散开 */
.petface.fx-hatch { animation: pet-hatch .78s ease-in; }
@keyframes pet-hatch {
  0%, 100% { transform: none; }
  10% { transform: rotate(-9deg) scale(.96); }
  25% { transform: rotate(9deg) scale(.94); }
  40% { transform: rotate(-7deg) scale(.98); }
  55% { transform: rotate(7deg) scale(1.02); box-shadow: 0 0 0 8px rgba(255, 226, 138, .5); }
  70% { transform: scale(1.22); box-shadow: 0 0 0 18px rgba(255, 226, 138, 0); }
  85% { transform: scale(.94); }
}
.fx-food {
  position: fixed; z-index: 95; font-size: 30px; pointer-events: none;
  transform: translate(-50%, 0);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18));
  animation: food-drop .56s cubic-bezier(.5, 0, .9, .5) forwards;
}
@keyframes food-drop {
  0% { opacity: 0; transform: translate(-50%, -10px) rotate(0) scale(.7); }
  15% { opacity: 1; }
  100% { opacity: .9; transform: translate(calc(-50% + var(--tx)), var(--ty)) rotate(320deg) scale(1.1); }
}

/* 饱食度条 */
.hb { height: 5px; border-radius: 999px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.hb i { display: block; height: 100%; background: linear-gradient(90deg, #34c759, #7ee787); }
.hb.warn i { background: linear-gradient(90deg, #f5a524, #ffd479); }
.hb.bad i { background: linear-gradient(90deg, #e02424, #ff8a8a); width: 4px !important; }

/* 等级小徽章 */
.lv-badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px;
  font-weight: 650; color: var(--c, var(--primary));
  background: color-mix(in srgb, var(--c, #2f6bff) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, #2f6bff) 22%, transparent);
}

/* 排行卡：上排 + 操作排 */
.sc-top { display: flex; align-items: center; gap: 10px; }
.sc-ops {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 9px;
  border-top: 1px dashed var(--border);
}
.sc-card.hungry-card { border-color: #f3cfcf; background: var(--red-soft); }
.sc-card .sc-points b { font-variant-numeric: tabular-nums; }

/* 规则页：分组 tab + 奖励/惩罚两列 */
.rule-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .rule-cols { grid-template-columns: 1fr; } }
.rule-col {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.rule-col-h {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  font-size: 13px; font-weight: 650; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.rule-col-h b { margin-left: auto; color: var(--text-3); font-weight: 600; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: #22c55e; }
.dot.red { background: #e02424; }
.rule-list { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.rule-i {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; border: 1px solid transparent;
  background: var(--surface-2); font-size: 13.5px;
}
.rule-i:hover { border-color: var(--border-strong); background: var(--surface); }
.rule-i.bad { background: #fdf3f3; }
.rule-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-s { font-weight: 700; color: #15803d; font-variant-numeric: tabular-nums; }
.rule-i.bad .rule-s { color: #b91c1c; }
.rule-op { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.rule-i:hover .rule-op { opacity: 1; }
.rule-op .btn { height: 24px; padding: 0 8px; font-size: 12px; }
.empty-fill { padding: 18px 10px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* 领养弹窗 */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; max-height: 52vh; overflow: auto; }
.ad-i {
  text-align: center; padding: 12px 6px 10px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); transition: .15s;
}
.ad-i:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.ad-i .petface { width: 54px; height: 54px; font-size: 30px; margin: 0 auto 8px; }
.ad-n { font-size: 13px; font-weight: 600; }

/* 奖品卡图区 */
.sc-prize-img img { width: 100%; height: 100%; object-fit: cover; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 升级大动画 */
.fx-level {
  position: fixed; inset: 0; z-index: 96; display: flex;
  align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(255, 244, 214, .96), rgba(255, 255, 255, .82));
  animation: fx-fade-in .2s ease;
}
.fx-level.out { animation: fx-fade-out .55s ease forwards; }
@keyframes fx-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fx-fade-out { to { opacity: 0; } }
.fx-level-rays {
  position: absolute; width: 640px; height: 640px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 208, 92, .5) 0 6deg, transparent 6deg 18deg);
  animation: fx-rays 6s linear infinite; opacity: .55;
}
@keyframes fx-rays { to { transform: rotate(360deg); } }
.fx-level-box {
  position: relative; text-align: center; padding: 26px 42px; border-radius: 24px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 24px 60px rgba(240, 180, 30, .28);
  animation: fx-level-pop .5s cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes fx-level-pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fx-level-t { font-size: 15px; letter-spacing: 4px; color: var(--amber); font-weight: 700; }
.fx-level-n { font-size: 30px; font-weight: 800; margin: 6px 0 2px; }
.fx-level-n b { font-size: 56px; background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.fx-level-c { font-size: 18px; color: var(--amber); font-weight: 700; }
.fx-level-s { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }

/* ══ 上课页「养成挂件」（右侧浮层，开关控制）═══════════════════════ */
.ls-btn.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.pdock {
  position: fixed; right: 14px; top: 70px; bottom: 92px; width: 272px; z-index: 70;
  display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .97); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 18px 46px rgba(23, 37, 66, .16);
  backdrop-filter: blur(10px); overflow: hidden;
  animation: pdock-in .22s ease;
}
@keyframes pdock-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.pdock-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.pdock-t { font-size: 13.5px; font-weight: 700; }
.pdock-rules {
  padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 5px;
  max-height: 26%; overflow: auto; border-bottom: 1px dashed var(--border);
}
.pdock-grp { width: 100%; font-size: 10.5px; color: var(--text-3); margin: 2px 0 1px; }
.pd-rule {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 3px 9px; font-size: 12px; cursor: pointer; color: var(--text-2);
  font-family: inherit;
}
.pd-rule b { color: #15803d; margin-left: 2px; }
.pd-rule.bad b { color: #b91c1c; }
.pd-rule.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pd-rule.bad.on { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.pdock-list { flex: 1; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pd-card {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  cursor: pointer; position: relative; transition: .14s;
}
.pd-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.pd-card.hungry { background: #fffafa; }
.pd-card.pd-down { animation: fx-shake .6s; }
.pd-card.pd-sending { opacity: .65; }
.pd-card .petface { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
.pd-main { flex: 1; min-width: 0; }
.pd-n { font-size: 12.5px; font-weight: 650; display: flex; align-items: center; gap: 5px; }
.pd-n .lv-badge { font-size: 10px; padding: 0 5px; }
.pd-bar { height: 4px; background: var(--surface-3); border-radius: 999px; margin: 4px 0 3px; overflow: hidden; }
.pd-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--violet)); }
.pd-s { font-size: 10.5px; color: var(--text-3); }
.pd-feed {
  border: 0; background: var(--surface-3); border-radius: 9px; width: 26px; height: 26px;
  cursor: pointer; font-size: 14px; line-height: 1; flex-shrink: 0;
}
.pd-feed:hover { background: var(--amber-soft); }
.pdock-foot {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.pdock-foot .hint { font-size: 11px; }

/* 课堂工具：宠物形象 + 喂食小按钮 */
.ct-card .petface { float: right; width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
.ct-feed {
  position: absolute; right: 8px; bottom: 8px; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 7px; background: var(--surface-3); cursor: pointer;
  font-size: 12px; line-height: 1; opacity: 0; transition: opacity .15s;
}
.ct-card:hover .ct-feed { opacity: 1; }
.ct-feed:hover { background: var(--amber-soft); }

/* 新排行卡是「上下两排」：别沿用老的横向 flex */
.sc-card { flex-direction: column; align-items: stretch; gap: 0; }
.sc-card .sc-top { gap: 10px; }
.sc-card .sc-main .hint { font-size: 11.5px; }
.sc-card .sc-medal { flex-shrink: 0; }

/* 讲次卡片：已上完 / 下一讲 */
.ls-unit.done { opacity: .78; background: var(--surface-2); }
.ls-unit.next { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 107, 255, .1); }
.ls-cw-ops { display: flex; align-items: center; gap: 8px; }
.ls-cw-ops .btn { height: 26px; padding: 0 10px; font-size: 12px; }

/* 兼容/层级修正：徽章底色兜底 + 神化光环别盖住宠物本身 */
.lv-badge { background: rgba(47, 107, 255, .1); background: color-mix(in srgb, var(--c, #2f6bff) 12%, transparent); }
.petface b { position: relative; z-index: 2; }
.petface img { z-index: 3; }

/* tab 条：整条做一个可见的「胶囊槽」，否则只有选中项像按钮 */
.sc-tabs {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 13px; padding: 4px; gap: 4px;
}
.sc-tabs .seg-i { border-radius: 10px; }
.sc-tabs .seg-i.on {
  background: var(--surface); box-shadow: 0 2px 8px rgba(23, 37, 66, .08);
  border: 1px solid var(--border);
}
.sc-subtabs {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 3px; gap: 3px; display: inline-flex;
}
.sc-subtabs .seg-i { border-radius: 9px; padding: 5px 12px; }
.sc-subtabs .seg-i.on { background: var(--surface); box-shadow: 0 2px 7px rgba(23, 37, 66, .08); }

/* 负分标红 */
.sc-points b.neg { color: var(--red); }
.sc-card .sc-name { row-gap: 4px; }
.sc-card .sc-top > .petface { margin-top: 2px; }

/* 等级表：输入框别拉太宽 */
#lvBody input.input { width: 96px; text-align: right; }
#lvBody td { vertical-align: middle; }

/* 通用卡片网格（学生宠物等） */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
/* 饿着只做淡提示，别整卡片刷成粉红 */
.sc-card.hungry-card { background: #fffbfb; border-color: #f3d3d3; }
.sc-card.hungry-card .sc-name::after { content: ''; }

/* 饿着别灰成一片：降饱和就够，还要看得出是什么动物 */
.petface.hungry { filter: saturate(.45) grayscale(.25); opacity: .85; }

/* 养成挂件：顶栏按钮别换行、班级名省略、底部提示不挤压按钮 */
.ls-btn { white-space: nowrap; }
.pdock-head .hint {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 150px; font-size: 11px;
}
.pdock-foot .hint {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pdock-foot .btn { white-space: nowrap; flex-shrink: 0; }
.pd-card .lv-badge { font-size: 9.5px; }
.pdock-t { white-space: nowrap; flex-shrink: 0; }
.pd-feed { font-size: 15px; }

/* ══════════ 上课「讲题」模式（assets/quizplay.js）══════════════════
   全屏覆盖层：顶栏细、底栏是操作、中间整块留给题目。
   字号用 clamp 跟窗口走 —— 教室大屏 1080p 和老师笔记本 1366 都能看清，
   不用手动调。答案/解析是**分阶段出现**的，不是一上来全露。 */
.qz-wrap {
  position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column;
  background: #f6f8fc; color: var(--text);
  font-size: clamp(15px, 1.35vw, 19px);
}
.qz-wrap[hidden] { display: none; }
body.qz-on { overflow: hidden; }
.qz-top {
  display: flex; align-items: center; gap: 10px; height: 46px; flex: none;
  padding: 0 14px; border-bottom: 1px solid var(--border); background: #fff;
}
.qz-pos { font-weight: 750; font-size: 15px; letter-spacing: .3px; }
.qz-tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  background: var(--surface-3); color: var(--text-2);
}
.qz-src { font-size: 12.5px; color: var(--text-3); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-x {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 14px; color: var(--text-2);
}
.qz-x:hover { border-color: var(--danger); color: var(--danger); }
.qz-timer {
  font-variant-numeric: tabular-nums; font-weight: 750; font-size: 18px;
  color: var(--primary); padding: 0 8px;
}
.qz-timer.done { color: var(--danger); }

.qz-body { flex: 1; min-height: 0; overflow: auto; padding: 18px clamp(16px, 4vw, 64px) 26px; }
.qz-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; }
.qz-num { font-size: .82em; color: var(--text-3); margin-bottom: 4px; }
.qz-stem { font-size: clamp(19px, 1.85vw, 28px); line-height: 1.75; font-weight: 500; }
.qz-stem img { max-width: 100%; border-radius: 8px; margin: 6px 0; }
.qz-opts {
  margin-top: 14px; display: grid; gap: 8px 22px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.qz-opt {
  display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #fbfcfe;
  font-size: clamp(16px, 1.55vw, 22px); line-height: 1.5;
}
.qz-opt > b { flex: 0 0 auto; color: var(--primary); font-weight: 750; }

.qz-answer {
  margin-top: 14px; padding: 12px 18px; border-radius: 12px;
  background: #f0fbf3; border: 1px solid #bfe8cb;
}
/* 注意类名不能用 `ask`：站内确认框（util.ask）就是 `.ask`，opacity:0 + grid，
   会把这块整个变透明、还改变布局。用 `waiting`（等答案）这个名字。 */
.qz-answer.waiting { background: #fffcf2; border: 1.5px dashed #e6c983; }
.qz-answer.waiting .qz-ans-t { font-size: clamp(15px, 1.25vw, 19px); color: #8a6d3b; }
.qz-lab {
  font-size: 11.5px; font-weight: 700; color: #15803d; letter-spacing: .5px;
  text-transform: uppercase; margin-bottom: 2px;
}
.qz-answer.waiting .qz-lab { color: #a16207; }
.qz-ans-t { font-size: clamp(20px, 2vw, 30px); font-weight: 700; line-height: 1.5; }
.qz-ans-t.dim { font-size: 14px; font-weight: 400; color: var(--text-3); }

.qz-steps { margin-top: 12px; display: grid; gap: 8px; }
/* 未揭晓的解析行：**直接不显示**（不是模糊占位）。
   上课时模糊轮廓反而干扰学生 —— 他们能看到「还有三行」，就开始猜内容。 */
.qz-step { display: none; }
.qz-step.on {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  font-size: clamp(16px, 1.6vw, 23px); line-height: 1.7;
  animation: qz-step-in .26s ease both;
}
@keyframes qz-step-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.qz-step > i {
  flex: 0 0 24px; height: 24px; border-radius: 999px; font-style: normal;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--primary-soft); color: var(--primary); margin-top: .18em;
}
.qz-step img { max-width: 100%; border-radius: 8px; }

.qz-loading, .qz-empty { margin: 60px auto; max-width: 620px; text-align: center; color: var(--text-2); }
.qz-empty b { display: block; font-size: 20px; margin-bottom: 8px; color: var(--text); }
.qz-nobody { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); color: var(--text-3); font-size: 14px; }

.qz-bar {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 9px 14px; border-top: 1px solid var(--border); background: #fff;
}
.qz-btn {
  height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
  white-space: nowrap;
}
.qz-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.qz-btn:disabled { opacity: .45; cursor: default; }
.qz-btn.big { min-width: 132px; font-weight: 700; }
.qz-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.qz-btn.primary:hover:not(:disabled) { background: var(--primary-strong, #2059e0); color: #fff; }
.qz-btn.danger { border-color: #f3c1c1; color: #c02a2a; }
.qz-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }
.qz-hint { font-size: 12.5px; color: var(--text-3); }

/* ── 讲题器：顶栏小按钮 / 退出 / 手势说明 / 计时菜单 ───────────────── */
.qz-ico {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 14px; color: var(--text-2);
}
.qz-ico:hover { border-color: var(--primary); color: var(--primary); }
.qz-quit {
  height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 600;
}
.qz-quit:hover { border-color: #f0a9a9; color: #c02a2a; }

/* 手势说明浮层：全屏半透明遮罩 + 中间一张卡（讲台上看得清） */
.qz-sheet, .uihelp {
  position: fixed; inset: 0; z-index: 150; display: flex;
  align-items: center; justify-content: center; background: rgba(10, 14, 20, .5);
  opacity: 0; transition: opacity .18s ease;
}
.qz-sheet[hidden], .uihelp:not(.on) { display: none; }
.qz-sheet:not([hidden]), .uihelp.on { opacity: 1; }
.qz-sheet-card, .uihelp-card {
  width: min(560px, 92vw); background: #fff; border-radius: 16px; padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}
.qz-sheet-card h3, .uihelp-card h3 { margin: 0 0 12px; font-size: 17px; }
.qz-kv, .uihelp-kv { display: grid; gap: 8px; margin-bottom: 16px; }
.qz-kv > div, .uihelp-kv > div {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px;
  font-size: 13.5px; line-height: 1.6; padding-bottom: 7px;
  border-bottom: 1px dashed var(--border);
}
.qz-kv b, .uihelp-kv b { color: var(--primary); font-weight: 650; }
.qz-kv span, .uihelp-kv span { color: var(--text-2); }
.qz-sheet-card .btn, .uihelp-card .btn { width: 100%; }

/* 计时时长菜单：贴在底栏计时按钮上方 */
.qz-menu {
  position: fixed; z-index: 160; left: 50%; bottom: 68px; transform: translateX(-50%);
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .2); padding: 12px 14px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.qz-menu b { font-size: 13px; margin-right: 4px; }
.qz-min-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 2px; }
.qz-min-custom { display: inline-flex; align-items: center; gap: 6px; }
.qz-min-i {
  width: 168px; height: var(--ctl-h); padding: 0 10px; font: inherit; font-size: 13px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
  color: var(--text); outline: none;
}
.qz-min-i:focus { border-color: var(--primary); }
/* 讲题顶栏「换一份题单」：课堂练习 ↔ 课后作业 */
.qz-from {
  font-size: 12px; color: var(--primary); background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.qz-kind {
  height: 26px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 12px; white-space: nowrap;
}
.qz-kind:hover { border-color: var(--primary); color: var(--primary); }
.qz-menu button {
  height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: #fff; font: inherit; font-size: 13px;
}
.qz-menu button:hover { border-color: var(--primary); color: var(--primary); }
.qz-menu button.ghost { color: var(--text-3); border-color: var(--border); }
.qz-btn.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* 结束上课弹窗 · 讲评进度（讲到第几题 / 每题停留多久 / 哪些没揭答案） */
.end-quiz {
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
  background: var(--surface-2); max-height: 218px; overflow-y: auto; overflow-x: hidden;
}
.end-quiz-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.end-quiz-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.end-quiz-i {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  padding: 3px 5px; border-radius: 6px; min-width: 0;
}
.end-quiz-i.todo { background: var(--amber-soft); }
.end-quiz-n { flex: 0 0 26px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.end-quiz-b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.end-quiz-t { flex: 0 0 auto; color: var(--text-2); font-variant-numeric: tabular-nums; }
.end-quiz-i .badge { flex: 0 0 auto; }

/* ── 小程序码弹层（上课扫码）：从右下角弹出 ───────────────────────── */
.qrpop {
  position: fixed; right: 26px; bottom: 92px; z-index: 155;
  width: 300px; padding: 18px; border-radius: 18px; background: #fff;
  border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(15, 23, 42, .26);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  opacity: 0; transform: translate(18px, 22px) scale(.92);
  transition: opacity .22s ease, transform .26s cubic-bezier(.2, .9, .3, 1.2);
}
.qrpop.on { opacity: 1; transform: none; }
.qrpop img { width: 220px; height: 220px; border-radius: 10px; object-fit: contain; background: #fff; }
.qrpop b { font-size: 16px; }
.qrpop span { font-size: 12.5px; color: var(--text-3); text-align: center; line-height: 1.6; }
.qrpop-x {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  border-radius: 7px; border: 0; background: var(--surface-3); cursor: pointer;
  color: var(--text-2); font-size: 13px;
}

/* 窄屏（1080 一体机 / 笔记本）优先保住按钮，说明文字让位 */
@media (max-width: 1140px) {
  .qz-hint { display: none; }
  .qz-btn { padding: 0 10px; font-size: 13px; }
  .qz-btn.big { min-width: 112px; }
}

/* 讲题器打开时：toast / 课堂面板 / 批注 / 弹窗都要盖在讲题层之上 */
body.qz-on .toasts { z-index: 210; }
body.qz-on .mask { z-index: 200; }
body.qz-on .pdock, body.qz-on .pmini { z-index: 205; }
body.qz-on .board { z-index: 190; }

/* 上课页：这一讲没挂课件时的空舞台（不是错误，是正常状态） */
.ls-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; text-align: center; padding: 32px;
}
.ls-empty b { font-size: 20px; }
.ls-empty .hint { max-width: 460px; line-height: 1.8; }

/* ══════════ 挑题篮（讲次页「＋ 挑题」）══════════════════════════════
   左题库、右篮子；类名统一 qp- 前缀（别用裸类名，.ask 那次踩过）。 */
.qp-dlg {
  width: min(1020px, 96vw); height: min(660px, 90vh);
  display: flex; flex-direction: column; padding: 0;
}
.qp-dlg .dialog-head { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.qp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.qp-left { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.qp-search { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.qp-search .input { flex: 1; min-width: 0; height: var(--ctl-h); }
.qp-list { flex: 1; overflow: auto; padding: 6px 8px; }
.qp-item {
  display: grid; grid-template-columns: 18px 34px 52px minmax(0, 1fr) 52px;
  gap: 8px; align-items: center; padding: 8px 10px; border-radius: 9px;
  cursor: pointer; font-size: 13px; border: 1px solid transparent;
}
.qp-item:hover { background: var(--surface-2); }
.qp-item.on { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.qp-item input { margin: 0; }
.qp-n { color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.qp-t { color: var(--text-2); font-size: 11.5px; background: var(--surface-3); border-radius: 5px; padding: 1px 5px; text-align: center; }
.qp-b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-s { color: var(--text-3); text-align: right; font-size: 12px; }
.qp-more { padding: 8px 12px; border-top: 1px solid var(--border); text-align: center; }
.qp-right { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }
.qp-sel-h { padding: 10px 12px; font-size: 12px; color: var(--text-2); border-bottom: 1px solid var(--border); }
.qp-sel { flex: 1; overflow: auto; padding: 8px; display: grid; gap: 6px; align-content: start; }
.qp-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 62px 24px 24px 24px;
  gap: 5px; align-items: center; background: #fff; border: 1px solid var(--border);
  border-radius: 9px; padding: 6px 8px; font-size: 12.5px;
}
.qp-i { color: var(--text-3); font-variant-numeric: tabular-nums; }
.qp-row .qp-b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-score { width: 100% !important; min-width: 0 !important; height: 26px !important; padding: 0 4px; font-size: 12px; text-align: center; }
.qp-op {
  width: 24px; height: 24px; padding: 0; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font-size: 12px; line-height: 1; display: grid; place-items: center;
}
.qp-op:hover { border-color: var(--primary); color: var(--primary); }
.qp-op.danger:hover { border-color: #f0a9a9; color: #c02a2a; }
.qp-dlg .dialog-foot {
  padding: 10px 18px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}

/* 看板右栏：小程序码卡片（老师/学生扫码进小程序） */
.dqr { display: flex; gap: 12px; align-items: center; padding: 6px 2px 4px; }
.dqr img {
  width: 104px; height: 104px; flex: none; border-radius: 10px;
  border: 1px solid var(--border); background: #fff; object-fit: contain;
}
.dqr-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dqr-txt > b { font-size: 14px; }
.dqr-txt .hint { line-height: 1.5; }

/* ══════════ 积分养成 4.0：下划线 tab + 统计条 + 排行表 ══════════ */
.tabs {
  display: flex; align-items: center; gap: 28px;
  border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.tabs .tab {
  position: relative; border: 0; background: none; cursor: pointer;
  padding: 9px 1px 12px; font-size: 14.5px; color: var(--text-3);
  font-family: inherit; letter-spacing: .2px; transition: color .15s;
}
.tabs .tab:hover { color: var(--text); }
.tabs .tab.on { color: var(--text); font-weight: 700; }
.tabs .tab.on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--primary);
}
.tabs-sm { gap: 20px; margin-bottom: 14px; }
.tabs-sm .tab { font-size: 13px; padding: 6px 1px 9px; }
.tab-n {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-3); font-size: 11px;
  line-height: 16px; font-weight: 500;
}
.tabs .tab.on .tab-n { background: var(--primary-soft); color: var(--primary); }

.statbar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 10px; margin-bottom: 16px;
}
.statbar .stat { position: relative; text-align: center; }
.statbar .stat + .stat::before {
  content: ''; position: absolute; left: 0; top: 10%; width: 1px; height: 80%;
  background: var(--border);
}
.statbar b {
  display: block; font-size: 26px; font-weight: 750; letter-spacing: -.6px;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.statbar span { font-size: 11.5px; color: var(--text-3); }
.statbar .warn b { color: var(--amber); }
@media (max-width: 820px) {
  .statbar { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
  .statbar .stat:nth-child(3)::before { display: none; }
}

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(23, 37, 66, .03);
}
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-title { font-size: 14px; font-weight: 700; letter-spacing: .2px; }
.panel > .tabs-sm { margin-top: 2px; }

/* 排行表 */
.rhead, .rrow {
  display: grid;
  grid-template-columns: 54px minmax(150px, 1.5fr) minmax(140px, 1fr) 76px 96px 76px;
  align-items: center; gap: 12px;
}
.rhead {
  padding: 0 8px 9px; font-size: 11.5px; color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.rhead .r { text-align: right; }
.rrow { padding: 9px 8px; border-bottom: 1px solid var(--border); transition: background .12s; }
.rrow:last-child { border-bottom: 0; }
.rrow:hover { background: var(--surface-2); }
.rrow.top .pts { color: var(--primary); }
.rk { text-align: center; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.medal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; font-size: 11.5px; font-weight: 750;
}
.medal.m1 { background: linear-gradient(140deg, #fff3cc, #ffcf5c); color: #8a5b00; }
.medal.m2 { background: linear-gradient(140deg, #f4f7fb, #ccd7e4); color: #5b6675; }
.medal.m3 { background: linear-gradient(140deg, #ffe9d5, #efb98b); color: #8a4a1c; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .petface { width: 36px; height: 36px; font-size: 19px; border-radius: 11px; }
.who-t { min-width: 0; }
.who .nm {
  font-size: 13.5px; font-weight: 650; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.who .meta { display: flex; align-items: center; gap: 7px; margin-top: 2px; font-size: 11px; color: var(--text-3); }
.who .meta .hungry { color: var(--red); }
.lv {
  display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 10.5px;
  font-weight: 650; color: var(--c, var(--primary));
  background: rgba(47, 107, 255, .1);
  background: color-mix(in srgb, var(--c, #2f6bff) 12%, transparent);
}
.grow .bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.grow .bar i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--violet)); }
.grow .bar-t { margin-top: 5px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cups { font-size: 12.5px; color: var(--amber); white-space: nowrap; }
.pts {
  text-align: right; font-size: 17px; font-weight: 750;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.pts.neg { color: var(--red); }
.ops { display: flex; justify-content: flex-end; gap: 6px; opacity: .25; transition: opacity .15s; }
.rrow:hover .ops { opacity: 1; }
.mini {
  width: 27px; height: 27px; padding: 0; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; line-height: 1; font-family: inherit; color: var(--text-2);
}
.mini:hover { border-color: var(--primary); color: var(--primary); }
.mini.p { border-color: var(--primary); color: var(--primary); }
.mini.off { display: inline-flex; align-items: center; justify-content: center; opacity: .4; cursor: default; }

/* 加减分两栏 */
/* ── 积分页：一屏工作台 ──────────────────────────────────────────────
   以前学生名单是 `max-height:54vh; overflow:auto`：页面上外圈还有一条滚动条，
   名单区自己又是一条，而且高度只到半屏（看着"没铺满"）。
   现在：顶栏 + tabs 固定，当前 tab 撑满剩余高度；加减分页里**只有学生名单**
   这一条滚动条，并且铺到屏幕底。 */
body[data-page="score"] { height: 100vh; overflow: hidden; }
body[data-page="score"] .layout,
body[data-page="score"] .content { height: 100vh; min-height: 0; }
body[data-page="score"] .pagebar { flex: 0 0 auto; }
body[data-page="score"] .pagebody {
  flex: 1; min-height: 0; overflow: hidden;
  padding: 16px 26px 18px; display: flex; flex-direction: column;
}
body[data-page="score"] .pagebody > .tabs { flex: 0 0 auto; }
body[data-page="score"] .pagebody > section {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
/* ⚠️ display:flex 会盖掉 [hidden] 自带的 display:none，必须显式关掉没选中的 tab */
body[data-page="score"] .pagebody > section[hidden] { display: none; }
/* 其它 tab（排行 / 奖品 / 规则 / 宠物）自己滚，内容本来就是长列表 */
body[data-page="score"] #paneRank,
body[data-page="score"] #panePrize,
body[data-page="score"] #paneRule,
body[data-page="score"] #panePet { overflow: auto; }
/* 加减分：两栏等高，左栏学生名单 flex:1 一直铺到屏幕底 */
body[data-page="score"] .award { flex: 1; min-height: 0; align-items: stretch; }
body[data-page="score"] #paneAward .panel:first-child {
  display: flex; flex-direction: column; min-height: 0;
}
body[data-page="score"] #paneAward .sc-stu {
  flex: 1; min-height: 0; max-height: none; overflow: auto;
}
body[data-page="score"] #paneAward .panel:last-child { overflow: auto; }
@media (max-width: 1080px) {
  body[data-page="score"],
  body[data-page="score"] .layout,
  body[data-page="score"] .content { height: auto; overflow: visible; }
  body[data-page="score"] .pagebody { display: block; overflow: visible; }
  body[data-page="score"] #paneAward .sc-stu { max-height: 52vh; }
}

.award { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1080px) { .award { grid-template-columns: 1fr; } }
.sc-stu {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 8px; max-height: 54vh; overflow: auto; padding-right: 2px;
}
.schip {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  cursor: pointer; font-size: 13px; transition: .13s;
}
.schip:hover { border-color: var(--border-strong); }
.schip.on { border-color: var(--primary); background: var(--primary-soft); }
/* 还没领养宠物：虚线灰底 + 「待领养」，不能选（后端也会拦） */
.schip.nopet { border-style: dashed; background: var(--surface-2); color: var(--text-3); }
.schip.nopet .schip-n { color: var(--text-3); }
.schip.nopet .ck { opacity: .45; }
.schip .ck {
  width: 16px; height: 16px; border-radius: 5px; flex-shrink: 0;
  border: 1px solid var(--border-strong); display: flex; align-items: center;
  justify-content: center; font-size: 11px; color: transparent;
}
.schip.on .ck { background: var(--primary); border-color: var(--primary); color: #fff; }
.schip .petface { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
.schip-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schip-p { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rulechips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; max-height: 40vh; overflow: auto; }
.rulechips .chip { font-size: 12.5px; padding: 5px 11px; }
.rulechips .chip b { color: #15803d; margin-left: 2px; }
.rulechips .chip.red b { color: #b91c1c; }

/* 规则两列 */
.rcols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .rcols { grid-template-columns: 1fr; } }
.rcol-h {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650;
  color: var(--text-2); padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.rcol-h b { margin-left: auto; color: var(--text-3); font-weight: 500; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.green { background: #22c55e; }
.dot.red { background: #e02424; }
.rcol-body { padding-top: 6px; }
.rule-i {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px;
  border-radius: 8px; font-size: 13px;
}
.rule-i:hover { background: var(--surface-2); }
.rule-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-s { font-weight: 700; color: #15803d; font-variant-numeric: tabular-nums; }
.rule-i.bad .rule-s { color: #b91c1c; }
.rule-op { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.rule-i:hover .rule-op { opacity: 1; }
.rule-op .btn { height: 23px; padding: 0 8px; font-size: 12px; }
.empty-fill { padding: 16px 8px; color: var(--text-3); font-size: 12.5px; }

/* 宠物卡片 */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; }
/* 学生宠物按班分组：外层整行占满，内层再排卡片 */
.pet-grp { grid-column: 1 / -1; }
.pet-grp-h { display: flex; align-items: baseline; gap: 10px; margin: 12px 2px 2px; }
.pet-grp-h b { font-size: 14px; }
.pet-grp .pgrid { margin-top: 8px; }
.pcard {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  background: var(--surface);
}
.pcard.hungry { border-color: #f1d3d3; background: #fffbfb; }
.pcard-top { display: flex; align-items: center; gap: 10px; }
.pcard .petface.big { width: 46px; height: 46px; font-size: 24px; border-radius: 14px; }
.pcard-t { min-width: 0; }
.pcard-n {
  font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pcard-s { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.pcard .hb { margin-top: 10px; }
.pcard-f { display: flex; justify-content: space-between; margin-top: 4px; }
.pcard-f .hint { font-size: 11px; }
.pcard-ops { display: flex; gap: 8px; margin-top: 11px; }

/* 领养弹窗 */
.adgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
  gap: 10px; margin-top: 12px; max-height: 52vh; overflow: auto;
}
.ad-i {
  text-align: center; padding: 12px 6px 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); transition: .14s;
}
.ad-i:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.ad-i .petface { width: 52px; height: 52px; font-size: 28px; margin: 0 auto 8px; }
.ad-n { font-size: 12.5px; font-weight: 600; }

/* 等级表 */
.lvtbl { max-width: 720px; }
.lvtbl td { vertical-align: middle; }
.lvtbl input.input { width: 96px; text-align: right; }

/* ══════════ 养成挂件 2.0（三段式 + 学生弹窗）══════════════════ */
.pdock {
  position: fixed; right: 16px; top: 68px; bottom: 88px; width: 400px; z-index: 70;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 20px 50px rgba(23, 37, 66, .16);
  overflow: hidden; animation: pdock-in .2s ease;
}
@keyframes pdock-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.pdock-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.pdock-t { font-size: 14px; font-weight: 750; white-space: nowrap; flex-shrink: 0; }
.pdock-cls {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; max-width: 210px;
}
.pd-ico {
  width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 12px; line-height: 1;
  color: var(--text-3); flex-shrink: 0;
}
.pd-ico:hover { border-color: var(--primary); color: var(--primary); }
.pdock-body { flex: 1; overflow: auto; padding: 12px; }
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pd-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 10px;
  background: var(--surface); cursor: pointer; transition: .14s; position: relative;
}
.pd-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.pd-card.empty { border-style: dashed; background: var(--surface-2); }
.pd-card.hungry { background: #fffbfb; }
.pd-card .petface.big { width: 44px; height: 44px; font-size: 23px; border-radius: 13px; }
.pd-n {
  margin-top: 8px; font-size: 12.5px; font-weight: 650;
  display: flex; align-items: center; gap: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pd-b { height: 4px; border-radius: 999px; background: var(--surface-3); margin-top: 7px; overflow: hidden; }
.pd-b i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--violet)); }
.pd-m { display: flex; justify-content: space-between; margin-top: 5px; font-size: 10.5px; color: var(--text-3); }
.pdock-foot {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.pdock-foot .hint {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px;
}
.pdock-foot .btn { flex-shrink: 0; white-space: nowrap; }

/* 迷你档：右侧一条竖条 */
.pmini {
  position: fixed; right: 12px; top: 50%; transform: translateY(-50%); z-index: 70;
  width: 58px; padding: 8px 6px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(23, 37, 66, .14); cursor: pointer;
  animation: pdock-in .2s ease;
}
.pmini-t { text-align: center; font-size: 13px; margin-bottom: 6px; }
.pmini-list { display: flex; flex-direction: column; gap: 6px; max-height: 56vh; overflow: auto; }
.pmini-i { position: relative; display: flex; justify-content: center; }
.pmini-i .petface { width: 34px; height: 34px; font-size: 18px; border-radius: 11px; }
.pmini-lv {
  position: absolute; right: -2px; bottom: -2px;
  min-width: 15px; height: 15px; line-height: 15px; text-align: center;
  border-radius: 999px; background: var(--primary); color: #fff;
  font-size: 9.5px; font-weight: 700; padding: 0 3px;
}
.pmini-more { text-align: center; font-size: 10.5px; color: var(--text-3); padding-top: 2px; }

/* 学生弹窗 */
.pd-dialog { width: min(560px, 100%); }
.pd-hero {
  display: flex; gap: 16px; padding: 4px 2px 16px;
  border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.pd-hero-pet {
  width: 104px; height: 104px; border-radius: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--border);
}
.pd-hero-pet .petface { width: 84px; height: 84px; font-size: 46px; border-radius: 18px; border: 0; background: none; }
.pd-hero-pet.s3 { background: linear-gradient(160deg, #fff8e8, #ffe8bd); }
.pd-hero-pet.s4 { background: radial-gradient(circle at 30% 25%, #fff, #ffe9f3 45%, #e6dcff 100%); }
.pd-hero-pet.pd-shake { animation: fx-shake .6s; }
.pd-hero-t { flex: 1; min-width: 0; }
.pd-hero-n { font-size: 16px; font-weight: 750; display: flex; align-items: center; gap: 7px; }
.pd-hero-bar { height: 7px; border-radius: 999px; background: var(--surface-3); margin: 8px 0 5px; overflow: hidden; }
.pd-hero-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--violet)); }
.pd-hero-hunger { margin-top: 8px; }
.pd-hero-hunger .hb { margin-top: 4px; }
.pd-hero-ops { display: flex; gap: 8px; margin-top: 10px; }
.pd-pickhint { font-size: 13px; font-weight: 650; margin-bottom: 12px; }

.pd-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .pd-rules { grid-template-columns: 1fr; } }
.pd-rule-h {
  display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650;
  color: var(--text-2); padding-bottom: 7px; border-bottom: 1px solid var(--border);
}
.pd-r {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin-top: 6px; padding: 8px 11px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; font-family: inherit; color: var(--text); text-align: left;
}
.pd-r span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-r b { font-weight: 750; }
.pd-r.good b { color: #15803d; }
.pd-r.bad b { color: #b91c1c; }
.pd-r.good:hover { border-color: #22c55e; background: #f4fcf6; }
.pd-r.bad:hover { border-color: #e02424; background: #fef6f6; }
.pd-r:active { transform: scale(.985); }

/* 修正老规则：惩罚行不要整块粉底；饱食度 0% 别缩成一个红点 */
.rule-i.bad { background: none; }
.hb { background: var(--surface-3); }
.hb.bad { background: #fbeaea; }
.hb.bad i { width: auto; background: #e02424; }
.hb.warn { background: #fdf1dd; }

/* 挂件两列必须能收缩，否则第二列被面板边缘切掉 */
.pd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pd-card { min-width: 0; overflow: hidden; }
.pd-n, .pd-m { min-width: 0; }

/* 挂件改成「一行一个学生」的列表：横排更宽敞、信息不挤 */
.pd-grid { display: flex; flex-direction: column; gap: 6px; }
.pd-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.pd-card .petface.big { width: 38px; height: 38px; font-size: 20px; border-radius: 11px; flex-shrink: 0; }
.pd-ci { flex: 1; min-width: 0; }
.pd-n { margin-top: 0; }
.pd-cup { margin-left: auto; font-size: 10.5px; color: var(--amber); font-weight: 500; }
.pd-hungry {
  font-size: 9.5px; color: var(--red); border: 1px solid #f3cccc;
  border-radius: 999px; padding: 0 4px; line-height: 13px;
}
.pd-b { margin-top: 5px; }
.pd-m { margin-top: 4px; gap: 8px; }
.pd-m span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 规则条目：默认不要底色，只有 hover 才浅底（两列观感一致） */
.rule-i, .rule-i.bad { background: none; }
.rule-i:hover { background: var(--surface-2); }

/* ══════════ 图片槽位（宠物成长图 / 奖品图）══════════════════════ */
.imgs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
  gap: 10px; margin-top: 4px;
}
.imgs-grid.drag { outline: 2px dashed var(--primary); outline-offset: 4px; border-radius: 10px; }
.imgcell { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.imgcell-t {
  font-size: 11px; font-weight: 650; color: var(--text-3);
  padding: 5px 8px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.imgcell-b { position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.imgcell-b img {
  width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; background: #fff;
}
.imgcell-add {
  width: 100%; height: 100%; border: 0; background: none; cursor: pointer;
  color: var(--text-3); font-size: 20px; line-height: 1.1; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.imgcell-add span { font-size: 11px; }
.imgcell-add:hover { color: var(--primary); background: var(--primary-soft); }
.imgcell-x {
  position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: rgba(23, 37, 66, .55); color: #fff; font-size: 11px;
  cursor: pointer; line-height: 1; opacity: 0; transition: opacity .15s;
}
.imgcell:hover .imgcell-x { opacity: 1; }
.imgs-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.imgs-foot .hint { font-size: 11.5px; }

/* 大图预览 */
.imgbox {
  position: fixed; inset: 0; z-index: 120; display: none;
  align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .78); backdrop-filter: blur(2px);
}
.imgbox.on { display: flex; }
.imgbox img {
  max-width: 88vw; max-height: 86vh; border-radius: 12px;
  background: #fff; box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
}
.imgbox-x {
  position: absolute; right: 24px; top: 20px; color: #fff; font-size: 20px;
  cursor: pointer; opacity: .8;
}

/* 奖品图：完整显示，不裁切 */
.sc-prize-img {
  height: 120px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border-radius: 10px; overflow: hidden;
}
.sc-prize-img img { width: 100%; height: 100%; object-fit: contain; }
.sc-prize-img.ph { color: var(--text-3); font-size: 26px; }

/* 宠物图鉴卡里的形象：有图就按图片完整显示 */
.pcard .petface img { object-fit: contain; }

/* ══════════ 课堂面板 3.0（记分 / 点名 合一）══════════════════════ */
.pdock { width: 420px; }
/* 页签条现在在面板底部（内容下面），所以分割线在上边 */
.pd-tools {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  border-top: 1px solid var(--border); background: var(--surface-2);
  flex: none;
}
.pd-tab {
  border: 0; background: none; cursor: pointer; font-family: inherit;
  padding: 5px 10px; border-radius: 8px; font-size: 12.5px; color: var(--text-3);
}
.pd-tab:hover { color: var(--text); }
.pd-tab.on { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(23,37,66,.1); }
.pd-tab.off { opacity: .45; cursor: not-allowed; }
.pd-tool {
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-family: inherit; font-size: 12px; color: var(--text-2);
  padding: 4px 9px; border-radius: 8px;
}
.pd-tool:hover { border-color: var(--primary); color: var(--primary); }
.pd-tool.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pd-hintline {
  font-size: 11.5px; color: var(--text-3); padding: 0 2px 8px;
}
.pd-hintline b { color: var(--primary); }

/* 点名行 */
.pd-att {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface);
}
.pd-att .petface { width: 32px; height: 32px; font-size: 17px; border-radius: 9px; flex-shrink: 0; }
.pd-att-opts { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.att {
  border: 1px solid var(--border); background: var(--surface); border-radius: 7px;
  padding: 2px 8px; font-size: 11px; cursor: pointer; color: var(--text-3); font-family: inherit;
}
.att:hover { border-color: var(--border-strong); color: var(--text-2); }
.att.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 学生弹窗顶部：经验 / 饱食度 都做成「标签 + 条」的一行，不再被图片挤 */
.pd-hero { align-items: flex-start; }
.pd-hero-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.pd-stage {
  font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.pd-meter { margin-top: 9px; }
.pd-meter-h {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 11px; color: var(--text-3); white-space: nowrap;
}
.pd-meter-b {
  height: 6px; border-radius: 999px; background: var(--surface-3);
  margin-top: 4px; overflow: hidden;
}
.pd-meter-b i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--violet));
}
.pd-meter-b.hb i { background: linear-gradient(90deg, #34c759, #8ee99b); }
.pd-meter-b.hb.bad i { background: #e02424; }
.pd-meter-b.hb.warn i { background: linear-gradient(90deg, #f5a524, #ffd479); }
.pd-hero-facts { font-size: 11.5px; color: var(--text-3); margin-top: 9px; }
.pd-hero-ops { margin-top: 10px; }

/* ══════════ 批注画板 ══════════════════════════════════════════ */
.board { position: fixed; inset: 0; z-index: 88; display: none; }
.board.on { display: block; }
.board-cv { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.board-bar {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  background: rgba(23, 37, 66, .92); border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3); z-index: 2;
}
.board-t { color: #fff; font-size: 12px; opacity: .75; margin-right: 4px; }
.board-c {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent;
  background: var(--c); cursor: pointer; padding: 0;
}
.board-c.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.board-sep { width: 1px; height: 18px; background: rgba(255,255,255,.18); margin: 0 4px; }
.board-b {
  border: 0; background: rgba(255, 255, 255, .12); color: #fff;
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  cursor: pointer; font-family: inherit;
}
.board-b:hover { background: rgba(255, 255, 255, .22); }
.board-b.on { background: #fff; color: #1f2e45; font-weight: 600; }
.board-b.primary { background: var(--primary); }
body.board-on { cursor: crosshair; }

/* 奖品卡等高：图固定高度，说明占两行位，操作按钮贴底 */
.pgrid .sc-prize { display: flex; flex-direction: column; }
.pgrid .sc-prize .clamp2 { min-height: 2.9em; }
.pgrid .sc-prize .sc-prize-op { margin-top: auto; padding-top: 6px; }

/* ══════════ AI 自动配题（布置作业弹窗）═════════════════════════ */
.aihw {
  border: 1px solid var(--border); border-radius: 14px;
  background: linear-gradient(180deg, var(--primary-soft), var(--surface) 60%);
  margin: 14px 0; overflow: hidden;
}
.aihw-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; flex-wrap: wrap; }
.aihw-t { font-size: 13.5px; font-weight: 750; color: var(--primary); white-space: nowrap; }
.aihw-head .hint { font-size: 11.5px; min-width: 0; }
.aihw-body { padding: 2px 14px 14px; border-top: 1px dashed var(--border); }
.aihw-mix {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px; margin: 10px 0 12px;
}
.aihw-i {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 5px 8px 5px 11px;
}
.aihw-i span { flex: 1; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.aihw-i input.input { width: 52px; height: 26px; padding: 0 6px; text-align: center; }
.aihw-chk {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; color: var(--text-2); line-height: 1.55; cursor: pointer;
}
.aihw-chk input { margin-top: 3px; }
.aihw-chk b { color: var(--primary); }
.aihw-chk .hint { display: block; font-size: 11.5px; }

/* 书工作台：本讲教材进度标记（从讲次「翻教材」进来才有） */
.tp-lesson {
  font-size: 12px; padding: 2px 9px; border-radius: 999px; margin-left: 8px;
  background: var(--primary-soft); color: var(--primary); white-space: nowrap;
}
.tp-lesson.done { background: #e8f7ee; color: #177f3c; }

/* 去上课：讲次是主线，一讲一行占满宽度；课件卡才允许两列（收在折叠里） */
.ls-cw-list { grid-template-columns: 1fr; align-content: start; }
.ls-more-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ls-cws-head { flex-wrap: wrap; row-gap: 8px; }
.ls-cws-head .seg { flex-shrink: 0; }
.ls-cws-head .seg-i { white-space: nowrap; }
.ls-cws-head #cwHead { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-cw-f { flex-wrap: wrap; gap: 8px; }
.ls-cw-ops { flex-wrap: wrap; justify-content: flex-end; }
.ls-cw-ops .btn { white-space: nowrap; }
.ls-go { white-space: nowrap; }
.ls-unit .ls-cw-t { flex-wrap: wrap; row-gap: 4px; }

/* 去上课头部：tab 别被长班级名挤成竖排 */
.ls-cws-head .seg { min-width: 132px; }
.ls-cws-head .seg-i { padding: 6px 10px; text-align: center; }

/* tab 文案一律不换行（长了就滚动，别折成两行被裁） */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .tab { white-space: nowrap; flex-shrink: 0; }

/* 禁用按钮要看得出来（以前只有 cursor 变化，看着像能点） */
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ══════════ 成长设置：卡片式（一张卡 = 一次升级）════════════════ */
.lvcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(246px, 1fr)); gap: 12px; }
.lvcard {
  display: flex; flex-direction: column; gap: 9px;
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
  background: var(--surface);
}
.lvcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.lvcard-h { display: flex; align-items: center; gap: 8px; }
.lv-arrow { font-size: 13px; font-weight: 650; letter-spacing: .2px; }
.lv-arrow b { color: var(--primary); }
.lvcard-h .badge { margin-left: auto; }
.lvcard-h .btn { height: 22px; padding: 0 7px; font-size: 11.5px; }
.lvcard-b { display: flex; gap: 8px; }
.lvf { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px;
  font-size: 11.5px; color: var(--text-3); }
.lvf .input { width: 100%; text-align: right; }
.lvcard-f { font-size: 11.5px; color: var(--text-3);
  border-top: 1px dashed var(--border); padding-top: 7px; }
.lvcard-f b { color: var(--text-2); }
.lv-max { color: var(--amber); }
.lvcard-h .btn { min-width: 38px; }

/* ══════════ 题库 · 题目视图（跨分册平铺）══════════════════════════ */
.qstem { max-width: 520px; }
.qstem a {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.5;
}
.qstem .badge { margin-left: 6px; }
.qbook {
  max-width: 190px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--text-3); font-size: 12.5px;
}

/* 徽标一律单行：窄列里被挤成「生/物」两行的竖条，看着像坏掉了 */
.badge { white-space: nowrap; flex-shrink: 0; }

/* 去上课头部：右侧两个快捷入口别掉到第二行（一掉就贴着左边缘，看着像标签） */
.ls-cws-head { flex-wrap: nowrap; }
.ls-cws-links { display: flex; gap: 6px; flex: 0 0 auto; }
.ls-cws-head #cwHead { flex: 1 1 auto; }

/* 长文本徽标（比如「第 5 讲 识字与写字·第一单元」）：限宽省略，别把列撑开 */
.badge.ell {
  display: inline-block; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; line-height: 22px; vertical-align: middle;
}

/* ══════════ 讲次详情：基本信息 / 本讲教材 / 本讲材料 / 本讲作业 ══════ */
.up-card { padding: 14px 16px; }
.up-card + .up-card { margin-top: 14px; }
.up-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.up-t { font-size: 14px; font-weight: 750; letter-spacing: .2px; }
.up-h .hint { font-size: 11.5px; min-width: 0; }
.up-h .btn { flex: 0 0 auto; }
.hw-more { margin-top: 8px; }
.hw-more summary { cursor: pointer; font-size: 12.5px; color: var(--primary); }
.hw-qs { margin: 8px 0 0; padding-left: 20px; font-size: 12.5px; color: var(--text-2); line-height: 1.75; }
.hw-qs li { margin-bottom: 3px; }
.hw-qs .hint { margin-left: 6px; }
.hw-qs .badge { margin-right: 4px; }

/* ══════════ 积分 · 全机构：学生按班级分组 + 班级小标签 ══════════ */
.schip-grp {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px;
  margin: 4px 0 0; padding-top: 8px; border-top: 1px dashed var(--border);
}
.schip-grp:first-child { border-top: 0; padding-top: 0; }
.schip-grp-t { font-size: 12.5px; font-weight: 750; color: var(--text-2); }
.schip-grp .btn { margin-left: auto; height: 24px; padding: 0 8px; font-size: 12px; }
.schip-wrap {
  grid-column: 1 / -1; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 8px;
}
.cls-tag {
  display: inline-block; padding: 0 6px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-3);
  font-size: 11px; line-height: 17px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.meta-sub { margin-top: 3px; }

/* 讲次详情的小标题：按钮多了会把「本讲作业」挤成两行竖排，标题必须不换行、整行可折行 */
#detail .sec-head { flex-wrap: wrap; row-gap: 6px; }
#detail .sec-head .sec-title { white-space: nowrap; flex: 0 0 auto; }
#detail .sec-head .hint { min-width: 0; }

/* AI 配题：与学科无关的题型（如生物的「听力题」）置灰，不能填 */
.aihw-i.off { opacity: .45; }
.aihw-i.off input { pointer-events: none; }

/* ══════════ 上课：触摸屏 / 高屏幕适配 ══════════════════════════════
   教室里的真实环境是「竖屏很高 + 触摸屏」：顶栏那排按钮要站起来探手才够得着，
   而且顶栏吃掉的是最值钱的内容高度。所以——
   · 顶部只留只读信息（←、标题、计时、全屏）；
   · 所有操作按钮沉到底部工具条（手自然垂放的位置），触控目标 ≥ 44px；
   · 内容区尽量占满。 */
/* 6 行：顶栏 / 舞台 / 进度条 / 章节圆点 / 步数圆点 / 底栏 */
.ls { grid-template-rows: auto minmax(0, 1fr) 4px auto auto auto; }
.ls-top {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px;
  min-height: 46px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.ls-top .ls-back {
  height: 34px; min-width: 34px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 9px; font-size: 20px;
}
.ls-top .ls-back:hover { background: var(--surface-3); }
.ls-clock {
  height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px;
  font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation;
}
.ls-bar {
  border-top: 1px solid var(--border); border-bottom: 0;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  gap: 10px; flex-wrap: wrap; justify-content: center;
  background: var(--surface); box-shadow: 0 -6px 18px rgba(20, 30, 50, .07);
}
.ls-btn {
  height: 44px; padding: 0 16px; font-size: 15px; border-radius: 10px;
  touch-action: manipulation;
}
.ls-btn.big { min-width: 128px; justify-content: center; font-weight: 600; }
.ls-btn.primary { box-shadow: 0 2px 10px rgba(47, 107, 255, .28); }
.ls-pos { font-size: 15px; min-width: 64px; }
.ls-dots { padding: 6px 0 10px; gap: 10px; }
.ls-dots i { width: 12px; height: 12px; }
.ls-stage { padding: 24px 40px; }
.ls-cw { width: min(1180px, 100%); padding: 40px 52px; font-size: 19px; }

/* /teach 教材上课：整条工具栏沉到底部（flex order），
   顶部 52px 还给书页；按钮加大到手指能点。 */
.tp-main { order: 1; }
.tp-bar {
  order: 2; height: auto; min-height: 58px; padding: 6px 10px;
  border-top: 1px solid var(--border); border-bottom: 0;
  overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap;
  box-shadow: 0 -6px 18px rgba(20, 30, 50, .07);
}
.tp-bar::-webkit-scrollbar { height: 0; }
body.tp-idle .tp-bar { opacity: .85; }
.tp-btn { height: 40px; min-width: 40px; padding: 0 12px; font-size: 13.5px; touch-action: manipulation; }
.tp-page { height: 40px; width: 62px; font-size: 15px; }
.tp-brand { height: 40px; }

/* 上课舞台是 grid：默认单列 auto 会被最宽的一行（底部工具条）撑出屏幕，
   导致工具条右侧被截掉。列宽锁死成 minmax(0,1fr)，让 flex-wrap 正常折行。 */
.ls { grid-template-columns: minmax(0, 1fr); }
.ls-bar { min-width: 0; }
.ls-stage { min-width: 0; }

/* 窄屏（笔记本 / 一体机小窗）：底部工具条允许折行，别把右边的按钮顶出屏幕 */
@media (max-width: 1100px) {
  .ls-btn.big { min-width: 0; padding: 0 12px; }
  .ls-bar { gap: 6px; }
}

/* ══════════ 上课：逐条动画 + 底部工具条分组 ══════════════════════════
   顶栏只留只读信息（标题 / 进度），所有能点的东西都在底部工具条：
   教室是一体机（竖屏很高 + 触摸），顶上的按钮够不着，底栏才是手自然落点。 */
.ls-top-hint { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.ls-bar {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; row-gap: 8px; column-gap: 8px;
}
.ls-group { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ls-btn.on {
  background: var(--primary-soft); border-color: var(--primary);
  color: var(--primary-ink, var(--primary));
}
.ls-btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--border)); }
.ls-btn.danger:hover { background: color-mix(in srgb, var(--red) 10%, var(--surface)); }
.ls-btn.primary-ghost {
  background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  color: var(--primary);
}
.ls-clock {
  height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px;
  font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation;
  letter-spacing: .5px;
}

/* 逐条出现：只改透明度/位移，占位不动（不然下面的内容会跳） */
.ls-cw > * { transition: opacity .26s ease, transform .26s ease; }
.ls-cw > .ls-off { opacity: 0; transform: translateY(10px); }
.ls-cw > .ls-pop { will-change: opacity, transform; }

/* 本页的「第几步」小圆点：比章节圆点更细，放在章节圆点下面 */
.ls-stepdots { display: flex; gap: 5px; justify-content: center; height: 8px; margin-top: 2px; }
.ls-stepdots i {
  width: 6px; height: 6px; border-radius: 999px; background: var(--border);
  transition: background .2s ease, width .2s ease;
}
.ls-stepdots i.on { background: var(--primary); width: 12px; }

/* 幻灯片式正文：一页一块白板，四边留白，标题更大一点 */
.ls-slide { display: flex; flex-direction: column; gap: 4px; }
.ls-slide h3 { font-size: 30px; line-height: 1.3; margin: 0 0 10px; }
.ls-slide h4 { font-size: 21px; margin: 12px 0 4px; }
.ls-slide p, .ls-slide li { font-size: 20px; line-height: 1.8; }

/* ══════════ 讲次：本讲课件 + 幻灯片编辑器 ══════════════════════════ */
.cwnow {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 10px; background: var(--surface-2);
}
.cwnow-t { font-weight: 650; }
/* 基本信息：12 栅格。以前用 row3 三等分，但 select 的固有宽度会把列撑歪，
   第几讲窄、学科宽、知识点和简介高度对不齐 —— 统一按栅格比例走。 */
.meta-form {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px 14px; align-items: start;
}
.meta-form > .field { min-width: 0; }
.meta-form .f2 { grid-column: span 2; }
.meta-form .f4 { grid-column: span 4; }
.meta-form .f5 { grid-column: span 5; }
.meta-form .f6 { grid-column: span 6; }
.meta-form .f8 { grid-column: span 8; }
.meta-form .field > .select, .meta-form .field > .selshell { width: 100%; }
.meta-form textarea.input { height: auto; line-height: 1.7; resize: vertical; }

/* 次要操作收进「更多」：主操作只留 编辑 / 去上课 / 发布，避免按钮挤到第二行 */
.more-wrap { position: relative; display: inline-flex; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 156px; padding: 6px; display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg);
}
.more-menu[hidden] { display: none; }
.more-menu button {
  text-align: left; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; font-size: 13px; color: var(--text-2);
}
.more-menu button:hover { background: var(--surface-2); color: var(--text); }
.more-menu button.danger { color: var(--red); }
.more-menu button.danger:hover { background: color-mix(in srgb, var(--red) 10%, transparent); }

@media (max-width: 1000px) {
  .meta-form .f2, .meta-form .f4, .meta-form .f5,
  .meta-form .f6, .meta-form .f8 { grid-column: span 12; }
}

/* 同一讲的多份年度版本（2026 版 / 2027 版）：一行一个，各自试讲/编辑 */
.cwnow .cw-vers { flex: 1 0 100%; display: grid; gap: 4px; margin-top: 8px; }
.cw-ver {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px;
  border-radius: 8px; background: var(--surface); border: 1px solid var(--border);
}
.cw-ver.on { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.cw-ver-t {
  flex: 1; min-width: 0; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 编辑器：整屏高，左页列表 / 中间写 / 右边预览 */
.edlg {
  width: min(1400px, 96vw); height: min(92vh, 900px);
  display: flex; flex-direction: column;
}
.edbody { flex: 1; min-height: 0; display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 0; }
.edpages {
  border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0;
  background: var(--surface-2);
}
.edpages-h {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  font-size: 12.5px; color: var(--text-3);
}
.edpages-h .btn { margin-left: auto; height: 26px; padding: 0 8px; font-size: 12px; }
#edPageList { flex: 1; overflow: auto; padding: 4px 8px 12px; }
.edpage {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px; margin-bottom: 6px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; background: var(--surface); font: inherit; text-align: left;
}
.edpage:hover { border-color: var(--border); }
.edpage.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.edpage-n {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); font-size: 11.5px; color: var(--text-2);
}
.edpage.on .edpage-n { background: var(--primary); color: #fff; }
.edpage-t { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.edmain { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.edtool {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.edtool .btn { height: 26px; padding: 0 9px; font-size: 12px; }
.edsplit { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.edta {
  height: 100%; border: 0; border-radius: 0; padding: 16px 18px; resize: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.75; background: var(--surface);
}
.edta:focus { outline: none; }
.edpv {
  border-left: 1px solid var(--border); overflow: auto; padding: 14px 18px;
  background: var(--surface-2);
}
.edpv-h { font-size: 12px; color: var(--text-3); margin-bottom: 8px; display: flex; gap: 6px; }
.edpv-b {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 24px; min-height: 260px; box-shadow: var(--shadow);
}
@media (max-width: 900px) {
  .edsplit { grid-template-columns: minmax(0, 1fr); }
  .edpv { display: none; }
}

/* ══════════ 底部固定操作条（看板；触摸屏 + 高屏，顶部按钮够不着）═════ */
body[data-page="dashboard"] .pagebody { padding-bottom: 104px; }
.dbar {
  position: fixed; left: var(--side-w); right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 26px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(20, 30, 50, .08);
}
.dbar-b {
  height: 46px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
  font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; touch-action: manipulation; text-decoration: none;
}
.dbar-b:hover { background: var(--surface-2); }
.dbar-b.primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 14px rgba(47, 107, 255, .28);
}
.dbar-b.primary:hover { filter: brightness(1.04); }
@media (max-width: 700px) {
  .dbar { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .dbar-b { flex: 1 1 auto; justify-content: center; padding: 0 12px; font-size: 14px; }
}

/* ══════════ 开始上课 / 选班级 弹窗 ══════════════════════════════════ */
.spdlg { width: min(980px, 96vw); height: min(78vh, 680px); display: flex; flex-direction: column; }
.spbody {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr);
}
.spcls {
  border-right: 1px solid var(--border); background: var(--surface-2);
  display: flex; flex-direction: column; min-height: 0;
}
.spcls-h { padding: 10px 12px; font-size: 12px; color: var(--text-3); }
#spClassList { flex: 1; overflow: auto; padding: 0 8px 12px; }
.spcls-i {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  padding: 10px 12px; margin-bottom: 6px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; background: var(--surface); font: inherit;
}
.spcls-i:hover { border-color: var(--border); }
.spcls-i.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.spcls-n { font-weight: 600; font-size: 13.5px; }
.spmain { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.spseg {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.spseg-i {
  height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer;
}
.spseg-i.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.splist { flex: 1; overflow: auto; padding: 12px 14px; }
.spitem {
  display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left;
  padding: 12px 14px; margin-bottom: 8px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); font: inherit;
}
.spitem:hover { border-color: var(--primary); }
.spitem.on { border-color: var(--primary); background: var(--primary-soft); }
.spitem-t { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* OnlyOffice 编辑页：上面一条窄工具条，其余全给编辑器 */
.oobar {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.oohost { height: calc(100vh - 48px); }
.oohost iframe { display: block; }

/* 弹窗标题和说明挤在一起，加一点间距 */
.spdlg .dialog-head h2 { white-space: nowrap; }
.spdlg .dialog-head .hint { margin-left: 10px; }

/* 教材库表格列多，把「课件」列撑开一点，标题别挤成一条竖排 */
body[data-page="courseware"] .tbl td:first-child { min-width: 230px; }

/* ══════════ 幻灯片课件（编辑器 / 上课 / 缩略图共用）══════════════════
   .sl 是「容器查询」容器：字号用 cqw 换算，1280 宽的稿子投到任何屏幕都等比。
   位置全部百分比，所以小缩略图和大屏是同一份 HTML。 */
.sl {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  container-type: inline-size; border-radius: 12px;
  color: #1f2937; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
.sl-b {
  position: absolute; font-size: calc(var(--fs, 30) * 1cqw / 12.8);
  line-height: 1.45; white-space: pre-wrap; word-break: break-word;
  transition: opacity .3s ease, transform .3s ease, clip-path .35s ease;
}
.sl-b img, .sl-b video { width: 100%; height: auto; display: block; border-radius: 6px; }
.sl-b audio { width: 100%; height: 40px; min-width: 180px; }
.sl-b ul, .sl-b ol { margin: 0; padding-left: 1.2em; }
.sl-title { font-weight: 700; }
.sl-ph {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 160px; min-height: 90px; padding: 12px;
  border: 1px dashed #c7cfdb; border-radius: 8px; color: #94a3b8; font-size: .8em;
}
.sl-tex { display: block; text-align: center; }

/* ── 块内排版（编辑器右侧「排版」面板写的就是这几个变量）───────────────
   行距 / 段距 / 首行缩进 / 分栏 / 垂直对齐 / 项目符号。项目符号故意用
   display:list-item 而不是往内容里插 <ul>：老师说「不要点了」，换个选项就回去了，
   正文 HTML 不会越改越乱。 */
.sl-b { line-height: var(--lh, 1.45); }
.sl-b > div, .sl-b > p { margin: 0 0 calc(var(--para, 0) * 1em); }
.sl-b > *:last-child { margin-bottom: 0; }
.sl-b.v-middle { display: flex; flex-direction: column; justify-content: center; }
.sl-b.v-bottom { display: flex; flex-direction: column; justify-content: flex-end; }
.sl-b.list-dot > div, .sl-b.list-dot > p {
  display: list-item; list-style: disc outside; margin-left: 1.15em;
}
/* 编号要「每个块从 1 开始」：默认的 list-item 计数器会把同一页上两个块的编号连着数
   （第二块从 3 开始），所以自己 reset + ::before 画序号。 */
.sl-b.list-num { counter-reset: slni; }
.sl-b.list-num > div, .sl-b.list-num > p {
  display: list-item; list-style: none; margin-left: 1.6em; position: relative;
}
.sl-b.list-num > div::before, .sl-b.list-num > p::before {
  counter-increment: slni; content: counter(slni) '.';
  position: absolute; left: -1.7em; width: 1.5em; text-align: right;
  padding-right: .25em; opacity: .75;
}
.sl-b.list-check > div, .sl-b.list-check > p { padding-left: 1.15em; position: relative; }
.sl-b.list-check > div::before, .sl-b.list-check > p::before {
  content: '✓'; position: absolute; left: 0; opacity: .7;
}

/* ── 文字环绕：文本块里插一张「浮动图」，后面的文字自动绕开 ────────────
   这是真正的绕排（float + shape-outside），不是把图片压在上面。 */
.sl-b img.sl-float {
  float: left; width: 34%; margin: 0 .8em .4em 0;
  shape-outside: inset(0); border-radius: 8px;
}
.sl-b img.sl-float.fl-right { float: right; margin: 0 0 .4em .8em; }
.sl-b img.sl-float.fl-center { float: none; display: block; margin: .2em auto .6em; }
.sl-b.editing img.sl-float { cursor: pointer; }

/* 图片块的填充方式（有高度时才生效） */
.sl-b img { max-height: 100%; }
.sl-b.fit-cover img { height: 100%; object-fit: cover; }
.sl-b.fit-contain img { height: 100%; object-fit: contain; }
.sl-b.fit-fill img { height: 100%; object-fit: fill; }

/* 手写块：笔迹是 SVG，跟着块盒子缩放 */
.sl-ink { display: block; width: 100%; height: 100%; }

/* 拖动时的参考线（编辑器里对齐用，只在编辑态出现） */
#seSlide .seguides { position: absolute; inset: 0; pointer-events: none; z-index: 999; }
#seSlide .seguides i { position: absolute; background: #f43f5e; opacity: .85; }
#seSlide .seguides i.sv { top: 0; bottom: 0; width: 1px; }
#seSlide .seguides i.sh { left: 0; right: 0; height: 1px; }
.sl-badge {
  position: absolute; right: 2%; bottom: 3%; font-size: calc(14 * 1cqw / 12.8);
  color: #94a3b8;
}

/* 逐条出现：位置/透明度过渡，隐藏时仍占位，翻页不会跳 */
.sl-b.ls-off { opacity: 0; }
.sl-b.anim-up.ls-off { transform: translateY(18px); }
.sl-b.anim-zoom.ls-off { transform: scale(.92); }
.sl-b.anim-wipe { clip-path: inset(0 0 0 0); }
.sl-b.anim-wipe.ls-off { clip-path: inset(0 100% 0 0); opacity: 1; }

/* 上课页里的一页幻灯片：按高度算宽度，保证 16:9 完整可见（不能出竖向滚动条） */
.ls-stage { overflow: hidden; }
.ls-slidewrap {
  width: min(100%, calc((100dvh - 210px) * 16 / 9));
  max-width: 1280px; margin: 0 auto;
}
.ls-slidewrap .sl { box-shadow: var(--shadow); }

/* ══════════ 课件编辑器（/slideedit）══════════════════════════════════
   教室里的课件是「一页一页的幻灯片」，不是一篇文章：
   左边页面缩略图（多页好切换）、中间画布（拖块、双击改字）、右边样式与动画。 */
body.sebody-page { height: 100vh; overflow: hidden; background: var(--bg); }
.sebar {
  height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.se-title { width: 280px; font-weight: 600; }
.semain {
  height: calc(100vh - 54px); display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 268px;
}
.sethumbs {
  border-right: 1px solid var(--border); background: var(--surface-2);
  display: flex; flex-direction: column; min-height: 0;
}
.sethumbs-h {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  font-size: 12px; color: var(--text-3);
}
.sethumbs-h .btn { margin-left: auto; height: 26px; padding: 0 8px; }
#seList { flex: 1; overflow: auto; padding: 0 8px 8px; }
.sethumb {
  position: relative; display: block; width: 100%; padding: 0; margin-bottom: 8px;
  border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer;
  overflow: hidden;
}
.sethumb.on { border-color: var(--primary); }
.sethumb-cv { display: block; pointer-events: none; }
.sethumb-n {
  position: absolute; left: 4px; top: 4px; z-index: 2;
  background: rgba(15, 23, 42, .55); color: #fff; font-size: 10px;
  padding: 0 5px; border-radius: 4px; line-height: 15px;
}
/* 缩略图上的悬浮快捷操作：上移/下移/复制/删除 + 转场徽标 */
.sethumb-acts {
  position: absolute; right: 4px; bottom: 4px; z-index: 3;
  display: flex; gap: 2px; opacity: 0; transition: opacity .12s;
}
.sethumb:hover .sethumb-acts, .sethumb.on .sethumb-acts { opacity: 1; }
.sethumb-acts i {
  width: 17px; height: 17px; display: grid; place-items: center;
  background: rgba(15, 23, 42, .72); color: #fff; border-radius: 4px;
  font-size: 10px; font-style: normal; line-height: 1; cursor: pointer;
}
.sethumb-acts i:hover { background: var(--primary); }
.sethumb-tr {
  position: absolute; right: 4px; top: 4px; z-index: 3;
  width: 17px; height: 17px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 4px; font-size: 9px; cursor: pointer;
}
.sethumb-tr.off { background: rgba(15, 23, 42, .3); color: #fff; opacity: .5; }

.sethumbs-f { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--border); }
.sethumbs-f .btn { flex: 1; justify-content: center; }

.secanvas { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.setools {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.setool {
  height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 12.5px;
  cursor: pointer;
}
.setool:hover { border-color: var(--primary); color: var(--primary); }
.setool-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.setool-color {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  color: var(--text-2); cursor: pointer;
}
.setool-color input { width: 24px; height: 24px; padding: 0; border: 0; background: none; }
.secanvas-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 18px; overflow: auto; }
.sefit {
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  grid-template-rows: 16px auto;
}
.seruler-corner { grid-column: 1; grid-row: 1; }
/* 标尺：小格 2.5%、大格 10%，纯 CSS 渐变画刻度（不占 JS，缩放跟得上） */
.seruler { position: relative; color: var(--text-3); font-size: 9px; overflow: hidden; }
.seruler-top {
  grid-column: 2; grid-row: 1;
  background-image:
    repeating-linear-gradient(to right, var(--border-strong) 0 1px, transparent 1px 10%),
    repeating-linear-gradient(to right, var(--border) 0 1px, transparent 1px 2.5%);
  background-size: 100% 8px, 100% 4px;
  background-position: left bottom, left bottom;
  background-repeat: no-repeat;
}
.seruler-left {
  grid-column: 1; grid-row: 2;
  background-image:
    repeating-linear-gradient(to bottom, var(--border-strong) 0 1px, transparent 1px 10%),
    repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 2.5%);
  background-size: 8px 100%, 4px 100%;
  background-position: right top, right top;
  background-repeat: no-repeat;
}
.seruler-num { position: absolute; opacity: .75; }
.seruler-top .seruler-num { top: 0; transform: translateX(-50%); }
.seruler-left .seruler-num { left: 0; transform: translateY(-50%); }
#seSlide { grid-column: 2; grid-row: 2; min-width: 0; }
/* 画布自成层叠上下文：里面的选中框（z 9999）、参考线（999）再大也盖不到弹层上 ——
   以前在编辑器里开公式 / 手写 / 试看弹层时，蓝色选中框会浮在弹层前面。 */
#seSlide .sl { isolation: isolate; }
/* 关掉标尺时收成一格，画布不跑位 */
body.noruler .seruler, body.noruler .seruler-corner { display: none; }
body.noruler .sefit { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
body.noruler #seSlide { grid-column: 1; grid-row: 1; }
/* 网格：垫在块下面，只做参考 */
body.showgrid #seSlide .sl::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    repeating-linear-gradient(to right, rgba(47, 107, 255, .12) 0 1px, transparent 1px 2.5%),
    repeating-linear-gradient(to bottom, rgba(47, 107, 255, .12) 0 1px, transparent 1px 5.5%);
}
.sehint { padding: 0 12px 10px; font-size: 11.5px; color: var(--text-3); text-align: center; }

/* 画布里的块：选中描边、文字块可双击、拖动时别选中文字 */
#seSlide .sl { background: #fff; box-shadow: var(--shadow); }
#seSlide .sl-b { cursor: move; outline: 1px dashed transparent; }
#seSlide .sl-b:hover { outline-color: rgba(47, 107, 255, .35); }
/* 选中态不再用 outline（块自带 clip / 透明 / 层级时会被吃掉，出现「有的有框有的没有」），
   统一由 .seframe 覆盖层画框 + 八个缩放手柄 */
#seSlide .sl-b.sel { outline: none; }

.seframe {
  position: absolute; z-index: 9999; pointer-events: none;
  border: 2px solid var(--primary); border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .6) inset;
}
.seframe i {
  position: absolute; width: 9px; height: 9px; background: #fff;
  border: 2px solid var(--primary); border-radius: 2px;
  pointer-events: auto; transform: translate(-50%, -50%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.seframe i:hover { background: var(--primary); }
.seframe i[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.seframe i[data-h="n"] { left: 50%; top: 0; cursor: ns-resize; }
.seframe i[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.seframe i[data-h="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.seframe i[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.seframe i[data-h="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.seframe i[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.seframe i[data-h="w"] { left: 0; top: 50%; cursor: ew-resize; }
#seSlide .sl-b.editing { cursor: text; outline: 2px solid #16a34a; }
#seSlide .sl-b.editing audio, #seSlide .sl-b.editing video { pointer-events: none; }
/* 图片/视频块：按块的宽高铺满（编辑器拖手柄时宽高等比变化，所以不会拉变形）；
   文字块里内嵌的小图不受影响（选择器限定 > 直接子元素 + 素材类块） */
.sl-b.sl-image > img, .sl-b.sl-video > video {
  width: 100%; height: 100%; object-fit: fill; display: block;
}
/* 编辑器里的素材**不吃指针事件**：视频/音频自带播放控件，几乎铺满整块，
   点上去会被播放器吃掉 —— 块选不中、也就拖不动（点别处取消选中后再也点不回来）。
   选中/拖动一律落在块上；要播放用检查器「▶ 试看」或双击块，在弹层里看/听。 */
#seSlide .sl-b > img,
#seSlide .sl-b > video,
#seSlide .sl-b > audio { pointer-events: none; -webkit-user-drag: none; }
#seSlide .sl-video { background: #000; }
/* 缩放手柄给所有块：文字块也要能拖宽/拖高来对齐（素材块是等比，文字块自由改）。
   `.media` 只用来区分「等比」还是「自由」，不再决定有没有手柄。 */
.sealign { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); }
.sealign-h { font-size: 12px; font-weight: 650; color: var(--text-2); margin-bottom: 8px; }
/* 等宽四列：别让按钮按文字长度自己撑，四行高度一致才对得齐 */
.sealign-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sealign-grid.v3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; }
.sealign-grid .btn {
  width: 100%; padding: 0 4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; justify-content: center;
}

/* 素材试看/试听弹层（编辑器里不跟上课抢播放器，单独开一个） */
.se-media-dlg { width: min(1040px, 94vw); display: flex; flex-direction: column; }
.se-media-dlg .dialog-head h2 { margin-right: 10px; white-space: nowrap; }
.se-media-dlg .dialog-head .hint { flex: 0 1 auto; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 56%;
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.se-media-body { padding: 14px 18px 18px; display: flex; align-items: center;
  justify-content: center; min-height: 0; overflow: auto; }
.se-media-body video, .se-media-body img {
  max-width: 100%; max-height: 68vh; border-radius: 8px; display: block;
}
.se-media-body img { object-fit: contain; }
.se-media-body audio { width: 100%; }

.seinsp {
  border-left: 1px solid var(--border); background: var(--surface);
  overflow-y: auto; overflow-x: hidden; padding: 12px; min-height: 0;
}
.seinsp-sec + .seinsp-sec { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.seinsp-h { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.sefield { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.sefield > span { flex: 0 0 56px; }
.sefield input[type="range"] { flex: 1; min-width: 0; }
.sefield input[type="color"] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; }
.sefield .input, .sefield .select { flex: 1; min-width: 88px; height: var(--ctl-h); }
.sefield .select { font-size: 12.5px; }
.se-val { flex: 0 0 34px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
/* 位置/尺寸那几个数字框：列宽用 minmax(0,1fr)，窄面板下自动缩，
   否则会把属性栏顶出横向滚动条（输入框自带 min-width） */
.segrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.segrid .sefield .input { min-width: 0; }
.segrid .sefield { flex-direction: column; align-items: stretch; gap: 3px; }
.segrid .sefield > span { flex: none; }

@media (max-width: 1100px) {
  .semain { grid-template-columns: 128px minmax(0, 1fr) 230px; }
  .se-title { width: 180px; }
}

/* 幻灯片上课：画布不留白，整页铺开（宽高由 .ls-slidewrap 按 16:9 算） */
.ls-cw-doc {
  padding: 0 !important; width: 100% !important; background: transparent;
  box-shadow: none; height: 100%; display: flex; align-items: center; justify-content: center;
}

/* ══════════ 素材库：版本 → 学科 → 年级 → 学期 的层级条 ══════════════
   素材是「哪个版本的哪一科哪一册」组织的：先缩到一册，再看这一册里
   有哪些教材 / 教辅 / 课件。四个下拉排成一条，箭头表示往下收。 */
.hier {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.hier-lbl { font-size: 12px; color: var(--text-3); }
.hier-arrow { color: var(--text-3); font-size: 14px; }
.hier-sum {
  margin-left: 6px; font-size: 12px; color: var(--primary);
  background: var(--primary-soft); padding: 3px 9px; border-radius: 999px;
}
.hier-sum:empty { display: none; }

/* 编辑器：缩略图大一点，白底 + 细边框，才看得出是「一页」 */
.semain { grid-template-columns: 196px minmax(0, 1fr) 312px; }
.sethumb { background: #fff; box-shadow: inset 0 0 0 1px var(--border); }
.sethumb.on { box-shadow: none; }
@media (max-width: 1100px) {
  .semain { grid-template-columns: 132px minmax(0, 1fr) 268px; }
  .segrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ══════════ 列表分组（讲次 / 素材库）：年级 · 学科 · 版本 ══════════
   一屏里先看到「这是哪一册的」，再往下才是具体的讲次/材料。
   分组头要明显压住下面的行，但不能像另一个表格。 */
.grprow td {
  background: var(--surface-2) !important;
  border-top: 1px solid var(--border);
  padding: 7px 12px !important;
  font-size: 12.5px;
}
.grp-g { font-size: 13.5px; font-weight: 750; color: var(--text); }
.grp-g::before { content: '▸ '; color: var(--primary); font-weight: 700; }
.grp-s { margin-left: 8px; color: var(--text-2); }
.grprow .badge { margin-left: 8px; }
.grp-n { float: right; color: var(--text-3); font-size: 11.5px; }

/* ══════════ 公式编辑器 v2（公用组件 assets/formula.js）══════════════
   三栏：分类 → 符号网格 → 输入 / 模板 / 手写。符号按钮用 KaTeX 画出来，
   比显示 \frac{}{} 这种源码好认；网格一行能放十几个，比一页只显示一类好用。 */
.fx2-dlg { width: min(1120px, 97vw); height: min(700px, 92vh); display: flex; flex-direction: column; }
.fx2-dlg .dialog-head { gap: 10px; }
.fx2-dlg .dialog-head h2 { white-space: nowrap; }
.fx2-search { width: 250px; height: 30px; flex: none; }
.fx2-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 98px minmax(0, 1fr) 384px; }
.fx2-rail {
  overflow: auto; padding: 8px 6px; border-right: 1px solid var(--border);
  background: var(--surface-2);
}
.fx2-cat {
  display: block; width: 100%; height: 30px; margin-bottom: 4px; padding: 0 8px;
  border-radius: 8px; border: 1px solid transparent; background: none;
  color: var(--text-2); font: inherit; font-size: 12.5px; text-align: left;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fx2-cat:hover { background: var(--surface); color: var(--text); }
.fx2-cat.on {
  background: var(--primary-soft); color: var(--primary); font-weight: 650;
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}
.fx2-railsep { height: 1px; margin: 8px 4px; background: var(--border); }
.fx2-mid { display: flex; flex-direction: column; min-height: 0; }
.fx2-midh {
  padding: 9px 12px 6px; font-size: 12px; color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.fx2-grid {
  flex: 1; overflow: auto; padding: 10px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px; align-content: start;
}
.fx2-it {
  min-height: 46px; padding: 4px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.fx2-it:hover { border-color: var(--primary); background: var(--primary-soft); }
.fx2-it .katex { font-size: 1em; }
.fx2-grid.fx2-chips { display: flex; flex-direction: column; gap: 6px; }
.fx2-chips .fx2-it {
  min-height: 38px; justify-content: flex-start; padding: 6px 12px; overflow-x: auto;
}
.fx2-right { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); }
.fx2-rtabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--border); }
.fx2-rtab {
  height: 28px; padding: 0 12px; border: 1px solid transparent; border-bottom: 0;
  border-radius: 8px 8px 0 0; background: none; color: var(--text-2);
  font: inherit; font-size: 12.5px; cursor: pointer;
}
.fx2-rtab.on { background: var(--surface); color: var(--primary); font-weight: 650; }
.fx2-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; }
.fx2-pane[hidden] { display: none; }
.fx2-ta {
  height: 118px; resize: vertical; font-family: ui-monospace, Consolas, Menlo, monospace;
  font-size: 13px; line-height: 1.6;
}
.fx2-pvbar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.fx2-chk { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.fx2-pv {
  flex: 1; min-height: 88px; overflow: auto; padding: 14px;
  border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2);
  font-size: 20px; display: flex; align-items: center; justify-content: center;
}
.fx2-tpl { flex: 1; overflow: auto; }
.fx2-tplg { font-size: 11.5px; color: var(--text-3); margin: 8px 0 4px; }
.fx2-tplb {
  display: block; width: 100%; text-align: left; padding: 6px 8px; margin-bottom: 4px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; color: var(--text);
}
.fx2-tplb:hover { border-color: var(--primary); background: var(--primary-soft); }
.fx2-tplt { display: block; font-size: 12px; }
.fx2-tplx { display: block; font-size: 14px; color: var(--text-2); overflow: hidden; }
.fx2-inkbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fx2-cv, .ink-cv {
  width: 100%; aspect-ratio: 1000 / 520; background: #fff;
  border: 1px dashed var(--border); border-radius: 10px;
  touch-action: none; cursor: crosshair;
}
.fx2-inkfoot { display: flex; gap: 6px; flex-wrap: wrap; }
.ink-dot {
  width: 20px; height: 20px; border-radius: 50%; padding: 0;
  border: 2px solid transparent; cursor: pointer;
}
.ink-dot.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.ink-w { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.ink-w input { width: 76px; }
.ink-sep { width: 1px; height: 18px; background: var(--border); }
.ink-dlg { width: min(880px, 94vw); display: flex; flex-direction: column; }
.ink-body { padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.ink-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 940px) {
  .fx2-body { grid-template-columns: 84px minmax(0, 1fr); }
  .fx2-right {
    grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border);
    max-height: 46vh;
  }
}

/* 更多进入动画（编辑器里每块可选）
   做法统一：.ls-off 是「没出现时」的初始状态，去掉这个类就靠 transition 回到正常，
   所以不需要写 keyframes，编辑器里点一下也能立刻看到。 */
.sl-b.anim-down.ls-off { transform: translateY(-18px); }
.sl-b.anim-shrink.ls-off { transform: scale(1.14); }
.sl-b.anim-wipe-up { clip-path: inset(0 0 0 0); }
.sl-b.anim-wipe-up.ls-off { clip-path: inset(100% 0 0 0); opacity: 1; }
.sl-b.anim-spin.ls-off { transform: rotate(-150deg) scale(.55); }
.sl-b.anim-flip.ls-off { transform: perspective(900px) rotateY(-72deg); }
.sl-b.anim-skew.ls-off { transform: skewX(-16deg) translateX(-22px); }
.sl-b.anim-blur.ls-off { filter: blur(9px); }
.sl-b.anim-pulse.ls-off { transform: scale(.55); }
.sl-b.anim-swing.ls-off { transform: rotate(-7deg) translateY(8px); }
/* 带回弹的几个：只改缓动曲线，就有「弹一下 / 晃一下」的观感 */
.sl-b.anim-bounce { transition-timing-function: cubic-bezier(.34, 1.56, .64, 1); transition-duration: .55s; }
.sl-b.anim-bounce.ls-off { transform: translateY(-46px) scale(.96); }
.sl-b.anim-drop { transition-timing-function: cubic-bezier(.34, 1.4, .64, 1); transition-duration: .5s; }
.sl-b.anim-drop.ls-off { transform: translateY(-70px); }
.sl-b.anim-swing { transition-timing-function: cubic-bezier(.36, 1.5, .5, 1); transition-duration: .6s; }
.sl-b.anim-left.ls-off { transform: translateX(-28px); }
.sl-b.anim-right.ls-off { transform: translateX(28px); }
.sl-b.anim-rotate.ls-off { transform: rotate(-6deg) scale(.96); }

/* ══════════ 页面转场（PPT 的「切换效果」）════════════════════════════
   换页时给 .ls-slidewrap 加一个 tr-* 类，播一次就够（不循环、不挡住交互）。 */
.ls-slidewrap.tr-fade { animation: lsTrFade .34s ease both; }
.ls-slidewrap.tr-push { animation: lsTrPush .38s cubic-bezier(.2,.7,.3,1) both; }
.ls-slidewrap.tr-cover { animation: lsTrCover .38s ease both; }
.ls-slidewrap.tr-zoom { animation: lsTrZoom .4s ease both; }
.ls-slidewrap.tr-flip { animation: lsTrFlip .45s ease both; transform-origin: 50% 50%; }
.ls-slidewrap.tr-wipe { animation: lsTrWipe .4s ease both; }
.ls-slidewrap.tr-circle { animation: lsTrCircle .5s ease both; }

@keyframes lsTrFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lsTrPush { from { transform: translateX(22%); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes lsTrCover { from { transform: translateY(16%); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes lsTrZoom { from { transform: scale(.93); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes lsTrWipe { from { clip-path: inset(0 100% 0 0); opacity: .9; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes lsTrCircle {
  from { clip-path: circle(0% at 50% 50%); opacity: .8; }
  to { clip-path: circle(75% at 50% 50%); opacity: 1; }
}
@keyframes lsTrFlip {
  from { transform: perspective(1200px) rotateY(-14deg) scale(.97); opacity: .35; }
  to { transform: none; opacity: 1; }
}

/* 讲课备注：只在老师这屏显示，靠下不挡正文 */
.ls-notes {
  position: fixed; left: 18px; right: 18px; bottom: 92px; z-index: 30;
  max-height: 32vh; overflow: auto; padding: 12px 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); font-size: 14px; line-height: 1.7; color: var(--text-2);
  backdrop-filter: blur(8px);
}
.ls-notes b { color: var(--text); }

/* 本讲教辅：整屏弹层（左列表 / 右预览）。教室里要看得清，所以不用小抽屉 */
.ls-aux {
  position: fixed; inset: 0; z-index: 120; padding: 30px;
  background: rgba(12, 20, 32, .44); display: flex;
  align-items: center; justify-content: center;
}
.ls-aux[hidden] { display: none; }
.ls-aux-card {
  width: min(1180px, 100%); height: min(86vh, 920px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg);
}
.ls-aux-h {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.ls-aux-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.ls-aux-main.solo { grid-template-columns: minmax(0, 1fr); }
.ls-aux-list {
  border-right: 1px solid var(--border); overflow: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.ls-aux-i {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  background: var(--surface); transition: border-color .15s, background .15s;
}
.ls-aux-i:hover { border-color: var(--primary); background: var(--surface-2); }
.ls-aux-it { flex: 1; min-width: 0; }
.ls-aux-t {
  font-weight: 600; font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ls-aux-go { flex: 0 0 auto; color: var(--primary); font-size: 12px; }
.ls-aux-view { display: flex; flex-direction: column; min-height: 0; }
.ls-aux-vh {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.ls-aux-vt { font-weight: 650; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-aux-body { flex: 1; min-height: 0; overflow: auto; background: var(--surface-3); }
.ls-aux-pdf { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.ls-aux-doc { padding: 14px; display: grid; gap: 14px; }
.ls-aux-doc .sl { box-shadow: var(--shadow); background: #fff; }
.ls-aux-text { padding: 18px 22px; background: var(--surface); font-size: 14px; line-height: 1.8; }
.ls-aux-text hr { border: 0; border-top: 1px dashed var(--border); margin: 16px 0; }

/* 编辑器里预览页面转场（同一套 keyframes，加在画布容器上） */
#seSlide.tr-fade { animation: lsTrFade .34s ease both; }
#seSlide.tr-push { animation: lsTrPush .38s cubic-bezier(.2,.7,.3,1) both; }
#seSlide.tr-cover { animation: lsTrCover .38s ease both; }
#seSlide.tr-zoom { animation: lsTrZoom .4s ease both; }
#seSlide.tr-flip { animation: lsTrFlip .45s ease both; }
#seSlide.tr-wipe { animation: lsTrWipe .4s ease both; }
#seSlide.tr-circle { animation: lsTrCircle .5s ease both; }

/* 公式块在右侧面板里的预览 */
.fx-mini {
  flex: 1; min-width: 0; padding: 8px; border-radius: 8px;
  background: var(--surface-2); border: 1px dashed var(--border);
  font-size: 18px; overflow: auto; text-align: center;
}

/* 分组头里的学期：和版本徽标区分开（学期是「这册的上/下册」） */
.grprow .badge.grp-term {
  background: var(--primary-soft); color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

/* 公式弹窗标题和说明别贴在一起 */
.fx-dlg .dialog-head h2 { white-space: nowrap; }
.fx-dlg .dialog-head .hint { margin-left: 10px; }

/* 公式块预览别把右栏撑出横向滚动条 */
.fx-mini .sl-ink { height: auto; max-height: 90px; }
.fx-mini .katex-display { margin: 0; }
.fx-mini .katex { font-size: .92em; }
