/* ============ 智学伴 SmartCampus 设计系统 ============ */
:root {
  --bg: #eef1f8;
  --bg-soft: #e4e9f4;
  --card: #ffffff;
  --card-2: #f6f8fd;
  --text: #1a2233;
  --muted: #6b7588;
  --border: #e2e8f3;
  --primary: #4f6bf0;
  --primary-deep: #3d55d6;
  --primary-soft: #e9edfe;
  --violet: #8b5cf6;
  --ok: #0ea878;
  --ok-soft: #e2f7ef;
  --warn: #e9930c;
  --warn-soft: #fdf3e0;
  --danger: #e5484d;
  --danger-soft: #fdeaea;
  --info: #2a7fd4;
  --info-soft: #e4f0fc;
  --shadow: 0 6px 24px rgba(30, 42, 90, .08);
  --shadow-lg: 0 12px 40px rgba(30, 42, 90, .16);
  --radius: 16px;
  --radius-sm: 10px;
  --tabbar-h: 64px;
  --header-h: 56px;
}
[data-theme="dark"] {
  --bg: #0d1220;
  --bg-soft: #121a2e;
  --card: #161e33;
  --card-2: #1c2740;
  --text: #e8ecf6;
  --muted: #8b94ab;
  --border: #263252;
  --primary: #6382ff;
  --primary-deep: #4f6bf0;
  --primary-soft: #232f56;
  --violet: #a78bfa;
  --ok: #34d399;
  --ok-soft: #123529;
  --warn: #fbbf24;
  --warn-soft: #3a2c10;
  --danger: #f87171;
  --danger-soft: #3b1a1e;
  --info: #60a5fa;
  --info-soft: #14294a;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .3s, color .3s;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--text); }
img, svg, video { max-width: 100%; display: block; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.mt8 { margin-top: 8px; }

/* ============ 通用组件 ============ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 2px 10px; font-weight: 700; font-size: 1.02rem;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 12px; font-size: .95rem; font-weight: 600;
  border: 1px solid transparent; transition: transform .12s, filter .2s, background .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff; box-shadow: 0 4px 14px rgba(79, 107, 240, .35); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--card-2); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger { background: linear-gradient(135deg, #ef5350, #d32f2f); color: #fff; }
.btn-danger-ghost { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: .85rem; border-radius: 10px; }
.link-btn { color: var(--primary); font-size: .85rem; font-weight: 600; }
.input {
  width: 100%; padding: 11px 13px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--card-2);
  outline: none; transition: border .2s;
}
.input:focus { border-color: var(--primary); background: var(--card); }
textarea.input { resize: vertical; line-height: 1.6; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field-label { font-size: .82rem; font-weight: 600; color: var(--muted); margin: 10px 0 6px; }
.chip {
  display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-size: .82rem; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: filter .2s;
}
.chip:hover { filter: brightness(1.05); }
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 700;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
@media (max-width: 420px) { .form-grid { grid-template-columns: 1fr; } }
.search-row { display: flex; gap: 8px; }
.search-row .input { flex: 1; }
.switch-wrap { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; }
.switch { position: relative; width: 44px; height: 25px; display: inline-block; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px; background: var(--border);
  transition: background .25s;
}
.switch i::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 19px; height: 19px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform .25s;
}
.switch input:checked + i { background: linear-gradient(135deg, var(--primary), var(--violet)); }
.switch input:checked + i::after { transform: translateX(19px); }
.seg { display: flex; background: var(--card-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg-btn { flex: 1; padding: 8px; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.seg-btn.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }

/* ============ 登录页 ============ */
#login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(700px 400px at 15% 0%, rgba(99, 130, 255, .18), transparent 60%),
    radial-gradient(700px 420px at 90% 100%, rgba(139, 92, 246, .16), transparent 60%),
    var(--bg);
}
.login-box { width: 100%; max-width: 420px; }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo h1 { font-size: 1.7rem; margin-top: 10px; letter-spacing: 2px; }
.login-tag { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.role-select { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.role-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; border-radius: 14px; border: 2px solid var(--border);
  background: var(--card-2); transition: border .2s, transform .15s;
}
.role-card:active { transform: scale(.97); }
.role-card.sel { border-color: var(--primary); background: var(--primary-soft); }
.role-ic {
  width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 800; color: #fff;
}
.role-ic-stu { background: linear-gradient(135deg, #4f6bf0, #38bdf8); }
.role-ic-tea { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.role-name { font-weight: 800; font-size: 1.02rem; }
.role-desc { font-size: .7rem; color: var(--muted); text-align: center; line-height: 1.4; }
.login-privacy { font-size: .74rem; color: var(--muted); line-height: 1.6; margin-top: 12px; text-align: center; }
.login-foot { text-align: center; color: var(--muted); font-size: .74rem; margin-top: 14px; letter-spacing: 1px; }

/* ============ 应用外壳 ============ */
#app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; max-width: 680px; margin: 0 auto;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.hd-left { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.hd-logo {
  width: 32px; height: 32px; border-radius: 10px; color: #fff; font-size: .95rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--violet));
}
.hd-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--card-2); border: 1px solid var(--border);
}
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: var(--text); stroke-width: 1.9; stroke-linecap: round; }
[data-theme="dark"] .ic-sun { display: block; } [data-theme="dark"] .ic-moon { display: none; }
:root:not([data-theme="dark"]) .ic-sun { display: none; } :root:not([data-theme="dark"]) .ic-moon { display: block; }
.ic-moon { fill: var(--text); stroke: none; }
.lang-select {
  padding: 7px 8px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card-2); font-weight: 700; font-size: .8rem; outline: none;
}
.user-chip {
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15;
  padding: 5px 11px; border-radius: 11px; background: var(--primary-soft);
}
.user-chip span { font-size: .82rem; font-weight: 700; color: var(--primary); }
.user-chip em { font-style: normal; font-size: .64rem; color: var(--muted); }

