/* ============================================================
 * 互动中枢 · 教师机 · HarmonyOS / iOS 光感玻璃 + CSS Grid v8
 * ============================================================ */

/* 与课程端共用同一套光感 token（深空底色 / 玻璃 / 圆角 / 发光） */
@import "/course/_shared/glass.css";

:root {
  --bg-base: #050714;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.22);
  --text: #f5f5f7;
  --text-2: rgba(255, 255, 255, 0.86);
  --text-dim: rgba(255, 255, 255, 0.55);
  --text-mute: rgba(255, 255, 255, 0.32);
  --accent: #0a84ff;
  --accent-2: #5e5ce6;
  --cyan: #06b6d4;
  --green: #30d158;
  --red: #ff453a;
  --yellow: #ffd60a;
  --orange: #ff9f0a;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ============ 深空背景 + 固定壁纸《太空》 ============ */
html, body { min-height: 100vh; }
/* 三层背景画在 html 上（2026-09-27 修顶部色带）：.topbar 的 14px 上外边距会穿过 body
 * 发生外边距折叠把 body 顶下 14px，背景放 body 时顶部一条露 html 底色；放 html 则无缝。 */
html {
  background-color: #050714;
  background-image:
    linear-gradient(180deg, rgba(5, 7, 20, 0.42) 0%, rgba(5, 7, 20, 0.6) 60%, rgba(5, 7, 20, 0.76) 100%),
    url('/portal/wallpaper-2k.jpg'),
    radial-gradient(ellipse 70% 50% at 12% 0%, rgba(10, 132, 255, 0.42), transparent 60%),
    radial-gradient(ellipse 55% 45% at 88% 15%, rgba(94, 92, 230, 0.35), transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(6, 182, 212, 0.28), transparent 65%),
    radial-gradient(ellipse 50% 40% at 92% 100%, rgba(175, 82, 222, 0.22), transparent 60%),
    linear-gradient(180deg, #06091a 0%, #0c1230 50%, #100a28 100%);
  background-size: cover, cover, auto, auto, auto, auto, auto;
  background-position: center, center, center, center, center, center, center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  background: none;   /* 壁纸在 html 上，body 不再叠一层 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: none;   /* 壁纸《太空》自带星点，原装饰层隐掉避免叠脏 */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.5) 0.5px, transparent 1px),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,0.4) 0.5px, transparent 1px),
    radial-gradient(circle at 40% 60%, rgba(255,255,255,0.3) 0.5px, transparent 1px),
    radial-gradient(circle at 90% 20%, rgba(255,255,255,0.45) 0.5px, transparent 1px);
  background-size: 600px 600px, 800px 800px, 500px 500px, 700px 700px;
  opacity: 0.5;
  z-index: 0;
}

.card-export.flash { outline: 2px solid rgba(10, 132, 255, 0.8); outline-offset: 3px; transition: outline-color .4s ease; }

/* ============ 顶部玻璃栏 ============ */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 100;
  margin: 14px 24px 0;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;   /* 宽度不够时靠下面的断点逐级收成图标，绝不换行 */
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 0.5px rgba(255,255,255,0.06) inset;
}
.brand {
  font-size: 16px; font-weight: 600; white-space: nowrap;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  display: flex; align-items: center; gap: 10px;
}
/* 平台 logo（翻开的书 × 对话气泡），原来这里是一颗蓝点 */
.brand-logo { width: 28px; height: 28px; flex: 0 0 auto; display: block; filter: drop-shadow(0 0 10px rgba(10,132,255,0.45)); }
/* 平台导航 tab（与 portal/kjsc.css 同源，教师端不引 kjsc.css 以免与本文件重叠） */
.kjsc-nav {
  display: flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.06);
}
.kjsc-nav a {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  border-radius: var(--radius-pill); font-size: 13px; font-weight: 500;
  color: var(--text-dim); white-space: nowrap; text-decoration: none;
  transition: color .18s, background .18s;
}
.kjsc-nav a:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.kjsc-nav a.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(10,132,255,0.95) 0%, rgba(0,102,204,0.95) 100%);
  box-shadow: 0 0 0 0.5px rgba(255,255,255,0.2) inset, 0 3px 12px rgba(10,132,255,0.45);
}
.kjsc-nav a .ni { font-size: 13px; line-height: 1; opacity: .9; }
.session-info { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.topbar .topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar .topbar-actions::-webkit-scrollbar { display: none; }
.topbar .topbar-actions .btn { flex: 0 0 auto; }
/* 顶栏用户名（与 kjsc.css .topbar-user 同源） */
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; margin-left: 4px; }
.topbar-user .role {
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: rgba(10,132,255,0.14); border: 1px solid rgba(10,132,255,0.35); color: #cfe4ff;
  letter-spacing: .06em; font-size: 11.5px;
}

/* ============ 顶栏自适应：由 portal/kjsc.js 按实际宽度逐级加 .fit-1 ~ .fit-4 ============
 * 不用媒体查询猜断点：一行放得下就全显示文字；放不下才一级一级收，窗口拉宽自动恢复。
 * fit-1 导航 tab 只留图标 → fit-2 右侧按钮只留图标（title 悬停提示还在）
 * fit-3 隐掉用户名胶囊和「已连接 N 人」 → fit-4 品牌只留 logo
 * 兜底：.topbar-actions 可横向滚动，极端窄屏也不换行 */
