/* 布局：桌面端左侧导航 + 内容区；手机端顶栏 + 底部标签栏，表格转为可横向滚动 */
:root {
  --bg: #f3f5f7; --surface: #ffffff; --surface-2: #f8fafb; --ink: #16202a; --muted: #5b6977; --line: #dfe4ea;
  --accent: #1d58b0; --accent-ink: #ffffff; --accent-soft: #e6eefa; --warm: #e59a2c; --warm-soft: #fdf2e1;
  --ok: #1f8a5b; --ok-soft: #e3f4ec; --bad: #c2412d; --bad-soft: #fbe9e5; --warn: #b7791f; --warn-soft: #fbf1df;
  --grey-soft: #eceff2; --violet: #6b4fbb; --violet-soft: #efeafb;
  --shadow: 0 1px 2px rgba(22, 32, 42, .06), 0 4px 16px rgba(22, 32, 42, .05);
  --f-display: "Bricolage Grotesque", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 10px; --side: 236px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e141a; --surface: #161e27; --surface-2: #1b2530; --ink: #e4ebf2; --muted: #93a2b1; --line: #26323f;
  --accent: #6fa2f2; --accent-ink: #0b1420; --accent-soft: #1a2a42; --warm: #f0b25a; --warm-soft: #33270f;
  --ok: #4cc28c; --ok-soft: #12301f; --bad: #f07a65; --bad-soft: #3a1a15; --warn: #e6b058; --warn-soft: #362812;
  --grey-soft: #222c37; --violet: #a993ef; --violet-soft: #271f40; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0e141a; --surface: #161e27; --surface-2: #1b2530; --ink: #e4ebf2; --muted: #93a2b1; --line: #26323f;
  --accent: #6fa2f2; --accent-ink: #0b1420; --accent-soft: #1a2a42; --warm: #f0b25a; --warm-soft: #33270f;
  --ok: #4cc28c; --ok-soft: #12301f; --bad: #f07a65; --bad-soft: #3a1a15; --warn: #e6b058; --warn-soft: #362812;
  --grey-soft: #222c37; --violet: #a993ef; --violet-soft: #271f40; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- 登录 ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-side { background: var(--accent); color: var(--accent-ink); padding-block: 48px; padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.login-side .brand { font: 700 22px/1 var(--f-display); letter-spacing: .01em; display: flex; align-items: center; gap: 10px; }
.login-side h1 { font: 600 clamp(28px, 3.6vw, 44px)/1.15 var(--f-display); max-width: 14em; }
.login-side p { opacity: .85; max-width: 30em; margin: 12px 0 0; }
.ticket { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 12px; padding: 16px 18px; max-width: 360px; display: grid; gap: 4px; }
.ticket .t-k { font-size: 12px; opacity: .75; letter-spacing: .04em; }
.ticket .t-v { font: 500 18px var(--f-mono); }
.login-main { display: flex; align-items: center; justify-content: center; padding-block: 40px; padding-left: 24px; padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.login-card { width: 100%; max-width: 400px; display: grid; gap: 18px; }
.login-card h2 { font: 600 24px var(--f-display); }
.demo-accts { display: grid; gap: 8px; }
.demo-accts .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.demo-accts .lab { font-size: 12px; color: var(--muted); width: 3.5em; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-side { padding-block: 28px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); gap: 18px; }
  .login-side h1 { font-size: 26px; }
  .login-side .ticket { display: none; }
  .login-main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 24px 40px; align-items: flex-start; }
}