#app-main {
  max-width: 680px; margin: 0 auto; padding: calc(var(--header-h) + 14px) 14px calc(var(--tabbar-h) + 26px);
}
.view { display: none; animation: viewIn .3s ease; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ 底部导航 ============ */
#tabbar {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: min(94%, 640px); height: var(--tabbar-h); z-index: 50;
  display: flex; align-items: stretch; justify-content: space-around;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 6px;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .68rem; font-weight: 600; border-radius: 14px;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--primary); background: var(--primary-soft); }
.tab-center-btn {
  width: 44px; height: 44px; border-radius: 50%; margin-top: -26px;
  background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 800;
  box-shadow: 0 6px 18px rgba(79, 107, 240, .45); border: 3px solid var(--card);
}
.tab-center { color: var(--muted); }

/* ============ 首页 ============ */
.home-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.home-head h2 { font-size: 1.35rem; }
.next-class { position: relative; overflow: hidden; border: none; color: #fff;
  background: linear-gradient(135deg, #4f6bf0 0%, #7c5cf0 60%, #8b5cf6 100%);
}
.next-class::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px;
  border-radius: 50%; background: rgba(255,255,255,.12);
}
.nc-top { display: flex; justify-content: space-between; font-size: .8rem; opacity: .92; }
.nc-count { font-weight: 800; }
.nc-main { margin: 10px 0 14px; }
.nc-subject { font-size: 1.7rem; font-weight: 800; margin-right: 12px; }
.nc-meta { font-size: .88rem; opacity: .92; }
.nc-actions { display: flex; gap: 8px; position: relative; z-index: 1; }
.nc-actions .btn-primary { background: #fff; color: var(--primary-deep); box-shadow: none; }
.nc-actions .btn-ghost { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.35); color: #fff; }
.empty-card { text-align: center; padding: 26px 16px; }
.empty-card p { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.today-list { display: flex; flex-direction: column; gap: 8px; }
.tl-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
}
.tl-item.now { border-color: var(--primary); background: var(--primary-soft); }
.tl-time { min-width: 86px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.tl-item.now .tl-time { color: var(--primary); }
.tl-body { flex: 1; }
.tl-subject { font-weight: 700; font-size: .95rem; }
.tl-room { font-size: .78rem; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tl-room .go-mini { color: var(--primary); font-size: .74rem; font-weight: 700; cursor: pointer; }
.tl-state { font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); font-weight: 700; }
.tl-state.done { color: var(--ok); background: var(--ok-soft); }
.tl-state.now { color: var(--primary); background: var(--primary-soft); }
.tl-empty { text-align: center; color: var(--muted); padding: 18px; font-size: .88rem; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 4px; font-size: .74rem; font-weight: 700; color: var(--text);
  box-shadow: var(--shadow); transition: transform .15s;
}
.quick-item:active { transform: scale(.95); }
.qi-ic {
  width: 40px; height: 40px; border-radius: 13px; color: #fff; font-weight: 800; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
}
.qi-nav { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.qi-snap { background: linear-gradient(135deg, #f472b6, #d946ef); }
.qi-mon { background: linear-gradient(135deg, #34d399, #0d9488); }
.qi-learn { background: linear-gradient(135deg, #fbbf24, #f97316); }
.qi-att { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.qi-sch { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.qi-task { background: linear-gradient(135deg, #a78bfa, #7c3aed); box-shadow: 0 4px 12px rgba(124,58,237,.35); }
.qi-qr { background: linear-gradient(135deg, #22d3ee, #0891b2); box-shadow: 0 4px 12px rgba(8,145,178,.35); }

/* ============ 导航 ============ */
.search-modes { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: .8rem; }
.hot-chip { background: var(--card-2); border-color: var(--border); color: var(--text); }
.search-results { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.sr-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-radius: 12px; background: var(--card-2); cursor: pointer; text-align: left;
}
.sr-item:hover { background: var(--primary-soft); }
.sr-name { font-weight: 700; font-size: .9rem; }
.sr-sub { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.map-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
.map-box { position: relative; border-radius: 14px; overflow: hidden; background: var(--card-2); border: 1px solid var(--border); }
#campus-svg { width: 100%; height: auto; touch-action: none; cursor: grab; display: block; }
#campus-svg.dragging { cursor: grabbing; }
.map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-zoom button {
  width: 34px; height: 34px; border-radius: 10px; background: var(--card); border: 1px solid var(--border);
  font-size: 1.05rem; font-weight: 800; color: var(--text); box-shadow: var(--shadow);
}
.map-legend {
  position: absolute; left: 10px; bottom: 10px; display: flex; gap: 12px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(8px);
  padding: 6px 10px; border-radius: 10px; font-size: .7rem; font-weight: 600;
}
.map-legend span { display: inline-flex; align-items: center; gap: 4px; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lg-me { background: #2dd4bf; }
.lg-dest { background: #f43f5e; }
.lg-privacy { background: repeating-linear-gradient(45deg, #f59e0b 0 3px, transparent 3px 6px); border: 1px solid #f59e0b; }
/* 地图 SVG 元素 */
.bld { fill: var(--card); stroke: var(--border); stroke-width: 2; }
.bld:hover { fill: var(--primary-soft); }
.bld-label { font-size: 15px; font-weight: 700; fill: var(--text); text-anchor: middle; pointer-events: none; }
.bld-sub { font-size: 10px; fill: var(--muted); text-anchor: middle; pointer-events: none; }
.road { stroke: var(--bg-soft); stroke-width: 14; fill: none; stroke-linecap: round; }
.road-line { stroke: var(--border); stroke-width: 1; fill: none; stroke-dasharray: 4 6; }
.privacy-zone { fill: rgba(245, 158, 11, .14); stroke: #f59e0b; stroke-dasharray: 6 4; stroke-width: 1.5; }
.privacy-tag { font-size: 10px; fill: var(--warn); font-weight: 700; text-anchor: middle; }
.route-line { stroke: #4f6bf0; stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 700; stroke-dashoffset: 700; animation: dash 1.2s ease forwards; filter: drop-shadow(0 0 4px rgba(79,107,240,.5)); }
@keyframes dash { to { stroke-dashoffset: 0; } }
.me-dot { fill: #2dd4bf; stroke: #fff; stroke-width: 3; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { r: 10; opacity: 1; } 70% { r: 14; opacity: .7; } 100% { r: 10; opacity: 1; } }
.me-halo { fill: none; stroke: #2dd4bf; stroke-width: 2; opacity: .6; animation: halo 1.8s infinite; }
@keyframes halo { from { r: 10; opacity: .7; } to { r: 26; opacity: 0; } }
.dest-dot { fill: #f43f5e; stroke: #fff; stroke-width: 3; }
.dest-pin { font-size: 13px; fill: #f43f5e; font-weight: 800; text-anchor: middle; }
.route-card { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.route-info { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.route-info b { font-size: 1.05rem; margin-right: 8px; }
.route-stats { display: flex; gap: 8px; }
.route-stats span { background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: .82rem; padding: 4px 10px; border-radius: 999px; }
.route-steps { margin: 10px 0; display: flex; flex-direction: column; gap: 5px; }
.route-step { display: flex; gap: 8px; align-items: baseline; font-size: .85rem; color: var(--muted); }
.route-step b { color: var(--primary); font-size: .75rem; min-width: 18px; }
.route-step.cur { color: var(--text); font-weight: 700; }
.route-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.route-actions .btn { flex: 1; min-width: 140px; }

/* ============ AR 导航 ============ */
#ar-overlay { position: fixed; inset: 0; z-index: 200; background: #000; color: #fff; }
#ar-video { width: 100%; height: 100%; object-fit: cover; }
.ar-fallback, .ar-privacy {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; text-align: center; padding: 30px;
}
.ar-fallback { background: radial-gradient(600px 400px at 50% 30%, #1e293b, #020617); color: #94a3b8; }
.ar-nocam-inner svg { color: #60a5fa; margin: 0 auto 8px; }
.ar-privacy { background: rgba(15, 10, 2, .92); color: #fbbf24; }
.ar-hud {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,.78)); display: flex; flex-direction: column; gap: 12px;
}
.ar-step { display: flex; align-items: center; gap: 14px; }
.ar-arrow { width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.15); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; flex: none; }
.ar-arrow svg { width: 34px; height: 34px; color: #4ade80; transition: transform .4s; }
.ar-arrow.turn-left svg { transform: rotate(-90deg); }
.ar-arrow.turn-right svg { transform: rotate(90deg); }
.ar-arrow.arrived svg { transform: rotate(180deg); color: #facc15; }
.ar-text b { font-size: 1.25rem; display: block; }
.ar-text span { color: #a5b4fc; font-size: .9rem; }
.ar-progress { height: 5px; border-radius: 999px; background: rgba(255,255,255,.2); overflow: hidden; }
.ar-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4ade80, #22d3ee); border-radius: 999px; transition: width .5s; }
.ar-ctrl { display: flex; gap: 8px; flex-wrap: wrap; }
.ar-ctrl .btn { flex: 1; }
.ar-ctrl .btn-ghost { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }

/* ============ 课堂监护 ============ */
.mon-privacy-note {
  margin-top: 12px; font-size: .74rem; line-height: 1.65; color: var(--muted);
  background: var(--warn-soft); border: 1px dashed var(--warn); padding: 9px 12px; border-radius: 10px;
}
.mon-live-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.mon-live-btns { display: flex; gap: 8px; }
.mon-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ms-item { background: var(--card-2); border-radius: 12px; padding: 10px 4px; text-align: center; }
.ms-val { font-size: 1.3rem; font-weight: 800; }
.ms-lab { font-size: .66rem; color: var(--muted); margin-top: 2px; }
.ms-item.ok .ms-val { color: var(--ok); }
.ms-item.warn .ms-val { color: var(--warn); }
.ms-item.danger .ms-val { color: var(--danger); }
.ms-item.info .ms-val { color: var(--info); }
.mon-alert-bar { margin-top: 10px; font-size: .78rem; font-weight: 700; }
.mon-alert-bar.flash { animation: flashBar 1s infinite alternate; }
@keyframes flashBar { from { background: var(--danger-soft); } to { background: transparent; } }
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }
.mon-stu {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 12px 8px; text-align: center; position: relative; transition: border .3s;
}
.mon-stu.st-focus { border-color: var(--ok); background: linear-gradient(180deg, var(--ok-soft), var(--card)); }
.mon-stu.st-tired { border-color: var(--warn); background: linear-gradient(180deg, var(--warn-soft), var(--card)); }
.mon-stu.st-away { border-color: var(--danger); background: linear-gradient(180deg, var(--danger-soft), var(--card)); }
.mon-stu.st-offline { opacity: .55; }
.mon-avatar {
  width: 40px; height: 40px; margin: 0 auto 6px; border-radius: 50%; color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  background: linear-gradient(135deg, #64748b, #475569);
}
.mon-name { font-size: .82rem; font-weight: 700; }
.mon-state { margin-top: 5px; }
.mon-spark { display: flex; gap: 2px; justify-content: center; margin-top: 6px; height: 14px; align-items: flex-end; }
.mon-spark i { width: 5px; border-radius: 2px; background: var(--ok); }
.mon-spark i.t { background: var(--warn); }
.mon-spark i.a { background: var(--danger); }
.alert-feed { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.alert-item {
  display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border-radius: 11px;
  background: var(--card-2); font-size: .8rem;
}
.alert-item .at { color: var(--muted); font-size: .7rem; min-width: 38px; padding-top: 2px; }
.alert-item.tired { background: var(--warn-soft); }
.alert-item.away { background: var(--danger-soft); }
.alert-item.info { background: var(--info-soft); }
.alert-item.remind { background: var(--ok-soft); }
.join-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.join-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--border);
}
.join-item b { font-size: .92rem; display: block; }
.join-item small { color: var(--muted); }
.mine-cam-wrap {
  position: relative; border-radius: 14px; overflow: hidden; background: #0b1020; aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
}
#mine-video { width: 100%; height: 100%; object-fit: cover; }
.mine-cam-off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #8b95b0; font-size: .85rem; text-align: center; padding: 12px; background: #101830; }
.mine-state-badge {
  position: absolute; top: 10px; left: 10px; padding: 4px 12px; border-radius: 999px;
  font-size: .74rem; font-weight: 800; color: #fff; background: rgba(0,0,0,.45); backdrop-filter: blur(6px);
}
.mine-state-badge.b-focus { background: rgba(16,185,129,.85); }
.mine-state-badge.b-tired { background: rgba(245,158,11,.9); }
.mine-state-badge.b-away { background: rgba(239,68,68,.9); }
.cam-frame { position: absolute; inset: 12% 8%; border: 2px dashed rgba(255,255,255,.0); border-radius: 12px; transition: border-color .3s; }
.cam-frame.on { border-color: rgba(74, 222, 128,.8); animation: frameBreath 2s infinite; }
@keyframes frameBreath { 0%,100% { box-shadow: 0 0 0 rgba(74,222,128,0); } 50% { box-shadow: 0 0 18px rgba(74,222,128,.35); } }
.mine-ctrl { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0; }
.focus-meter { display: flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 700; }
.fm-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.fm-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #f43f5e, #f59e0b, #22c55e); transition: width .8s; }

/* ============ 拍照学习 ============ */
.snap-cam-wrap {
  position: relative; border-radius: 14px; overflow: hidden; background: #0b1020; aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center; margin: 12px 0;
}
#snap-video { width: 100%; height: 100%; object-fit: cover; }
.snap-guide {
  position: absolute; inset: 10% 8%; border: 2px dashed rgba(255,255,255,.55); border-radius: 12px;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 12px; color: rgba(255,255,255,.9); font-size: .82rem;
}
.snap-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.snap-actions .btn { flex: 1; min-width: 110px; }
.snap-preview-box { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.snap-preview-box img { width: 100%; max-height: 300px; object-fit: contain; }
.ocr-progress { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ai-card { border: 1.5px solid var(--primary); }
.ai-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.ai-avatar {
  width: 34px; height: 34px; border-radius: 11px; font-size: .78rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--violet)); display: flex; align-items: center; justify-content: center;
}
.ai-body { line-height: 1.75; font-size: .92rem; }
.ai-body .kw-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ai-point { display: flex; gap: 8px; margin: 7px 0; }
.ai-point i { color: var(--primary); font-style: normal; font-weight: 800; }
.quiz-box { margin-top: 14px; background: var(--card-2); border-radius: 12px; padding: 13px; }
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.quiz-opt {
  padding: 10px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card);
  font-size: .88rem; font-weight: 600; text-align: left; transition: border .2s;
}
.quiz-opt:hover { border-color: var(--primary); }
.quiz-opt.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.quiz-opt.wrong { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.quiz-feedback { margin-top: 10px; font-size: .84rem; font-weight: 700; }
.quiz-feedback.ok { color: var(--ok); }
.quiz-feedback.no { color: var(--danger); }
.chat-list { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 15px; font-size: .89rem; line-height: 1.65; white-space: pre-wrap; }
.msg-ai { align-self: flex-start; background: var(--card-2); border-bottom-left-radius: 5px; }
.msg-me { align-self: flex-end; background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff; border-bottom-right-radius: 5px; }
.chat-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* ============ 课表 ============ */
.sch-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.sch-table-wrap { overflow-x: auto; }
.sch-table { width: 100%; border-collapse: collapse; font-size: .78rem; min-width: 560px; }
.sch-table th { background: var(--card-2); color: var(--muted); font-size: .72rem; padding: 8px 4px; border: 1px solid var(--border); }
.sch-table td { text-align: center; padding: 7px 4px; border: 1px solid var(--border); vertical-align: top; }
.sch-table td.today-col { background: var(--primary-soft); }
.sch-cell { display: flex; flex-direction: column; gap: 2px; }
.sch-cell b { font-size: .8rem; }
.sch-cell span { color: var(--muted); font-size: .68rem; }
.sch-cell a { color: var(--primary); font-size: .68rem; font-weight: 700; cursor: pointer; }

/* ============ 点名 ============ */
.att-toolbar { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.att-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.att-legend { display: flex; gap: 8px; margin: 12px 2px; flex-wrap: wrap; }
.att-roster { display: flex; flex-direction: column; gap: 8px; }
.att-row {
  display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border);
  border-radius: 13px; padding: 9px 12px;
}
.att-num { width: 26px; height: 26px; border-radius: 9px; background: var(--card-2); color: var(--muted); font-size: .74rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.att-name { flex: 1; font-weight: 700; font-size: .92rem; }
.att-btns { display: flex; gap: 5px; }
.att-btn {
  width: 40px; height: 32px; border-radius: 9px; font-size: .74rem; font-weight: 800;
  background: var(--card-2); border: 1.5px solid var(--border); color: var(--muted);
}
.att-btn.selected.present { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.att-btn.selected.late { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.att-btn.selected.personal { background: var(--info-soft); border-color: var(--info); color: var(--info); }
.att-btn.selected.sick { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.att-h-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-radius: 11px; background: var(--card-2); margin-bottom: 8px; cursor: pointer;
}
.att-h-item b { font-size: .86rem; }
.att-h-item .muted { font-size: .74rem; }

/* ============ 学习中心 ============ */
.subj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.subj-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: var(--card); border: 1.5px solid var(--border); border-radius: 15px; padding: 13px 6px;
  font-weight: 700; font-size: .8rem; box-shadow: var(--shadow); transition: transform .15s, border .2s;
}
.subj-item:active { transform: scale(.95); }
.subj-item.sel { border-color: var(--primary); background: var(--primary-soft); }
.subj-ic {
  width: 42px; height: 42px; border-radius: 13px; color: #fff; font-size: 1.15rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.subj-bar { width: 80%; height: 5px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.subj-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--violet)); }
.subj-detail-head { display: flex; align-items: center; gap: 12px; }
.subj-detail-head > div { flex: 1; }
.subj-detail-head b { font-size: 1.1rem; display: block; }
.kp-list { margin-top: 13px; display: flex; flex-direction: column; gap: 8px; }
.kp-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px;
  background: var(--card-2); font-size: .88rem; font-weight: 600; cursor: pointer;
}
.kp-item:hover { background: var(--primary-soft); }
.kp-state { margin-left: auto; font-size: .68rem; padding: 2px 9px; border-radius: 999px; font-weight: 800; }
.suggest-head { display: flex; align-items: center; gap: 8px; }

/* ============ Toast / Modal ============ */
#toast-wrap { position: fixed; top: calc(var(--header-h) + 10px); left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; width: min(92%, 400px); }
.toast {
  padding: 12px 16px; border-radius: 13px; font-size: .88rem; font-weight: 600; color: #fff;
  background: #1e293b; box-shadow: var(--shadow-lg); animation: toastIn .3s ease;
  display: flex; gap: 8px; align-items: center;
}
.toast.ok { background: #067a5a; }
.toast.warn { background: #b45309; }
.toast.danger { background: #be123c; }
.toast.ai { background: linear-gradient(135deg, #4338ca, #7c3aed); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.modal-mask {
  position: fixed; inset: 0; z-index: 250; background: rgba(8, 12, 24, .6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 18px; animation: toastIn .25s ease;
}
.modal {
  width: min(100%, 430px); max-height: 86vh; overflow-y: auto; background: var(--card);
  border-radius: 18px; padding: 20px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.modal h3 { margin-bottom: 12px; font-size: 1.08rem; }
.modal-body { font-size: .9rem; line-height: 1.7; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }
.consent-check { display: flex; gap: 9px; align-items: flex-start; margin: 9px 0; font-size: .84rem; line-height: 1.6; }
.consent-check input { margin-top: 3px; }

/* ============ 报告（打印） ============ */
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; padding: 24px; color: #111; font-size: 13px; }
  .rp-head { text-align: center; border-bottom: 2px solid #333; padding-bottom: 12px; margin-bottom: 16px; }
  .rp-head h1 { font-size: 20px; margin-bottom: 4px; }
  .rp-sec { margin-bottom: 14px; }
  .rp-sec h2 { font-size: 15px; border-left: 4px solid #4f6bf0; padding-left: 8px; margin-bottom: 8px; }
  .rp-table { width: 100%; border-collapse: collapse; }
  .rp-table th, .rp-table td { border: 1px solid #999; padding: 5px 8px; text-align: center; font-size: 12px; }
  .rp-table th { background: #eef1f8; }
  .rp-foot { margin-top: 18px; font-size: 11px; color: #555; text-align: center; }
}

/* ============ 响应式 ============ */
@media (min-width: 700px) {
  .mon-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .subj-grid { grid-template-columns: repeat(5, 1fr); }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  html { font-size: 15px; }
  .mon-stats { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .ms-val { font-size: 1.05rem; }
  .quiz-opts { grid-template-columns: 1fr; }
  .nc-subject { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* ================================================================ */
/* ============ v2：弹幕 / 红描边 / 积分 / 授课 / 任务 / 扫码 ============ */
/* ================================================================ */

/* ---- 英文副标题 ---- */
.en-cap {
  display: block; font-style: normal; font-size: .58rem; letter-spacing: 1.6px;
  color: var(--muted); font-weight: 800; text-transform: uppercase; margin-top: 3px;
}
.section-title > span { display: flex; flex-direction: column; }
.en-sub { font-size: .78rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.nc-en { display: block; font-style: normal; font-size: .58rem; letter-spacing: 1.6px; opacity: .78; font-weight: 800; margin-top: 2px; }
.center { text-align: center; }

/* ---- 弹幕层（锚定在授课共享舞台内，随舞台显隐） ---- */
#dm-float {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden;
}
.dm-item {
  position: absolute; left: 100%; white-space: nowrap; padding: 6px 16px; border-radius: 999px;
  font-weight: 800; font-size: .84rem; box-shadow: 0 6px 20px rgba(0,0,0,.28);
  animation: dmFly linear forwards;
}
@keyframes dmFly { from { left: 100%; } to { left: -100%; } }
.dm-item.lv0 { background: rgba(255,255,255,.94); color: #14203a; border: 1px solid rgba(20,32,58,.12); }
.dm-item.lv1 {
  background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; font-size: 1rem;
  box-shadow: 0 6px 26px rgba(239,68,68,.55); border: 1px solid rgba(255,255,255,.25);
}
.dm-item.lv2 { background: rgba(250,204,21,.95); color: #422006; }

/* ---- 违规红描边（学生端氛围警示） ---- */
#neg-overlay { position: fixed; inset: 0; z-index: 1180; pointer-events: none; opacity: 0; transition: opacity .35s; }
#neg-overlay.on { opacity: 1; }
.neg-edge { position: absolute; background: linear-gradient(90deg, rgba(239,68,68,.2), rgba(239,68,68,.95), rgba(239,68,68,.2)); }
#neg-overlay.on .neg-edge { animation: negPulse 1s infinite; }
.neg-edge.t { top: 0; left: 0; right: 0; height: 5px; box-shadow: 0 0 26px 6px rgba(239,68,68,.55); }
.neg-edge.b { bottom: 0; left: 0; right: 0; height: 5px; box-shadow: 0 0 26px 6px rgba(239,68,68,.55); }
.neg-edge.l { left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, rgba(239,68,68,.2), rgba(239,68,68,.95), rgba(239,68,68,.2)); box-shadow: 0 0 26px 6px rgba(239,68,68,.5); }
.neg-edge.r { right: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, rgba(239,68,68,.2), rgba(239,68,68,.95), rgba(239,68,68,.2)); box-shadow: 0 0 26px 6px rgba(239,68,68,.5); }
@keyframes negPulse { 0%,100% { opacity: .95; } 50% { opacity: .4; } }
.neg-text {
  position: absolute; top: 16%; left: 50%; transform: translateX(-50%);
  background: rgba(190,18,60,.94); color: #fff; padding: 10px 24px; border-radius: 999px;
  font-weight: 800; font-size: .9rem; box-shadow: 0 12px 34px rgba(190,18,60,.5);
  animation: outBounce 1s infinite;
}

/* ---- 离镜警示（红色感叹号 + 氛围灯） ---- */
.out-badge {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  background: rgba(190,18,60,.95); color: #fff; padding: 6px 13px; border-radius: 12px;
  font-weight: 800; font-size: .8rem; box-shadow: 0 8px 24px rgba(190,18,60,.55);
  animation: outBounce 1s infinite;
}
.out-badge b {
  width: 21px; height: 21px; border-radius: 50%; background: #fff; color: #be123c;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
@keyframes outBounce { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.cam-frame.out {
  border-style: solid; border-color: rgba(239,68,68,.95) !important;
  animation: outGlow 1.1s infinite !important;
}
@keyframes outGlow {
  0%,100% { box-shadow: inset 0 0 46px rgba(239,68,68,.28), 0 0 16px rgba(239,68,68,.35); }
  50% { box-shadow: inset 0 0 90px rgba(239,68,68,.55), 0 0 38px rgba(239,68,68,.6); }
}

/* ---- 学生端专注度条 + 积分进度条 ---- */
.focus-mini {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  background: rgba(9,13,26,.66); backdrop-filter: blur(6px);
  border-radius: 12px; padding: 8px 12px; color: #fff; font-size: .72rem; font-weight: 700;
}
.focus-mini .fm-bar { height: 8px; background: rgba(255,255,255,.22); }
.focus-mini b { font-size: .95rem; font-variant-numeric: tabular-nums; }
.pts-track {
  display: grid; grid-template-columns: 1fr 8px 1fr; gap: 10px;
  margin-top: 14px; background: var(--card-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px;
}
.pts-track-side { display: flex; flex-direction: column; gap: 8px; }
.pts-track-mid { background: linear-gradient(180deg, transparent, var(--border), transparent); border-radius: 2px; }
.pt-cell {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1.5px solid var(--border); border-radius: 12px; padding: 8px 11px;
}
.pt-ic { font-size: 1.05rem; position: relative; z-index: 1; }
.pt-body { position: relative; z-index: 1; display: flex; flex-direction: column; line-height: 1.25; }
.pt-body b { font-size: 1.08rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pt-body span { font-size: .64rem; color: var(--muted); font-weight: 800; }
.pt-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; opacity: .16; border-radius: 10px; transition: width .8s ease; }
.pt-fill.fw { background: var(--warn); }
.pt-fill.fn { background: var(--danger); }
.pt-fill.fh { background: linear-gradient(90deg, var(--ok), #22d3ee); }
.pt-fill.fr { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.pt-cell.warn .pt-body b { color: var(--warn); }
.pt-cell.neg .pt-body b { color: var(--danger); }
.pt-cell.hp .pt-body b { color: var(--ok); }
.pt-cell.rw .pt-body b { color: #f59e0b; }

/* ---- 首页积分卡 / 学院杯 ---- */
.pts-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.pts-head b { font-size: 1.02rem; }
.pts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pts-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; padding: 11px 4px 9px;
}
.pts-ic { font-size: 1rem; }
.pts-num { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pts-lab { font-size: .62rem; color: var(--muted); font-weight: 800; }
.pts-item.warn .pts-num { color: var(--warn); }
.pts-item.danger .pts-num { color: var(--danger); }
.pts-item.ok .pts-num { color: var(--ok); }
.pts-item.gold .pts-num { color: #f59e0b; }
.hc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.hc-row { display: flex; align-items: center; gap: 10px; font-size: .78rem; }
.hc-name { min-width: 92px; font-weight: 800; }
.hc-bar { flex: 1; height: 9px; background: var(--card-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.hc-bar i { display: block; height: 100%; border-radius: 999px; transition: width .9s ease; }
.hc-val { min-width: 28px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.pts-house-line { margin-top: 11px; text-align: center; font-weight: 700; }

/* ---- 课堂类型切换（大卡片段选） ---- */
#mon-mode-seg, #tk-type-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: transparent; padding: 0; }
#tk-type-seg { grid-template-columns: repeat(3, 1fr); }
#mon-mode-seg .seg-btn, #tk-type-seg .seg-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 12px 13px; border: 1.5px solid var(--border); background: var(--card-2);
}
#mon-mode-seg .seg-btn b, #tk-type-seg .seg-btn b { font-size: .92rem; }
#mon-mode-seg .seg-btn small, #tk-type-seg .seg-btn small { font-size: .64rem; color: var(--muted); font-weight: 600; line-height: 1.45; }
#mon-mode-seg .seg-btn.active, #tk-type-seg .seg-btn.active {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary);
}
#mon-mode-seg .seg-btn.active small, #tk-type-seg .seg-btn.active small { color: var(--primary); }

/* ---- 授课教室：屏幕共享 / 弹幕 / 摄像头画面墙 ---- */
.share-stage {
  position: relative; border-radius: 14px; overflow: hidden;
  background: #070b16; aspect-ratio: 16/9; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.share-stage video, .share-stage img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.share-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 9px;
  align-items: center; justify-content: center; color: #7c89a8; font-size: .84rem; text-align: center; padding: 14px;
}
.share-badge {
  position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 7px;
  background: rgba(190,18,60,.94); color: #fff; font-size: .7rem; font-weight: 800;
  padding: 4px 12px; border-radius: 999px; letter-spacing: 1px;
}
.share-badge i, .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; display: inline-block; animation: blink 1s infinite; }
.live-dot { margin-right: 6px; }
@keyframes blink { 50% { opacity: .15; } }
.teach-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.pub-row { flex: 1; display: flex; gap: 8px; min-width: 230px; }
.dm-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dm-demo { font-size: .68rem; font-weight: 800; padding: 5px 13px; border-radius: 999px; }
.dm-demo.lv0 { background: #fff; color: #14203a; border: 1px solid rgba(20,32,58,.18); }
[data-theme="dark"] .dm-demo.lv0 { background: #e2e8f0; }
.dm-demo.lv1 { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; }
.dm-demo.lv2 { background: #facc15; color: #422006; }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 10px; }
.cam-tile {
  position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3;
  background: var(--card-2); border: 1.5px solid var(--border);
}
.cam-tile.live { border-color: var(--ok); }
.cam-tile img { width: 100%; height: 100%; object-fit: cover; }
.cam-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.7rem; font-weight: 800; }
.cam-tile-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px;
  font-size: .68rem; font-weight: 800; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.78));
}
.cam-dot { position: absolute; top: 7px; right: 7px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); }
.cam-dot.ok { background: #22c55e; }
.cam-dot.warn { background: #f59e0b; }
.cam-dot.bad { background: #ef4444; animation: blink .8s infinite; }
.cam-dot.off { background: #64748b; }
.ms-item.violet .ms-val { color: var(--violet); }
.mon-stats { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); }

/* ---- 二维码签到 ---- */
.qr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qr-scan-wrap {
  position: relative; border-radius: 14px; overflow: hidden;
  background: #070b16; aspect-ratio: 4/3; margin-top: 12px; display: flex; align-items: center; justify-content: center;
}
.qr-scan-wrap video { width: 100%; height: 100%; object-fit: cover; }
.qr-scan-frame {
  position: absolute; inset: 15% 24%; border: 2.5px solid rgba(74,222,128,.95); border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.38); animation: frameBreath 2s infinite;
}
.qr-scan-tip {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 9px 12px; text-align: center;
  color: #cbd5f5; font-size: .72rem; background: linear-gradient(transparent, rgba(0,0,0,.75));
}
.qr-big { display: flex; justify-content: center; background: #fff; padding: 16px; border-radius: 14px; }
.qr-big img { width: min(68vw, 250px); height: auto; }

/* ---- 学习任务 ---- */
.tk-task-card { cursor: pointer; transition: transform .15s, box-shadow .25s, border-color .25s; }
.tk-task-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tk-task-card.reviewed { border-color: var(--ok); }
.tk-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-row-head b { font-size: .98rem; }
.tk-row-stats { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.tk-content { margin-top: 9px; font-size: .8rem; line-height: 1.6; }
.tk-presets { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.tk-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 11px; }
.tk-metric { background: var(--card-2); border-radius: 12px; padding: 10px 4px 8px; text-align: center; }
.tk-metric b { display: block; font-size: 1.12rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tk-metric span { font-size: .62rem; color: var(--muted); font-weight: 800; }
.tk-viol {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--danger-soft); color: var(--danger);
  border-radius: 11px; padding: 8px 11px; font-size: .8rem; font-weight: 700; margin-bottom: 6px;
}
.tk-viol.ok { background: var(--ok-soft); color: var(--ok); }
.tk-snap { width: 54px; height: 40px; object-fit: cover; border-radius: 7px; border: 1px solid var(--border); }
.tk-video-wrap { border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 8px; }
.tk-video-wrap video { width: 100%; max-height: 300px; }
.tk-photo-wrap img { width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.tk-verdict { font-weight: 800; padding: 10px 14px; border-radius: 12px; font-size: .86rem; margin-top: 6px; }
.tk-verdict.pass { background: var(--ok-soft); color: var(--ok); }
.tk-verdict.redo { background: var(--warn-soft); color: var(--warn); }
.tk-overwarn { color: var(--danger); font-weight: 800; font-size: .85rem; margin-bottom: 8px; }
.tk-fb-box { margin-top: 10px; background: var(--ok-soft); border-radius: 12px; padding: 11px 13px; font-size: .85rem; line-height: 1.7; }
.tk-fb-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-word-list { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; }
.tk-word-row {
  display: flex; align-items: center; gap: 10px; background: var(--card-2);
  border-radius: 10px; padding: 7px 11px; font-size: .86rem; font-weight: 700;
}
.tk-bad-words { color: var(--danger); font-weight: 800; }
.tk-words-review p { font-size: .86rem; line-height: 1.8; }

/* ---- 背诵录像全屏层 ---- */
#tk-recite-ov {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(6,10,20,.8); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: toastIn .25s ease;
}
.tk-recite-box {
  width: min(100%, 560px); max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-lg);
}
.tk-recite-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.tk-recite-head b { display: block; }
.tk-recite-head .muted { display: block; font-size: .72rem; margin-top: 2px; }
.tk-recite-timer {
  font-size: 1.45rem; font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums;
  background: var(--card-2); padding: 6px 15px; border-radius: 12px; border: 1px solid var(--border);
}
.tk-recite-timer.over { color: #fff; background: linear-gradient(135deg, #ef4444, #b91c1c); border-color: transparent; animation: outBounce 1s infinite; }
.tk-recite-stage {
  position: relative; border-radius: 14px; overflow: hidden; background: #070b16;
  aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
}
.tk-recite-stage video { width: 100%; height: 100%; object-fit: cover; }
.tk-recite-nocam {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #8b95b0; font-size: .85rem; padding: 16px; text-align: center;
}
.rec-dot {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(190,18,60,.94); color: #fff; font-size: .66rem; font-weight: 800;
  padding: 4px 12px; border-radius: 999px; letter-spacing: 1.5px;
}
.rec-dot::before { content: "●"; margin-right: 7px; animation: blink 1s infinite; }
.tk-live-viols { display: flex; flex-direction: column; gap: 6px; margin: 11px 0 4px; }
.tk-live-viol {
  background: var(--danger-soft); color: var(--danger); font-weight: 800; font-size: .8rem;
  border-radius: 10px; padding: 8px 12px; animation: toastIn .3s ease;
}
.tk-recite-actions { margin-top: 12px; }
#toast-wrap { z-index: 500; }

/* ---- 桌面全屏 · 专业赛事级布局 ---- */
@media (min-width: 960px) {
  html { font-size: 17px; }
  body {
    background:
      radial-gradient(1000px 560px at 10% -6%, rgba(99,130,255,.12), transparent 60%),
      radial-gradient(1000px 560px at 96% 108%, rgba(139,92,246,.10), transparent 60%),
      var(--bg);
  }
  #app-header { max-width: 1240px; }
  #app-main { max-width: 1240px; padding: calc(var(--header-h) + 26px) 30px calc(var(--tabbar-h) + 44px); }
  #tabbar { width: min(52%, 680px); }
  .login-box { max-width: 470px; }
  .home-head h2 { font-size: 1.65rem; }
  .card { transition: box-shadow .25s, transform .2s; }
  .card:hover { box-shadow: var(--shadow-lg); }
  .quick-grid { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
  .mon-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .cam-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
  .alert-feed { max-height: 340px; }
  .modal { width: min(100%, 520px); }
  #view-tasks #tk-teacher { display: grid; grid-template-columns: minmax(330px, 2fr) minmax(320px, 3fr); gap: 4px 24px; align-items: start; }
  #view-tasks #tk-teacher > .card { grid-row: 1 / 4; }
  #view-home .pts-card { background:
    linear-gradient(135deg, rgba(79,107,240,.05), rgba(139,92,246,.05)),
    var(--card); }
  .share-stage { aspect-ratio: 21/10; }
}