.topbar.fit-1 { gap: 12px; }
.topbar.fit-1 .kjsc-nav a { padding: 6px 11px; }
.topbar.fit-1 .kjsc-nav a .nl { display: none; }
.topbar.fit-1 .kjsc-nav a .ni { font-size: 15px; }
.topbar.fit-2 .topbar-actions .btn .bl { display: none; }
.topbar.fit-2 .topbar-actions .btn:not(.btn-primary):not(.btn-danger) { padding: 8px 12px; min-width: 36px; justify-content: center; }
.topbar.fit-3 { gap: 10px; }
.topbar.fit-3 .topbar-actions { gap: 6px; }
.topbar.fit-3 .topbar-user { display: none; }
.topbar.fit-3 #student-count { display: none !important; }
.topbar.fit-4 .brand { font-size: 0; gap: 0; }   /* 只留 logo */
.topbar.fit-4 .topbar-actions .btn-primary, .topbar.fit-4 .topbar-actions .btn-danger { padding: 9px 14px; font-size: 13px; }

/* ============ 选课页（未带 ?course= 时盖在控制台上，顶栏仍可用） ============ */
.course-select {
  /* 压过所有弹窗（新手引导 z-997 等），否则第一次进来引导层会把卡片点击吃掉 */
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  padding: 110px 24px 40px;
  /* 2026-09-27：原先自带不透明 mesh 底，把 body 的《太空》壁纸盖住了。
     现改为全透明：选课期间直接把背后仪表盘隐藏（见下条），
     壁纸原样透出，无磨砂开销，卡片自带玻璃底保对比度 */
  background: transparent;
  overflow-y: auto;
}
body.choosing-course .card-grid { display: none; }   /* 选课层显示时仪表盘本就全被盖住，隐掉避免透底干扰 */
.course-select.hidden { display: none; }
body.choosing-course .topbar { z-index: 1201; }
/* 选课层半透明后，新手引导弹窗要盖在选课层上面，不能从背后透出来 */
#guide-modal { z-index: 1250; }
.cs-inner { width: 100%; max-width: 1080px; text-align: center; }
.cs-kicker { font-size: 12px; letter-spacing: .2em; color: var(--accent); font-weight: 600; margin: 0 0 12px; }
.cs-title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: #fff; margin: 0 0 10px; }
.cs-sub { color: var(--text-dim); font-size: 14px; margin: 0 0 32px; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; text-align: left; }
.cs-loading, .cs-empty { grid-column: 1 / -1; text-align: center; color: var(--text-mute); padding: 40px 0; }
.cs-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px 22px 18px;
  border-radius: 20px; text-align: left; cursor: pointer; font-family: inherit; color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); border-top-color: rgba(255,255,255,0.2);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  transition: transform .22s var(--spring, cubic-bezier(.34,1.56,.64,1)), border-color .2s, background .2s;
}
.cs-card:hover { transform: translateY(-3px); border-color: rgba(10,132,255,0.55); background: rgba(255,255,255,0.09); }
.cs-card .cs-icon { font-size: 38px; line-height: 1; }
.cs-card .cs-name { font-size: 19px; font-weight: 700; color: #fff; }
.cs-card .cs-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; min-height: 2.6em; }
.cs-card .cs-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-mute); }
.cs-card .cs-meta span { padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); }
.cs-card .cs-go {
  margin-top: 4px; align-self: flex-start; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, rgba(10,132,255,0.95), rgba(0,102,204,0.95));
  box-shadow: 0 3px 12px rgba(10,132,255,0.4);
}
.cs-card.cs-live { border-color: rgba(52,199,89,0.5); }
.cs-card.cs-live .cs-go { background: linear-gradient(180deg, #34c759, #248a3d); box-shadow: 0 3px 12px rgba(52,199,89,0.4); }

/* AI 学情分析报告（Markdown 输出区，与 kjsc.css .md 同源） */
.md { font-size: 14px; line-height: 1.75; color: var(--text-2); padding: 24px 28px; }
.md h1, .md h2, .md h3 { color: #fff; margin: 18px 0 8px; font-weight: 700; letter-spacing: -0.01em; }
.md h1 { font-size: 20px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15px; }
.md p { margin: 8px 0; }
.md ul, .md ol { margin: 8px 0 8px 22px; }
.md li { margin: 4px 0; }
.md strong { color: #fff; }
.md code { font-family: ui-monospace, "SF Mono", monospace; font-size: 12.5px; padding: 1px 6px; border-radius: 5px; background: rgba(255,255,255,0.1); }
.md pre { padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(0,0,0,0.35); overflow: auto; margin: 10px 0; }
.md pre code { background: none; padding: 0; }
.md hr { border: none; border-top: 1px solid var(--glass-border); margin: 14px 0; }
.md table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.md th, .md td { border: 1px solid var(--glass-border); padding: 6px 10px; text-align: left; }
.md th { background: rgba(255,255,255,0.06); color: #fff; }
.ai-report-status { display: flex; align-items: center; gap: 10px; padding: 20px 28px; color: var(--text-dim); font-size: 13.5px; }
.ai-report-status .spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--accent);
  animation: kjsc-spin .8s linear infinite;
}
@keyframes kjsc-spin { to { transform: rotate(360deg); } }
.ai-report-err { padding: 20px 28px; color: #ffb3ad; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.offline { background: rgba(255,255,255,0.25); }
.status-dot.online { background: var(--green); box-shadow: 0 0 10px rgba(48,209,88,0.7); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 4px rgba(48,209,88,0.4); }
  50% { box-shadow: 0 0 14px rgba(48,209,88,0.9); }
}
/* 有未读告警时：状态点变红脉冲（优先于课堂状态色） */
.status-dot.alert { background: var(--red); box-shadow: 0 0 10px rgba(255,69,58,0.7); animation: pulse-alert 1.2s infinite; }
@keyframes pulse-alert {
  0%,100% { box-shadow: 0 0 4px rgba(255,69,58,0.4); }
  50% { box-shadow: 0 0 14px rgba(255,69,58,0.9); }
}

/* ============ 告警铃铛 + 未读角标 ============ */
#btn-alerts { position: relative; }
#btn-alerts.has-alert { border-color: rgba(255,69,58,0.5); color: #ff8078; }
.alert-badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(255,69,58,0.5);
  pointer-events: none;
}
/* 告警列表弹层条目 */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,69,58,0.08);
  border: 1px solid rgba(255,69,58,0.3);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.alert-time { color: var(--text-mute); font-family: ui-monospace, "SF Mono", monospace; font-size: 11.5px; flex-shrink: 0; padding-top: 2px; }
/* 告警学号明码（查人场景） */
.alert-sid { color: var(--cyan); font-weight: 600; font-family: ui-monospace, "SF Mono", monospace; font-size: 12px; flex-shrink: 0; }

/* ============ 二层确认弹层 / 广播输入弹层（压在通用弹窗 z-997 之上） ============ */
.confirm-layer {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 7, 20, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease-out;
}
.confirm-layer.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.confirm-box {
  width: min(430px, calc(100vw - 48px));
  padding: 24px 24px 20px;
  border-radius: var(--radius-lg);
  background: rgba(22, 27, 46, 0.92);
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 0 0.5px var(--glass-hi, rgba(255,255,255,0.08)) inset;
}
.confirm-box h3 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.confirm-box p, #confirm-body { font-size: 13.5px; line-height: 1.7; color: var(--text-dim); margin-bottom: 18px; white-space: pre-line; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
#broadcast-text {
  width: 100%; resize: vertical; min-height: 74px;
  padding: 10px 12px; margin-bottom: 10px;
  font: inherit; font-size: 14px; color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  outline: none;
}
#broadcast-text:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25); }
.broadcast-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.broadcast-quick .bq { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-pill); }

