* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #eef1f6; --panel: #ffffff; --line: #dfe4ec;
  --text: #1f2937; --muted: #6b7280;
  --brand: #2563eb; --brand-dk: #1e4fbf;
  --danger: #dc2626; --ok: #16a34a; --warn: #d97706;
  --radius: 10px;
}
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 14px;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dk); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-plus-lg, .btn-minus-lg { flex: 1; padding: 12px; font-size: 17px; font-weight: bold; border-radius: 10px; border: 0; color: #fff; cursor: pointer; }
.btn-plus-lg { background: var(--ok); }
.btn-plus-lg:hover { background: #15803d; }
.btn-minus-lg { background: var(--danger); }
.btn-minus-lg:hover { background: #b91c1c; }
.ipt {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  font-size: 14px; background: #fff; color: var(--text); outline: none;
}
.ipt:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.ipt-amount { max-width: 130px; }
.ta { min-height: 90px; resize: vertical; }
.muted { color: var(--muted); font-weight: normal; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.6; }
.empty { color: var(--muted); text-align: center; padding: 28px 0; }

/* 顶栏 */
.topbar {
  height: 60px; background: linear-gradient(90deg, #16233f, #1f3a68);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0; z-index: 20;
}
.brand-title { font-size: 18px; font-weight: bold; letter-spacing: 1px; }
.brand-sub { font-size: 12px; opacity: .75; margin-top: 2px; }
.brand-row { display: flex; align-items: center; gap: 10px; }
/* 顶栏班级码 chip：新手找不到班级码的根因是它只藏在某个页签里。
   放在班名右边，永远可见、点一下即复制。 */
.code-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
  padding: 2px 9px 2px 7px; border-radius: 999px; cursor: pointer;
  background: rgba(93, 202, 165, .16); border: 1px solid rgba(93, 202, 165, .55);
  color: #b8f0dd; font-size: 11px; line-height: 18px; transition: all .15s;
}
.code-chip:hover { background: rgba(93, 202, 165, .28); color: #fff; border-color: #5dcaa5; }
.code-chip .cc-k { opacity: .8; }
.code-chip .cc-v {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700;
  font-size: 12.5px; letter-spacing: .08em; color: #eafff7;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.operator-chip { background: rgba(255,255,255,.14); padding: 5px 12px; border-radius: 999px; font-size: 12px; margin-right: 4px; }
.topbar .btn-ghost { color: #cfe0ff; border-color: rgba(255,255,255,.3); }
.topbar .btn-ghost:hover { color: #fff; border-color: #fff; }

/* 登录 */
.login-holder { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--panel); border-radius: 16px; padding: 34px 34px 26px; width: 360px; box-shadow: 0 10px 30px rgba(15,30,60,.12); }
.login-title { font-size: 20px; font-weight: bold; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.login-card .ipt { margin-bottom: 14px; }
.login-hint { margin-top: 12px; font-size: 12px; color: var(--warn); background: #fef6e7; border: 1px solid #f3d9a4; border-radius: 8px; padding: 8px 10px; }
.login-err { margin-top: 10px; color: var(--danger); font-size: 13px; background: #fdecec; border-radius: 8px; padding: 8px 10px; }

/* 主体 */
.app { max-width: 1180px; margin: 0 auto; padding: 16px 16px 60px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; background: #fff; padding: 6px; border-radius: 12px; border: 1px solid var(--line); }
.tab { border: 0; background: transparent; padding: 9px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--muted); }
.tab:hover { color: var(--brand); }
.tab.active { background: var(--brand); color: #fff; font-weight: 600; }

.panel { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel.active { display: block; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-title { font-size: 17px; font-weight: 600; }
.col-title { font-size: 15px; margin-bottom: 10px; }

/* 表格 */
.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.grid th { background: #f6f8fb; color: #4b5563; font-weight: 600; }
.grid tr:hover td { background: #f8faff; }
.grid .ops { display: flex; gap: 6px; }
.table-scroll { max-height: 56vh; overflow: auto; }
.table-scroll .grid th { position: sticky; top: 0; z-index: 1; }

.score-pos { color: var(--ok); font-weight: bold; }
.score-neg { color: var(--danger); font-weight: bold; }

.rank-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rank-col { background: #fbfcfe; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.medal { display: inline-block; min-width: 22px; text-align: center; border-radius: 6px; font-weight: bold; }
.medal.m1 { background: #fcd34d; color: #7c4a03; }
.medal.m2 { background: #cbd5e1; color: #334155; }
.medal.m3 { background: #fdba74; color: #7c2d12; }
.medal.mn { background: #eef2f7; color: var(--muted); }

@media (max-width: 900px) { .rank-cols { grid-template-columns: 1fr; } }

/* 积分操作 */
.score-wrap { max-width: 780px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; color: #374151; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 16px; cursor: pointer; font-size: 14px; font-weight: bold; }
.chip-plus { color: var(--ok); }
.chip-plus:hover { background: #f0fdf4; border-color: var(--ok); }
.chip-minus { color: var(--danger); }
.chip-minus:hover { background: #fef2f2; border-color: var(--danger); }
.chip.active-plus { background: var(--ok); color: #fff; border-color: var(--ok); }
.chip.active-minus { background: var(--danger); color: #fff; border-color: var(--danger); }
.chip-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.amount-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.amount-tip { color: var(--muted); font-size: 12px; }
.submit-row { display: flex; gap: 10px; margin-top: 4px; }
.score-result { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; line-height: 1.7; min-height: 18px; }
.score-result.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* 公告：原来限宽 780px，面板 1180px 右侧一大片空白 → 改成「编辑区 + 侧栏」两列 */
.notice-block {
  display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; align-items: start;
}
@media (max-width: 960px) { .notice-block { grid-template-columns: 1fr; } }
.notice-main { display: flex; flex-direction: column; gap: 14px; }
.notice-main .field { margin-bottom: 0; }
/* 输入框加高：公告最长 300 字，写起来更顺手，也让左列高度更接近右侧侧栏 */
#noticeInput { min-height: 132px; }
.notice-now { background: #fffbeb; border: 1px dashed #f0c36c; border-radius: 8px; padding: 12px; color: #92400e; font-size: 15px; min-height: 40px; }
.notice-now.empty-now { color: var(--muted); font-style: italic; }
/* 侧栏：小贴士 + 常用模板（点一下直接填入左边输入框，省得老师每次重打） */
.notice-side { display: flex; flex-direction: column; gap: 12px; }
.side-card { background: #fbfcfe; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.side-card h4 { font-size: 13px; margin-bottom: 8px; color: #374151; }
.side-card ul { padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.tpl-btn {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font-size: 13px; line-height: 1.5; color: #374151; margin-bottom: 8px;
}
.tpl-btn:hover { border-color: var(--brand); color: var(--brand); background: #f8faff; }
.tpl-btn b { display: block; font-size: 12px; color: var(--brand); margin-bottom: 3px; font-weight: 600; }
.tpl-btn span { display: block; }

/* 设置 */
/* 设置页顶层：标题 + 分区锚点导航。项太多时靠它跳，别让老师一路滚到底 */
.set-head { align-items: flex-end; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 4px; }
.set-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.set-nav a {
  font-size: 12px; color: #5b6b85; text-decoration: none; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fbfcfe;
  transition: all .15s;
}
.set-nav a:hover { color: var(--brand); border-color: #bcd0f5; background: #f2f7ff; }

/* 分区：每块有自己的小标题，视觉上把 12 个设置项切成人能数得清的几段 */
.set-sec { margin-top: 26px; scroll-margin-top: 78px; }
.set-sec:first-of-type { margin-top: 6px; }
.set-sec-h {
  margin: 0 2px 12px; padding-left: 9px; border-left: 3px solid var(--brand);
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.set-sec-h b { font-size: 14.5px; color: #1f2937; letter-spacing: .01em; }
.set-sec-h span { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* 设置页统一两列：分区之后每区最多 4 块，2×2 正好排满，不再出现行尾空位 */
#tab-settings .settings-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 900px) { #tab-settings .settings-cols { grid-template-columns: 1fr; } }
/* 通栏块内部的排布（大屏显示设置的两列字段等） */
.dsp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-items: start; }
.dsp-cols .dsp-col > .field:last-of-type { margin-bottom: 0; }
@media (max-width: 1000px) { .dsp-cols { grid-template-columns: 1fr; } }
.settings-block { background: #fbfcfe; border: 1px solid var(--line); border-left: 3px solid #c7d4ea; border-radius: 10px; padding: 14px 16px; }
.settings-block:hover { border-left-color: var(--brand); }
.danger-zone { border-color: #f5b5b5; border-left-color: var(--danger); background: #fffbfb; }
.danger-zone:hover { border-left-color: var(--danger); }
.danger-zone .col-title { color: var(--danger); }
/* 设置项「标签 — 控件」同行：两列宽度足够，比上下堆叠更紧凑 */
#tab-settings .settings-block .field {
  display: grid; grid-template-columns: minmax(84px, 34%) 1fr; gap: 10px;
  align-items: center; margin-bottom: 10px;
}
#tab-settings .settings-block .field > label { margin: 0; font-size: 13px; line-height: 1.45; }
#tab-settings .settings-block .field:last-of-type { margin-bottom: 0; }
/* 开关行（label 里嵌 checkbox）保持整行，别被压成两列 */
#tab-settings .settings-block .field-chk { grid-template-columns: 1fr; }
.settings-block .hint { font-size: 12px; line-height: 1.65; margin-top: 9px; }
.settings-block .submit-row { margin-top: 12px; }
/* 内容较少的页签：底部提示条，既填掉空白也给实在的用法建议 */
.tip-strip {
  margin-top: 16px; background: #fbfcfe; border: 1px solid var(--line);
  border-left: 3px solid #c7d4ea; border-radius: 10px; padding: 12px 16px;
  font-size: 12.5px; color: #4b5563; line-height: 1.85;
}
.tip-strip b { color: #1f2937; }
.tip-strip ul { padding-left: 18px; }
/* 合并页签内的子块（换组 · 小组 / 班委）：一个页签放两三类内容，用子标题分层 */
.sub-block { margin-top: 20px; }
.sub-block:first-of-type { margin-top: 14px; }
.sub-title { font-size: 14px; font-weight: 700; color: #334155; margin: 0 0 10px; }
.sub-title .muted { font-weight: 400; }
/* 提示条两列（换组注意事项 | 分组命名建议） */
.tip-strip.tip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; align-items: start; }
.tip-strip.tip-cols > div { min-width: 0; }
@media (max-width: 900px) { .tip-strip.tip-cols { grid-template-columns: 1fr; } }

/* 弹窗 */
/* 关键修复：作者样式 display 会覆盖 hidden 属性，必须用 !important 保证 [hidden] 生效 */
[hidden] { display: none !important; }
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 420px; max-width: 92vw; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal-sm { width: 380px; }
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.modal-text { color: #374151; line-height: 1.7; margin-bottom: 14px; white-space: pre-wrap; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); background: #1f2937; color: #fff; padding: 11px 22px; border-radius: 999px; z-index: 200; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }

/* ============ 批量导入 ============ */
.head-btns { display: flex; gap: 10px; }
#importText { font-family: Consolas, "Microsoft YaHei", monospace; line-height: 1.9; }

/* ============ 全班快评 ============ */
.quick-block { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--line); }
.quick-block .col-title { margin-bottom: 12px; }
.quick-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.quick-bar .chips { margin-bottom: 0; }
.ipt-amount-sm { width: 84px; }
.quick-reason { width: 220px; }
.quick-search { width: 320px; margin-bottom: 12px; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.q-gtitle { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: #64748b; margin-top: 6px; }
.q-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 6px 7px; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; font: inherit; }
.q-card:hover { transform: translateY(-2px); border-color: #93c5fd; box-shadow: 0 4px 12px rgba(59,130,246,.15); }
.q-card:active { transform: translateY(0) scale(.97); }
.q-card:disabled { opacity: .6; }
.q-name { font-size: 15px; font-weight: 600; color: #1e293b; }
.q-total { font-size: 12px; color: #94a3b8; }
.flash-plus { animation: qplus .7s ease; border-color: #16a34a !important; background: #f0fdf4 !important; }
@keyframes qplus { 0% { transform: scale(1); } 30% { transform: scale(1.12); background: #bbf7d0; } 100% { transform: scale(1); } }
.flash-minus { animation: qminus .7s ease; border-color: #dc2626 !important; background: #fef2f2 !important; }
@keyframes qminus { 0% { transform: scale(1); } 30% { transform: scale(1.12); background: #fecaca; } 100% { transform: scale(1); } }
.q-empty { grid-column: 1 / -1; color: #94a3b8; padding: 18px 0; text-align: center; }
.quick-result { margin-top: 12px; min-height: 22px; font-size: 14px; color: #16a34a; font-weight: 600; }
.q-undo { color: #dc2626; border-color: #fca5a5; }
.q-mode-minus .q-card { border-color: #fca5a5; }
.q-mode-minus .q-card:hover { border-color: #ef4444; box-shadow: 0 4px 12px rgba(220,38,38,.15); }
.q-mode-row { display: flex; gap: 8px; margin-bottom: 12px; }
.q-group-card { min-height: 56px; justify-content: center; }

/* ============ 排行榜模式 / 本班入口 ============ */
.rank-mode-row { display: flex; gap: 8px; align-items: center; }
.backup-list { margin-top: 10px; line-height: 1.9; font-size: 13px; }

/* 「本班入口」块（2026-10-22 精简）：左三条直达链接、右四张二维码。
   旧版把服务器地址 / 技术入口 / 每张网卡 / 备用外网全堆在这里，老师找不着要发的链接。 */
.entry-block { padding: 16px 18px; }
.entry-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .entry-grid { grid-template-columns: 1fr; gap: 18px; } }
.entry-cap { font-size: 12px; font-weight: 700; color: #4b5563; margin-bottom: 9px; letter-spacing: .02em; }
.entry-cap .muted { font-weight: 400; margin-left: 8px; font-size: 11.5px; }

.lan-list { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.lan-line {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.lan-line:hover { border-color: #bcd0f5; box-shadow: 0 2px 8px rgba(37,99,235,.07); }
.lan-txt { flex: 1; min-width: 0; }
.lan-name { font-size: 13.5px; font-weight: 700; color: #1f2937; }
.lan-url {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  color: #2b4a7d; margin-top: 3px; word-break: break-all; line-height: 1.5;
}
.lan-tip { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }
.lan-line .btn-sm { flex: none; }
.lan-empty {
  padding: 18px 16px; border: 1px dashed var(--line); border-radius: 10px;
  background: #fbfcfe; color: var(--muted); font-size: 13px; line-height: 1.75;
}
.entry-gate {
  margin-top: 10px; padding: 8px 11px; border-radius: 8px; font-size: 12px; line-height: 1.7;
  color: #92400e; background: #fffbeb; border: 1px solid #f5d9a0;
}

/* 二维码墙：四张统一样式的卡片（查询 / 大屏 / 宠物墙 / 微信小程序） */
.entry-qr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.entry-qr {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 8px 8px; text-align: center;
}
.entry-qr .qr-img img {
  width: 100%; max-width: 112px; height: auto; display: block;
  margin: 0 auto 6px; background: #fff; border-radius: 6px;
}
.eq-name { font-size: 12px; color: #4b5563; }
.mp-cell { background: #fffaef; border-color: #f0d9a8; }
.mp-cell .mp-code { width: 112px; height: 112px; display: block; margin: 0 auto 6px; padding: 0; border: 0; border-radius: 6px; }
#mpNote { margin-top: 9px; font-size: 11.5px; line-height: 1.65; color: var(--muted); }
#mpNote.mp-note-warn { color: #a2620d; }


/* ============ 表格局部横向滚动（防整页溢出） ============ */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
.tbl-wrap .grid td, .tbl-wrap .grid th { white-space: nowrap; }
.table-scroll { -webkit-overflow-scrolling: touch; }
.table-scroll .grid td, .table-scroll .grid th { white-space: nowrap; }
.record-time { white-space: nowrap; }

/* ============ 手机/窄屏适配（<800px 全部重排） ============ */
@media (max-width: 800px) {
  body { overflow-x: hidden; }

  /* 顶栏：自动换行，操作按钮单行可横向滑动 */
  .topbar { height: auto; flex-wrap: wrap; row-gap: 6px; padding: 10px 12px; }
  .brand-title { font-size: 16px; }
  .top-actions { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .top-actions::-webkit-scrollbar { display: none; }
  .topbar .btn-ghost { padding: 6px 11px; font-size: 13px; white-space: nowrap; }
  .operator-chip { flex: 0 0 auto; }

  /* 主体留白压缩 */
  .app { padding: 10px 10px 44px; }

  /* 标签页：6 个铺成 3×2 两行，等宽整齐 */
  .tabs { display: flex; flex-wrap: wrap; gap: 6px; }
  .tab { flex: 1 1 calc(33.333% - 6px); text-align: center; padding: 10px 4px; font-size: 13px; white-space: nowrap; }

  /* 面板与标题行可换行 */
  .panel { padding: 12px; border-radius: 12px; }
  .panel-head { flex-wrap: wrap; gap: 8px; }
  .panel-title { font-size: 16px; }
  .rank-mode-row, .head-btns, .q-mode-row { flex-wrap: wrap; }
  .col-title { line-height: 1.5; }
  .col-title .muted { display: block; margin-top: 3px; }

  /* 通用按钮加大触控区域 */
  .btn { padding: 10px 14px; }
  .btn-sm { padding: 8px 12px; }
  .chip { padding: 9px 15px; }
  .btn-plus-lg, .btn-minus-lg { min-height: 50px; font-size: 18px; }

  /* 表格：保证列宽不被挤烂，内部横滑 */
  .tbl-wrap .grid { min-width: 540px; }
  .table-scroll .grid { min-width: 760px; }

  /* 登录卡片适配窄屏 */
  .login-holder { padding: 12px; }
  .login-card { width: min(360px, 100%); padding: 26px 22px 22px; }

  /* 输入框：16px 防 iOS 聚焦时自动放大页面 */
  .ipt, .login-card input, select, textarea, input[type="number"], input[type="password"], input[type="text"], input[type="search"] { font-size: 16px; }

  /* 快评区固定宽度元素改为自适应 */
  .quick-search, .quick-reason { width: 100%; }
  .quick-bar { gap: 8px; }
  .ipt-amount-sm { width: 88px; }
  .amount-row { flex-wrap: wrap; gap: 8px; }
  .amount-tip { width: 100%; }

  /* 双栏并排元素在手机改单列/收紧 */
  .entry-qr-grid { gap: 8px; }
  .entry-qr .qr-img img { max-width: 96px; }
  .mp-cell .mp-code { width: 96px; height: 96px; }
  .submit-row { gap: 8px; }
  .submit-row .btn { flex: 1; text-align: center; }

  /* 弹窗与提示 */
  .modal { padding: 20px 16px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; text-align: center; }
  .toast { max-width: 88vw; text-align: center; }
}

/* ---------- 成长阶段分值设置 ---------- */
.growth-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin: 10px 0 4px; }
@media (max-width: 720px) { .growth-grid { grid-template-columns: 1fr; } }
.growth-grid-title { font-weight: 700; font-size: 13px; color: #374151; margin-bottom: 8px; }
/* 当前生效的阈值表高亮，另一套变淡（两套都可见、都能改） */
#treeSumCol.dim, #treeAvgCol.dim { opacity: .5; }
.stage-active { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: #dcfce7; color: #15803d; font-size: 11px; font-weight: 700; vertical-align: middle; }
.stage-dirty { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  background: #fef3c7; color: #b45309; font-size: 12px; font-weight: 700; vertical-align: middle; }
.stage-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.stage-row .stage-name { width: 110px; flex: none; }
.stage-row .stage-min { width: 100px; flex: none; }
.stage-row .stage-arrow { color: #9ca3af; font-size: 12px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 值日 · 课表 ---------- */
/* 值日轮换 */
.duty-today { background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.duty-today .dt-main { font-size: 18px; font-weight: bold; color: var(--brand); }
.duty-today .dt-sub { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.7; }
.duty-order { display: flex; flex-direction: column; gap: 6px; }
.duty-order-row { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.duty-order-row.first { border-color: var(--brand); background: #f3f7ff; }
.duty-order-idx { width: 22px; height: 22px; flex: none; border-radius: 50%; background: #e5e9f2; color: #4b5563; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.duty-order-row.first .duty-order-idx { background: var(--brand); color: #fff; }
.duty-order-name { flex: 1; min-width: 0; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duty-order-row .btn-sm { padding: 3px 9px; line-height: 1.3; }
.duty-plan-item { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 12px; color: #4b5563; margin: 3px 0; }
.duty-plan-item.cur { background: var(--brand); border-color: var(--brand); color: #fff; }
.duty-plan-item b { font-weight: bold; }
.duty-plan-arrow { color: #b6bdc9; margin: 0 5px; font-size: 12px; }

/* 整周课表 */
.course-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.course-toolbar .grow { flex: 1; }
.course-toolbar .ck { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #374151; cursor: pointer; }
.course-grid-wrap { overflow-x: auto; }
.course-grid { width: 100%; border-collapse: collapse; min-width: 520px; }
.course-grid th, .course-grid td { border: 1px solid var(--line); padding: 2px; }
.course-grid thead th { background: #f3f5f9; font-size: 12px; font-weight: bold; padding: 7px 4px; color: #374151; }
.course-grid thead th.cg-today { color: var(--brand); }
.course-grid .cg-corner, .course-grid .cg-p { width: 48px; text-align: center; font-size: 12px; color: var(--muted); background: #f7f9fc; font-weight: normal; }
.course-grid .cg-ipt { width: 100%; min-width: 72px; border: 1px solid transparent; background: transparent; padding: 6px 4px; text-align: center; border-radius: 6px; font-size: 13px; }
.course-grid .cg-ipt:hover { border-color: var(--line); background: #fff; }
.course-grid .cg-ipt:focus { border-color: var(--brand); background: #fff; outline: none; }
.course-paste { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.course-paste summary { cursor: pointer; font-size: 13px; color: #4b5563; font-weight: bold; }
.course-paste-text { width: 100%; font-family: inherit; resize: vertical; line-height: 1.7; }
@media (max-width: 720px) {
  .course-grid .cg-ipt { min-width: 58px; font-size: 12px; }
}

/* ---------- 快捷换组 ---------- */
.regroup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; align-items: start; }
.rg-col { background: #f9fafc; border: 1px solid var(--line); border-radius: 10px; padding: 8px; transition: border-color .15s, background .15s; min-height: 90px; }
.rg-col.over { border-color: var(--brand); background: #eef4ff; }
.rg-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 8px; cursor: pointer; user-select: none; }
.rg-head:hover .rg-name { color: var(--brand); }
.rg-name { font-weight: bold; font-size: 14px; }
.rg-count { font-size: 12px; color: var(--muted); margin-left: auto; }
.rg-list { display: flex; flex-direction: column; gap: 5px; min-height: 30px; }
.rg-chip { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; cursor: grab; font-size: 13px; transition: box-shadow .12s, border-color .12s; }
.rg-chip:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.rg-chip:active { cursor: grabbing; }
.rg-chip.dragging { opacity: .45; }
.rg-chip.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(37,99,235,.18); }
.rg-chno { color: var(--muted); font-size: 11px; min-width: 20px; }
.rg-chname { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-chscore { color: #b45309; font-variant-numeric: tabular-nums; font-size: 12px; }
@media (max-width: 720px) {
  .regroup-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
}

/* ---------- 座位表编辑器 ---------- */
.seat-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seat-toolbar label { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.ipt-sm { width: 58px; padding: 4px 6px; }
.seat-wrap { margin-top: 10px; }
.seat-lectern { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; text-align: center; font-size: 12px; color: #b91c1c; padding: 6px 0; margin-top: 10px; letter-spacing: 6px; font-weight: 600; }
.seat-layout { display: grid; grid-template-columns: 175px 1fr; gap: 14px; align-items: start; }
.seat-un-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.seat-un-list { display: flex; flex-direction: column; gap: 5px; border: 1px dashed var(--line); border-radius: 8px; padding: 6px; min-height: 60px; max-height: 420px; overflow: auto; }
.seat-chip { background: #eef2ff; color: #3730a3; border-radius: 6px; padding: 4px 8px; font-size: 12px; text-align: center; cursor: grab; user-select: none; }
.seat-chip:active { cursor: grabbing; }
.seat-grid { display: grid; gap: 6px; }
.seat-cell { border: 1px dashed var(--line); border-radius: 8px; min-height: 40px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); background: #fff; }
.seat-cell.occupied { border-style: solid; border-color: #bfdbfe; background: #eff6ff; color: #1e3a8a; font-weight: 600; cursor: grab; }
.seat-cell.over { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(37,99,235,.18); }
.seat-cell.dragging { opacity: .35; }
.seat-un-list.over { border-color: var(--brand); background: #eff6ff; }
.seat-empty-hint { font-size: 12px; color: var(--muted); }
@media (max-width: 720px) {
  .seat-layout { grid-template-columns: 1fr; }
  .seat-un-list { flex-direction: row; flex-wrap: wrap; max-height: 140px; }
}

/* ===== 调休 · 特殊日期 ===== */
.cal-add-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cal-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.cal-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font-size: 13px; background: #fff; }
.cal-row .cal-date { font-weight: 700; }
.cal-row .cal-tag { border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.cal-row .cal-tag.work { background: #ecfdf5; color: #047857; }
.cal-row .cal-tag.rest { background: #fef2f2; color: #b91c1c; }
.cal-row .cal-sub { color: var(--muted); font-size: 12px; }
.cal-row .cal-del { margin-left: auto; }
.cal-empty { color: var(--muted); font-size: 12px; }

/* 调休标记（值日预览里的小字） */
.duty-swap { font-style: normal; font-size: 11px; margin: 0 3px; padding: 1px 5px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; }

/* 整组拖动开关 */
.seat-toolbar .seat-gdrag { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; user-select: none; white-space: nowrap; }
.seat-toolbar .seat-gdrag input { cursor: pointer; }

/* ===== 座位表 · 墨水屏（2026-10-12）：抬头栏 / 请假登记 / 请假标记 ===== */
.seat-tb-sep { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }
.btn-xs { padding: 3px 9px; font-size: 12px; border-radius: 6px; }

.seat-epdbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; padding: 7px 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.seat-epdbar label { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.seat-epdbar .ipt { width: 150px; }
.seat-epdbar .hint { margin: 0; }

.leave-bar { margin-top: 10px; padding: 10px; border: 1px solid #fed7aa; background: #fffbeb; border-radius: 8px; }
.leave-bar[hidden] { display: none !important; }
.leave-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.leave-head b { font-size: 14px; }
.leave-counts { color: #b45309; font-weight: 600; }
.leave-head .btn-xs:first-of-type { margin-left: auto; }
.leave-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.leave-lbl { flex: 0 0 62px; font-size: 12px; font-weight: 600; padding-top: 4px; }
.leave-lbl.leave-all { color: #b91c1c; }
.leave-lbl.leave-eve { color: #c2410c; }
.leave-lbl.leave-long { color: #7c3aed; }
.leave-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; max-height: 108px; overflow: auto; }
.leave-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; user-select: none; color: #374151; }
.leave-chip:hover { border-color: #f59e0b; }
.leave-chip.on { background: #b91c1c; border-color: #b91c1c; color: #fff; font-weight: 600; }

/* 座位格：请假标记（网页所见 = 屏上所得） */
.seat-col { display: flex; flex-direction: column; }
.seat-dir { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.seat-cell { position: relative; overflow: hidden; }
.seat-grid.picking .seat-cell.occupied { cursor: pointer; }
.seat-cell.leave-all { color: #b91c1c !important; }
.seat-cell.leave-all.occupied { background: #fff1f2; border-color: #fecaca; }
/* 今日请假：右上角红三角（屏上同位置） */
.seat-cell.leave-today::after { content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0; border-top: 13px solid #dc2626; border-left: 13px solid transparent; }
/* 长期延时：格子底部红色短横线 */
.seat-cell.leave-long::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 3px; height: 3px; background: #dc2626; border-radius: 2px; }

/* ===== 积分商城 + 学生登录密码（2026-09-24） ===== */
.chip.on { background: var(--primary, #2563eb); color: #fff; border-color: var(--primary, #2563eb); }

.tag-on { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: bold; background: #ecfdf5; color: #047857; }
.tag-off { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: bold; background: #f3f4f6; color: #6b7280; }

.pwd-ok { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: bold; background: #ecfdf5; color: #047857; }
.pwd-wait { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: bold; background: #fffbeb; color: #b45309; }

.st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: bold; }
.st-pending { background: #fffbeb; color: #b45309; }
.st-done { background: #ecfdf5; color: #047857; }
.st-rejected { background: #fef2f2; color: #b91c1c; }
.st-canceled { background: #f3f4f6; color: #6b7280; }

.ck-line { display: inline-flex; align-items: center; gap: 7px; margin: 8px 0 4px; font-size: 13px; cursor: pointer; user-select: none; }
.ck-line input { cursor: pointer; }

.pwd-result { margin-top: 14px; border: 1px solid #fcd34d; background: #fffbeb; border-radius: 10px; padding: 12px 14px; }
.pwd-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #92400e; }
.pwd-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; max-height: 260px; overflow: auto; }
.pwd-chip { display: inline-flex; align-items: baseline; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 13px; }
.pwd-chip b { font-weight: bold; }
.pwd-chip i { font-style: normal; color: var(--muted); font-size: 12px; }
.pwd-chip em { font-style: normal; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: bold; color: #1d4ed8; letter-spacing: 1px; }

/* ===== 值日任务分工（2026-09-28） ===== */
.duty-task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.dt-row { display: flex; align-items: center; gap: 8px; background: var(--panel-bg, #f9fafb); border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 7px 10px; }
.dt-name { flex: 0 0 auto; font-size: 13px; font-weight: bold; min-width: 3.5em; }
.dt-ipt { flex: 1; min-width: 0; padding: 6px 10px !important; font-size: 13px !important; }

/* ===== 班委补录标记（2026-09-28）：积分记录与补录日志用 ===== */
.bdtag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 5px;
         background: #fff4e0; color: #b96b00; border: 1px solid #f3c47a; font-size: 11px; white-space: nowrap; }
.bdtag.warn { background: #fdecec; color: #b91c1c; border-color: #f6b1b1; }

/* ===== 方案B（2026-10-14）：老师账号登录 / 我的班级 / 账号审核 ===== */
.login-links { margin-top: 14px; text-align: center; font-size: .85rem; }
.login-links a { color: var(--muted, #8fa3c8); text-decoration: none; cursor: pointer; }
.login-links a:hover { color: var(--accent, #2f6fd0); }
.login-ok { margin-top: 10px; color: #15803d; font-size: 13px; background: #eafaf0;
            border-radius: 8px; padding: 8px 10px; }
.cls-pick { display: grid; gap: 10px; }
.cls-pick button { width: 100%; text-align: left; padding: 13px 14px; border-radius: 12px;
                   border: 1px solid var(--line, #e3e8f0); background: #fff; cursor: pointer;
                   font-size: 15px; font-weight: 600; color: var(--text, #1a2436); }
.cls-pick button:hover { border-color: var(--accent, #2f6fd0); background: #f5f9ff; }
.cls-pick .cp-sub { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--muted, #7b8698); }
.tab-badge { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 4px;
             border-radius: 9px; background: #dc2626; color: #fff; font-size: 11px; line-height: 16px; }
.st-pending { color: #b96b00; } .st-active { color: #15803d; }
.st-rejected { color: #b91c1c; } .st-disabled { color: #6b7280; }
/* 班级管理里的「班级码」列：码要能一眼读清并复制 */
.cls-code-txt { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px;
                letter-spacing: .06em; color: #1a2436; }

/* ===== 桌面悬浮按钮（v4.0，2026-10-22）：下载 + 三步引导 + 班级码大字卡 =====
   设计动机：旧版让老师把 JSON 片段抄进 config.json，新手一看到代码就卡住。
   现在只留「下载按钮 + 班级码 + 三步说明」，其余全在按钮里做。 */
.desk-block .col-title { margin-bottom: 12px; }
.desk-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border-radius: 12px; flex-wrap: wrap;
  background: linear-gradient(120deg, #eef4ff 0%, #f2fbf7 100%);
  border: 1px solid #dbe7fb;
}
.desk-hero-t { font-size: 15px; font-weight: 700; color: #16305c; }
.desk-hero-s { font-size: 12px; color: #5b6b86; margin-top: 4px; }
.btn-dl {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px; border-radius: 10px; font-size: 15px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28); text-decoration: none;
}
.btn-dl:hover { color: #fff; transform: translateY(-1px); }
.btn-dl .dl-ico { font-size: 19px; line-height: 1; }
.btn-dl .dl-txt { display: flex; flex-direction: column; line-height: 1.25; }
.btn-dl .dl-meta { font-size: 11px; font-weight: 400; opacity: .85; letter-spacing: .02em; }

.desk-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.desk-step {
  display: flex; gap: 10px; padding: 12px 13px; border-radius: 10px;
  background: #fafbfe; border: 1px solid var(--line);
}
.desk-step .ds-n {
  flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--brand);
  color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 22px;
}
.desk-step b { font-size: 13px; }
.desk-step p { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 3px; }
.desk-step code {
  font-family: ui-monospace, Consolas, monospace; font-size: 11px;
  background: #eef1f6; padding: 1px 4px; border-radius: 4px;
}

.desk-code {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 16px; padding: 14px 18px; border-radius: 12px;
  background: #0f1f38; color: #fff;
}
.desk-code-lbl { font-size: 12px; color: #93a7c7; }
.desk-code-val {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 30px; font-weight: 700;
  letter-spacing: .16em; color: #7ff0cb; line-height: 1.1; margin-left: -4px;
}
.desk-code-ops { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.desk-gate { font-size: 11.5px; color: #b9c6db; }
.desk-gate.on { color: #7ff0cb; }
.desk-code-hint { margin-top: 10px; }

@media (max-width: 900px) {
  .desk-steps { grid-template-columns: 1fr; }
  .desk-code-val { font-size: 24px; }
  .btn-dl { width: 100%; justify-content: center; }
}

/* 班级码徽章（超管「班级管理」表格）：比裸文字显眼一档，一眼能找到 */
.cls-code-badge {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  background: #e8f7f0; border: 1px solid #b6e6d3; color: #0f7a55;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px;
  font-weight: 700; letter-spacing: .08em;
}