/* ---------- 外壳 ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding-block: 18px; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: 14px; display: flex; flex-direction: column; gap: 14px; }
.side .brand { font: 700 18px/1 var(--f-display); display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 15px var(--f-display); flex: none; }
.login-side .logo { background: var(--accent-ink); color: var(--accent); }
.role-tag { font-size: 12px; color: var(--muted); padding: 0 8px; }
.nav { display: grid; gap: 2px; }
.nav-group { font-size: 11px; letter-spacing: .08em; color: var(--muted); padding: 12px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .ico { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 8px; display: grid; gap: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding-block: 10px; padding-left: 28px; padding-right: max(28px, env(safe-area-inset-right, 0px)); min-height: 60px; }
.top h1 { font: 600 19px var(--f-display); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .sp { flex: 1; }
.tz-chip { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; background: var(--surface); }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px; }
.user-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--warm-soft); color: var(--warm); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.child-switch { display: flex; align-items: center; gap: 6px; }
.child-switch select { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 10px; }
.content { grid-template-columns: minmax(0, 1fr); padding-block: 24px 48px; padding-left: 28px; padding-right: max(28px, env(safe-area-inset-right, 0px)); display: grid; gap: 20px; align-content: start; max-width: 1280px; width: 100%; }
.tabbar { display: none; }
.mobile-only { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 8px; min-height: 54px; }
  .top h1 { font-size: 17px; }
  .top .tz-chip, .user-chip .uname { display: none; }
  .user-chip { padding: 2px; }
  .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 16px calc(88px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 6px; font-size: 11px; color: var(--muted); text-decoration: none; position: relative; background: none; border: 0; cursor: pointer; }
  .tabbar a.on { color: var(--accent); font-weight: 600; }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar .dot { position: absolute; top: 4px; left: calc(50% + 6px); width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
  .mobile-only { display: initial; }
  .desk-only { display: none !important; }
  .child-switch .lab { display: none; }
}

/* ---------- 通用组件 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h2 { font: 600 16px var(--f-display); }
.card-h .sp { flex: 1; }
.card-h .sub { color: var(--muted); font-size: 12px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .g2, .g3, .g-main { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 22px 8px; border: 1px dashed var(--line); border-radius: var(--r); font-size: 13px; }
.kv { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.label { font-size: 11px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 7px 14px; cursor: pointer; text-decoration: none; font-weight: 500; white-space: nowrap; font-size: 13.5px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.warm { background: var(--warm); color: #1d1405; border-color: var(--warm); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); padding-inline: 8px; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { padding: 11px 20px; font-size: 15px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 9px; border-radius: 999px; white-space: nowrap; font-weight: 500; background: var(--grey-soft); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.scheduled { background: var(--accent-soft); color: var(--accent); }
.pill.completed { background: var(--ok-soft); color: var(--ok); }
.pill.cancelled { background: var(--grey-soft); color: var(--muted); }
.pill.student_absent { background: var(--warn-soft); color: var(--warn); }
.pill.teacher_absent { background: var(--bad-soft); color: var(--bad); }
.pill.pending { background: var(--violet-soft); color: var(--violet); }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.plain::before { display: none; }
.badge { min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; background: var(--bad); color: #fff; font-size: 11px; line-height: 20px; text-align: center; font-weight: 600; }
.badge.soft { background: var(--grey-soft); color: var(--muted); }

/* 表单 */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--muted); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .fields, .fields.three { grid-template-columns: minmax(0, 1fr); } }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 13px; background: var(--surface); }
.checks input { accent-color: var(--accent); }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.radio-cards label { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: pointer; display: grid; gap: 2px; font-size: 13px; background: var(--surface); }
.radio-cards input { position: absolute; opacity: 0; pointer-events: none; }
.radio-cards label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.radio-cards small { color: var(--muted); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.err { color: var(--bad); font-size: 13px; background: var(--bad-soft); border-radius: 8px; padding: 8px 12px; }
.note { font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.note.warm { background: var(--warm-soft); border-color: transparent; }
.issues { display: grid; gap: 4px; }
.issue { font-size: 12.5px; display: flex; gap: 6px; align-items: baseline; }
.issue.error { color: var(--bad); } .issue.warn { color: var(--warn); }

/* 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; }
.plus { color: var(--ok); } .minus { color: var(--bad); }

/* 课程卡片 */
.lesson { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.lesson:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.lesson .when { display: grid; gap: 0; text-align: center; border-right: 1px solid var(--line); padding-right: 12px; }
.lesson .when b { font: 600 18px var(--f-mono); }
.lesson .when span { font-size: 11.5px; color: var(--muted); }
.lesson .what { min-width: 0; display: grid; gap: 2px; }
.lesson .what .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson .what .m { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson .side-r { display: grid; gap: 6px; justify-items: end; }
.lesson.cancelled { opacity: .62; }
@media (max-width: 600px) { .lesson { grid-template-columns: 62px minmax(0, 1fr); } .lesson .side-r { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; } }

/* 下一节课 */
.next { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.next-main { padding: 22px; display: grid; gap: 12px; align-content: start; }
.next-main .eyebrow { display: flex; align-items: center; gap: 8px; color: var(--warm); font-weight: 600; font-size: 13px; }
.next-main h2 { font: 600 24px/1.25 var(--f-display); }
.next-time { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.next-time b { font: 600 30px/1 var(--f-mono); letter-spacing: -.01em; }
.countdown { font-size: 13px; color: var(--muted); }
.next-room { background: var(--surface-2); border-left: 1px solid var(--line); padding: 22px; display: grid; gap: 12px; align-content: start; }
@media (max-width: 860px) { .next { grid-template-columns: minmax(0, 1fr); } .next-room { border-left: 0; border-top: 1px solid var(--line); } .next-main h2 { font-size: 20px; } .next-time b { font-size: 26px; } }

/* 课堂房间 */
.room { display: grid; gap: 8px; }
.room-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; padding: 8px 8px 8px 12px; background: var(--surface); }
.room-row .k { font-size: 12px; color: var(--muted); }
.room-row .v { font: 600 16px var(--f-mono); overflow-wrap: anywhere; }
.room-row > div { min-width: 0; }
.ticket-num { font: 600 15px var(--f-mono); }

/* 统计 */
.stat { display: grid; gap: 4px; }
.stat .v { font: 600 28px/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat.attn .v { color: var(--bad); }
.meter { height: 8px; border-radius: 4px; background: var(--grey-soft); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* 课表 */
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-head .range { font: 600 15px var(--f-display); margin-right: auto; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-height: 150px; display: flex; flex-direction: column; min-width: 0; }
.day-h { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.day-h b { font: 600 16px var(--f-mono); color: var(--ink); }
.day.today .day-h { color: var(--accent); } .day.today .day-h b { color: var(--accent); }
.day.today { border-color: var(--accent); }
.day-b { display: grid; gap: 6px; padding: 8px; align-content: start; }
.ev { border-radius: 7px; padding: 6px 8px; font-size: 12px; cursor: pointer; background: var(--accent-soft); color: var(--ink); border-left: 3px solid var(--accent); display: grid; gap: 1px; min-width: 0; }
.ev b { font-family: var(--f-mono); font-weight: 600; }
.ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ev.completed { background: var(--ok-soft); border-color: var(--ok); }
.ev.cancelled { background: var(--grey-soft); border-color: var(--muted); text-decoration: line-through; opacity: .7; }
.ev.student_absent { background: var(--warn-soft); border-color: var(--warn); }
.ev.teacher_absent { background: var(--bad-soft); border-color: var(--bad); }
.ev.pending { background: var(--violet-soft); border-color: var(--violet); }
.ev.avail { background: transparent; border: 1px dashed var(--ok); color: var(--ok); cursor: default; }
@media (max-width: 1000px) {
  .week { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; flex-direction: row; }
  .day-h { flex-direction: column; justify-content: center; align-items: center; border-bottom: 0; border-right: 1px solid var(--line); width: 64px; flex: none; }
  .day-b { flex: 1; }
  .day.empty-day .day-b::after { content: "无课程"; color: var(--muted); font-size: 12px; padding: 4px; }
}
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month .wd { font-size: 12px; color: var(--muted); text-align: center; padding: 4px; }
.mcell { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-height: 86px; padding: 6px; display: grid; gap: 3px; align-content: start; min-width: 0; cursor: pointer; }
.mcell.other { opacity: .45; }
.mcell.today { border-color: var(--accent); }
.mcell .d { font: 600 13px var(--f-mono); }
.mcell .mev { font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 4px; padding: 0 4px; background: var(--accent-soft); }
.mcell .mev.completed { background: var(--ok-soft); } .mcell .mev.pending { background: var(--violet-soft); }
@media (max-width: 600px) { .mcell { min-height: 52px; } .mcell .mev { display: none; } .mcell .cnt { display: block; } }
.mcell .cnt { display: none; font-size: 11px; color: var(--accent); font-weight: 600; }

/* 反馈 */
.fb { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface); display: grid; gap: 10px; }
.fb-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fb-h .d { font: 600 14px var(--f-mono); }
.fb-sec { display: grid; gap: 2px; }
.fb-sec .k { font-size: 12px; color: var(--muted); }
.fb-sec .v { white-space: pre-wrap; overflow-wrap: anywhere; }
.practice { background: var(--warm-soft); border-radius: 8px; padding: 10px 12px; }
.mastery { display: inline-flex; gap: 3px; align-items: center; font-size: 12px; }
.mastery i { width: 14px; height: 6px; border-radius: 3px; background: var(--grey-soft); display: block; }
.mastery.good i { background: var(--ok); } .mastery.ok i:nth-child(-n+2) { background: var(--warn); } .mastery.weak i:first-child { background: var(--bad); }

/* 进度 */
.prog-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.book { display: flex; gap: 14px; align-items: center; min-width: 0; }
.book-spine { width: 48px; height: 64px; border-radius: 4px 8px 8px 4px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 12px var(--f-display); flex: none; box-shadow: inset 6px 0 0 rgba(0,0,0,.18); text-align: center; line-height: 1.1; padding: 2px; }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 92px 18px minmax(0, 1fr); gap: 10px; }
.tl .d { font: 500 12.5px var(--f-mono); color: var(--muted); padding-top: 2px; text-align: right; }
.tl .line { position: relative; }
.tl .line::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl .line::after { content: ""; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tl .line.completed::after { background: var(--ok); border-color: var(--ok); }
.tl .b { padding-bottom: 16px; min-width: 0; }
.tl .b .t { font-weight: 600; }
.tl .b .m { font-size: 12.5px; color: var(--muted); }
@media (max-width: 600px) { .tl { grid-template-columns: 64px 18px minmax(0, 1fr); } .prog-hero { grid-template-columns: minmax(0, 1fr); } }

/* 通知 */
.ntf { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: start; }
.ntf:last-child { border-bottom: 0; }
.ntf.unread { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.ntf .ni { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--grey-soft); color: var(--muted); }
.ntf .ni svg { width: 18px; height: 18px; }
.ntf .ni.schedule, .ntf .ni.upcoming { background: var(--accent-soft); color: var(--accent); }
.ntf .ni.credit { background: var(--warm-soft); color: var(--warm); }
.ntf .ni.exception, .ntf .ni.cancel { background: var(--bad-soft); color: var(--bad); }
.ntf .ni.feedback { background: var(--ok-soft); color: var(--ok); }
.ntf .ni.teacher_change, .ntf .ni.request { background: var(--violet-soft); color: var(--violet); }
.ntf .t { font-weight: 600; } .ntf .bd { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ntf .at { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* 抽屉 */
.scrim { position: fixed; inset: 0; background: rgba(10, 16, 22, .42); z-index: 20; display: flex; justify-content: flex-end; animation: fade .15s ease; }
.drawer { width: min(560px, 100%); height: 100%; background: var(--bg); display: flex; flex-direction: column; box-shadow: -8px 0 32px rgba(0,0,0,.18); animation: slide .2s ease; padding-top: env(safe-area-inset-top, 0px); }
.drawer.wide { width: min(760px, 100%); }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; padding-right: max(18px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-h h2 { font: 600 17px var(--f-display); flex: 1; min-width: 0; }
.drawer-b { overflow-y: auto; padding: 18px; padding-right: max(18px, env(safe-area-inset-right, 0px)); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px; align-content: start; flex: 1; grid-template-columns: minmax(0, 1fr); }
@keyframes fade { from { opacity: 0; } } @keyframes slide { from { transform: translateX(30px); opacity: .6; } }
@media (max-width: 600px) { .scrim { align-items: flex-end; } .drawer, .drawer.wide { height: 92%; border-radius: 16px 16px 0 0; animation: up .2s ease; } .drawer-h { border-radius: 16px 16px 0 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
.sheet-menu { display: grid; gap: 4px; }
.sheet-menu a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.sheet-menu a.on { color: var(--accent); border-color: var(--accent); }
.sheet-menu .ico { width: 20px; height: 20px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 40; font-size: 13.5px; box-shadow: var(--shadow); max-width: calc(100% - 32px); animation: fade .2s; }
.toast.bad { background: var(--bad); color: #fff; }
@media (max-width: 860px) { .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.filters .field { min-width: 140px; flex: 1 1 140px; max-width: 220px; }
.demo-bar { font-size: 12px; background: var(--warm-soft); color: var(--ink); padding: 6px 12px; text-align: center; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.demo-bar button { border: 0; background: none; color: var(--accent); cursor: pointer; text-decoration: underline; padding: 0 4px; font-size: 12px; }
.loading { color: var(--muted); padding: 40px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; background: var(--surface); cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.diff { font-family: var(--f-mono); font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow: auto; background: var(--surface-2); border-radius: 6px; padding: 6px 8px; margin: 4px 0 0; }
.avail-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.avail-day { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 8px; display: grid; gap: 4px; align-content: start; min-height: 90px; min-width: 0; }
.avail-day h4 { margin: 0 0 2px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.slot { font: 500 12px var(--f-mono); background: var(--ok-soft); color: var(--ok); border-radius: 6px; padding: 3px 6px; display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.slot button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 2px; font-size: 14px; line-height: 1; }
@media (max-width: 860px) { .avail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
svg.ico { width: 16px; height: 16px; flex: none; }
.icon-btn svg.ico { width: 19px; height: 19px; }
.next-main .eyebrow svg.ico { width: 16px; height: 16px; }
.nav svg.ico { width: 18px; height: 18px; }
.tabbar svg.ico { width: 22px; height: 22px; }
.sheet-menu svg.ico { width: 20px; height: 20px; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details.card > summary h2::after { content: " ▾"; color: var(--muted); font-size: 12px; }
details.card[open] > summary { margin-bottom: 4px; }
form:has(input[name=roomMode][value=fixed]:checked) [data-custom-room] { display: none; }
