/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --ink: #16211f;
  --ink-2: #3d4a47;
  --muted: #74837f;
  --line: #e2e8e6;
  --line-2: #eef2f1;
  --brand: #0f766e;
  --brand-d: #0b5d57;
  --brand-s: #e6f4f1;
  --accent: #d97706;
  --accent-s: #fdf3e3;
  --danger: #dc2626;
  --danger-s: #fdecec;
  --ok: #15803d;
  --ok-s: #e8f6ed;
  --r: 10px;
  --shadow: 0 1px 2px rgba(16,32,29,.06), 0 8px 24px -12px rgba(16,32,29,.14);
}
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); }

/* ============ 布局 ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 212px; flex: 0 0 212px; background: #0e1a18; color: #c9d6d2;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand b { display: block; color: #fff; font-size: 15px; letter-spacing: .3px; }
.brand span { font-size: 11.5px; color: #7f938e; letter-spacing: 2px; }
.nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px;
  background: none; border: 0; border-radius: 8px; color: #a9bab5; cursor: pointer;
  text-align: left; font-size: 13.5px; transition: .15s;
}
.nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav button.on { background: var(--brand); color: #fff; font-weight: 600; }
.nav button .ic { font-size: 15px; width: 18px; text-align: center; }
.nav button .badge {
  margin-left: auto; background: #dc2626; color: #fff; border-radius: 9px;
  font-size: 10.5px; padding: 1px 6px; font-weight: 700;
}
.nav-sec { font-size: 10.5px; letter-spacing: 1.4px; color: #5e716c; padding: 14px 12px 6px; }
.side-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #6b7d78; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 12px 24px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16.5px; font-weight: 700; }
.topbar .sub { font-size: 12px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.content { padding: 22px 24px 78px; max-width: 1360px; width: 100%; }

/* ============ 备案号（页脚固定条） ============ */
.beian-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: 14px; justify-content: center; align-items: center; padding: 4px 0; font-size: 11px; color: #8a9995; background: rgba(246,249,248,.94); border-top: 1px solid var(--line); pointer-events: auto; }
.beian-bar a { color: #8a9995; text-decoration: none; }
.beian-bar a:hover { color: var(--brand); }
.beian-bar img { height: 12px; vertical-align: -2px; margin-right: 3px; }
@media print { .beian-bar { display: none; } }

/* ============ 通用件 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #c9d3d0; background: #fafcfb; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-s); }
.btn.danger { color: var(--danger); border-color: #f3cfcf; background: var(--danger-s); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.card-h { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.card-h h3 { font-size: 14px; font-weight: 700; }
.card-h .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.card-h .spacer { flex: 1; }
.card-b { padding: 16px; }

.grid { display: grid; gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.stat .v { font-size: 25px; font-weight: 700; letter-spacing: -.4px; margin-top: 2px; }
.stat .v small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat.warn .v { color: var(--danger); }
.stat.ok .v { color: var(--ok); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fbfcfc;
  letter-spacing: .3px; white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfc; }
.t-wrap { overflow-x: auto; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tag.g { background: var(--ok-s); color: var(--ok); }
.tag.y { background: var(--accent-s); color: #b45309; }
.tag.r { background: var(--danger-s); color: var(--danger); }
.tag.b { background: var(--brand-s); color: var(--brand); }
.tag.n { background: #f0f3f2; color: var(--muted); }

.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field label .req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none; transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-s); }
.field textarea { resize: vertical; min-height: 74px; line-height: 1.6; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.f3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }

.seg { display: inline-flex; background: #eef2f1; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: none; padding: 6px 13px; border-radius: 7px; cursor: pointer;
  font-size: 12.5px; color: var(--muted); font-weight: 500; white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--brand); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.09); }

/* ============ 弹窗 ============ */
.mask {
  position: fixed; inset: 0; background: rgba(10,22,20,.42); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px;
  overflow-y: auto; animation: fade .14s ease;
}
@keyframes fade { from { opacity: 0 } }
.dlg {
  background: #fff; border-radius: 14px; width: 100%; max-width: 520px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28); animation: pop .16s ease;
}
.dlg.wide { max-width: 860px; }
@keyframes pop { from { transform: translateY(-8px) scale(.985); opacity: 0 } }
.dlg-h { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; }
.dlg-h h3 { font-size: 15px; font-weight: 700; }
.dlg-h .x { margin-left: auto; border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; padding: 2px 4px; }
.dlg-b { padding: 18px 20px; max-height: 68vh; overflow-y: auto; }
.dlg-f { padding: 13px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 9px; justify-content: flex-end; background: #fbfcfc; border-radius: 0 0 14px 14px; }

/* ============ 提示 ============ */
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #14211f; color: #fff; padding: 10px 18px; border-radius: 22px;
  font-size: 13px; box-shadow: 0 8px 26px rgba(0,0,0,.26); animation: tin .2s ease;
  max-width: 82vw;
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }
@keyframes tin { from { transform: translateY(12px); opacity: 0 } }

/* ============ 课表 ============ */
.sched-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.sched { display: grid; grid-template-columns: 54px repeat(7, minmax(118px, 1fr)); min-width: 900px; }
.sched .th {
  padding: 9px 6px; text-align: center; font-size: 12px; font-weight: 700;
  border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-2);
  background: #fbfcfc; color: var(--ink-2); position: sticky; top: 0; z-index: 2;
}
.sched .th.today { background: var(--brand-s); color: var(--brand); }
.sched .th small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.sched .th.today small { color: var(--brand); }
.sched .gut { position: relative; border-left: 0; }
.sched .gut .hr {
  height: 56px; border-bottom: 1px dashed var(--line-2); font-size: 10.5px;
  color: var(--muted); padding-right: 6px; text-align: right; line-height: 1;
  position: relative; top: -6px;
}
.sched .col { position: relative; border-left: 1px solid var(--line-2); }
.sched .col .hr { height: 56px; border-bottom: 1px dashed var(--line-2); }
.lesson {
  position: absolute; left: 3px; right: 3px; border-radius: 7px; padding: 5px 7px;
  font-size: 11.5px; line-height: 1.35; overflow: hidden; cursor: pointer;
  border-left: 3px solid var(--brand); background: var(--brand-s); color: #0b4f4a;
  transition: .15s;
}
.lesson:hover { filter: brightness(.96); box-shadow: 0 3px 10px rgba(0,0,0,.1); }
.lesson b { display: block; font-size: 12px; font-weight: 700; }
.lesson span { display: block; color: #4b6a66; font-size: 10.5px; }
.lesson .st { display: block; font-size: 10.5px; color: #4b6a66; }

/* ============ 消息中心 ============ */
.msg-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
@media (max-width: 980px) { .msg-grid { grid-template-columns: 1fr; } }
.pick { max-height: 560px; overflow-y: auto; }
.pick-item {
  display: flex; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line-2);
  transition: .13s; align-items: center;
}
.pick-item:hover { background: #fbfdfc; }
.pick-item.on { background: var(--brand-s); }
.pick-item .av {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; flex: 0 0 32px;
}
.pick-item .nm { font-weight: 600; font-size: 13.5px; }
.pick-item .mt { font-size: 11.5px; color: var(--muted); }
.pick-item .rt { margin-left: auto; text-align: right; font-size: 11px; color: var(--muted); }

.preview-box {
  background: #f7f9f8; border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; white-space: pre-wrap; font-size: 13px; line-height: 1.75;
  font-family: "PingFang SC", "Microsoft YaHei", monospace; color: var(--ink-2);
  max-height: 340px; overflow-y: auto;
}
.canvas-holder { display: flex; justify-content: center; padding: 4px; }
.canvas-holder img { max-width: 100%; border-radius: 8px; box-shadow: 0 6px 22px -8px rgba(0,0,0,.3); }
.tip {
  background: var(--accent-s); border: 1px solid #f5e0bb; color: #8a5a08;
  padding: 10px 13px; border-radius: 9px; font-size: 12.5px; line-height: 1.65;
}
.tip b { color: #6d4706; }
.tip.blue { background: var(--brand-s); border-color: #cbe7e2; color: #0b5d57; }
.tip.blue b { color: #08403c; }

/* ============ 设置 ============ */
.qr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.qr-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfc; }
.qr-label { font-size: 12.5px; font-weight: 600; color: #3d4a47; margin-bottom: 8px; }
.qr-label .muted { font-weight: 400; color: var(--muted); }
.qr-box { display: flex; gap: 12px; align-items: center; }
.qr-box img { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qr-box .no-qr { width: 96px; height: 96px; border: 1px dashed #cfd8d5; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: var(--muted); text-align: center; padding: 8px; flex: 0 0 96px; }
@media (max-width: 900px) { .qr-two { grid-template-columns: 1fr; } }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch i { width: 40px; height: 22px; border-radius: 12px; background: #d3dcda; position: relative; transition: .18s; flex: 0 0 40px; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { left: 21px; }

.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.kv:last-child { border: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; }

/* ============ 打印 ============ */
@media print {
  .sidebar, .topbar, .btn, .seg, .no-print { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}

/* ============ 周末课表（周六班 / 周日班两块） ============ */
.wk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1080px) { .wk-grid { grid-template-columns: 1fr; } }

.wk-col { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; box-shadow: var(--shadow); }
.wk-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; background: linear-gradient(180deg, #fbfdfc, #f6faf8);
  border-bottom: 1px solid var(--line);
}
.wk-title { font-size: 15.5px; font-weight: 800; letter-spacing: .3px; }
.wk-date { margin-left: 9px; font-size: 12px; color: var(--muted); }
.wk-stat { font-size: 12px; color: var(--muted); white-space: nowrap; }

.wk-list { display: flex; flex-direction: column; }
.wk-row {
  display: flex; gap: 12px; padding: 12px 15px; border-left: 4px solid var(--brand);
  border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .15s;
}
.wk-row:last-child { border-bottom: 0; }
.wk-row:hover { background: #f8fbfa; }
.wk-time {
  flex: 0 0 62px; text-align: right; font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column; line-height: 1.25;
}
.wk-time b { font-size: 14.5px; }
.wk-time span { font-size: 11.5px; color: var(--muted); }
.wk-body { flex: 1; min-width: 0; }
.wk-name { font-weight: 700; font-size: 14px; }
.wk-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.wk-stu { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-ops { display: flex; align-items: center; }
.wk-empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.wk-empty span { display: block; font-size: 12px; margin-top: 6px; color: #9aa8a4; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============ 矩阵总表（参照机构课表：行=时间段，列=教室） ============ */
.mx-block {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden;
}
.mx-scroll { overflow: auto; max-height: 72vh; -webkit-overflow-scrolling: touch; }
.mx-table {
  width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px;
  border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2);
}
/* 边框改走右/下（separate 模式下 sticky 单元格的边框才能跟着吸住） */
.mx-table th, .mx-table td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 0; vertical-align: top; height: 56px; }
/* 冻结首行（教室行）与首列（时间列）：表头吸顶、时间列吸左 */
.mx-table thead th { position: sticky; top: 0; z-index: 3; }
.mx-table td.mx-time { position: sticky; left: 0; z-index: 2; }
.mx-table thead th.mx-time { z-index: 4; }
.mx-table thead th {
  background: #f6faf8; font-size: 12.5px; padding: 9px 6px; text-align: center;
  font-weight: 700; white-space: nowrap; height: auto;
}
.mx-time { width: 88px; min-width: 88px; text-align: center; background: #fbfdfc; white-space: nowrap; }
.mx-time b { display: block; font-size: 13px; padding: 9px 4px 0; font-variant-numeric: tabular-nums; }
.mx-time span { display: block; font-size: 11px; color: var(--muted); padding: 1px 4px 9px; font-variant-numeric: tabular-nums; }
.mx-cell { padding: 7px 9px 8px; cursor: pointer; transition: filter .15s; }
.mx-cell:hover { filter: brightness(0.95); }
.mx-cell b { display: block; font-size: 12.5px; line-height: 1.35; }
.mx-cell span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 教师名（可点临时替换） */
.mx-cell .mx-tea { margin-top: 3px; }
.tea-btn {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 1px 5px 1px 6px; margin-left: -5px;
  border: 1px dashed transparent; border-radius: 6px; background: none; cursor: pointer;
  font: inherit; font-size: 11px; color: #55655f; line-height: 1.6;
}
.tea-btn i { font-style: normal; font-size: 10px; color: #9aa8a4; opacity: 0; transition: opacity .15s; }
.tea-btn:hover { border-color: #cfe0db; background: rgba(255, 255, 255, .8); color: #0b5d57; }
.tea-btn:hover i { opacity: 1; }
.tea-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.tea-opt {
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; font: inherit; font-size: 12.5px; color: var(--ink-2);
}
.tea-opt:hover { border-color: #0f766e; color: #0b5d57; background: #f2faf7; }
.tea-opt.on { border-color: #0f766e; background: #e9f7f4; color: #0b5d57; font-weight: 700; }

/* 人数 → 名单：一个大圆圈装数字 + 「人」 */
.rs-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  padding: 0; border: 0; background: none; cursor: pointer; font: inherit; vertical-align: middle;
}
.rs-chip b, .mx-cell .rs-chip b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; margin: 0;
  background: #fff; border: 2px solid rgba(15, 118, 110, .30);
  font-size: 15px; font-weight: 800; color: #0b5d57; line-height: 1;
  box-shadow: 0 1px 3px rgba(11, 93, 87, .12); transition: transform .15s, background .15s, border-color .15s;
}
.rs-chip span, .mx-cell .rs-chip span {
  display: inline; font-size: 11.5px; color: #55655f; margin: 0;
}
.rs-chip:hover b { border-color: #0f766e; background: #e9f7f4; transform: translateY(-1px); }
.rs-chip:hover span { color: #0b5d57; }
.wk-meta .rs-chip { margin-top: 0; vertical-align: -2px; }

/* 名单弹窗 */
.rs-sum {
  display: flex; align-items: baseline; gap: 9px; margin-top: 12px;
  font-size: 13px; color: var(--muted);
}
.rs-sum b { font-size: 22px; font-weight: 800; color: #0b5d57; line-height: 1; }
.rs-list { max-height: 44vh; overflow: auto; border-top: 1px solid var(--line-2); }
.rs-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px solid var(--line-2);
}
.rs-row:last-child { border-bottom: 0; }
.rs-name { flex: 0 0 96px; font-size: 13.5px; }
.rs-meta { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
/* 退班按钮（名单行里，状态徽章右侧） */
.rs-drop {
  flex: 0 0 auto; margin-left: 4px; padding: 3px 8px; border-radius: 7px;
  border: 1px solid #f3c6c6; background: #fff; color: #b91c1c;
  font-size: 11px; cursor: pointer; line-height: 1.4;
}
.rs-drop:hover { background: #fef2f2; border-color: #dc2626; }
/* 不欠费学员：名字蓝色区分（报课与收费 / 学员档案 / 催费名单） */
.nm-free { color: #2563eb; }
/* 待缴金额下面的备注：数学请假2节+英语请假1节，已扣除费用 */
.due-note { margin-top: 3px; font-size: 10.8px; line-height: 1.45; color: #b45309; max-width: 156px; white-space: normal; }

/* 总览：应退费提醒（已缴清后请假，多收的钱要退） */
.refund-card { border-color: #f3d9a8; background: linear-gradient(180deg, #fffdf8, #fff8ec); }
.refund-card .card-h { cursor: pointer; user-select: none; }
.refund-card h3 { color: #8a5a08; }
.refund-card .hint b { color: #b45309; }
.refund-card .card-h:hover { background: rgba(217, 119, 6, .05); }
.refund-card .caret { font-style: normal; display: inline-block; margin-left: 5px; transition: transform .18s; }
.refund-card.open .caret { transform: rotate(180deg); }
.refund-card table th { background: #fffaf0; }
.refund-card table td { background: #fffdf8; }
.st-toggle { background: none; border: 0; padding: 0; cursor: pointer; }
.st-toggle:hover { filter: brightness(.92); }


/* ================= 排课用 ================= */
.sc-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow);
}
.sc-state { font-size: 12.5px; font-weight: 700; color: #15803d; padding: 4px 10px; border-radius: 999px; background: #e9f7ef; }
.sc-state.warn { color: #b91c1c; background: #fdecec; }
.sc-src { font-size: 12px; color: var(--muted); margin-left: 4px; }

.sc-card {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.sc-card-h {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--line-2);
}
.sc-card-h h3 { margin: 0; font-size: 14.5px; }
.sc-hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.sc-legend { margin-left: auto; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.sc-legend .lg-te { background: #fecaca; border: 1px solid #dc2626; }
.sc-legend .lg-cls { background: #fed7aa; border: 1px solid #ea580c; }
/* 上传待更新：导入后将按「排课用」变动的格子 */
.sc-legend .lg-pend { background: #ffedd5; border: 1px solid #ea580c; }

.sc-scroll { overflow: auto; max-height: 72vh; }
.sc-tb { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }
.sc-tb th, .sc-tb td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 0; }
.sc-tb thead th {
  position: sticky; top: 0; z-index: 3;
  background: #f4f8f7; font-size: 12px; font-weight: 700; padding: 8px 4px;
  white-space: nowrap; text-align: center; min-width: 92px;
}
/* 两行表头：第一行校区（跨列），第二行教室名 */
.sc-tb thead tr.sc-grp-row th.sc-grp {
  top: 0; height: 26px; line-height: 26px; padding: 0 8px;
  background: #e9f1ef; color: #0b5d57; font-size: 11px; letter-spacing: .8px;
}
.sc-grp i { font-style: normal; font-weight: 400; color: #6b837e; margin-left: 5px; font-size: 10.5px; }
.sc-tb thead tr.sc-room-row th { top: 26px; }
/* 校区之间的竖线 */
.sc-campus-start { border-left: 2px solid #9fb6b1 !important; }
/* 周六 / 周日 之间的空行 */
.sc-gap td { height: 14px; padding: 0 !important; background: #f3f6f5; border-right: 0 !important; }
.sc-tb thead th.sc-th-day, .sc-tb thead th.sc-th-time { min-width: 0; }
.sc-th-day { width: 46px; left: 0; z-index: 4; }
.sc-th-time { width: 74px; left: 46px; z-index: 4; }
.sc-day {
  position: sticky; left: 0; z-index: 2; background: #eef5f3;
  text-align: center; font-weight: 700; font-size: 13px; writing-mode: vertical-rl;
  letter-spacing: 3px; color: #0b5d57; width: 46px;
}
.sc-time {
  position: sticky; left: 46px; z-index: 2; background: #fafcfb;
  text-align: center; width: 74px; min-width: 74px; padding: 4px 2px !important;
}
.sc-time b { display: block; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.sc-time span { display: block; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.sc-td { padding: 2px !important; vertical-align: middle; }
.sc-td.sc-blank { background: #fff; }
.sc-cell { padding: 2px 3px 2px 6px; border-radius: 5px; cursor: grab; }
.sc-cell.sc-blank { min-height: 30px; }
.sc-cell:hover { background: rgba(15, 118, 110, .07); }
.sc-cell.dragging { opacity: .45; }
.sc-td.over { background: #d7f0ea !important; outline: 2px dashed #0f766e; outline-offset: -2px; }
/* 拖到已有排课的格子上：红框提示「不能覆盖」 */
.sc-td.over-no { background: #fdecec !important; outline: 2px dashed #dc2626; outline-offset: -2px; }
.sc-cell input {
  display: block; width: 100%; border: 0; background: transparent; outline: none;
  font: inherit; color: var(--ink); padding: 1px 2px; border-radius: 3px; cursor: grab;
}
/* 拖动中：整页锁定文字选择，光标变抓手，跟手的小浮标 */
body.sc-dragging, body.sc-dragging * { user-select: none !important; cursor: grabbing !important; }
.sc-ghost {
  position: fixed; z-index: 9999; left: 0; top: 0; pointer-events: none;
  padding: 4px 9px 5px 11px; border-radius: 6px; background: #fff;
  border: 1px solid #0f766e; box-shadow: 0 8px 20px rgba(11, 93, 87, .22);
  opacity: .96; transform: rotate(-1.5deg); max-width: 160px;
}
.sc-ghost b { display: block; font-size: 12px; font-weight: 700; }
.sc-ghost span { display: block; font-size: 11px; color: #4b5b57; }
.sc-cell input.sc-i1 { font-weight: 700; font-size: 12px; }
.sc-cell input.sc-i2 { font-size: 11px; color: #4b5b57; }
.sc-cell input:focus { background: #fff; box-shadow: 0 0 0 2px #0f766e55; }
.sc-cell input::placeholder { color: #c4cfcc; font-weight: 400; }

.sc-td.bad-te { background: #fdecec !important; box-shadow: inset 0 0 0 1.5px #dc2626 !important; }
.sc-td.bad-cls { background: #fef4e8 !important; box-shadow: inset 0 0 0 1.5px #ea580c !important; }
.sc-td.bad-te.bad-cls { background: #fde7e7 !important; box-shadow: inset 0 0 0 2px #dc2626 !important; }
/* 待更新橙框（放在冲突样式后，叠加时以橙框为主） */
.sc-td.sc-pend { background: #fff7ed !important; box-shadow: inset 0 0 0 2px #ea580c !important; }

.sc-tb-te th { min-width: 84px; }
.sc-tb-te thead th.sc-te-h { border-bottom: 2px solid #cddbd7; }
.sc-td.sc-empty { background: #fcfdfd; }
.sc-tcell { padding: 3px 5px 3px 8px; margin: 1px 0; border-radius: 4px; background: #f7faf9; }
.sc-tcell b { display: block; font-size: 11.5px; font-weight: 700; }
.sc-tcell span { display: block; font-size: 10.5px; color: var(--muted); }

/* 打印：矩阵更省纸 */
@media print {
  .mx-scroll { overflow: visible; }
  .mx-table { min-width: 0; }
  .mx-block { break-inside: avoid; box-shadow: none; }
}

/* ============ 课程表只读分享：查看密码门 ============ */
.share-gate {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(150deg, #eef5f2 0%, #e5efeb 60%, #dfeae6 100%);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.sg-box {
  width: 100%; max-width: 390px; box-sizing: border-box; background: #fff;
  border: 1px solid #dbe6e2; border-radius: 16px;
  box-shadow: 0 18px 50px rgba(22, 55, 46, .13);
  padding: 34px 30px 26px; text-align: center;
}
.sg-ic { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 15px; background: #e7f3ee; color: #1f7a5c; font-size: 27px; line-height: 54px; }
.sg-box h2 { font-size: 19px; margin: 0 0 4px; color: #16211f; }
.sg-org { font-size: 13px; color: #5b6f69; margin-bottom: 16px; }
.sg-desc { font-size: 12.5px; color: #74837f; line-height: 1.9; margin-bottom: 18px; }
.sg-box input#sgPass, .sg-box input#pxGateCode {
  width: 100%; box-sizing: border-box; padding: 11px 13px; font-size: 15px;
  border: 1px solid #cfdcd8; border-radius: 9px; outline: none; text-align: center; letter-spacing: 1px;
}
.sg-box input#sgPass:focus, .sg-box input#pxGateCode:focus { border-color: #3f9b78; box-shadow: 0 0 0 3px rgba(63, 155, 120, .13); }
.sg-box .btn { width: 100%; margin-top: 12px; padding: 11px; font-size: 14px; border-radius: 9px; }
.sg-err { min-height: 20px; margin-top: 10px; font-size: 12.5px; color: #b42318; }
.sg-foot { font-size: 11.5px; color: #9aa8a4; margin-top: 6px; }

/* 只读界面：收窄侧栏、去掉所有可点编辑态 */
body.share-readonly .sidebar { width: 190px; }
body.share-readonly .content { padding-bottom: 34px; }
body.share-readonly .mx-cell { cursor: default; }
body.share-readonly .mx-cell:hover { box-shadow: none; }
body.share-readonly .rs-chip.ro,
body.share-readonly .tea-btn.ro,
body.share-readonly .st-toggle.ro { cursor: default; opacity: .92; }
