/* 网页版全局样式：移动端优先，观感对齐小程序端的改版（浅底 + 白卡 + 单一主色） */
:root {
  --bg: #f6f5fb;
  --card: #ffffff;
  --card2: #f7f6fc;
  --line: #eae8f3;
  --text: #1f2329;
  --sub: #6b7280;
  /* 12px 辅助文字（"第 8 周""点开看每一条"）原来用 #a3a9b2，对白底只有
     2.3:1，投屏和户外光线下基本看不见。提到 #6b7482（4.7:1）后仍比正文淡
     一档，但达到 WCAG AA 对正文的要求。 */
  --faint: #6b7482;
  --main: #6c5ce7;
  --ok: #12a150;
  --warn: #d9821b;
  --bad: #e34d59;
  /* 状态色的「文字专用」深一档。原色（--ok/--warn/--bad）留给图形——
     进度条、边框、色块、胶囊底；一旦拿来当 11~13px 的**小字**颜色，
     对白底只有 2.9~3.8:1，投屏和户外光线下看不清（AA 要求 4.5:1）。
     这三个深色版全部 ≥4.5:1，其中 ok/bad 与 .pill.ok/.pill.bad 已用的
     文字色一致（等于把那次只改了胶囊的修复推广到全站）。 */
  --ok-text: #0f7a3d;   /* 5.4:1 */
  --warn-text: #a85e00; /* 4.9:1 */
  --bad-text: #b02a37;  /* 6.5:1 */
  --radius: 14px;
  /* 内容外壳宽度。手机/网页共用同一套样式，只有这个变量随屏宽变化：
     手机上 720px 本来就吃不满，等于不生效；桌面由下面的媒体查询放宽。
     抽成变量是为了让「顶栏右侧按钮」也能跟正文左边缘对齐——顶栏原来是
     通栏的，内容居中后装饰线和按钮会甩到屏幕两端，看着像两个无关的界面。 */
  --shell: 720px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  padding: 0 0 env(safe-area-inset-bottom);
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 加载态：首屏和每次切页（动态 import 期间）都会看到它。弱网下这就是
   用户对产品的第一印象——一行裸文字像"卡住了"，换成品牌标记 + 轻微
   脉冲，既好看也传达"在干活"。图形用内联 data-URI 的 SVG（和 favicon
   同一款紫色圆角音符），不额外发请求，离线也能显示。 */
.boot {
  min-height: 68vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  padding: 40px 20px; text-align: center; color: var(--faint); font-size: 14px;
}
.boot::before {
  content: '';
  width: 58px; height: 58px; border-radius: 18px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%236c5ce7'/%3E%3Ctext x='16' y='23' font-size='18' text-anchor='middle' fill='%23ffffff'%3E%E2%99%AA%3C/text%3E%3C/svg%3E")
    center / contain no-repeat;
  box-shadow: 0 10px 24px rgba(40,26,110,.24);
}
@media (prefers-reduced-motion: no-preference) {
  .boot::before { animation: boot-pulse 1.5s ease-in-out infinite alternate; }
}
@keyframes boot-pulse {
  from { transform: scale(1); opacity: 1; }
  to   { transform: scale(1.07); opacity: .82; }
}

/* ---- 布局 ---- */
.page { padding: 14px 14px 40px; max-width: var(--shell); margin: 0 auto; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }

/* ---- 板块切换（视唱练耳 / 乐理）----
   放在 sticky 顶栏的第二行：选哪块始终可见，不会被作业列表滚走。
   .tbar 默认是「名字 + 退出」一行，加 .tbar--board 后改成纵向，
   第一行仍是名字 + 退出，第二行才是板块条。 */
.tbar--board { flex-direction: column; align-items: stretch; gap: 10px; }
.tbar--board .tbar-row { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.boardbar { display: flex; gap: 8px; width: 100%; }
.board-opt {
  flex: 1; text-align: center; padding: 9px 0; border-radius: 10px;
  background: var(--card2); color: var(--sub);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line);
}
.board-opt.on { background: var(--main); color: #fff; border-color: var(--main); }

/* ---- 板块选择页：整屏两个大按钮（学生端 / 教师端共用，见 utils/portal.js） ----
   用户 2026-11-05：「整一个画面只有两个按钮」「美观我都说累了，字的比例太丑」。

   【上一版为什么丑】两块高饱和渐变铺满 600px 高的整卡，图标 + 文字缩在正中间
   一小团：21px 标题配 12.5px 副标，压在 443px 宽的色块上，字太小、空太多，
   整屏像两张没做完的海报。

   【这一版的思路】把颜色收回到「图标 + 顶端淡染」两处，卡面还是白卡（和全站
   一致），字号按卡片实际尺寸放大（标题 24px / 副标 13.5px，手机上 17/12），
   再用一张 4.5% 透明度的大水印把下半部分的空白填住——不抢字，但不再空。
   配色只用 --main 的紫和一个偏灰的蓝，两个并排放不会互相打架。 */
.portal {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 18px calc(18px + env(safe-area-inset-bottom));
  background: var(--bg);
}
.portal-top {
  width: 100%; max-width: 880px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; padding: 18px 2px 20px;
}
.portal-id { min-width: 0; }
.portal-hello { font-size: 17px; font-weight: 600; letter-spacing: .2px; line-height: 1.35; }
.portal-id .acct-mail { margin-top: 3px; }
.portal-cards {
  width: 100%; max-width: 880px;
  /* 【为什么不写 flex:1】上一版让两张卡吃掉全部剩余高度，iPad 竖屏上算出来
     1074px 高——76px 的图标和 24px 的标题浮在正中间，上下各 400 多 px 空白，
     就是用户说的"字小、空多"。现在给一个上限（520px，矮屏按 62vh 收），
     整组用 auto 外边距在页面里垂直居中：屏幕再高，卡片也不会变成空房间。 */
  flex: 0 1 auto;
  height: min(560px, 60vh);
  min-height: 280px;
  margin: auto 0;
  display: flex; gap: 16px;
  padding-bottom: 6px;
}
.portal-card {
  position: relative; overflow: hidden;
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 32px 20px;
  border-radius: 26px;
  color: var(--text); cursor: pointer; text-align: center; font-family: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
/* 顶端淡染 + 白底：有颜色，但不是一整块色砖 */
.portal-card.ear {
  border: 1px solid #e6e1ff;
  background: linear-gradient(180deg, #f2eeff 0%, #fff 58%);
  box-shadow: 0 10px 30px rgba(72, 56, 168, .07);
}
.portal-card.theory {
  border: 1px solid #dceaf9;
  background: linear-gradient(180deg, #eaf3fd 0%, #fff 58%);
  box-shadow: 0 10px 30px rgba(46, 96, 160, .07);
}
.portal-card:hover { transform: translateY(-3px); }
.portal-card.ear:hover { border-color: #cfc6ff; box-shadow: 0 18px 38px rgba(72, 56, 168, .14); }
.portal-card.theory:hover { border-color: #b9d8f7; box-shadow: 0 18px 38px rgba(46, 96, 160, .14); }
.portal-card:active { transform: translateY(-1px) scale(.995); }

.portal-ic {
  position: relative; z-index: 1;
  width: 80px; height: 80px; border-radius: 25px;
  display: grid; place-items: center;
}
.portal-card.ear .portal-ic { background: #e6e0ff; color: #5b4bd6; }
.portal-card.theory .portal-ic { background: #dcecfe; color: #2f7fe0; }
.portal-ic svg { width: 38px; height: 38px; }

.portal-txt { position: relative; z-index: 1; }
.portal-txt b {
  display: block;
  font-size: 26px; font-weight: 600; line-height: 1.35; letter-spacing: .5px;
}
.portal-sub {
  display: block; margin-top: 9px;
  font-size: 14px; letter-spacing: .4px; color: var(--sub);
}

/* 右下角的大水印：填住下半部分的空白。4.5% 的黑，只在白底上隐约可见 */
.portal-wm {
  position: absolute; right: -26px; bottom: -30px;
  width: 190px; height: 190px;
  color: var(--text); opacity: .045;
  pointer-events: none;
}
.portal-wm svg { width: 100%; height: 100%; }

/* ---- 乐理板块（内测 / 即将上线）----
   原来这一屏是「标题 + 一段灰字 + 一个占满整行宽的按钮」：宽屏上正文一行
   要拉到 1000px，读完一行眼睛得回扫；按钮比正文还宽，像张没收尾的表单。
   现在收成一张 620 的窄卡居中——图标 + 标题 + 状态胶囊一行，正文限宽、
   行高放宽；返回降级成文字链（顶栏本来就有 ‹，这里只是给个看得懂的出口）。 */
.theory-page { max-width: 620px; }
.theory-card { padding: 22px 22px 18px; }
.theory-head { display: flex; align-items: center; gap: 13px; }
.theory-ic {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: #eef0f5; color: #8d94a3;
}
.theory-ic.on { background: #e6e0ff; color: #5b4bd6; }
.theory-ic svg { width: 23px; height: 23px; }
.theory-h {
  flex: 1; min-width: 0;
  font-size: 19px; font-weight: 700; letter-spacing: .2px;
}
.theory-pill {
  flex: none; padding: 5px 11px; border-radius: 999px;
  background: #eff1f5; color: var(--sub);
  font-size: 12px; font-weight: 600;
}
.theory-pill.on { background: #ede8ff; color: #5b4bd6; }
.theory-body {
  margin: 15px 0 0; font-size: 14.5px; line-height: 1.85; color: var(--text);
}
.theory-note {
  margin-top: 12px; padding: 10px 13px; border-radius: 10px;
  background: var(--card2); border-left: 3px solid #ded8f7;
  font-size: 13px; line-height: 1.7; color: var(--sub);
}
/* 返回做成文字链：低调，但要是能认出来的可点项。
   必须写成 .linklike.theory-back —— .linklike 的规则在后面（全局按钮区），
   同优先级会把它压回灰色，点了像没反应。 */
.linklike.theory-back { margin-top: 14px; padding: 6px 0; font-size: 13px; color: var(--main); }

/* 手机上再收一点：卡片内边距和标题字号跟着掉，避免 390px 下两边太挤 */
@media (max-width: 560px) {
  .theory-card { padding: 18px 16px 14px; }
  .theory-h { font-size: 17px; }
  .theory-body { font-size: 14px; line-height: 1.8; margin-top: 13px; }
}

/* ==================== 乐理知识点图谱（教师端） ====================
 * 三层下钻：板块列表 → 小节 + 知识点胶囊 → 知识点详情（带关联）。
 * 不画关系网：一百多个点在手机上点不中，投影上也看不清；
 * 每一步只给一个明确目标，走错了点面包屑就退回去。 */
/* 宽屏上别让卡片横着拉满：.page 在桌面的外壳宽度比手机宽得多，
   一张只有五个胶囊的卡片铺到 1000px，内容全挤在左边，右边空得像没加载完。
   620 是详情页的舒服宽度，图谱列表两列各 420 也正好。 */
.theory-graph { max-width: 860px; padding-top: 16px; }

.tg-lead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 2px 12px; }
.tg-lead b { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.tg-lead span { font-size: 12px; color: var(--faint); }

.tg-boards { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .tg-boards { grid-template-columns: 1fr 1fr; } }

.tg-board {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 15px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(31, 35, 41, .04), 0 4px 14px rgba(93, 79, 197, .06);
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
@media (hover: hover) {
  .tg-board:hover { transform: translateY(-2px); border-color: #d6cffa; box-shadow: 0 10px 24px rgba(72, 56, 168, .12); }
}
.tg-board:active { transform: scale(.99); }
/* 序号用等宽数字：07 和 12 宽度一样，左边那一列才齐 */
.tg-no {
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: #ece8fd; color: #5b4bd6;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tg-btxt { flex: 1; min-width: 0; }
.tg-btxt b { display: block; font-size: 15.5px; font-weight: 600; margin-bottom: 3px; }
/* 描述给两行：一行时"音的四要素、音名唱名、五线谱、音符与休止符、…"这种
   截断会把最关键的后半段吃掉，老师看不出这个板块到底装了什么 */
.tg-btxt i {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: normal; font-size: 12.5px; line-height: 1.55; color: var(--sub);
}
.tg-bn { flex: none; align-self: flex-start; margin-top: 2px; font-size: 11.5px; color: var(--faint); }

.tg-crumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 2px 12px; font-size: 12.5px; color: var(--faint); }
.tg-crumb b { color: var(--text); font-weight: 600; }
.tg-cr { background: none; border: none; padding: 2px 0; font-size: 12.5px; color: var(--main); cursor: pointer; }

.tg-sec { padding: 14px 15px 13px; }
.tg-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.tg-sec-h b { font-size: 14px; font-weight: 600; }
.tg-sec-h span { font-size: 11.5px; color: var(--faint); }

.tg-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tg-chip {
  padding: 7px 11px; border-radius: 9px; cursor: pointer;
  background: var(--card2); border: 1px solid var(--line);
  font-size: 13px; color: var(--text);
  transition: background .14s, border-color .14s, color .14s;
}
@media (hover: hover) {
  .tg-chip:hover { background: #fff; border-color: #cfc6ff; color: var(--main); }
}
.tg-chip:active { transform: scale(.97); }
/* 关联胶囊：右上角标出它属于哪个板块，避免"点了跳到别处"的错愕 */
.tg-chip.rel { display: inline-flex; align-items: baseline; gap: 6px; background: #f6f4ff; border-color: #e2dcff; }
.tg-chip.rel i { font-style: normal; font-size: 10.5px; color: #8d84b8; }

.tg-detail { padding: 20px 20px 18px; }
.tg-dt-k { font-size: 11.5px; color: var(--faint); letter-spacing: .3px; }
.tg-dt-h { margin: 6px 0 10px; font-size: 22px; font-weight: 700; letter-spacing: .2px; }
.tg-dt-p { margin: 0; font-size: 15px; line-height: 1.85; color: var(--text); }
.tg-rel-h {
  margin: 18px 0 9px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--sub);
}

/* ---- 列表 / 地图 开关（和标题、面包屑同一行）---- */
.tg-toprow { display: flex; align-items: center; gap: 12px; margin: 0 2px 12px; }
.tg-toprow .tg-lead, .tg-toprow .tg-crumb { margin: 0; flex: 1; min-width: 0; }
.tg-view {
  flex: none; display: flex; gap: 2px; padding: 3px;
  background: #efedf8; border-radius: 10px;
}
.tg-view button {
  border: none; background: none; cursor: pointer;
  padding: 5px 12px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; color: var(--sub);
  transition: background .14s, color .14s;
}
.tg-view button.on {
  background: #fff; color: var(--main); font-weight: 600;
  box-shadow: 0 1px 3px rgba(60, 40, 140, .12);
}

/* ---- 地图（横向发散导图）----
   宽度给到 1120：地图本来就是"摊开看"的东西，和列表页的 860 不是一个用途。
   高度固定在一个视口内的比例，超出的部分就地滚动，页面本身不要跟着滚——
   否则展开一次，整页高度跳一下，人会失去位置感。 */
.theory-graph.is-map { max-width: 1120px; }
.tg-maplead { flex: 1; min-width: 0; font-size: 12px; color: var(--faint); }
.tg-mapwrap { position: relative; }
.tg-mapbox {
  background: var(--card); border-radius: 16px; padding: 18px 28px 18px 18px;
  box-shadow: 0 1px 2px rgba(31, 35, 41, .04), 0 4px 14px rgba(93, 79, 197, .06);
  height: min(62vh, 580px); min-height: 320px;
  overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.tg-svg { display: block; }

/* 连线用很浅的紫，只负责"这是从哪来的"，不抢节点 */
.tg-links path { fill: none; stroke: #e4dffb; stroke-width: 1.6; }

.tg-mn { cursor: pointer; }
.tg-mn rect { transition: fill .14s, stroke .14s; }
.tg-mn text { font-weight: 500; }
.tg-mn.root rect { fill: #6c5ce7; }
.tg-mn.root text { fill: #fff; font-size: 14px; font-weight: 700; }
.tg-mn.board rect { fill: #fff; stroke: #ddd6fe; stroke-width: 1.5; }
.tg-mn.board text { fill: var(--text); font-size: 13.5px; font-weight: 600; }
.tg-mn.section rect { fill: #f6f4ff; stroke: #e6e0ff; stroke-width: 1.2; }
.tg-mn.section text { fill: #4b3fbf; font-size: 12.5px; }
.tg-mn.node rect { fill: #fff; stroke: var(--line); stroke-width: 1.2; }
.tg-mn.node text { fill: var(--text); font-size: 12px; }
/* 右格：折叠时是数量，展开时是「−」，两态都在同一格，展开不会让整列抖 */
.tg-mn-slot { fill: #a9a2c9; font-size: 10.5px; font-weight: 600; }
.tg-mn.is-open rect { stroke: #6c5ce7; stroke-width: 1.8; }
.tg-mn.is-sel rect { fill: #6c5ce7; stroke: #6c5ce7; }
.tg-mn.is-sel text { fill: #fff; }
.tg-mn.is-sel .tg-mn-slot { fill: #fff; }
@media (hover: hover) {
  .tg-mn:hover rect { stroke: #6c5ce7; }
}

.tg-mapctl {
  position: absolute; top: 12px; right: 18px; z-index: 3;
  display: flex; gap: 6px;
}
.tg-mapctl button {
  min-width: 32px; height: 30px; padding: 0 8px; cursor: pointer;
  border-radius: 9px; background: rgba(255, 255, 255, .94); border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(60, 40, 140, .12);
  font-size: 15px; line-height: 1; color: var(--sub);
}
.tg-mapctl button[data-mapz="fit"] { font-size: 11px; letter-spacing: .2px; }
.tg-mapctl button:active { transform: scale(.95); }

/* 内容比卡片高时，上下压一道白渐变，暗示"还能滚"；
   否则边缘那个被切一半的胶囊看起来像没画完。 */
.tg-mapwrap.has-scroll::before,
.tg-mapwrap.has-scroll::after {
  content: ''; position: absolute; left: 1px; right: 1px; height: 22px;
  pointer-events: none; z-index: 2;
}
.tg-mapwrap.has-scroll::before {
  top: 1px; border-radius: 16px 16px 0 0;
  background: linear-gradient(#fff, rgba(255, 255, 255, 0));
}
.tg-mapwrap.has-scroll::after {
  bottom: 1px; border-radius: 0 0 16px 16px;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff);
}

.tg-mapdetail { margin-top: 12px; padding: 18px 20px 16px; }
.tg-mapempty {
  margin-top: 12px; padding: 15px 16px; border-radius: 14px;
  border: 1px dashed #e2dcff; background: rgba(255, 255, 255, .65);
  font-size: 12.5px; color: var(--faint);
}

@media (max-width: 560px) {
  .tg-board { padding: 12px 13px; gap: 10px; }
  .tg-no { width: 34px; height: 34px; border-radius: 10px; }
  .tg-detail { padding: 17px 16px 15px; }
  .tg-dt-h { font-size: 19px; }
  .tg-dt-p { font-size: 14.5px; }

  /* 手机上「列表 / 地图」和说明挤在一行会折成一团，改成上下两行；
     折下去之后靠右，和标题左对齐形成一左一右，不要吊在左下角 */
  .tg-toprow { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
  .tg-toprow .tg-lead, .tg-toprow .tg-crumb { flex: 1 0 100%; }
  .tg-toprow .tg-view { margin-left: auto; }
  .tg-maplead { flex: 1 0 100%; font-size: 11.5px; line-height: 1.5; }
  .tg-mapbox { height: 58vh; min-height: 300px; padding: 12px 22px 12px 12px; }
  .tg-mapctl { top: 9px; right: 13px; gap: 5px; }
  .tg-mapctl button { min-width: 30px; height: 28px; padding: 0 7px; border-radius: 8px; font-size: 14px; }
  .tg-mapctl button[data-mapz="fit"] { font-size: 10.5px; }
  .tg-mapdetail { padding: 15px 15px 13px; }
}

/* 手机（竖屏窄屏）：两张卡**上下竖排**。
   2026-11-05 用户：「手机版两个按钮是纵向的」。
   【为什么不是把两张横卡直接转成竖卡】试过：整宽 + 半屏高，图标和标题被
   justify-content:center 顶在正中间，上下各留一大片白，比横排还空。
   现在改成「整宽的按钮列表」——图标在左、文字紧挨着、右侧一个箭头，
   单卡约 120px 高，整组在页面里垂直居中。既满足"纵向两个大按钮"，
   也不再是两块空荡荡的色块。 */
@media (max-width: 560px) {
  .portal { padding: 0 14px calc(14px + env(safe-area-inset-bottom)); }
  .portal-top { padding: 14px 2px 14px; }
  .portal-hello { font-size: 16px; }
  .portal-cards {
    /* 竖排时按内容高度走，不要再套上面那个 520px 的上限 */
    flex: 0 0 auto; margin: auto 0;
    height: auto; min-height: 0;
    flex-direction: column; gap: 14px;
  }
  .portal-card {
    flex: 0 0 auto; min-height: 120px;
    flex-direction: row; align-items: center; justify-content: flex-start;
    gap: 16px; padding: 20px 18px;
    border-radius: 20px; text-align: left;
  }
  .portal-ic { flex: 0 0 auto; width: 58px; height: 58px; border-radius: 18px; }
  .portal-ic svg { width: 29px; height: 29px; }
  .portal-txt { flex: 1 1 auto; min-width: 0; }
  .portal-txt b { font-size: 20px; letter-spacing: .3px; }
  .portal-sub { font-size: 12.5px; margin-top: 4px; letter-spacing: 0; }
  /* 右侧箭头：让整条读起来像"可以点进去"，而不是一块板子 */
  .portal-card::after {
    content: '›'; margin-left: 6px;
    font-size: 26px; line-height: 1; color: var(--faint); opacity: .7;
  }
  /* 紧凑横条里放 132px 的水印会和箭头打架，手机上不要 */
  .portal-wm { display: none; }
}
/* 矮屏（横屏手机 / 小笔记本）：卡片矮了以后 76px 图标会顶掉字，收一档。
   横屏手机宽度通常 > 560，仍是左右并排，所以这里只收尺寸、不改方向。 */
@media (max-height: 520px) {
  .portal-ic { width: 52px; height: 52px; border-radius: 16px; }
  .portal-ic svg { width: 26px; height: 26px; }
  .portal-card { gap: 10px; padding: 16px 12px; }
  .portal-txt b { font-size: 17px; }
}

/* 顶栏左组：回板块按钮 + 名字/账号 */
.tbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tbar-right { display: flex; align-items: center; gap: 6px; }
.back-ic {
  flex: 0 0 auto; width: 30px; height: 30px; padding: 0 0 2px;
  border: none; border-radius: 10px; background: var(--card2); color: var(--sub);
  font-size: 20px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.back-ic:hover { color: var(--text); }

/* 邮件图标：学生反馈（和老师的对话）不再占底部 tab，改成信封图标 */
.mail-btn {
  position: relative; width: 36px; height: 36px; padding: 0;
  border: none; border-radius: 12px; background: transparent; color: var(--sub);
  display: inline-grid; place-items: center; cursor: pointer;
  transition: color .18s, background .18s;
}
.mail-btn svg { width: 21px; height: 21px; }
.mail-btn:hover, .mail-btn.on { color: var(--main); background: var(--card2); }
/* 有未读：右上角一个红色感叹号 */
.mail-badge {
  position: absolute; top: -2px; right: -2px;
  width: 16px; height: 16px; border-radius: 999px;
  background: var(--bad); color: #fff;
  font-size: 11px; line-height: 16px; font-style: normal; font-weight: 700;
  text-align: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
}

/* ---- 邮箱页（老师端）：顶栏信封点开后的整页收件箱 ----
   老师平时在工作台核对作业，消息是低频的；常驻一块列表既占地方又容易被无视。
   改成信封入口后，点开是一整页，第一行写明"邮箱 + 未读数"，和学生端同一套。 */
.mail-page { padding-bottom: 24px; }
/* 宽屏上收窄一点：邮箱是"一行一条"的列表，拉满 1024 会让名字和日期隔得太远 */
@media (min-width: 720px) {
  .mail-page { max-width: 760px; }
}
.mail-head {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 14px;
}
.mail-title { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.mail-title em {
  font-style: normal; font-size: 12.5px; font-weight: 500;
  color: var(--bad); margin-left: 8px;
}
.mail-title em.read { color: var(--faint); }
/* KPI 第三格（未读消息）点一下直接进邮箱 */
.kpi-cell[data-mail] { cursor: pointer; }

/* ---- 「更新内容」弹窗（师生共用，见 utils/news.js） ----
   登录后弹一次：底架复用 .ui-mask / .ui-dialog，这里只管条目列表的排版
   和弹窗宽度。列表字号比卡片版大一点——弹窗是一次性的，别让人眯眼看。

   2026-10-30 起条目改成「标题 + 一句话」，详情默认收起：
   八条更新写成整段，谁都不会读完；收起后一屏能看全，想细看再点开。 */
.news-dialog { width: min(560px, 90vw); text-align: left; max-height: 82vh; overflow-y: auto; }
.news-list { margin: 6px 0 2px; padding-left: 0; list-style: none; font-size: 13.5px; line-height: 1.6; }
.news-list li { margin-bottom: 2px; padding: 8px 10px; border-radius: 10px; }
.news-list li + li { border-top: 1px solid var(--line, rgba(0,0,0,.06)); }
.news-list li b { display: block; font-weight: 600; }
.news-list li .news-sum { display: block; color: var(--sub); margin-top: 2px; }
/* 详情：默认收起，点条目展开 */
.news-list .news-d { display: none; margin: 7px 0 0; color: var(--sub); font-size: 12.5px; line-height: 1.65; }
.news-list li[data-open="1"] .news-d { display: block; }
.news-list li.news-item { cursor: pointer; }
.news-list li.news-item:active { background: rgba(0,0,0,.03); }
.news-list .news-fold {
  display: inline-block; margin-top: 4px; font-size: 11.5px;
  color: var(--pri, #4b6ef5); font-weight: 600;
}
/* 登录页那行「这次更新了什么」：不挡登录表单，点开才弹 */
.news-tip {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 14px; padding: 0; border: 0; background: none;
  font: inherit; font-size: 12.5px; color: var(--pri, #4b6ef5); cursor: pointer;
}
.news-tip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--warn, #f08c00); display: inline-block;
}
.muted { color: var(--sub); font-size: 13px; }
.faint { color: var(--faint); font-size: 12px; }

/* ---- 顶栏 ---- */
/* 左右内边距跟着内容外壳走：宽屏时顶栏按钮正好落在正文右边缘上方，
   窄屏时 100% - 720px 是负数，max() 取 16px，与手机端原来一致。 */
.tbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px max(16px, calc((100% - var(--shell)) / 2));
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.tbar-name { font-size: 16px; font-weight: 600; }
.tbar-right { font-size: 13px; color: var(--sub); }

/* 顶栏左侧的「名字 + 账号」两行。
   【为什么把账号做成小字而不是另起一行正文】它是用来核对身份的，
   不是给人天天读的；放在名字正下方一行灰字，需要时一眼扫到，
   不需要时也不会抢走注意力。 */
.tbar-id { min-width: 0; }
.acct-mail {
  font-size: 11.5px; color: var(--sub); margin-top: 1px;
  /* 邮箱可能很长，窄屏上必须截断：撑宽顶栏会把右边的「退出」挤出屏幕 */
  max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 空列表（还没有班级）里的账号提示。
   这里是老师/学生最容易被吓到的地方，所以给一块带底色的说明，而不是灰字。 */
.acct-hint {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--card2); color: var(--sub);
  font-size: 12.5px; line-height: 1.65;
}
.acct-hint b { color: var(--text, inherit); word-break: break-all; }

/* ---- 表单 ---- */
.field { margin-bottom: 12px; }
.field-label { font-size: 13px; color: var(--sub); margin-bottom: 6px; }
.input {
  width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--card2);
  border-radius: 10px; padding: 12px 14px; font-size: 16px; color: var(--text);
  outline: none; -webkit-appearance: none;
}
.input:focus { border-color: var(--main); background: #fff; }

.btn {
  display: block; width: 100%; border: none; border-radius: 12px;
  padding: 14px; font-size: 16px; font-weight: 600; color: #fff;
  background: var(--main); cursor: pointer;
}
.btn:active { opacity: .85; }
.btn:disabled { background: #c9ced6; cursor: default; }
.btn.ghost { background: transparent; color: var(--main); border: 1px solid var(--line); }
.btn.gray { background: var(--sub); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* 用 <label> 当按钮（里面包着原生 file input）。
   文字居中、不可选中、隐藏 input——点 label 由浏览器原生打开选择器，
   不经过任何 JS 触发，扩展/策略/webview 都拦不住。 */
/**
 * 文件上传按钮（label + 原生 input）。
 *
 * 【为什么 input 不做 display:none，而是透明铺满整个按钮】
 * display:none 的 input 靠 label 转发点击才能弹选择器，这条路在部分环境里
 * 会静默失败：Safari 不给不渲染的控件转发，一些内嵌 webview 和装了扩展/
 * 企业策略的 Chrome 也不弹——用户看到的就是"点了完全没动静"，没有报错、
 * 没有任何反馈，最难排查。
 * 让 input 自己成为按钮（透明、盖满整个 label 区域）就不用转发了：
 * 鼠标点下去命中的就是 input 本身，浏览器必须打开选择器。
 * 视觉上仍然是那个按钮，只是它的可点击层换成了真正的文件控件。
 */
.file-pick { position: relative; overflow: hidden; text-align: center; user-select: none; -webkit-user-select: none; cursor: pointer; }
.file-pick input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 100px;
}

/**
 * 拖拽落区：系统文件窗口打不开时的备用通道。
 * 拖进来的文件会走与"选了文件"完全相同的后续流程（校验→压缩→回填）。
 */
.pick-zone {
  border: 1px dashed transparent; border-radius: 12px;
  padding: 6px; margin: -6px;
  transition: border-color .12s, background .12s;
}
.pick-zone.over {
  border-color: var(--main);
  background: rgba(108,92,231,.07);
}

/* ---- 反馈 ---- */
.err { background: #fdecee; color: #b02a37; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.ok-tip { background: #e8f6ee; color: #0f7a3d; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.empty { text-align: center; padding: 40px 20px; color: var(--faint); font-size: 14px; }

/* ---- 列表行 ---- */
.row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row-k { color: var(--sub); font-size: 13px; }
.row-v { font-weight: 500; text-align: right; word-break: break-all; max-width: 62%; }

/* ---- 概览数字 ---- */
.stats { display: flex; gap: 10px; margin-bottom: 12px; }
.stat { flex: 1; background: var(--card); border-radius: var(--radius); padding: 12px 10px; text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--sub); margin-top: 2px; }

/* ---- 分段切换（登录页身份选择） ---- */
.seg {
  display: flex; gap: 4px; background: #e9ebef; border-radius: 12px;
  padding: 4px; margin: 0 0 12px;
}
.seg-item {
  flex: 1; text-align: center; padding: 10px 0; border-radius: 9px;
  font-size: 15px; color: var(--sub); cursor: pointer; transition: background .15s, color .15s;
}
.seg-item.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---- 顶栏退出按钮 ---- */
.linklike { background: none; border: none; color: var(--sub); font-size: 13px; cursor: pointer; padding: 4px 2px; }
.linklike:disabled { opacity: .5; }

/* 「⋯」更多操作：一个字符宽，但要有 36px 的点击区（手机上点不中就是没这个功能）。
   行尾的「交 9/12」和它并排，所以不能真的只有 13px 高 */
.more-btn {
  font-size: 18px;
  line-height: 1;
  letter-spacing: 1px;
  min-width: 32px;
  min-height: 32px;
  padding: 0 6px;
  border-radius: 9px;
  color: var(--sub);
}
.more-btn:active { background: rgba(108,92,231,.1); color: var(--main); }

/* ---- 首页：结论卡 / 周次行 / 分区标题 ---- */
.headline-title { font-size: 17px; font-weight: 700; }
.headline.ok .headline-title { color: var(--ok-text); }
.headline.doing .headline-title { color: var(--main); }
.week-line { font-size: 14px; font-weight: 600; margin: 4px 2px 10px; }
.section { font-size: 13px; color: var(--sub); margin: 14px 4px 8px; }

/* ---- 作业批次卡 ---- */
.asg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.asg-class { font-weight: 600; margin-right: 8px; }
.asg-kindlabel { font-size: 12px; color: var(--sub); background: var(--card2); border-radius: 6px; padding: 2px 8px; }
.card-due { font-size: 12px; color: var(--warn-text); margin-bottom: 6px; }
.asg-part { padding: 10px 0 4px; border-top: 1px solid var(--line); margin-top: 8px; cursor: pointer; }
.asg-part:active { background: var(--card2); }
.asg-part:first-of-type { border-top: none; margin-top: 2px; }
.asg-part-head { display: flex; align-items: baseline; gap: 8px; }
.asg-kind { font-size: 12px; color: var(--main); flex: none; }
.asg-title { font-size: 15px; font-weight: 500; min-width: 0; word-break: break-all; }
.asg-part-sub { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); margin: 3px 0 6px; gap: 8px; }
/* 同类型多条（一次留了 3 条视唱）合成一栏，点开才看明细。
   展开后的子项往右缩一格 + 竖线，一眼看出"这几条属于上面那一栏" */
.asg-fold .asg-more { margin-left: auto; font-size: 12px; color: var(--main); flex: none; }
.asg-sub { margin-left: 6px; padding-left: 9px; border-left: 2px solid var(--line); }
.asg-sub[hidden] { display: none; }
.asg-sub .asg-part:first-of-type { border-top: none; margin-top: 0; }

/* ---- 往周折叠（师生共用，见 work.groupByWeek）
   一周一行：标题写"第 3 周 + 日期"，副行写"几份 · 还差几人"。
   点开之后里面还是正常的作业行/卡片，只是背景压暗一层、往里缩一点，
   一眼看出"这些属于上面那一周"。 */
/* ---- 往周折叠的旧样式已由上面的「周历方块」取代（2026-10-30）
   旧类名 .wk-row / .wk-box 不再生成，留一段注释说明，避免以后有人照着找。 */

/* ---- 周历方块（学生首页 / 教师工作台共用，见 pages/home.js 的 weekCellHtml）
   一周一格：上面是周次，中间是那一周的结果（学生看分、老师看还差几人），
   下面是几份作业。点一格，下面只显示那一周的明细——首页默认只看本周。
   往周多起来时横向滑动，不换行：一屏三四格，滑得更远反而更清楚"时间在往哪走"。 */
.wkj-strip {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 2px 10px; margin: 2px 0 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.wkj-strip::-webkit-scrollbar { display: none; }
.wkj {
  flex: 0 0 auto; width: 88px;
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 9px 10px 8px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card);
  color: inherit; font: inherit; cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.wkj:active { transform: scale(.98); }
.wkj-t {
  font-size: 11.5px; color: var(--sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wkj-v { display: flex; align-items: baseline; gap: 2px; line-height: 1.2; }
.wkj-v b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wkj-v b.warn { color: var(--warn-text); }
.wkj-v em { font-style: normal; font-size: 10.5px; color: var(--sub); }
.wkj-s { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.wkj-hold { font-size: 11.5px; font-weight: 500; color: var(--faint); }
.wkj-ok { font-size: 11.5px; font-weight: 600; color: var(--ok-text); }
/* 选中格：主色描边 + 淡底，不做成实心（一格实心会像按钮，看不出是"当前这一周"） */
.wkj.on { border-color: var(--main); box-shadow: 0 0 0 2px rgba(108,92,231,.13); }
.wkj.on .wkj-t { color: var(--main); font-weight: 600; }
/* 本周那一格始终带一条主色顶线，滑到哪儿都能认出"我在这一周" */
.wkj.now { background: linear-gradient(to bottom, rgba(108,92,231,.07), var(--card) 46%); }
/* 还没有往周时（开学头几周），条上只有一格——
   让它横着铺满一整行，别在左边缩成一个小方块像残了似的 */
.wkj:only-child {
  width: auto; flex: 1 1 auto;
  flex-direction: row; align-items: center; gap: 10px;
}
.wkj:only-child .wkj-t { flex: 1 1 auto; font-size: 12.5px; }
.wkj:only-child .wkj-v,
.wkj:only-child .wkj-s { flex: none; }
.wkj:only-child .wkj-v b { font-size: 21px; }
.wkj:only-child .wkj-v em { font-size: 12px; }

/* 「往周留的、这周还在收」一行提示。
   比卡片轻、比纯文字重：一条虚线边 + 左边一小段告警色竖条，
   扫一眼知道"这不是本周布置的，但还得催"，点一下跳到那一周。 */
.carry-line {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin: 0 0 12px; padding: 9px 12px 9px 11px;
  border: 1px dashed var(--line); border-left: 3px solid var(--warn);
  border-radius: 10px; background: rgba(245,158,11,.05);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.carry-line:active { transform: scale(.995); }
.carry-t { flex: 1 1 auto; font-size: 12.5px; color: var(--sub); }
.carry-v {
  flex: none; font-size: 12.5px; font-weight: 600; color: var(--warn-text);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.carry-v em { font-style: normal; color: var(--faint); font-weight: 400; }

/* hero 里的「回到本周」 */
.hero .hero-back {
  color: rgba(255,255,255,.92); font-size: 12px;
  text-decoration: underline; text-underline-offset: 2px;
  margin-left: auto; padding: 0;
}
.hero .hero-back:active { opacity: .7; }

/* ---- 胶囊状态 ---- */
.pill { font-size: 12px; border-radius: 999px; padding: 3px 10px; flex: none; background: var(--card2); color: var(--sub); }
.pill.ok { background: #e8f6ee; color: #0f7a3d; }
.pill.doing { background: #eceafd; color: #5648ce; }
.pill.bad { background: #fdecee; color: #b02a37; }

/* ---- 细进度条 ---- */
.bar { height: 6px; background: var(--card2); border-radius: 999px; overflow: hidden; }
.bar-in { height: 100%; background: #c9ced6; border-radius: 999px; transition: width .3s; }
.bar-in.doing { background: var(--main); }
.bar-in.ok { background: var(--ok); }

/* ---- 练习页：大标题 / 选项网格 / 录音条目 ---- */
.asg-title.big { font-size: 17px; font-weight: 600; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt {
  border: 1px solid var(--line); background: var(--card2); border-radius: 12px;
  padding: 16px 8px; font-size: 17px; font-weight: 600; color: var(--text); cursor: pointer;
}
.opt:active { background: #f1eefe; border-color: var(--main); }
.take { padding: 10px 0; border-bottom: 1px solid var(--line); }
.take:last-child { border-bottom: none; }
.take-name { font-size: 15px; }
.take-meta { margin-top: 2px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-item { flex: 1; text-align: center; padding: 12px 0 10px; font-size: 13px; color: var(--sub); cursor: pointer; }
.tabbar-item.on { color: var(--main); font-weight: 600; }
body.has-tabbar .page { padding-bottom: 76px; }

/* ==================== 通用交互件（ui.js） ==================== */
.ui-toast {
  position: fixed; left: 50%; bottom: 92px; z-index: 200;
  transform: translate(-50%, 8px); opacity: 0;
  max-width: 84vw; padding: 10px 16px; border-radius: 10px;
  background: rgba(31,35,41,.92); color: #fff; font-size: 14px; line-height: 1.5;
  transition: opacity .18s, transform .18s; pointer-events: none;
}
.ui-toast.in { opacity: 1; transform: translate(-50%, 0); }

.ui-mask {
  position: fixed; inset: 0; z-index: 210; background: rgba(17,20,24,.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity .16s;
}
.ui-mask.in { opacity: 1; }
.ui-dialog {
  width: 100%; max-width: 320px; background: var(--card); border-radius: 16px;
  padding: 20px 18px 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.ui-dialog-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.ui-dialog-text { font-size: 14px; color: var(--sub); line-height: 1.6; margin-bottom: 12px; }
.ui-dialog-input { margin-bottom: 14px; }
.ui-dialog-btns { display: flex; gap: 10px; margin-top: 6px; }
.ui-btn {
  flex: 1; border: none; border-radius: 10px; padding: 11px 0;
  font-size: 15px; font-weight: 600; background: var(--main); color: #fff; cursor: pointer;
}
.ui-btn.ghost { background: var(--card2); color: var(--text); }
.ui-btn.danger { background: var(--bad); }

.ui-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 215;
  background: var(--card); border-radius: 16px 16px 0 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  transform: translateY(12px); transition: transform .16s;
  /* 选项多的表（比如时值有 12 档）在小屏上会顶出屏幕外，"取消"就点不到了。
     让它自己滚，取消始终留在最后一条 */
  max-height: 76vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.ui-mask.in .ui-sheet { transform: translateY(0); }
.ui-sheet-item {
  display: block; width: 100%; border: none; background: transparent;
  padding: 15px 0; font-size: 16px; color: var(--text); cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.ui-sheet-item:last-child { border-bottom: none; }
.ui-sheet-item.danger { color: var(--bad-text); }
.ui-sheet-item.cancel { color: var(--sub); margin-top: 6px; }

.ui-loading {
  position: fixed; inset: 0; z-index: 220; background: rgba(17,20,24,.35);
  display: flex; align-items: center; justify-content: center;
}
.ui-loading-box {
  background: rgba(31,35,41,.92); color: #fff; border-radius: 14px;
  padding: 20px 24px; min-width: 140px; text-align: center;
}
.ui-loading-text { font-size: 13px; margin-top: 10px; }
.ui-spinner {
  width: 26px; height: 26px; margin: 0 auto; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25); border-top-color: #fff;
  animation: ui-spin .8s linear infinite;
}
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* ==================== 通用列表 / 表单件 ==================== */
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.lrow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 14px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.lrow:last-child { border-bottom: none; }
.lrow:active { background: var(--card2); }
.lrow-main { min-width: 0; flex: 1; }
.lrow-title { font-size: 15px; font-weight: 500; word-break: break-all; }
.lrow-sub { font-size: 12px; color: var(--sub); margin-top: 3px; }
/* 合计 = 老师填的底分 + 作业到期后自动加的分（学生看到的就是这个数）。
   放在输入框正下方、用「=」连起来：老师要的是这个数，不能做成一行灰色小字备注。 */
.score-box { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.score-total {
  font-size: 12px; font-weight: 700; line-height: 1.15;
  color: var(--main); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.lrow-right { flex: none; font-size: 13px; color: var(--sub); text-align: right; }

/* ---------- 学生交的录像（视唱作业） ---------- */
/*
 * 一条视频 = 一行标题 + 一个原生播放器。`.lrow` 是 flex 横排，视频塞进去会被
 * 压成一条缝，所以整行改成 block，标题和「删除」单独用 .take-vhead 横排。
 * max-height:46vh 是必要的：竖屏视频按宽度铺满后接近 100vh，一条就能把
 * 下面的作业信息全挤出屏幕，学生会以为这一页只剩视频。
 */
.take-vrow { display: block; }
.take-vhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.take-video {
  display: block; width: 100%; max-height: 46vh; margin: 8px 0 4px;
  border-radius: 10px; background: #000; object-fit: contain;
}

/* ---------- 现场录像的取景层 ---------- */
/*
 * 全屏黑底：录的时候只需要看清两件事——自己在不在画面里、谱子露没露出来。
 * 这一层挂在 body 上（不在 #app 里），页面重绘不会把它换掉，
 * 详见 pages/sing.js 里 ensureVideoLayer 的说明。
 */
.vrec { position: fixed; inset: 0; z-index: 900; background: #000; display: none; }
.vrec.on { display: flex; align-items: center; justify-content: center; }
.vrec-body {
  position: relative; width: 100%; max-width: 560px; height: 100%;
  display: flex; flex-direction: column; justify-content: center; padding: 18px;
}
.vrec-prev {
  /*
   * min-height 是给"还没出第一帧"留的框：摄像头刚开、或设备迟迟不吐画面时，
   * video 元素高度算出来是 0，停止按钮会飘到屏幕正中间，下面的黑底空一大片，
   * 看起来像卡住了。给一个固定的最小高度，按钮位置从一开始就是稳的。
   */
  width: 100%; min-height: 46vh; max-height: 62vh;
  background: #000; border-radius: 12px; object-fit: contain;
}
.vrec-hud {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 13px; white-space: nowrap;
}
.vrec-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ff453a;
  animation: vrec-blink 1s ease-in-out infinite;
}
@keyframes vrec-blink { 50% { opacity: .25; } }
.vrec-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.vrec-hint { color: rgba(255, 255, 255, .72); }
.vrec-acts { display: flex; gap: 10px; margin-top: 14px; }
.vrec-acts .btn { flex: 1; }

/* ---------- 平时分录入 ---------- */
/*
 * 【为什么输入框只有 54px 宽】一行里要同时放姓名、学号、已加入标签和"移除"，
 * 手机上（360px 宽）再给输入框留太多，姓名会被挤成两行。
 * 平时分最多三位数字（100），54px 放得下 100.5；字号用 15px 而不是 13px，
 * 是为了 iOS 上 focus 时不被自动放大（小于 16px 会缩放，但这里输入框
 * 有 --text 颜色和足够的点击区域，14px 是实测不缩放的下限之一）。
 */
.score-cell { flex: none; margin-right: 2px; }
.score-in {
  width: 54px; padding: 7px 6px; text-align: center;
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text); background: var(--card2);
  border: 1px solid transparent; border-radius: 9px;
  outline: none; -webkit-appearance: none; appearance: none;
}
.score-in::placeholder { color: var(--sub); font-weight: 400; }
.score-in:focus {
  background: var(--card);
  border-color: var(--main);
  /* 焦点态给一圈淡色光晕：一屏四五十个格子，得让人一眼看到光标在哪一行 */
  box-shadow: 0 0 0 3px rgba(108, 92, 231, .12);
}
.score-na { display: inline-block; width: 54px; text-align: center; color: var(--sub); }

/* 保存条：整页唯一"会变实心"的按钮，避免老师以为分数已经自动存了 */
.score-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 12px;
  margin: 0 2px 12px;
}
/*
 * 说明文字必须独占一行。
 *
 * 早先是 `flex: 1 + min-width: 0`，本意是让按钮靠右；但 min-width:0 允许
 * 这个盒子被压到比"一个字"还窄，窗口一窄（老师把浏览器缩一半、或手机横屏）
 * 就出现整段话竖排、一个字一行的情况——截图里那个"平时分 0~100"竖下来
 * 就是这么来的。改成 flex-basis:100% 后它直接占满整行，按钮换到下一行右对齐，
 * 无论多窄都不会再被挤扁。
 */
.score-bar .faint { flex: 1 1 100%; min-width: 0; font-size: 12px; line-height: 1.5; }
.score-bar .btn { flex: none; margin-left: auto; white-space: nowrap; padding-left: 14px; padding-right: 14px; }

.chipbar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; -webkit-overflow-scrolling: touch; }
.chipbar::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--sub); cursor: pointer;
}
.chip.on { background: var(--main); border-color: var(--main); color: #fff; font-weight: 600; }

.tag { display: inline-block; font-size: 12px; border-radius: 6px; padding: 2px 7px; background: var(--card2); color: var(--sub); }
.tag.ok { background: #e8f6ee; color: #0f7a3d; }
.tag.warn { background: #fdf3e6; color: #a35d0c; }
.tag.bad { background: #fdecee; color: #b02a37; }

.textarea {
  width: 100%; min-height: 84px; border: 1px solid var(--line); background: var(--card2);
  border-radius: 10px; padding: 12px 14px; font-size: 15px; font-family: inherit;
  color: var(--text); outline: none; resize: vertical; -webkit-appearance: none;
}
.textarea:focus { border-color: var(--main); background: #fff; }

.switchrow { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.switch {
  position: relative; width: 46px; height: 28px; border-radius: 999px; background: #d5d9df;
  border: none; cursor: pointer; transition: background .18s; flex: none;
}
.switch.on { background: var(--main); }
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: transform .18s;
}
.switch.on::after { transform: translateX(18px); }

.sec-title { font-size: 13px; color: var(--sub); margin: 16px 4px 8px; display: flex; align-items: center; justify-content: space-between; }
.btns { display: flex; gap: 10px; margin-top: 12px; }
.btns .btn { flex: 1; }
.btn.sm { padding: 9px 0; font-size: 14px; border-radius: 10px; }
/* 整体移调：4 个按钮挤一行（窄屏 320px 也要放得下，所以字号比 .btn.sm 再小一号），
   不换行——一旦换行，"↑ 一个音"和"↓ 一个音"就不在同一行，容易点错方向 */
.tbtns { display: flex; gap: 8px; }
.tbtns .btn {
  flex: 1; min-width: 0; padding: 9px 0; font-size: 13px; border-radius: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn.danger { background: var(--bad); }
.fixed-bottom {
  position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, rgba(244,245,247,0));
  padding: 10px 0 12px; margin-top: 8px;
}

/* ---- 宽屏双栏 ----
 * 手机上是自上而下一叠卡片；桌面把"作业流"和"班级 / 反馈"并排放，
 * 老师不用为了瞄一眼反馈滚过整个作业列表。默认 block（单列），
 * 1024 起才分栏，移动端零影响。minmax(0,·) 防止长标题把栏撑破。 */
.cols { display: block; }
@media (min-width: 1024px) {
  .cols {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    column-gap: 26px; align-items: start;
  }
  .cols .col { min-width: 0; }
  .cols .col > .sec-title:first-child { margin-top: 4px; }
}

/* ==================== 宽屏（桌面 / 横屏平板）====================
 * 为什么需要这一整块：
 * 上面的样式是"移动端优先"写的——正文 15px、内容上限 720px。在手机上这是对的
 * （375~430px 宽，720 上限等于没设）。但桌面窗口通常 1280~2560px，720px 只占
 * 一半甚至三分之一，左右两大片空白，读起来像"手机页面被贴在屏幕中间"：
 * 一行字很短、每次翻页都要滚动、顶栏按钮还甩在屏幕两端。
 *
 * 这里按屏宽分档，移动端一行不改（所有规则都在媒体查询里）：
 *   ≥1024px：外壳 1180px，整体字号放大一档
 *   ≥1600px：外壳 1360px（再宽不再放：中文正文一行超过 ~45 字就要来回找行首）
 * 同一档里再用 CSS 变量给"内容形态不适合铺满"的页面单独收窄，
 * 比如登录/填表页 1180px 宽的一行输入框会显得空旷，听辨页的全宽播放按钮会过重。
 */
@media (min-width: 1024px) {
  :root { --shell: 1180px; }

  body { font-size: 16px; }

  .page { padding: 24px 28px 64px; }
  .tbar { padding-top: 14px; padding-bottom: 14px; }
  .tbar-name { font-size: 18px; }
  .tbar-right { font-size: 14px; }
  .linklike { font-size: 14px; }
  .boot { font-size: 15px; }

  /* 卡片与文字：等比放大一档，别只加宽不加字——只加宽会让字显得更稀 */
  .card { padding: 18px 20px; margin-bottom: 14px; border-radius: 16px; }
  .card-title { font-size: 16px; margin-bottom: 12px; }
  .muted { font-size: 14px; }
  .faint { font-size: 13px; }
  .empty { font-size: 15px; padding: 48px 20px; }
  .err, .ok-tip { font-size: 14px; padding: 12px 14px; }

  .field { margin-bottom: 14px; }
  .field-label { font-size: 14px; }
  .input { font-size: 17px; padding: 13px 16px; }
  .textarea { font-size: 16px; padding: 13px 16px; }

  .btn { font-size: 17px; padding: 15px; }
  .btn.sm { font-size: 15px; padding: 10px 0; }
  /* 窄屏时为了四个按钮不换行把字号压到了 13px；宽屏空间足够，还回 14px。
     仍然 nowrap：一旦换行「↑一个音」和「↓一个音」就不在同一行，容易点错方向 */
  .tbtns .btn { font-size: 14px; padding: 11px 0; }

  .row { padding: 13px 0; }
  .row-k { font-size: 14px; }
  .row-v { font-size: 16px; }

  .stats { gap: 14px; }
  .stat { padding: 16px 12px; border-radius: 16px; }
  .stat-num { font-size: 30px; }
  .stat-label { font-size: 13px; }

  .seg { border-radius: 14px; }
  .seg-item { font-size: 16px; padding: 12px 0; border-radius: 11px; }

  .headline-title { font-size: 20px; }
  .week-line { font-size: 16px; }
  .section, .sec-title { font-size: 14px; margin-top: 18px; }
  .section { margin-top: 20px; }

  .asg-class { font-size: 16px; }
  .asg-title { font-size: 16px; }
  .asg-title.big { font-size: 20px; }
  .asg-part { padding: 12px 0 6px; }
  .pill { font-size: 13px; padding: 4px 12px; }
  .bar { height: 8px; }

  /* 听辨/视唱的选项：宽屏两列会变成两个 500px 的巨块，改四列；
     选项本身仍然是一眼能扫完的大小 */
  .opt-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .opt { font-size: 19px; padding: 18px 10px; }
  .take-name { font-size: 16px; }

  .list { border-radius: 16px; }
  .lrow { padding: 15px 18px; }
  .lrow-title { font-size: 16px; }
  .lrow-sub { font-size: 13px; }
  .lrow-right { font-size: 14px; }
  .chip { font-size: 14px; padding: 8px 16px; }
  .chipbar { padding-bottom: 12px; }
  .tag { font-size: 13px; padding: 3px 8px; }

  /* 底部主按钮不铺满 1124px：一条 1 米宽的蓝色按钮既难看清也难瞄准，
     收到 460px 居中，视觉重量和上面的卡片一致。卡片内的主按钮同理
     （听辨页的「再听一次」、空状态的「加入班级」、登录页的「登录」） */
  .fixed-bottom > .btn,
  .page > .btn,
  .card > .btn { max-width: 460px; margin-left: auto; margin-right: auto; }
  .btn-row { max-width: 640px; margin-left: auto; margin-right: auto; }
  .btns { max-width: 760px; margin-left: auto; margin-right: auto; }

  /* 底部标签栏：通栏时三个字贴在三处、中间全是空白，改成居中的一列胶囊 */
  .tabbar { justify-content: center; gap: 6px; padding: 8px max(24px, calc((100% - var(--shell)) / 2)); }
  .tabbar-item { flex: 0 1 240px; border-radius: 12px; padding: 12px 0; }
  body.has-tabbar .page { padding-bottom: 96px; }

  /* 弹层：宽屏下 320px 的对话框偏小，底部动作面板通栏会横跨整个屏幕 */
  .ui-dialog { max-width: 440px; padding: 24px 22px 18px; }
  .ui-dialog-title { font-size: 18px; }
  .ui-dialog-text { font-size: 15px; }
  .ui-btn { font-size: 16px; padding: 13px 0; }
  .ui-sheet {
    left: 0; right: 0; margin-left: auto; margin-right: auto;
    max-width: 480px; bottom: 24px; border-radius: 16px;
  }
  .ui-sheet-item { font-size: 17px; padding: 16px 0; }
  .ui-sheet-item > * { padding-left: 10px; padding-right: 10px; }
  .ui-toast { max-width: 460px; font-size: 15px; bottom: 40px; }
  .ui-loading-box { min-width: 180px; }
  .ui-loading-text { font-size: 14px; }

  /* ---- 按页面形态微调外壳宽度 ---- */
  /* 登录/填资料/加入班级/学期设置：都是一列表单，铺到 1180 会让输入框长得像搜索条，
     视线从标签跳到输入框末端要横扫一整屏 */
  #app[data-path="/login"],
  #app[data-path="/setup"],
  #app[data-path="/join"],
  #app[data-path="/term"] { --shell: 860px; }

  /* 练习类：主体是"播放按钮 + 几个选项"，太宽会显得空，1000px 既宽敞又不散 */
  #app[data-path="/ear"],
  #app[data-path="/sing"],
  #app[data-path="/sing/tuner"],
  #app[data-path="/sing/free"] { --shell: 1000px; }

  /* ---- 布置页：作业项卡片内的表单改两列 ----
   * 单列时每个输入框拉到 1100px，像一条通栏搜索条，视线要从标签横扫到
   * 输入内容处。宽屏改成两列网格后：名称/呈现方式一行，音域/组数一行，
   * 「考哪些音程」的胶囊区最占宽、放最后一行通栏。手机端仍是单列。 */
  #app[data-path="/t/assign"] .card[data-item] {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 26px; align-items: start;
  }
  #app[data-path="/t/assign"] .card[data-item] > .asg-head,
  #app[data-path="/t/assign"] .card[data-item] > .field:last-child,
  /* 视唱卡的「乐谱 / 示范」和「精确音高 · MusicXML」都是整行的东西：
     各占半格时，两个上传按钮被压进半屏，右半边空着，看着像排错了 */
  #app[data-path="/t/assign"] .card[data-item] > .field.wide { grid-column: 1 / -1; }
}

/* 超大屏再放一档。中文正文一行约 45 字最好读，1360px 减去内边距后约 1300px，
   16px 字号下正好接近这个上限；再放宽就只是把空白从两边挪到行里。 */
@media (min-width: 1600px) {
  :root { --shell: 1360px; }
}

/* ==================== 音符网格（读谱核对页） ====================
 * 【为什么是一个"格子"而不是一张表】
 * 一条视唱谱二三十个音。一行一个音时，老师要滚三屏才能看全，改一个音
 * 还得点中它、再滚到底部按「升半音」，视线来回跳。谱子本来就是横着一行
 * 一行写的，所以这里也横着排：一屏看全、错在哪一眼就看见。
 *
 * 【为什么每个音自己带按钮】
 * 核对时脑子里只有"这个音高了还是低了"这一件事。按钮贴在音上，
 * 点一下半个音，改完立刻重绘，看到的就是结果。 */
.ngrid {
  display: grid;
  /* auto-fill + 固定最小宽度：宽屏一行六七个，手机一行两三个，
     不需要写两套媒体查询 */
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.nchip {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 6px 8px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color .12s, background .12s, transform .12s, box-shadow .12s;
}
.nchip:active { background: var(--card2); }
/* 选中态：老师说"听当前音时要一眼知道在听哪个" */
.nchip.sel { border-color: var(--main); background: rgba(108,92,231,.07); box-shadow: inset 0 0 0 1px var(--main); }
/* 认不出音高的格子必须显眼，否则老师会以为那是"已经核对过"的音 */
.nchip.bad { border-color: var(--bad); background: rgba(227,77,89,.05); }

/* 播放游标：正在发声的那个音整格点亮。
   【为什么用实底+白字而不是再加一圈描边】核对页上已经有"选中"（描边+浅底）
   和"红音"（红边）两种状态，再加一种描边会分不清谁是谁。整格反色最不容易混淆，
   而且余光扫得到——老师这时在听，不在看。 */
.nchip.pnow {
  border-color: var(--main);
  background: var(--main);
  box-shadow: 0 0 0 3px rgba(108,92,231,.20), 0 6px 16px rgba(108,92,231,.26);
  transform: translateY(-1px) scale(1.03);
}
.nchip.pnow .nchip-p,
.nchip.pnow .nchip-i,
.nchip.pnow .nchip-d { color: #fff; }
.nchip.pnow .nbtn { border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.16); color: #fff; }
/* 休止符也在时间轴上：它亮起来是灰的，不会和"这里有音"混淆 */
.nchip.pnow.rest { background: var(--sub); border-color: var(--sub); border-style: solid; }
.nchip.pnow.bad { background: var(--bad); border-color: var(--bad); }

/* 延音线标记：格子右上角一个小 "⌒连"。
   【为什么用绝对定位不用行内】行内会挤掉音名——格子最窄只有 94px，
   "B4" 加上一个徽标就换行了，三四个音的宽度都不一样。挂在角上，
   格子里的内容怎么排都不动。 */
.nchip { position: relative; }
.nchip-tie {
  position: absolute;
  top: -9px;
  right: 6px;
  z-index: 1;
  padding: 0 4px;
  border-radius: 6px;
  background: rgba(108,92,231,.14);
  color: var(--main);
  font-size: 10px;
  line-height: 15px;
  white-space: nowrap;
  pointer-events: none;
}
.nchip.pnow .nchip-tie { background: rgba(255,255,255,.26); color: #fff; }

/* 「正在播第几个音」那一条：播放时才出现，跟着声音换数字 */
.playnow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(108,92,231,.08);
  font-size: 12.5px;
  color: var(--sub);
}
.playnow b { color: var(--main); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.playnow .pn-hint { margin-left: auto; font-size: 11px; }
.playnow .pn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--main);
  flex: 0 0 auto;
  animation: pnPulse 1.1s ease-in-out infinite;
}
.playnow .pn-tie { color: var(--main); }
/* 暂停：界面静止了，就不该再有一个"正在跑"的闪点在跳 */
.playnow.paused { background: var(--card2); }
.playnow.paused .pn-dot { animation: none; background: var(--sub); opacity: .45; }
.playnow.paused b { color: var(--sub); }
@keyframes pnPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.6); }
}

/* 播放控制：第一行两个按钮，第二行速度。挤成一行时手机上的按钮会竖排成
   "听 当 前 音"，看起来像坏了。
   【width:auto 不能省】.btn 基类是 width:100%（满宽主按钮），放进 flex 行
   里它会占满整行，整排被挤出卡片外，左边的"80 拍/分"会跑到屏幕外来 */
.playrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.playrow .btn { width: auto; flex: 0 0 auto; white-space: nowrap; }
.playrow .btn.grow { flex: 1; }
/* 停止只在播放/暂停时出现，给它固定宽度，别让两个主按钮被挤窄 */
.playrow #btnStop { flex: 0 0 auto; padding-left: 12px; padding-right: 12px; }
.playrow.speedbar { justify-content: flex-end; gap: 6px; margin: -2px 0 10px; }
.speedbar .btn.sm { min-width: 42px; }
.speedbar .tag { align-self: center; }

/* 选中音的编辑按钮一共 7 个（升/降/节奏/延音线/改音名/插入/删除）。
   手机上一行塞不下 7 个，不换行就会把"降半音"挤成两行字。
   允许换行、一行三个，正好两屏都够点。 */
.actbar { flex-wrap: wrap; }
.actbar .btn { flex: 1 1 30%; width: auto; min-width: 0; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .nchip { transition: none; }
  .nchip.pnow { transform: none; }
  .playnow .pn-dot { animation: none; }
}
.nchip-top { display: flex; align-items: baseline; gap: 5px; }
.nchip-i { font-size: 11px; color: var(--sub); min-width: 15px; font-variant-numeric: tabular-nums; }
.nchip-p { font-size: 17px; line-height: 1.15; color: var(--main); font-variant-numeric: tabular-nums; }
.nchip.bad .nchip-p { color: var(--bad-text); }
.nchip-d { margin-left: auto; font-size: 11px; color: var(--sub); white-space: nowrap; }
.nchip-bot { display: flex; gap: 5px; margin-top: 5px; }
/* 30px 高是手指能稳稳点中的下限；两个按钮各占一半，误触不到隔壁 */
.nbtn {
  flex: 1;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card2);
  color: var(--sub);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}
.nbtn:active { background: var(--main); border-color: var(--main); color: #fff; }
@media (max-width: 420px) {
  /* 手机上一行两个格子比三个好按：格子里的音名和按钮都不至于挤成一条 */
  .ngrid { grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 7px; }
  .nchip-p { font-size: 16px; }
}

/* 休止符的格子：没有音高、没有升降按钮，视觉上要一眼和音符区分开。
   虚线边框 + 灰字，读起来像谱面上的"空缺"，不会和"没认出来"（红框）混淆。 */
.nchip.rest { border-style: dashed; background: var(--card2); }
.nchip.rest .nchip-p { color: var(--sub); font-size: 15px; }
.nchip.rest .nchip-d { margin-left: 0; }

/* ==================== 结构性改版（2026-10 第二版） ====================
 * 第一版只改了配色，观感上仍然是"一堆白卡叠起来"。这一版动的是版式：
 *   登录页   → 品牌头图 + 表单卡（手机一屏到底，桌面左右分栏）
 *   学生首页 → 四张数字卡 + 结论卡合并成一张带环形进度的 hero
 *   听辨页   → 「再听一遍」升为圆形主按钮，题量进度改用圆点
 *   底部导航 → 补图标（mask 上色，选中态自动跟随主色）
 * 类名沿用原来那套，业务逻辑（取数、路由、录音）没有改动。
 * 主色 #6c5ce7 对白底 4.9:1、对其上的白字同样 4.9:1，满足 WCAG AA。 */

/* ---- 顶栏：毛玻璃，内容滚动时从下面透出来 ---- */
.tbar {
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom-color: rgba(108,92,231,.12);
  /* 静止时只有一条淡紫分界线；内容滚起来之后 JS 给 .tbar 加
     .tbar-scrolled，阴影浮出来，顶栏才真的像"浮在内容上面"。
     transition 让出现/消失都柔和，不会闪一下。 */
  transition: box-shadow .18s ease;
}
.tbar.tbar-scrolled { box-shadow: 0 2px 12px rgba(31,35,41,.08); }

/* ---- 切页淡入 ----
   hash 路由是整段 innerHTML 重绘，切页时一闪就换。给新页面一个
   160ms 的淡入上移，消掉生硬感；时长压得很短，不让人"等动画"。
   挂在 #app.page-in 上、由 app.js 在每次 render 后重新触发。
   用户开了「减弱动态效果」时不播。 */
@media (prefers-reduced-motion: no-preference) {
  #app.page-in .page { animation: page-in .16s ease-out; }
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.tbar-name { letter-spacing: .01em; }

/* ==================== 登录页 ==================== */
/* 手机上取消 .page 的左右内边距，让品牌头图通栏；表单卡保留 14px 边距 */
.page.login-page { padding: 0 0 40px; }
.login-grid { display: block; }

.login-hero {
  position: relative; overflow: hidden;
  padding: 32px 22px 68px;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(155deg, #5f4ddc 0%, #7a68f0 52%, #a294ff 100%);
  color: #fff; text-align: center;
}
/* 五线谱：五条极细的白线贴着底部，音符落在线上。
   手机上头图矮，线必须收在底部一条 44px 的带子里，
   否则会横穿副标题（第一版截图里就是这么压上去的）。 */
.login-staff { position: absolute; inset: 0; pointer-events: none; }
.login-staff i {
  position: absolute; left: -6%; right: -6%; height: 1px;
  background: rgba(255,255,255,.22);
}
.login-staff i:nth-child(1) { bottom: 8px; }
.login-staff i:nth-child(2) { bottom: 18px; }
.login-staff i:nth-child(3) { bottom: 28px; }
.login-staff i:nth-child(4) { bottom: 38px; }
.login-staff i:nth-child(5) { bottom: 48px; }
.login-note { position: absolute; color: rgba(255,255,255,.5); line-height: 1; }
.login-note.n1 { font-size: 24px; bottom: 34px; left: 10%; }
.login-note.n2 { font-size: 30px; bottom: 10px; left: 30%; }
.login-note.n3 { font-size: 20px; bottom: 24px; right: 13%; }

/* 手机上谱表只有 44px 高、还会被表单压掉一半，放大成水印又会被裁成一小截。
   所以手机上干脆不要音符：干净的通栏渐变 + 一点柔光，比"半截装饰"体面。 */
@media (max-width: 767px) {
  .login-staff { display: none; }
  .login-hero::after {
    content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%;
    right: -110px; top: -120px; pointer-events: none;
    background: radial-gradient(circle, rgba(255,255,255,.28), rgba(255,255,255,0) 70%);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .login-note { animation: note-bob 4.5s ease-in-out infinite alternate; }
  .login-note.n2 { animation-duration: 5.5s; animation-delay: -1.2s; }
  .login-note.n3 { animation-duration: 6.5s; animation-delay: -2.4s; }
}
@keyframes note-bob { from { transform: translateY(-4px); } to { transform: translateY(4px); } }

.login-logo {
  position: relative; z-index: 1;
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.34);
  box-shadow: 0 10px 24px rgba(40,26,110,.28);
}
.login-h1 { position: relative; z-index: 1; margin: 0; font-size: 28px; font-weight: 700; letter-spacing: .08em; }
/* 备案名：与 ICP 备案信息逐字一致，公安核验要对照网站名称。
   只做一行小字，不参与视觉层级——学生认的是上面的品牌名。 */
.login-sub { position: relative; z-index: 1; margin: 7px 0 0; font-size: 12.5px; letter-spacing: .06em; color: rgba(255,255,255,.8); }
.login-p { position: relative; z-index: 1; margin: 8px 0 0; font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,.88); }
.login-points { position: relative; z-index: 1; display: none; list-style: none; margin: 22px 0 0; padding: 0; text-align: left; }
.login-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: rgba(255,255,255,.94); margin-bottom: 10px; }
.login-points b {
  flex: none; width: 22px; height: 22px; border-radius: 7px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center;
}

/* 表单卡从品牌区下沿压上来，形成层次 */
.login-form { position: relative; z-index: 2; margin-top: -38px; padding: 0 14px; }
.login-card { padding: 18px 16px; border-radius: 20px; box-shadow: 0 14px 34px rgba(60,48,140,.14); }
/* 登录方式切换（验证码 / 密码 / 设置密码）：两枚文字按钮横排，居中，不抢主按钮的注意力 */
.login-alt { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.login-alt .linklike { font-size: 13px; }
.login-tip {
  margin-top: 12px; padding: 14px 16px; border-radius: 16px;
  background: var(--card); box-shadow: 0 1px 2px rgba(31,35,41,.04);
}

@media (min-width: 768px) {
  .login-points { display: block; }
  /* 平板/桌面上头图够高，五线谱可以铺成一整条 80px 的谱表 */
  .login-hero { text-align: left; padding: 40px 34px 108px; }
  .login-logo { margin: 0 0 16px; }
  .login-staff i:nth-child(1) { bottom: 26px; }
  .login-staff i:nth-child(2) { bottom: 42px; }
  .login-staff i:nth-child(3) { bottom: 58px; }
  .login-staff i:nth-child(4) { bottom: 74px; }
  .login-staff i:nth-child(5) { bottom: 90px; }
  .login-note.n1 { font-size: 30px; bottom: 70px; left: 14%; }
  .login-note.n2 { font-size: 38px; bottom: 34px; left: 34%; }
  .login-note.n3 { font-size: 24px; bottom: 58px; right: 16%; }
}
/* 桌面：左品牌栏 + 右表单栏 */
@media (min-width: 1024px) {
  #app[data-path="/login"] { --shell: 1080px; }
  .page.login-page { padding: 34px 28px 60px; }
  .login-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    gap: 34px; align-items: stretch;
  }
  .login-hero {
    display: flex; flex-direction: column; justify-content: flex-start;
    border-radius: 28px; padding: 60px 44px 120px; min-height: 560px;
  }
  .login-h1 { font-size: 40px; }
  .login-p { font-size: 15px; max-width: 22em; }
  .login-points { margin-top: 30px; }
  .login-points li { font-size: 15px; margin-bottom: 12px; }
  .login-form { margin-top: 0; padding: 0; }
  .login-card { padding: 24px 22px; }
}

/* ==================== 学生首页 hero ==================== */
/* 一张卡讲完"这周做到哪了"：一句话结论 + 环形进度 + 四项拆解。
   环用 conic-gradient 画，百分比由内联的 --pct 传进来。 */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: start; gap: 4px 12px;
  padding: 18px 18px 0; margin-bottom: 14px;
  border-radius: 22px; color: #fff;
  background: linear-gradient(152deg, #5546c8 0%, #7a68f0 58%, #9d8dff 100%);
  box-shadow: 0 12px 28px rgba(85,70,200,.26);
}
.hero::after {
  content: ''; position: absolute; z-index: 0; width: 240px; height: 240px;
  right: -80px; top: -110px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.30), rgba(255,255,255,0) 70%);
}
.hero > * { position: relative; z-index: 1; }
/* 全部做完时换成绿色：这是"可以歇了"的信号，不该还是紫色 */
.hero.ok { background: linear-gradient(152deg, #0c7a45 0%, #14a05c 58%, #3ec489 100%); box-shadow: 0 12px 28px rgba(12,122,69,.24); }

.hero-top { min-width: 0; }
.hero-kicker { font-size: 11.5px; letter-spacing: .14em; color: rgba(255,255,255,.72); }
.hero-title { margin-top: 6px; font-size: 18px; font-weight: 700; line-height: 1.35; }
.hero-sub { margin-top: 4px; font-size: 13px; color: rgba(255,255,255,.86); }
.hero-week { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: rgba(255,255,255,.78); }
.hero-week em { font-style: normal; color: rgba(255,255,255,.6); }

.hero-ring {
  position: relative; flex: none; width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center; align-content: center; gap: 1px; text-align: center;
}
.hero-ring::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#fff calc(var(--pct) * 1%), rgba(255,255,255,.22) 0);
  -webkit-mask: radial-gradient(closest-side, transparent 66%, #000 68%);
  mask: radial-gradient(closest-side, transparent 66%, #000 68%);
}
.hero-ring b { font-size: 17px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-ring span { font-size: 10px; color: rgba(255,255,255,.8); }

.hero-stats {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px -18px 0; padding: 12px 6px;
  background: rgba(255,255,255,.10);
  border-top: 1px solid rgba(255,255,255,.18);
}
.hero-stat { position: relative; text-align: center; }
.hero-stat b { display: block; font-size: 18px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: 10.5px; color: rgba(255,255,255,.78); }
.hero-stat + .hero-stat::before {
  content: ''; position: absolute; left: 0; top: 12%; bottom: 12%; width: 1px;
  background: rgba(255,255,255,.16);
}
/**
 * 平时分底下那行规则小字。
 * 统计条是 4 列 grid，这行要跨满 4 列单独占一行（grid-column: 1 / -1）。
 * 不写这一条就会挤进第 5 格，把 4 个数字挤成两行。
 * max-width + 居中：桌面宽屏下一行太长不好读。
 */
.hero-note {
  grid-column: 1 / -1;
  margin-top: 10px; padding: 0 6px;
  font-size: 11px; line-height: 1.65; text-align: center;
  color: rgba(255,255,255,.78);
}
.hero-note span { display: block; }
/* 第二行是固定规则，比状态淡一档：先读"什么时候加"，规则当注释 */
.hero-note span + span { color: rgba(255,255,255,.55); }
@media (min-width: 1024px) {
  .hero { padding: 24px 26px 0; border-radius: 24px; }
  .hero-title { font-size: 24px; }
  .hero-sub { font-size: 14.5px; }
  .hero-ring { width: 104px; height: 104px; }
  .hero-ring b { font-size: 23px; }
  .hero-ring span { font-size: 11px; }
  .hero-stats { margin: 20px -26px 0; padding: 16px 10px; }
  .hero-stat b { font-size: 24px; }
  .hero-stat span { font-size: 12px; }
  .hero-note { font-size: 12px; }
}

/* 区块标题加一道主色竖条：扫读时先找到分段，再进内容 */
.section { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.section::before {
  content: ''; flex: none; width: 3px; height: 13px; border-radius: 2px;
  background: linear-gradient(180deg, #8e7cff, #6c5ce7);
}

/* ==================== 听辨页：圆形播放键 + 题目圆点 ==================== */
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.quiz-count { font-size: 13px; font-weight: 600; color: var(--sub); font-variant-numeric: tabular-nums; }
.quiz-dots { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 58%; }
.quiz-dots i { width: 6px; height: 6px; border-radius: 999px; background: #ddd9ec; transition: width .2s, background .2s; }
.quiz-dots i.done { background: var(--ok); }
.quiz-dots i.cur { width: 16px; background: var(--main); }

.play {
  position: relative; display: grid; place-items: center;
  width: 96px; height: 96px; margin: 8px auto 0; padding: 0;
  border: none; border-radius: 50%; color: #fff; cursor: pointer;
  background: linear-gradient(145deg, #8776f5, #5b4bd1);
  box-shadow: 0 10px 24px rgba(91,75,209,.34);
  transition: transform .18s, box-shadow .18s;
}
.play svg { width: 40px; height: 40px; }
.play::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(108,92,231,.35);
  animation: play-ring 2.6s ease-out infinite;
}
@keyframes play-ring {
  0% { transform: scale(.92); opacity: .65; }
  70% { transform: scale(1.16); opacity: 0; }
  100% { transform: scale(1.16); opacity: 0; }
}
.play:active { transform: scale(.94); }
.play-hint { margin: 10px 0 2px; text-align: center; font-size: 12px; color: var(--faint); }
.quiz .opt-grid { margin-top: 14px; }
@media (min-width: 1024px) {
  .play { width: 112px; height: 112px; }
  .play svg { width: 46px; height: 46px; }
}

/* ==================== 底部导航：补图标 ==================== */
/* 图标用 mask 上色，颜色直接取 currentColor——选中变主色时图标自动跟上，
   不用为每个状态各准备一份彩色图。 */
.tabbar { border-top-color: rgba(108,92,231,.12); }
.tabbar-item { position: relative; padding: 9px 0 8px; transition: color .2s; }
.tabbar-item::before {
  content: ''; display: block; width: 22px; height: 22px; margin: 0 auto 3px;
  background: currentColor; opacity: .85;
  -webkit-mask: var(--tabicon) center / contain no-repeat;
  mask: var(--tabicon) center / contain no-repeat;
  transition: transform .2s, opacity .2s;
}
.tabbar-item.on::before { opacity: 1; transform: translateY(-1px); }
.tabbar-item.on::after {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--main);
}
.tabbar-item.on { color: var(--main); font-weight: 600; }
.tabbar-item[data-tab="work"] {
  --tabicon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 6h12M8 12h12M8 18h12'/%3E%3Ccircle cx='4' cy='6' r='1.4' fill='%23000' stroke='none'/%3E%3Ccircle cx='4' cy='12' r='1.4' fill='%23000' stroke='none'/%3E%3Ccircle cx='4' cy='18' r='1.4' fill='%23000' stroke='none'/%3E%3C/svg%3E");
}
.tabbar-item[data-tab="free"] {
  --tabicon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E");
}
.tabbar-item[data-tab="fb"] {
  --tabicon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}
body.has-tabbar .page { padding-bottom: 84px; }
@media (min-width: 1024px) {
  body.has-tabbar .page { padding-bottom: 104px; }
  /* 宽屏的导航是居中的三个胶囊，不是贴着屏幕底边的 tab，
     上面那道"标签页指示线"在这里会像一条多余的短线，改成浅色底 */
  .tabbar-item.on::after { display: none; }
  .tabbar-item { border-radius: 14px; }
  .tabbar-item.on { background: rgba(108,92,231,.09); }
}

/* ---- 主按钮：渐变 + 微动效（只动 transform/box-shadow/opacity） ---- */
.btn, .ui-btn { transition: transform .2s, box-shadow .2s, opacity .2s; }
.btn:not(.ghost):not(:disabled),
.ui-btn:not(.ghost):not(.danger) {
  background: linear-gradient(135deg, #7a68f0, #6c5ce7);
  box-shadow: 0 4px 14px rgba(108,92,231,.28);
}
.btn:disabled, .ui-btn:disabled { box-shadow: none; }
@media (hover: hover) {
  .btn:not(:disabled):hover, .ui-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(108,92,231,.34);
  }
}
.btn:not(:disabled):active, .ui-btn:not(:disabled):active { transform: scale(.97); transition-duration: .12s; }

/* ---- 答题选项：悬停浮起、按下收缩 ---- */
.opt { transition: transform .15s, box-shadow .15s, border-color .15s, background .15s; }
@media (hover: hover) {
  .opt:hover {
    border-color: rgba(108,92,231,.45); background: #fff;
    box-shadow: 0 4px 12px rgba(108,92,231,.12); transform: translateY(-2px);
  }
}
.opt:active { transform: scale(.96); transition-duration: .1s; }

/* ---- 卡片与统计块：更柔和的双层阴影 ---- */
.card, .list, .stat {
  box-shadow: 0 1px 2px rgba(31,35,41,.04), 0 4px 14px rgba(93,79,197,.06);
}

/* ---- 进度条：渐变填充 ---- */
.bar-in.doing { background: linear-gradient(90deg, #8e7cff, #6c5ce7); }
.bar-in.ok { background: linear-gradient(90deg, #34c07c, #12a150); }

/* ---- 分段控件 / 筛选胶囊：选中态统一为渐变 ---- */
.seg { background: #eceaf6; }
.seg-item.on { box-shadow: 0 2px 8px rgba(108,92,231,.18); }
.chip.on {
  background: linear-gradient(135deg, #7a68f0, #6c5ce7);
  border-color: transparent;
}


/* ---- 键盘焦点可见性（WCAG 2.4.7）----
 * 原样式只有 input 有 :focus 描边；按钮/选项/胶囊补上 focus-visible 外圈，
 * 鼠标点击不触发，Tab 导航才显示。 */
.btn:focus-visible, .ui-btn:focus-visible, .opt:focus-visible, .input:focus-visible,
.textarea:focus-visible, .chip:focus-visible, .linklike:focus-visible,
.switch:focus-visible, .seg-item:focus-visible, .nchip:focus-visible, .nbtn:focus-visible {
  outline: 3px solid rgba(108,92,231,.45);
  outline-offset: 2px;
}

/* ---- 尊重系统"减少动态效果"偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==================== 教师工作台（第三版） ====================
 * 教师端和学生端的目标不同：学生要"愿意练"，老师要"一眼看出谁掉了队"。
 * 所以这里不加装饰，只做三件事：数据前置、完成率可视化、列表卡片化。
 * 全部用 #app[data-path^="/t"] 作用域限定，学生端页面完全不受影响。 */

#app[data-path^="/t"] .tbar { padding-top: 14px; padding-bottom: 13px; }
#app[data-path^="/t"] .tbar-name { font-size: 17px; font-weight: 700; letter-spacing: .01em; }
/* 顶部操作（学期/退出/返回）原来只是纯文字链接，挤在一起分不清是按钮。
   给它们一个浅色胶囊底，手指更容易点中，也不抢标题的注意力。 */
#app[data-path^="/t"] .tbar .linklike {
  padding: 6px 11px; border-radius: 9px;
  background: var(--card2); color: var(--sub); font-size: 13px;
}
#app[data-path^="/t"] .tbar .linklike:active { background: #e8e5f6; color: var(--main); }

/* ---- KPI 数据带：本周作业 / 还没交 / 待回复 ---- */
.kpi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 2px 0 8px; }
.kpi-cell {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 12px 11px;
}
.kpi-num {
  font-size: 23px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.kpi-num em { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--faint); margin-left: 3px; letter-spacing: 0; }
.kpi-lab { margin-top: 6px; font-size: 12px; color: var(--sub); }
/* 有事情没做完时数字变色：扫一眼就知道今天要不要去催人 */
.kpi-cell.warn .kpi-num { color: #c2410c; }
.kpi-cell.alert .kpi-num { color: var(--bad-text); }
.kpi-cell.good .kpi-num { color: #0f7a3d; }

/* ---- 完成率条：数字之外再给一个长度，不用心算 ---- */
.cbar {
  height: 6px; border-radius: 99px; background: #eceaf6;
  overflow: hidden; margin: 8px 0 6px;
}
.cbar > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #8e7cff, #6c5ce7);
  transition: width .45s cubic-bezier(.4,0,.2,1);
}
.cbar.ok > i { background: linear-gradient(90deg, #45cf9b, #12a06a); }
.cbar.low > i { background: linear-gradient(90deg, #ffb354, #f08519); }
.pct {
  font-size: 15px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}

/* ---- 列表：从"表格行"改成"一张一张的卡" ---- */
#app[data-path^="/t"] .list { background: transparent; border-radius: 0; overflow: visible; margin-bottom: 4px; }
#app[data-path^="/t"] .lrow {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  margin-bottom: 8px; padding: 13px 14px;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
#app[data-path^="/t"] .lrow:last-child { border-bottom: 1px solid var(--line); }
#app[data-path^="/t"] .lrow:active { background: var(--card2); }
@media (hover: hover) {
  #app[data-path^="/t"] .lrow:hover {
    border-color: rgba(108,92,231,.26);
    box-shadow: 0 6px 18px rgba(60,48,140,.08);
    transform: translateY(-1px);
  }
}
/* 行内嵌的"展开名单"子行不要卡片化——它是父行的内容，不是并列的一条 */
#app[data-path^="/t"] .lrow[style*="padding-left:0"] { background: transparent; border: 0; border-radius: 0; margin-bottom: 0; }

/* 作业类型徽标：音程 / 视唱 用不同色相区分，扫列表时先分类再看内容 */
.kind {
  display: inline-flex; align-items: center; height: 19px; padding: 0 7px;
  border-radius: 6px; font-size: 11px; font-weight: 600;
  margin-right: 7px; vertical-align: 1px;
}
.kind.ear { background: rgba(108,92,231,.10); color: #5b48cf; }
.kind.sing { background: rgba(12,155,120,.12); color: #0b7a5e; }

/* 选人/选班的小方框：原来只有"已选/未选"两个字，选没选上要靠读文字 */
.pickbox {
  flex: none; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid #d5d2e4; background: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px; transition: background .15s, border-color .15s;
}
.pickbox::after {
  content: ''; width: 9px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px); opacity: 0; transition: opacity .15s;
}
.pickbox.on { background: var(--main); border-color: var(--main); }
.pickbox.on::after { opacity: 1; }
#app[data-path="/t/assign"] .lrow.on { border-color: rgba(108,92,231,.42); background: rgba(108,92,231,.05); }

/* 名单序号：一个班四五十人时，数到第几行这件事本身就该由界面来做 */
.rno {
  flex: none; width: 24px; height: 24px; border-radius: 8px;
  background: var(--card2); color: var(--sub); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px; font-variant-numeric: tabular-nums;
}

#app[data-path^="/t"] .sec-title {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  letter-spacing: .03em; margin: 20px 2px 9px;
}
#app[data-path^="/t"] .sec-title .faint { font-weight: 400; letter-spacing: 0; }

/* 行右侧的「详情 ›」被窄列拆成两行过，锁住不换行；
   .btn-row 里的按钮在极端窄屏会被压成竖排文字，也一并锁住。 */
#app[data-path^="/t"] .lrow-right { white-space: nowrap; }
.btn-row .btn { white-space: nowrap; }
.btn-row .input { min-width: 0; }

/* 班级页的作业行：右侧挤着「交 18/25 / 未完成 7 / 删除」三件，
   进度条塞在正文里只剩一小截，看起来像装饰。改成贴着整行底部的一条，
   宽度和整行一致，才能一眼比出哪份作业更缺人。 */
#app[data-path^="/t"] .lrow.asgbar { position: relative; padding-bottom: 17px; }
#app[data-path^="/t"] .lrow.asgbar .cbar {
  position: absolute; left: 14px; right: 14px; bottom: 8px; margin: 0;
}

/* ==================== 宽屏：把竖向空间分配开 ====================
 * 之前 .cols 是 align-items:start，内容有多少排多少：宽屏上工作台
 * 到一半就结束，下面一大片空白，看着像"没加载完"。
 * 现在页面撑满一屏高度，快捷入口吸在底部，中间内容区自己分配剩余空间。 */
@media (min-width: 1024px) {
  /* 只把「工作台」改成纵向 flex。别的教师页（布置作业/班级/读谱）里
     .btns 是靠 margin:auto + max-width 居中的块级元素，一旦父级变成 flex，
     auto 外边距会让它缩成内容宽度——按钮会突然挤成两个小字。 */
  #app[data-path="/t"] .page {
    display: flex; flex-direction: column;
    min-height: calc(100vh - 64px);
  }
  #app[data-path="/t"] .page > .cols { flex: 1 1 auto; }

  /* 老师打开工作台，最先读的就是这三个数字——宽屏上没理由还是手机的字号 */
  .kpi { gap: 14px; }
  .kpi-cell { padding: 18px 18px 16px; border-radius: 18px; }
  .kpi-num { font-size: 40px; letter-spacing: -.035em; }
  .kpi-num em { font-size: 13px; margin-left: 4px; }
  .kpi-lab { font-size: 13px; margin-top: 9px; }

  /* 列表行也放宽一点，跟着放大的字号走 */
  #app[data-path^="/t"] .lrow { padding: 15px 16px; }
  #app[data-path^="/t"] .lrow.asgbar { padding-bottom: 19px; }
  #app[data-path^="/t"] .lrow.asgbar .cbar { left: 16px; right: 16px; }
}

/* ---- 宽屏底部的快捷入口（手机端不出现：那里有底部固定的「布置作业」） ---- */
.quick { display: none; }
@media (min-width: 1024px) {
  .quick {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px; margin-top: auto; padding-top: 26px;
  }
}
.qcard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 15px 16px; text-align: left; cursor: pointer;
  font: inherit; color: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s;
}
.qcard b { font-size: 15px; font-weight: 600; margin-top: 2px; }
.qcard > span:last-child { font-size: 12.5px; color: var(--sub); }
.qcard .qi {
  width: 32px; height: 32px; border-radius: 11px; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(108,92,231,.10); color: var(--main);
}
.qcard .qi svg { width: 18px; height: 18px; }
@media (hover: hover) {
  .qcard:hover {
    border-color: rgba(108,92,231,.32); background: #fdfcff;
    box-shadow: 0 8px 22px rgba(60,48,140,.10); transform: translateY(-2px);
  }
}
.qcard:active { transform: translateY(0); }

/* 宽屏上「布置作业」已经有了底部快捷入口那一格，
   手机用的固定按钮在这里会压在快捷入口上面，必须收起来。 */
@media (min-width: 1024px) {
  #app[data-path="/t"] .fixed-bottom { display: none; }
}

/* 宽屏上「布置作业」已经有了底部快捷入口那一格，
   手机用的固定按钮在这里会压在快捷入口上面，必须收起来。 */
@media (min-width: 1024px) {
  #app[data-path="/t"] .fixed-bottom { display: none; }
}

/* 小号按钮在窄沟里会把"复制未加入名单"折成两行，锁住单行 */
.btn.sm { white-space: nowrap; }
/* 名单序号：之前的底色和白卡太接近，数字几乎看不见 */
.rno { background: #efedf9; color: #5c5578; font-weight: 600; }

/* 小号按钮在窄沟里会把"复制未加入名单"折成两行，锁住单行 */
.btn.sm { white-space: nowrap; }
/* 名单序号：之前的底色和白卡太接近，数字几乎看不见 */
.rno { background: #efedf9; color: #5c5578; font-weight: 600; }

@media (min-width: 1024px) {
  /* 表单页铺满 1180 会让「作业名称」这类输入框拉到近 900px，读起来很散。
     收窄到 900 并居中，宽度跟着正文走。 */
  #app[data-path="/t/assign"] .page,
  #app[data-path="/t/term"] .page {
    max-width: 900px; margin-left: auto; margin-right: auto;
  }
  /* 灰底页面上，透明底的 ghost 按钮几乎只剩一圈看不见的线，像纯文字。
     给它白底，按钮才回得去"可以点"的样子。 */
  .btn.ghost { background: var(--card); }
}

@media (min-width: 1024px) {
  /* 表单页铺满 1180 会让「作业名称」这类输入框拉到近 900px，读起来很散。
     收窄到 900 并居中，宽度跟着正文走。 */
  #app[data-path="/t/assign"] .page,
  #app[data-path="/t/term"] .page {
    max-width: 900px; margin-left: auto; margin-right: auto;
  }
  /* 灰底页面上，透明底的 ghost 按钮几乎只剩一圈看不见的线，像纯文字。
     给它白底，按钮才回得去"可以点"的样子。 */
  .btn.ghost { background: var(--card); }
}

/* ==================== 演示模式（?demo=） ====================
 * 课堂演示用：一组内存里的示例数据 + 顶部的"演示"提示条，
 * 教师端还多一个「学生视角」抽屉，把学生端真实页面嵌在手机框里。
 * 这一层只做"讲清楚现在看的是假数据"，不参与任何业务样式。 */

body.demo-on #app { padding-top: 34px; }

.demo-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 34px; z-index: 9999;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: #262040; color: #fff; font-size: 12.5px;
  box-shadow: 0 2px 10px rgba(30, 24, 60, .22);
}
.demo-bar .demo-txt { color: rgba(255, 255, 255, .82); }
.demo-bar .demo-exit {
  margin-left: auto; color: #d6cff8; text-decoration: none;
  font-size: 12.5px; padding: 4px 8px; border-radius: 8px;
  background: rgba(255, 255, 255, .10);
}

/* 小圆标：登录页的入口和顶部提示条共用 */
.demo-tag {
  display: inline-flex; align-items: center; height: 19px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(108, 92, 231, .12); color: #5b48cf;
}
.demo-bar .demo-tag { background: rgba(255, 255, 255, .18); color: #fff; }

/* ---- 登录页的演示入口 ---- */
.demo-entry {
  margin-top: 14px; padding: 14px 15px;
  background: var(--card); border: 1px dashed rgba(108, 92, 231, .38);
  border-radius: 16px;
}
.demo-entry-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--text);
}
.demo-entry-sub { margin-top: 5px; font-size: 12px; color: var(--sub); }
.demo-entry-btns { display: flex; gap: 8px; margin-top: 11px; }
.demo-entry-btns .btn {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; white-space: nowrap;
}

/* ---- 教师端：学生视角 ---- */
.sv-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #8e7cff, #6c5ce7);
  color: #fff; font: inherit; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 24px rgba(108, 92, 231, .38);
  transition: transform .16s ease, box-shadow .16s ease;
}
.sv-fab svg { width: 17px; height: 17px; }
.sv-fab:active { transform: scale(.97); }
.sv-fab.on { background: #fff; color: var(--main); box-shadow: 0 8px 20px rgba(60, 48, 140, .18); }

.sv-panel {
  position: fixed; z-index: 910;
  top: 46px; right: 14px; width: 396px; max-width: calc(100vw - 28px);
  height: calc(100vh - 60px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(38, 30, 80, .26), 0 0 0 1px rgba(108, 92, 231, .10);
  opacity: 0; pointer-events: none;
  transform: translateX(24px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
}
.sv-panel.on { opacity: 1; pointer-events: auto; transform: none; }

.sv-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px 9px;
}
.sv-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.sv-close {
  margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 9px;
  background: var(--card2); color: var(--sub); font-size: 18px; line-height: 1;
  cursor: pointer;
}
.sv-tabs { display: flex; gap: 6px; padding: 0 12px 10px; }
.sv-tab {
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff;
  font-size: 12.5px; color: var(--sub); font: inherit; font-size: 12.5px;
}
.sv-tab.on {
  background: rgba(108, 92, 231, .10); border-color: rgba(108, 92, 231, .38);
  color: var(--main); font-weight: 600;
}
.sv-body { flex: 1 1 auto; background: #f1eff8; border-top: 1px solid var(--line); }
.sv-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

@media (max-width: 1023px) {
  .sv-fab { right: 14px; bottom: 84px; padding: 10px 14px; font-size: 13px; }
  .sv-panel {
    top: 34px; right: 0; left: 0; width: auto; max-width: none;
    height: auto; bottom: 0; border-radius: 0;
  }
}

/* 宽屏上打开学生视角时，教师页往左让位，而不是被抽屉盖住——
   上课演示要的是"左边我看到的、右边学生看到的"同屏对照。 */
@media (min-width: 1024px) {
  body.sv-open #app { padding-right: 412px; transition: padding-right .2s ease; }
}

/* ---------- 布置页：草稿自动保存 ---------- */

/* 恢复提示条。用左侧主色竖条和普通卡片区分开——它是"刚刚发生了一件事"的
   通知，不是又一块内容，不该和下面的作业卡片看起来一样。 */
.draft-banner { border-left: 3px solid var(--main); }
.draft-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.draft-line .tag { flex: none; }

/* 谱子没存下来时的警告。用 warn 色而不是 bad：内容还在、只是要重传谱子，
   不是数据损坏，用红色会让人以为作业废了。 */
.draft-warn { color: var(--warn-text); margin-top: 8px; line-height: 1.55; }

/* 常驻的那行小字：回答"我现在关掉会不会白填"。
   做成一行浅灰而不是横幅——它需要一直在场，太显眼反而抢走对正文的注意力。 */
.draft-tip { font-size: 12px; color: var(--faint); padding: 0 2px 12px; line-height: 1.5; }

/* ==================== 顶部「正在联网」进度条 ====================
   点完按钮几百毫秒内屏幕上毫无变化，是人觉得"卡死、没反应"的直接原因。
   这条 2px 的细线不解释、不打扰，只在真的有云端请求在飞时出现。 */

.nprog {
  position: fixed; top: 0; left: 0; right: 0; height: 2.5px;
  z-index: 9999; pointer-events: none;
  background: transparent;
  opacity: 0; transition: opacity .18s ease;
  overflow: hidden;
}
.nprog.in { opacity: 1; }
.nprog i {
  display: block; height: 100%; width: 100%;
  background: var(--main);
  transform: scaleX(0); transform-origin: 0 50%;
}
/* 跑动阶段：一条永远走不到头的动画（真实进度拿不到，假装精确反而更假） */
.nprog i.run { animation: nprog-run 1.1s ease-in-out infinite; }
.nprog.done i { transition: transform .2s ease-out; }
@keyframes nprog-run {
  0%   { transform: translateX(-100%) scaleX(.45); }
  55%  { transform: translateX(-10%)  scaleX(.5); }
  100% { transform: translateX(0)     scaleX(.35); }
}

/* ==================== 第三版：两端一致性收口（2026-10-22） ====================
 * 这一版不新增功能，只解决三类"看得见但用不顺"的问题：
 *   1. 教师端「学生视角」浮标压住正文——读谱页正好盖在「保存参考」上，
 *      布置页正好盖在「组数」输入框上，点了没反应，看起来像按钮坏了。
 *   2. 读谱页四个操作按钮在手机上溢出卡片，最右边那个被裁成「导入 Mus」。
 *   3. 底部固定操作条与正文之间没有留白，最后一张卡片永远差一口才露全。
 * 另附可达性收口：键盘焦点可见、辅助文字对比度、等宽数字、减弱动效。
 */

/* ---- 1. 焦点可见 ----
 * 上课演示常常用键盘/遥控笔翻页，焦点看不见就等于"不知道按到哪了"。
 * 只在 :focus-visible（键盘触发）时画环，鼠标点击不会多出一圈。 */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--main);
  outline-offset: 2px;
}
/* 输入框自身已有边框+光晕的焦点态，再套一圈外框会显得脏 */
.input:focus-visible,
.textarea:focus-visible,
.score-in:focus-visible { outline: none; }

/* ---- 2. 按钮行允许收缩与换行 ----
 * .btn 的 min-width 默认是 auto（等于文字宽度）。一行放四个按钮时，
 * 「导入 MusicXML」撑住不肯缩，整排就溢出卡片。给 min-width:0 让它能缩；
 * 两列排布的加 .split，手机上正好 2×2，不再裁字。 */
.btns { flex-wrap: wrap; }
.btns > .btn,
.btns > .file-pick { min-width: 0; }
.btns.split > .btn,
.btns.split > .file-pick { flex: 1 1 calc(50% - 5px); }

/* ---- 3. 底部操作条 / 浮标 / 正文三者的让位 ----
 * .fixed-bottom 是 sticky，滚动时一直压在正文上方。原来它只有一层很淡的
 * 渐变，卡片文字会从按钮底下透出来；补一段不透明度更高的渐隐带。 */
.fixed-bottom {
  padding-top: 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top,
    var(--bg) 58%, rgba(246, 245, 251, .92) 80%, rgba(246, 245, 251, 0));
}
/* 页面末尾留出主按钮的高度，最后一张卡才能完整滚到按钮上方 */
body.has-fixed-bottom .page { padding-bottom: 88px; }
@media (min-width: 1024px) {
  body.has-fixed-bottom .page { padding-bottom: 104px; }
}

/* ---- 4. 触感：按压有反馈，hover 只给真有指针的设备 ----
 * 手机上 :hover 会在松手后"粘住"，所以统一关在 hover:hover 里。 */
.btn { transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease; }
.btn:not(:disabled):active { transform: scale(.985); }
@media (hover: hover) {
  .btn.ghost:not(:disabled):hover { background: rgba(108, 92, 231, .07); border-color: rgba(108, 92, 231, .34); }
  .btn:not(.ghost):not(:disabled):hover { filter: brightness(1.05); }
  .lrow:hover { background: var(--card2); }
  .nchip:hover { border-color: rgba(108, 92, 231, .34); }
  .nbtn:hover { background: #efedf9; color: var(--main); }
}

/* ---- 5. 数字等宽：位数一变（9→10）整行不跟着抖 ---- */
.stat-num,
.pct,
.score-in,
.nchip-i,
.nchip-d,
.playnow b { font-variant-numeric: tabular-nums; }

/* ---- 6. 减弱动效：系统里开了"减少动态效果"就不要再有位移和循环动画 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:not(:disabled):active { transform: none; }
}

/* ---- 演示条里的「学生视角」按钮 ----
 * 替代原来右下角的浮标：浮标是 fixed，注定压住正文（读谱页的「保存参考」、
 * 布置页的「组数」都被它盖过）。演示条始终在最上方，不遮任何内容。
 * 手机上把「，不会写入云端」收起来，按钮和「退出演示」才排得下。 */
.demo-bar .demo-sv {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border: 0; border-radius: 7px;
  background: rgba(255, 255, 255, .16); color: #fff;
  font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease;
}
.demo-bar .demo-sv svg { width: 13px; height: 13px; flex: 0 0 auto; }
.demo-bar .demo-sv:hover { background: rgba(255, 255, 255, .26); }
.demo-bar .demo-sv.on { background: #fff; color: #4a3ac0; }
.demo-sv + .demo-exit { margin-left: 8px; }

/* 窄屏：演示条只有 34px 一行，文字先让位给按钮 */
@media (max-width: 560px) {
  .demo-bar .demo-long { display: none; }
  .demo-bar .demo-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ==================== 反馈聊天（师生共用，见 utils/chat.js） ====================
   为什么单独一套样式而不是复用 .lrow：
   .lrow 是"一行一条记录"（作业、班级、名单），一行只有主副两行文字；
   会话列表需要头像、右上角时间、右下角未读角标，结构不同，硬套会让
   两种列表互相迁就。聊天页则完全是另一套版式（固定头 + 滚动区 + 输入栏）。 */

/* ---- 会话列表 ---- */
.thread-list { display: flex; flex-direction: column; gap: 8px; }
.thread {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--card); border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.05); cursor: pointer;
}
.thread:active { background: var(--card2); }
.thread-avatar {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #8f7bff, #6c5ce7);
}
.thread-avatar.tea { background: linear-gradient(135deg, #8f7bff, #6c5ce7); }
.thread-avatar.stu { background: linear-gradient(135deg, #5ac8b0, #12a150); }
.thread-main { flex: 1; min-width: 0; }
.thread-top { display: flex; align-items: baseline; gap: 8px; }
.thread-name { font-size: 15px; font-weight: 600; }
.thread-time { margin-left: auto; flex: none; font-size: 11.5px; color: var(--faint); }
.thread-bottom { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.thread-last {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--sub);
}
.thread-dot {
  flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: 11px; line-height: 18px;
  text-align: center; font-weight: 600;
}
.thread-wait {
  flex: none; font-size: 11px; color: var(--warn-text);
  border: 1px solid currentColor; border-radius: 999px; padding: 0 7px;
}
.fb-new { width: 100%; margin-bottom: 12px; }

/* ---- 底部「反馈」上的未读角标 ---- */
.tabbar-item { position: relative; }
.tab-dot {
  position: absolute; top: 5px; left: calc(50% + 8px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: 10px; line-height: 16px;
  font-style: normal; text-align: center; font-weight: 600;
}

/* ---- 聊天页 ----
   固定高度而不是让文档自然增长：输入框必须一直贴在底部（微信式），
   否则消息一多就要滚到最下面才能打字。高度 = 视口 - 顶栏 - 页面留白，
   底部有 tabbar 时再减一层。 */
.chat-page {
  display: flex; flex-direction: column;
  height: calc(100dvh - 104px); min-height: 340px;
  background: var(--card2); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
body.has-tabbar .chat-page { height: calc(100dvh - 180px); }
.chat-holder { padding-bottom: 0; }

.chat-head {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 9px 10px; background: var(--card); border-bottom: 1px solid var(--line);
}
.chat-back {
  flex: none; width: 34px; height: 34px; padding: 0; border: none;
  background: transparent; color: var(--text); font-size: 28px; line-height: 1;
  cursor: pointer; border-radius: 10px;
}
.chat-back:active { background: var(--card2); }
.chat-id { flex: 1; min-width: 0; }
.chat-title { font-size: 15px; font-weight: 600; }
.chat-sub {
  font-size: 11.5px; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-del { flex: none; color: var(--bad-text); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 10px 12px 6px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.chat-day { text-align: center; margin: 10px 0 6px; }
.chat-day span {
  font-size: 11px; color: var(--faint);
  background: rgba(31,35,41,.06); border-radius: 999px; padding: 2px 9px;
}
.chat-time { text-align: center; font-size: 11px; color: var(--faint); margin: 8px 0 2px; }

.msg { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
.msg.me { flex-direction: row-reverse; }
.msg-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff; background: var(--main);
}
.msg.them .msg-avatar { background: linear-gradient(135deg, #5ac8b0, #12a150); }
.msg-avatar.ghost { background: transparent; }
.msg-bubble {
  max-width: min(76%, 460px); padding: 9px 12px; border-radius: 14px;
  font-size: 14.5px; line-height: 1.55; word-break: break-word;
  background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.msg.me .msg-bubble {
  background: var(--main); color: #fff; border-top-right-radius: 4px;
}
.msg.them .msg-bubble { border-top-left-radius: 4px; }

.chat-compose {
  flex: none; display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line);
}
.chat-compose textarea {
  flex: 1; min-width: 0; min-height: 68px; max-height: 140px; resize: none;
  border: 1px solid var(--line); background: var(--card2); border-radius: 12px;
  padding: 10px 12px; font-size: 15px; line-height: 1.45; font-family: inherit;
  color: var(--text); overflow-y: auto; display: block;
}
/* 长高由 chat.autogrow() 用 scrollHeight 实现（field-sizing: content 兼容性
   不够，且和显式 height 混用行为诡异，实测会凭空变高，不用） */
.chat-compose textarea:focus { outline: none; border-color: var(--main); background: var(--card); }
/* 发送键：小号胶囊，贴在输入框右下，不再和输入框抢视觉。
   .btn 基类是 width:100% 的整行大按钮，这里必须全部覆盖掉，
   否则就是「发送两个字占半屏」的来源。 */
.chat-send {
  display: block; width: auto; flex: 0 0 auto;
  height: 34px; padding: 0 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; margin-bottom: 3px; letter-spacing: 1px;
}
.chat-send:disabled { opacity: .55; }
.chat-closed {
  flex: none; padding: 12px; text-align: center; font-size: 12.5px;
  color: var(--faint); background: var(--card); border-top: 1px solid var(--line);
}
.chat-empty { text-align: center; color: var(--faint); font-size: 13px; padding: 40px 16px; }
.chat-empty.err { color: var(--bad-text); }

@media (min-width: 1024px) {
  .chat-page { height: calc(100dvh - 120px); }
  .thread:hover { background: var(--card2); }
}

/* ============================================================
   一周作业完成情况（/t/week）
   ============================================================
   【为什么用 grid 式的 div 而不是 <table>】
   <table> 在手机上的横向滚动和「首列吸住」都要 hack，
   而且列宽会被内容推着走——作业名一长，整张表就变形。
   这里第一列 position:sticky 吸住，其余列定宽 56px，
   横向多出多少都能滑，滑动时姓名一直在左边。 */

.wkt-week {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 0 2px 12px;
}
.wkt-wt { font-size: 15px; font-weight: 500; color: var(--text); }
.wkt-week .linklike[disabled] { color: var(--line); pointer-events: none; }
.wkt-classbar { flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.wkt-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
/* 列少时铺满整宽（不然右边空一大块，像少了几列）；列多时按最小宽横向滚 */
.wkt { min-width: 100%; }

.wkt-row { display: flex; align-items: stretch; min-width: max-content; border-bottom: 1px solid var(--line); }
.wkt-row:last-child { border-bottom: 0; }
.wkt-head { background: var(--card2); }

.wkt-name {
  position: sticky; left: 0; z-index: 1;
  width: 100px; flex: none; padding: 8px 10px;
  background: var(--card); border-right: 1px solid var(--line);
}
.wkt-head .wkt-name {
  background: var(--card2); font-size: 12px; color: var(--sub);
  display: flex; align-items: center;
}
.wkt-nm {
  font-size: 14px; color: var(--text); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wkt-no { font-size: 11px; color: var(--faint); margin-top: 2px; }

.wkt-c {
  flex: 1 0 48px; min-width: 48px; max-width: 96px; min-height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--faint);
  /* 分隔线要看得见：用 0.03 的黑时，连续几个绿格子会连成一整块色带，
     看着像"整行被选中"，而不是四个独立的勾 */
  border-left: 1px solid var(--line);
}
.wkt-head .wkt-c { min-height: 34px; font-size: 12.5px; color: var(--sub); }
.wkt-c.ok { color: var(--ok-text); font-weight: 500; background: #f1fbf5; }
.wkt-c.mid { color: var(--warn-text); }
.wkt-c.bad { color: var(--bad-text); }
/* 没交的格子放一道浅灰短横：什么都不画会和"这一列没有这个学生"混在一起 */
.wkt-c.miss::after {
  content: ''; width: 8px; height: 1.5px; border-radius: 1px; background: #e6e3f0;
}
.wkt-c[data-sing] { cursor: pointer; }

.wkt-done .wkt-nm { color: var(--sub); }

.wkt-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  margin-top: 10px; font-size: 12px; color: var(--sub);
}
.wkt-legend .lg {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 5px; vertical-align: -1px;
}
.wkt-legend .lg.ok { background: #c6ecd4; }
.wkt-legend .lg.miss { background: #ecebf4; }
.wkt-legend .lg.mid { background: #f6e0c4; }

@media (max-width: 560px) {
  .wkt-name { width: 86px; padding: 7px 8px; }
  .wkt-nm { font-size: 13px; }
  .wkt-no { font-size: 10.5px; }
  .wkt-c { flex-basis: 44px; min-width: 44px; font-size: 11.5px; }
  .wkt-legend { gap: 10px; font-size: 11.5px; }
}

/* ---- 页脚备案行（ICP 号 + 公安联网备案号） ----
   规定要求两个号在首页可见、可点击。做成一行居中的浅灰小字：
   不抢登录表单的注意力，但位置固定在页面尽头，审核员一眼能找到。 */
.beian {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px 10px; margin: 18px 0 4px; padding: 0 8px;
  font-size: 11.5px; line-height: 1.7; color: var(--faint);
  text-align: center;
}
.beian a { color: var(--faint); text-decoration: none; border-bottom: 1px solid transparent; white-space: nowrap; }
.beian a:hover { color: var(--sub); border-bottom-color: var(--line); }
.beian .beian-dot { color: var(--faint); opacity: .5; }
@media (max-width: 560px) {
  .beian { margin-top: 14px; font-size: 11px; gap: 4px 8px; }
}