/* ============ 前后测控制面板 ============ */
.quiz-panel-tip { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 18px; }
.quiz-panel-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
/* 后测按钮：琥珀「次级但已就绪」外观。
 * 背景（桑先生 2026-09-19 指出）：它原先**只有** `.btn-issue-post.armed` 一条规则，
 * 而 .armed 从来没被 JS 加上过（quizIssued 只写不读）——
 * 于是它平时看起来就是个"没上色的死按钮"，跟实心蓝的「发起前测」并排很违和。
 * 语义：前测 = 现在就能做（实心主色）；后测 = 还没到时候但已就绪（琥珀描边）；
 *      点过之后变实心琥珀 + 文案「已发起·重发」，兼作"已发起"的状态反馈。
 * 选择器写成 .btn.btn-issue-post 提高特异性 —— 否则会被后面的 .btn-glass 覆盖（同特异性比源序）。 */
.btn.btn-issue-post {
  color: #ffc46b;
  background: rgba(255, 159, 10, 0.10);
  border: 1px solid rgba(255, 159, 10, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.btn.btn-issue-post:hover {
  background: rgba(255, 159, 10, 0.18);
  border-color: rgba(255, 159, 10, 0.7);
}
.btn.btn-issue-post.armed {
  color: #fff;
  background: linear-gradient(180deg, #ff9f0a 0%, #d97706 100%);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(255,159,10,0.45);
}
.quiz-progress { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border); border-radius: var(--radius-md); }
.qp-row { display: flex; align-items: center; gap: 12px; }
.qp-label { font-size: 13px; color: var(--text-2); width: 36px; flex-shrink: 0; }
.qp-bar { flex: 1; height: 10px; background: rgba(255,255,255,0.08); border-radius: 5px; overflow: hidden; }
.qp-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 5px; transition: width .3s; }
.qp-num { font-size: 12.5px; color: var(--text-dim); min-width: 74px; text-align: right; font-family: ui-monospace, "SF Mono", monospace; flex-shrink: 0; }
.quiz-panel-note { font-size: 12px; color: var(--text-mute); line-height: 1.6; margin-top: 16px; }

/* ============ 按钮 ============ */
.btn {
  font-family: inherit; font-size: 14px; font-weight: 500;
  padding: 9px 20px; border: none; border-radius: var(--radius-pill);
  cursor: pointer; transition: all .2s cubic-bezier(.4,0,.2,1);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #0a84ff 0%, #0066cc 100%);
  box-shadow: 0 0 0 0.5px rgba(255,255,255,0.2) inset, 0 4px 16px rgba(10,132,255,0.5), 0 1px 2px rgba(0,0,0,0.2);
}
.btn-primary:hover { background: linear-gradient(180deg, #1a8fff 0%, #0077dd 100%); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #ff453a 0%, #d70015 100%);
  box-shadow: 0 0 0 0.5px rgba(255,255,255,0.2) inset, 0 4px 16px rgba(255,69,58,0.5);
}
.btn-pause {
  color: #fff;
  background: linear-gradient(180deg, #ff9f0a 0%, #e68a00 100%);
  box-shadow: 0 0 0 0.5px rgba(255,255,255,0.2) inset, 0 2px 8px rgba(255,159,10,0.4);
}
.btn-resume {
  color: #fff;
  background: linear-gradient(180deg, #30d158 0%, #28a745 100%);
  box-shadow: 0 0 0 0.5px rgba(255,255,255,0.2) inset, 0 2px 8px rgba(48,209,88,0.4);
}
.btn-glass {
  color: var(--text);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.btn-glass:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.22); }
.btn-ai {
  color: #fff;
  background: linear-gradient(135deg, #5e5ce6 0%, #0a84ff 100%);
  box-shadow: 0 0 0 0.5px rgba(255,255,255,0.2) inset, 0 4px 16px rgba(94,92,230,0.45);
}
.btn-ai:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-small { padding: 6px 14px; font-size: 12.5px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.btn:disabled { opacity: .4; cursor: default; pointer-events: none; }

/* ============ CSS Grid 显式定位布局 ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto auto auto repeat(2, minmax(170px, auto)) minmax(150px, auto);
  gap: 16px;
  padding: 18px 24px 32px;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
/* 显式卡片定位 */
[data-pos="qr"]      { grid-row: 1 / 4; grid-column: 1; }
[data-pos="stat1"]   { grid-row: 1;     grid-column: 2; }
[data-pos="stat2"]   { grid-row: 1;     grid-column: 3; }
[data-pos="stat3"]   { grid-row: 1;     grid-column: 4; }
[data-pos="events"]  { grid-row: 2 / 4; grid-column: 2 / 5; }
[data-pos="student"] { grid-row: 4;     grid-column: 1 / -1; }
[data-pos="a1"]      { grid-row: 5;     grid-column: 1; }
[data-pos="a2"]      { grid-row: 5;     grid-column: 2; }
[data-pos="a3"]      { grid-row: 5;     grid-column: 3; }
[data-pos="a4"]      { grid-row: 5;     grid-column: 4; }
[data-pos="a5"]      { grid-row: 6;     grid-column: 1; }
[data-pos="a6"]      { grid-row: 6;     grid-column: 2; }
[data-pos="gantt"]   { grid-row: 6;     grid-column: 3 / 5; }
[data-pos="a7"]      { grid-row: 7;     grid-column: 1 / 3; }
[data-pos="export"]  { grid-row: 7;     grid-column: 3 / 5; }

/* ============ 光感玻璃卡片 + 鼠标跟随辉光 ============ */
.card {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(44px) saturate(200%);
  -webkit-backdrop-filter: blur(44px) saturate(200%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-lg);
  padding: 22px;
  overflow: hidden;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1),
              border-color .25s, box-shadow .35s;
  box-shadow:
    0 0 24px rgba(10, 132, 255, 0.07),
    0 8px 32px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.10) inset;
  /* 鼠标跟随辉光 — CSS 变量由 JS 更新 */
  --mouse-x: 50%;
  --mouse-y: 50%;
}
/* 顶部高光弧 */
.card::before {
  content: "";
  position: absolute;
  top: -1px; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,0.45) 30%,
    rgba(255,255,255,0.45) 70%,
    transparent);
  pointer-events: none;
  z-index: 1;
}
/* 鼠标跟随辉光层 */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(
    280px circle at var(--mouse-x) var(--mouse-y),
    rgba(10, 132, 255, 0.18),
    transparent 70%
  );
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  z-index: 0;
}
.card:hover::after { opacity: 1; }

/* Hover：Q弹上浮 + 光晕增强 + 辉光边框 */
.card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-strong);
  box-shadow:
    0 0 40px rgba(10, 132, 255, 0.15),
    0 16px 48px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.14) inset;
}
/* 确保卡片内容在辉光层之上 */
.card > * { position: relative; z-index: 2; }

/* 卡片标题 */
.card h2 {
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 16px; color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  position: relative;
}
.card h2 .icon { margin-right: 8px; }
/* 标题里的按钮组：右侧留出放大按钮（28px + 10px 边距）的位置，避免重叠。
   2026-09-18 桑先生反馈：「清空 / 学号已匿名」被放大按钮压住。 */
.header-toggle { font-weight: 400; display: flex; gap: 6px; align-items: center; padding-right: 34px; }
/* 无放大按钮的卡片不需要让位（卡片头只有按钮组时） */
.card h2 > .header-toggle:only-child { padding-right: 0; }

/* 卡片放大按钮 */
.card-expand {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 5;
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .2s, background .15s, color .15s;
  line-height: 1;
}
.card:hover .card-expand { opacity: 1; }
.card-expand:hover { background: rgba(255,255,255,0.16); color: var(--text); border-color: rgba(255,255,255,0.24); }

/* ============ 统计数字卡片 ============ */
.card-stat {
  text-align: center;
  padding: 28px 18px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.card-stat .stat-val {
  font-size: 42px; font-weight: 700; letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 20%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.card-stat .stat-label {
  font-size: 12.5px; color: var(--text-dim);
  margin-top: 6px; letter-spacing: 0.02em;
}
.card-stat.clickable { cursor: pointer; }
.card-stat.clickable .click-hint {
  font-size: 10.5px; color: var(--text-mute);
  margin-top: 8px; opacity: 0;
  transition: opacity .2s;
}
.card-stat.clickable:hover .click-hint { opacity: 1; }

/* ============ 分析卡片 ============ */
.card-analytics {
  min-height: 160px;
  display: flex;
  flex-direction: column;
}
.card-analytics h3 {
  font-size: 12px; font-weight: 500;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.card-analytics .a-body {
  font-size: 13px; color: var(--text-dim);
  flex: 1; overflow: hidden;
}
.a-empty { color: var(--text-mute); font-size: 12px; padding: 12px 0; text-align: center; }

/* ============ QR 区域 ============ */
.qr-frame {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px; margin-bottom: 14px;
}
.qr-box {
  background: #ffffff; border-radius: var(--radius-sm);
  padding: 14px; text-align: center;
  min-height: 200px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.qr-box svg, .qr-box img { max-width: 100%; height: auto; display: block; }
.qr-placeholder { color: #8e8e93; font-size: 14px; }
.qr-url {
  font-size: 12.5px; color: var(--cyan);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  word-break: break-all; text-align: center;
  margin-top: 10px; padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); cursor: pointer; user-select: all;
}
.qr-hint { font-size: 12px; color: var(--text-dim); text-align: center; }

/* ============ 事件日志 ============ */
.card-events { display: flex; flex-direction: column; height: 420px; overflow: hidden; }
.event-log {
  flex: 1; min-height: 0; max-height: none;
  overflow-y: auto; font-size: 12.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
  padding-right: 4px;
}
.event-log::-webkit-scrollbar { width: 6px; }
.event-log::-webkit-scrollbar-track { background: transparent; }
.event-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.event-log::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }
.event-log .ev {
  padding: 8px 12px; border-radius: var(--radius-sm);
  margin-bottom: 4px; color: var(--text-dim); line-height: 1.55;
  background: rgba(255,255,255,0.02); border: 1px solid transparent;
  transition: all .15s;
}
.event-log .ev:hover { background: rgba(255,255,255,0.06); border-color: var(--glass-border); }
/* 告警事件（重复进入/同设备多学号）：红色高亮醒目 */
.event-log .ev.ev-alert {
  background: rgba(255, 69, 58, 0.10);
  border-color: rgba(255, 69, 58, 0.35);
}
.event-log .ev.ev-alert:hover { background: rgba(255, 69, 58, 0.16); border-color: rgba(255, 69, 58, 0.5); }
.event-log .ev .ev-time { color: var(--text-mute); margin-right: 8px; font-size: 11.5px; }
.event-log .ev .ev-sid { color: var(--cyan); font-weight: 500; margin-right: 8px; display: inline-block; min-width: 70px; }
.event-log .ev .ev-type { color: var(--text-2); }
/* 同情境内的节点跳转：弱化一档，让老师视线跟着「选择」走。
   事件照收照记（进度/停留时长统计依赖它），只是少给一点视觉权重。 */
.event-log .ev.ev-dim {
  opacity: .5;
  padding-left: 22px;
  border-left: 2px solid rgba(255,255,255,0.10);
}
.event-log .ev.ev-dim:hover { opacity: .85; }
.event-log .ev.ev-dim .ev-type { color: var(--text-mute); }
.empty-hint { color: var(--text-mute); font-size: 13px; padding: 16px 0; text-align: center; }

/* ============ 分析卡片内元素 ============ */
.progress-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.progress-row .pr-sid { font-size: 11px; color: var(--text-mute); width: 48px; flex-shrink: 0; font-family: ui-monospace, "SF Mono", monospace; }
.progress-row .pr-bar-outer { flex: 1; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.progress-row .pr-bar-inner { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; transition: width .3s; }
.progress-row .pr-pct { font-size: 11px; color: var(--text-dim); width: 32px; flex-shrink: 0; text-align: right; }
.choice-block { margin-bottom: 12px; }
.choice-block:last-child { margin-bottom: 0; }
.choice-block-scene { font-size: 10px; color: var(--text-mute); margin-bottom: 6px; font-family: ui-monospace, "SF Mono", monospace; }
.choice-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.choice-bar-row .cb-label { font-size: 11px; color: var(--text-2); width: 80px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.choice-bar-row .cb-bar { flex: 1; height: 14px; background: rgba(255,255,255,0.05); border-radius: 3px; position: relative; overflow: hidden; }
.choice-bar-row .cb-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; transition: width .3s; min-width: 4px; }
.choice-bar-row .cb-count { font-size: 11px; color: var(--text-dim); width: 24px; flex-shrink: 0; text-align: right; font-family: ui-monospace, "SF Mono", monospace; }
.ending-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ending-row .ed-label { font-size: 11px; color: var(--text-2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ending-row .ed-count { font-size: 13px; font-weight: 600; color: var(--accent-2); width: 28px; text-align: right; font-family: ui-monospace, "SF Mono", monospace; }
.gantt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.gantt-row .gr-label { font-size: 10px; color: var(--text-mute); width: 48px; flex-shrink: 0; font-family: ui-monospace, "SF Mono", monospace; }
.gantt-row .gr-track { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; position: relative; }
.gantt-row .gr-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; position: absolute; }
.hotspot-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hotspot-row .hs-scene { font-size: 11px; color: var(--text-2); flex: 1; font-family: ui-monospace, "SF Mono", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hotspot-row .hs-bar { width: 50px; height: 4px; border-radius: 2px; flex-shrink: 0; }
.hotspot-row .hs-pct { font-size: 11px; color: var(--text-dim); width: 36px; text-align: right; font-family: ui-monospace, "SF Mono", monospace; }
.small-stat { margin-bottom: 6px; }
.small-stat .ss-val { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; background: linear-gradient(135deg, #fff, rgba(255,255,255,0.65)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.small-stat .ss-label { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ============ 学生详情表格 ============ */
.student-table-body { transition: max-height .3s ease; overflow: hidden; }
.student-table-body.collapsed { max-height: 0; }
.student-table-body.expanded { max-height: 2000px; }
/* 释放按钮两态确认：第一次点击变红“确认释放?”，3 秒不复原；再点才执行 */
.btn-release.armed {
  background: linear-gradient(180deg, #ff453a 0%, #d70015 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(255, 69, 58, 0.45);
}
.dashboard-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 13px; }
.dashboard-table th { text-align: left; padding: 6px 12px; color: var(--text-mute); font-weight: 500; font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.dashboard-table td { padding: 10px 12px; color: var(--text-2); background: rgba(255,255,255,0.025); border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); }
.dashboard-table td:first-child { border-left: 1px solid var(--glass-border); border-radius: var(--radius-sm) 0 0 var(--radius-sm); font-weight: 500; }
.dashboard-table td:last-child { border-right: 1px solid var(--glass-border); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.dashboard-table tr:hover td { background: rgba(255,255,255,0.06); }
.student-active { color: var(--green); font-size: 11.5px; margin-left: 4px; display: inline-flex; align-items: center; gap: 4px; }
.student-active::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px rgba(48,209,88,0.6); }
.student-idle { color: var(--text-mute); font-size: 11.5px; margin-left: 4px; }
.student-idle::before { content: "○"; margin-right: 4px; }

/* ============ 闸门状态标签 + 已离开分组（2026-09-21） ============
 * 老师要一眼看出「谁还卡在等待页」——这是 B 组等待室的核心可见性。 */
.gate-tag {
  display: inline-block; margin-right: 6px; padding: 1px 7px;
  border-radius: 999px; font-size: 11px; line-height: 1.7;
  border: 1px solid currentColor; white-space: nowrap;
}
.gate-ok { color: var(--green); }
.gate-bypass { color: var(--orange); }
.gate-wait { color: var(--red); }
.left-group { margin-top: 12px; }
.left-group > summary {
  cursor: pointer; font-size: 12.5px; color: var(--text-dim);
  padding: 8px 2px; list-style: none; user-select: none;
}
.left-group > summary::-webkit-details-marker { display: none; }
.left-group > summary::before { content: "▸ "; }
.left-group[open] > summary::before { content: "▾ "; }
.left-group .dashboard-table { margin-top: 4px; }
.left-group .dashboard-table td { color: var(--text-dim); }
.btn-bypass { margin-right: 6px; }

/* ============ 数据导出卡片（导出中心） ============ */
.card-export { text-align: left; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; }
.card-export h3 { font-size: 12px; font-weight: 500; color: var(--text-mute); letter-spacing: 0.04em; margin-bottom: 12px; }
.card-export .icon { margin-right: 6px; }
.export-btns { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; justify-content: flex-start; }
.export-btns .btn { flex: 0 0 auto; justify-content: center; white-space: nowrap; }
.export-status { font-size: 11px; color: var(--green); margin-top: auto; padding-top: 10px; min-height: 16px; }
.export-note { font-size: 11px; color: var(--text-mute); margin-top: 6px; line-height: 1.5; }

/* ============ 考勤日志弹窗（安全审计） ============ */
/* 注意：.modal-inner 基础规则（line ~634）在后且同为单类选择器，
   靠源码顺序会覆盖这里 → 必须提高特异性，用 .modal-inner.attendance-modal-inner */
.modal-inner.attendance-modal-inner { max-width: 1000px; width: 94vw; padding: 26px 28px; }
.attendance-modal-inner .modal-sub { font-size: 12px; color: var(--text-2); line-height: 1.6; margin-bottom: 16px; }
.att-layout { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 16px; min-height: 320px; }
.att-days { border-right: 1px solid var(--glass-border); padding-right: 16px; }
.att-days-title { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.att-day-list { display: flex; flex-direction: column; gap: 4px; max-height: 380px; overflow-y: auto; }
.att-day {
  padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text-2);
  background: rgba(255,255,255,0.04); border: 1px solid transparent; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; text-align: left; width: 100%;
}
.att-day:hover { background: rgba(255,255,255,0.09); color: var(--text); }
.att-day.active { background: rgba(120,140,255,0.16); border-color: rgba(120,140,255,0.4); color: var(--text); }
.att-day .att-day-n { font-size: 11px; color: var(--text-mute); }
.att-detail-head { font-size: 13px; color: var(--text); margin-bottom: 10px; }
.att-detail-body { max-height: 400px; overflow-y: auto; overflow-x: auto; }
.att-sess { margin-bottom: 18px; }
.att-sess-title { font-size: 12px; color: var(--accent); margin-bottom: 8px; }
.att-table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.att-table th {
  text-align: left; padding: 7px 8px; font-size: 11px; font-weight: 500; color: var(--text-mute);
  border-bottom: 1px solid var(--glass-border); white-space: nowrap;
  position: sticky; top: 0; background: #171a2e; z-index: 1;
}
.att-table td {
  padding: 7px 8px; color: var(--text-2); border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 第 1 列学号 / 第 6 列 IP 用等宽字体，便于肉眼比对 */
.att-table td:first-child { font-variant-numeric: tabular-nums; color: var(--text); }
.att-table td:last-child { font-variant-numeric: tabular-nums; }
/* 六列权宽：学号 110 / 姓名 80 / 进入 130 / 离开 130 / 时长 80 / IP 自适应 */
.att-table th:nth-child(1), .att-table td:nth-child(1) { width: 110px; }
.att-table th:nth-child(2), .att-table td:nth-child(2) { width: 80px; }
.att-table th:nth-child(3), .att-table td:nth-child(3) { width: 130px; }
.att-table th:nth-child(4), .att-table td:nth-child(4) { width: 130px; }
.att-table th:nth-child(5), .att-table td:nth-child(5) { width: 80px; text-align: right; }
.att-empty { font-size: 13px; color: var(--text-mute); padding: 20px 0; text-align: center; }

/* ============ 结束课堂确认弹窗 ============ */
/* 同上的特异性问题：需高过基础 .modal-inner */
.modal-inner.end-modal-inner { max-width: 480px; }
/* 按钮靠右（2026-09-30 桑先生：左对齐不协调） */
.end-modal-inner .modal-btns { display: flex; justify-content: flex-end; gap: 10px; }
.end-warn { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 18px; }
.end-warn b { color: #ff9b9b; }
.btn-danger {
  background: rgba(220,80,80,0.18) !important;
  border-color: rgba(220,80,80,0.45) !important;
  color: #ffb4b4 !important;
}
.btn-danger:hover { background: rgba(220,80,80,0.3) !important; }

@media (max-width: 760px) {
  .att-layout { grid-template-columns: 1fr; min-height: 0; }
  .att-days { border-right: 0; border-bottom: 1px solid var(--glass-border); padding: 0 0 12px; }
  .att-day-list { flex-direction: row; overflow-x: auto; max-height: none; }
  .att-day { flex: 0 0 auto; }
}

/* ============ 报告预览（expand-body 内） ============ */
.report-preview { font-size: 14px; color: var(--text-2); }
.report-preview .rp-header { text-align: center; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--glass-border); }
.report-preview .rp-header h1 { font-size: 24px; color: var(--text); margin-bottom: 8px; }
.report-preview .rp-header .rp-meta { font-size: 12px; color: var(--text-mute); display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.report-preview .rp-section { margin-bottom: 28px; }
.report-preview .rp-section h2 { font-size: 16px; color: var(--text); margin-bottom: 14px; display: block; }
.report-preview .rp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-preview .rp-table th { text-align: left; padding: 8px 10px; color: var(--text-mute); font-weight: 500; font-size: 11px; text-transform: uppercase; border-bottom: 1px solid var(--glass-border); }
.report-preview .rp-table td { padding: 8px 10px; color: var(--text-2); border-bottom: 1px solid rgba(255,255,255,0.06); }
.report-preview .rp-kp-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.report-preview .rp-kp-bar .kp-label { font-size: 12px; color: var(--text-2); width: 80px; flex-shrink: 0; }
.report-preview .rp-kp-bar .kp-track { flex: 1; height: 20px; background: rgba(255,255,255,0.05); border-radius: 4px; position: relative; overflow: hidden; }
.report-preview .rp-kp-bar .kp-fill { height: 100%; border-radius: 4px; transition: width .4s; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; }
.report-preview .rp-kp-bar .kp-fill.pre { background: linear-gradient(90deg, var(--orange), #ff6b00); }
.report-preview .rp-kp-bar .kp-fill.post { background: linear-gradient(90deg, var(--green), #00b340); }
.report-preview .rp-kp-bar .kp-fill.negative { background: linear-gradient(90deg, var(--red), #c40000); }
.report-preview .rp-kp-bar .kp-pct { font-size: 10px; color: #fff; font-weight: 600; font-family: ui-monospace, monospace; }
.report-preview .rp-kp-bar .kp-delta { font-size: 12px; font-weight: 600; width: 50px; text-align: right; flex-shrink: 0; font-family: ui-monospace, monospace; }
.report-preview .rp-analysis { list-style: none; padding: 0; }
.report-preview .rp-analysis li { padding: 8px 12px; margin-bottom: 6px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.6; }
.report-preview .rp-analysis li.positive { background: rgba(48,209,88,0.08); border-left: 3px solid var(--green); color: var(--text-2); }
.report-preview .rp-analysis li.warning { background: rgba(255,69,58,0.08); border-left: 3px solid var(--red); color: var(--text-2); }
.report-preview .rp-analysis li.info { background: rgba(10,132,255,0.08); border-left: 3px solid var(--accent); color: var(--text-2); }
.report-preview .rp-analysis li.neutral { background: rgba(255,255,255,0.04); border-left: 3px solid var(--text-mute); color: var(--text-2); }
.report-preview .rp-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.report-preview .rp-stat { flex: 1; min-width: 100px; text-align: center; padding: 14px; background: rgba(255,255,255,0.04); border-radius: var(--radius-md); border: 1px solid var(--glass-border); }
.report-preview .rp-stat .rp-stat-val { font-size: 28px; font-weight: 700; background: linear-gradient(135deg, #fff, rgba(255,255,255,0.6)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.report-preview .rp-stat .rp-stat-label { font-size: 11px; color: var(--text-mute); margin-top: 4px; }
.report-preview .rp-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--glass-border); text-align: center; font-size: 11px; color: var(--text-mute); }
.report-preview .rp-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: center; }

/* ============ 弹窗（深玻璃） ============ */
.modal {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: fade-in .2s;
}
.modal.hidden { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-inner {
  background: rgba(20,20,28,0.85);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 30px; max-width: 400px; width: 100%;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 20px 60px rgba(0,0,0,0.6);
  position: relative;
}
.modal-inner::before {
  content: ""; position: absolute; inset: 0;
  border-radius: var(--radius-lg); padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0) 30%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 14px; color: var(--red); display: flex; align-items: center; gap: 8px; }
.modal-sub { margin-top: 12px; font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; }

/* ============ 投屏引导弹窗 ============ */
.guide-modal-inner { max-width: 440px; }
.guide-flow-lg { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.gf-step-lg {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--text-2);
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
.gf-num-lg {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(10,132,255,0.4);
}
.guide-checkbox {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-dim);
  cursor: pointer; margin-top: 8px;
}
.guide-checkbox input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ============ 通用弹窗（学生列表/图表/活跃学生） ============ */
.popup-overlay {
  position: fixed; inset: 0; z-index: 997;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: rgba(5,7,20,0.8);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  animation: fade-in .25s;
}
.popup-overlay.hidden { display: none; }
.popup-container {
  width: 100%; max-width: 680px; max-height: 80vh;
  display: flex; flex-direction: column;
  background: rgba(20,20,28,0.82);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 20px 60px rgba(0,0,0,0.6);
  position: relative; overflow: hidden;
}
.popup-container::before {
  content: ""; position: absolute; inset: 0;
  border-radius: var(--radius-lg); padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0) 30%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.popup-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.popup-title { font-size: 16px; font-weight: 600; color: var(--text); }
.popup-body {
  padding: 24px; overflow-y: auto; flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.popup-body::-webkit-scrollbar { width: 6px; }
.popup-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* 弹窗内 — 学生列表表格 */
.popup-body .roster-section { margin-bottom: 20px; }
.popup-body .roster-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.popup-body .roster-header h4 { font-size: 14px; color: var(--text); }
.popup-body .roster-stats { font-size: 12px; color: var(--text-dim); }
.popup-body .roster-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13px; }
.popup-body .roster-table th { text-align: left; padding: 4px 10px; color: var(--text-mute); font-weight: 500; font-size: 11px; text-transform: uppercase; }
.popup-body .roster-table td { padding: 8px 10px; color: var(--text-2); background: rgba(255,255,255,0.03); border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); }
.popup-body .roster-table td:first-child { border-left: 1px solid var(--glass-border); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.popup-body .roster-table td:last-child { border-right: 1px solid var(--glass-border); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.roster-present { color: var(--green); font-weight: 500; }
.roster-absent { color: var(--text-mute); }
/* .roster-import-btn / .roster-hint 已随「导入班级名单」删除（2026-09-22）。
   保留 .roster-table / .roster-section / .roster-header 等 —— 它们仍被
   「已接入学生」弹窗和报告里的表格复用，不是名单功能专属。 */

/* 弹窗内 — 柱状图 */
.popup-body .chart-area { padding: 10px 0; }
.popup-body .bar-chart-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.popup-body .bar-chart-row .bcr-label { font-size: 12px; color: var(--text-2); width: 120px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popup-body .bar-chart-row .bcr-bar-container { flex: 1; height: 24px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; position: relative; }
.popup-body .bar-chart-row .bcr-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; transition: width .4s cubic-bezier(.4,0,.2,1); display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; }
.popup-body .bar-chart-row .bcr-value { font-size: 11px; color: #fff; font-weight: 600; font-family: ui-monospace, "SF Mono", monospace; }

/* 弹窗内 — 活跃学生 */
.popup-body .active-student-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; margin-bottom: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
.popup-body .active-student-card .asc-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.popup-body .active-student-card .asc-info { flex: 1; }
.popup-body .active-student-card .asc-name { font-size: 14px; color: var(--text); font-weight: 500; }
.popup-body .active-student-card .asc-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.popup-body .active-student-card .asc-status { font-size: 11px; color: var(--green); display: flex; align-items: center; gap: 4px; }
.popup-body .active-student-card .asc-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px rgba(48,209,88,0.6); }

/* 弹窗内 — 前后测对比图 */
.popup-body .prepost-compare { display: flex; flex-direction: column; gap: 16px; }
.popup-body .pp-row { display: flex; align-items: center; gap: 12px; }
.popup-body .pp-row .pp-label { font-size: 12px; color: var(--text-2); width: 100px; flex-shrink: 0; }
.popup-body .pp-row .pp-bar-group { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.popup-body .pp-bar-wrap { display: flex; align-items: center; gap: 8px; }
.popup-body .pp-bar-wrap .pp-tag { font-size: 10px; color: var(--text-mute); width: 30px; flex-shrink: 0; }
.popup-body .pp-bar-wrap .pp-bar-outer { flex: 1; height: 16px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.popup-body .pp-bar-wrap .pp-bar-fill { height: 100%; border-radius: 3px; transition: width .4s; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; }
.popup-body .pp-bar-wrap.pp-pre .pp-bar-fill { background: linear-gradient(90deg, var(--orange), #ff6b00); }
.popup-body .pp-bar-wrap.pp-post .pp-bar-fill { background: linear-gradient(90deg, var(--green), #00b340); }
.popup-body .pp-bar-wrap .pp-pct { font-size: 10px; color: #fff; font-weight: 600; font-family: ui-monospace, monospace; }
.popup-body .pp-delta { font-size: 13px; font-weight: 600; width: 56px; text-align: right; flex-shrink: 0; font-family: ui-monospace, monospace; }
.popup-body .pp-delta.up { color: var(--green); }
.popup-body .pp-delta.down { color: var(--red); }
.popup-body .pp-delta.flat { color: var(--text-mute); }

/* ============ 卡片放大弹窗 ============ */
.expand-overlay {
  position: fixed; inset: 0; z-index: 998;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px;
  background: rgba(5,7,20,0.85);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  animation: fade-in .25s;
}
.expand-overlay.hidden { display: none; }
.expand-toolbar {
  width: 100%; max-width: 720px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px; margin-bottom: 16px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.expand-title { font-size: 15px; font-weight: 600; color: var(--text); }
.expand-body {
  width: 100%; max-width: 720px; flex: 1;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.24);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 0 30px rgba(10,132,255,0.1), 0 12px 40px rgba(0,0,0,0.3);
  overflow: auto; position: relative; min-height: 0;
}
.expand-body::before {
  content: ""; position: absolute; inset: 0;
  border-radius: var(--radius-lg); padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0) 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.expand-body h2 { font-size: 20px; margin-bottom: 20px; }
.expand-body .qr-box { min-height: 360px; padding: 24px; }
.expand-body .qr-box svg, .expand-body .qr-box img { max-width: 320px; }
.expand-body .stat-val { font-size: 64px; }
.expand-body .stat-label { font-size: 16px; margin-top: 8px; }
.expand-body .event-log { max-height: none; height: auto; min-height: 300px; }
.expand-body .a-body { font-size: 14px; }
.expand-body .dashboard-table { font-size: 14px; }
.expand-body .dashboard-table th { font-size: 12px; }
.expand-body .dashboard-table td { padding: 12px 14px; }

/* ============ 响应式 ============ */
@media (max-width: 1100px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
  }
  [data-pos] { grid-row: auto !important; grid-column: auto !important; }
  [data-pos="qr"] { grid-column: 1 / -1; }
  [data-pos="events"], [data-pos="student"], [data-pos="gantt"], [data-pos="a7"], [data-pos="export"] { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; padding: 12px 14px 20px; }
  [data-pos] { grid-column: 1 !important; }
  .topbar { margin: 10px 14px 0; padding: 10px 14px; }
  .expand-overlay, .popup-overlay { padding: 16px; }
  .expand-toolbar, .expand-body, .popup-container { max-width: 100%; }
}
