* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  overflow: hidden;
}

/* ===== 进房遮罩 ===== */
#join {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  padding: 16px; overflow-y: auto;
}
.join-card {
  width: 100%; max-width: 380px; margin: auto;
  background: #fff; color: #1e293b;
  border-radius: 16px; padding: 28px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.join-card h1 { font-size: 22px; color: #1565c0; }
.join-card .sub { font-size: 13px; color: #64748b; margin: 6px 0 18px; }
.join-card label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: #334155; }
.join-card input[type=text] {
  width: 100%; padding: 11px 12px; font-size: 15px;
  border: 1px solid #cbd5e1; border-radius: 10px; outline: none;
}
.join-card input[type=text]:focus { border-color: #1976d2; }
.role-row { display: flex; gap: 16px; margin-top: 4px; }
.role { font-weight: 400 !important; font-size: 14px; display: flex; align-items: center; gap: 4px; }
.role-fixed {
  margin-top: 4px; font-size: 14px; color: #334155;
  background: #eef2f7; border: 1px solid #dbe3ec; border-radius: 8px;
  padding: 9px 12px;
}
/* 账号校验：仅限网站注册用户进房 */
.acct-hint { margin-top: 6px; font-size: 12px; color: #64748b; line-height: 1.55; }
.acct-hint.warn { color: #b45309; }
.acct-hint.ok { color: #16a34a; }
.join-card .opt { font-weight: 400; color: #94a3b8; font-size: 11.5px; }
#joinPin {
  width: 100%; padding: 11px 12px; font-size: 15px; letter-spacing: 2px;
  border: 1px solid #cbd5e1; border-radius: 10px; outline: none;
}
#joinPin:focus { border-color: #1976d2; }
#acctLinks { margin-top: 8px; font-size: 12.5px; color: #64748b; }
#acctLinks a { color: #1976d2; text-decoration: none; }
.acct-switch {
  margin-top: 8px; padding: 6px 12px; font-size: 12.5px; cursor: pointer;
  background: #eef2f7; color: #475569; border: 1px solid #dbe3ec; border-radius: 8px;
}
#nameInput[readonly] { background: #f1f5f9; color: #475569; }
#joinBtn {
  width: 100%; margin-top: 22px; padding: 13px;
  background: #1976d2; color: #fff; font-size: 16px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer;
}
#joinBtn:active { background: #1565c0; }
.warn { margin-top: 14px; font-size: 12px; color: #b45309; background: #fef3c7; padding: 8px 10px; border-radius: 8px; }
.err { margin-top: 12px; font-size: 13px; color: #dc2626; min-height: 18px; }
.invite { margin-top: 16px; display: flex; align-items: center; gap: 10px; }
#copyInvite {
  padding: 8px 12px; background: #e3f2fd; color: #1565c0;
  border: 1px solid #90caf9; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.hint { font-size: 12px; color: #16a34a; }
.tip { margin-top: 14px; font-size: 12px; color: #94a3b8; line-height: 1.5; }

/* ===== 课堂主界面 ===== */
#app { display: flex; flex-direction: column; height: 100%; }
#topbar {
  position: relative;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 16px; background: #111c33; border-bottom: 1px solid #1e293b;
  font-size: 14px;
}
#topbar .room b { color: #60a5fa; }
#topbar .count b { color: #34d399; }
/* 顶部居中品牌：与首页同一个 logo（透明底 PNG，71×61） */
#brand {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 8px; pointer-events: none;
}
#brand img { width: 24px; height: 22px; object-fit: contain; display: block; }
#brand span { font-size: 14px; letter-spacing: 2px; color: #d7e3f4; }
/* 离开：常规动作 → 蓝色（与红色「下课」明确区分，避免误点把全班踢下课） */
.leave, #leaveBtn {
  margin-left: auto; background: #2563eb; color: #fff; border: none;
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  font-weight: 600;
}
.leave:hover, #leaveBtn:hover { background: #1d4ed8; }
/* 下课：比「离开」更醒目（渐变+阴影），仅老师可见；放在「离开」左侧 */
#endClassBtn {
  margin-left: auto; border: none; cursor: pointer;
  padding: 7px 15px; border-radius: 8px; font-size: 13px; font-weight: 800;
  color: #fff; background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 3px 10px rgba(220, 38, 38, .38);
}
#endClassBtn:hover { background: linear-gradient(135deg, #f05252, #c11d1d); }
/* 有「下课」按钮时，把「离开」推到右侧但不吃掉它的 margin-left:auto */
#endClassBtn + #leaveBtn { margin-left: 0; }

/* ===== 金牌奖章（纯 CSS 绘制，不用 SVG/图片 → 微信 X5 WebView 安全）=====
   结构：.bean = 圆形金牌（外圈金属渐变 + 内圈凹陷 + 五角星），::after = 底部缎带。
   尺寸用 --m 控制，所有子尺寸按比例缩放，小到 14px 也不糊。 */
.bean {
  --m: 26px;
  position: relative; display: inline-block; flex: 0 0 auto;
  width: var(--m); height: var(--m); vertical-align: middle;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, #fffdf0 0%, #ffe9a3 18%, #ffc93c 45%, #e79b12 76%, #a86604 100%);
  box-shadow:
    inset 0 0 0 calc(var(--m) * .075) rgba(255, 245, 200, .55),
    inset -1px -2px calc(var(--m) * .2) rgba(130, 70, 0, .5),
    inset 1px 1px calc(var(--m) * .12) rgba(255, 255, 255, .75),
    0 2px calc(var(--m) * .26) rgba(230, 150, 20, .45);
}
/* 五角星：深金色描边 + 亮金填充，保证在金色底上仍然分得清 */
.bean::before {
  content: ""; position: absolute; left: 50%; top: 47%;
  width: calc(var(--m) * .62); height: calc(var(--m) * .62);
  transform: translate(-50%, -50%);
  background: linear-gradient(170deg, #fffdf2 0%, #ffe07a 40%, #f0a81c 100%);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 1.4px #8a4d00) drop-shadow(0 1px 0 rgba(120, 60, 0, .75));
}
/* 底部缎带：朝下的燕尾。★ 不能写 z-index:-1（父元素没有独立层叠上下文时会被压到父背景之下而看不见） */
.bean::after {
  content: ""; position: absolute; left: 50%; bottom: calc(var(--m) * -.34);
  width: calc(var(--m) * .72); height: calc(var(--m) * .42);
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ef5350 0%, #c62828 55%, #8e0f0f 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 64%, 0 100%);
  box-shadow: 0 1px 2px rgba(120, 10, 10, .45);
}
.bean.sm { --m: 16px; }
.bean.lg { --m: 46px; }
.bean.xl { --m: 72px; }

/* 名单里的豆子计数（单行布局下要更瘦：金牌 16px + 数字） */
#roster .bcnt {
  display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto;
  background: #3a2a0b; border: 1px solid #7a5a18; border-radius: 999px;
  padding: 1px 6px 1px 3px; font-size: 12px; color: #ffd75e; font-weight: 700;
}
/* 小尺寸下缎带会挤掉圆形本体，花名册里只留金牌圆盘 → 稍微放大 + 去掉缎带 */
#roster .bcnt .bean, .bean-total .bean { --m: 16px; }
#roster .bcnt .bean::after, .bean-total .bean::after { display: none; }
/* 摄像头方框头顶的徽章：小尺寸也要带缎带，看得像奖章 */
.bn-badge .bean.sm { --m: 20px; }
/* 全班撒豆 */
.bn-scatter {
  background: linear-gradient(135deg, #f5b942, #e08a1e); color: #3a2200;
  border: none; border-radius: 8px; padding: 7px 13px; font-size: 12.5px;
  font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.bean-total { font-size: 12px; color: #7f93ad; }

/* 发奖弹层 */
#giveBox {
  position: fixed; inset: 0; z-index: 90; background: rgba(3, 8, 18, .55);
  display: flex; align-items: center; justify-content: center;
}
.gb-card {
  width: 330px; background: #16233c; border: 1px solid #2b4a6f; border-radius: 14px;
  padding: 16px; box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
}
.gb-title { font-size: 13px; color: #9fb4cf; margin-bottom: 12px; }
.gb-title b { color: #fff; font-size: 14px; }
.gb-amt { display: flex; gap: 8px; margin-bottom: 12px; }
.gb-amt button {
  flex: 1; background: #0d1b30; border: 2px solid #24405f; color: #ffd75e;
  border-radius: 10px; padding: 9px 0; cursor: pointer; font-size: 14px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.gb-amt button.sel { border-color: #f5b942; background: #2a2410; }
.gb-words { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gb-words button {
  background: #0d1b30; border: 1px solid #24405f; color: #cfe0f5;
  border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer;
}
.gb-words button.sel { background: #1d4ed8; border-color: #3b82f6; color: #fff; }
#gbCustom {
  width: 100%; background: #0d1b30; border: 1px solid #24405f; color: #dbe6f5;
  border-radius: 8px; padding: 6px 9px; font-size: 13px; outline: none;
}
.gb-foot { display: flex; gap: 8px; margin-top: 12px; }
.gb-foot button { flex: 1; border: none; border-radius: 9px; padding: 9px 0; font-size: 13px; cursor: pointer; }
.gb-send { background: linear-gradient(135deg, #f5b942, #e08a1e); color: #3a2200; font-weight: 800; }
.gb-cancel { background: #1e2c44; color: #9fb4cf; }

/* 学员端奖励庆祝层 */
#beanLayer { position: fixed; inset: 0; z-index: 95; pointer-events: none; overflow: hidden; }
.bn-fall {
  position: absolute; top: -50px; animation: bnFall 2s linear forwards;
}
@keyframes bnFall {
  to { transform: translateY(105vh) rotate(220deg); opacity: .05; }
}
.bn-card {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(160deg, #fffaf0, #ffe9b8);
  border-radius: 16px; padding: 14px 20px 14px 16px;
  box-shadow: 0 18px 44px rgba(245, 185, 66, .45), inset 0 0 0 3px rgba(255, 255, 255, .55);
  animation: bnPop .45s cubic-bezier(.22, 1.4, .4, 1) both;
}
@keyframes bnPop {
  from { transform: translate(-50%, -50%) scale(.5); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.bn-card.fade { animation: bnFade .5s ease forwards; }
@keyframes bnFade { to { opacity: 0; transform: translate(-50%, -60%) scale(.92); } }
.bn-card .bn-main { color: #4a2c00; }
.bn-card .bn-name { font-size: 13px; font-weight: 700; opacity: .8; }
.bn-card .bn-big { font-size: 21px; font-weight: 900; letter-spacing: .5px; }
.bn-card .bn-big em { font-style: normal; color: #c2410c; }
.bn-card .bn-words { font-size: 12.5px; margin-top: 3px; color: #7c4a00; }

/* ===== 发奖飞行 + 落到摄像头方框的光圈 =====
   ① .bn-fly  从发奖人（老师点按钮处 / 屏幕中央）飞向获奖学员的 .tile，抵达即删
   ② .bn-ring 抵达时方框外扩一圈金环
   ③ .tile.bn-hit  方框金色描边 + 轻微上浮 + 奖章在框上弹出停留
   全员可见：老师在本地直接看 DOM，学员各自按同一条消息自己算目标 tile。 */
.bn-fly {
  position: fixed; left: 0; top: 0; z-index: 97; pointer-events: none;
  animation: bnFlyFly .62s cubic-bezier(.45, .05, .55, .95) forwards;
}
.bn-fly .bean { --m: 34px; }
@keyframes bnFlyFly {
  0%   { transform: translate(var(--x0), var(--y0)) scale(.55); opacity: 0; }
  18%  { opacity: 1; }
  100% { transform: translate(var(--x1), var(--y1)) scale(1.15); opacity: 1; }
}
/* 光圈：以方框中心扩散 */
.bn-ring {
  position: fixed; z-index: 96; pointer-events: none;
  border-radius: 14px; border: 3px solid rgba(255, 210, 80, .95);
  box-shadow: 0 0 22px rgba(255, 200, 60, .85), inset 0 0 22px rgba(255, 210, 90, .55);
  animation: bnRingGo .9s ease-out forwards;
}
@keyframes bnRingGo {
  0%   { transform: scale(.82); opacity: 1; }
  100% { transform: scale(1.22); opacity: 0; }
}
/* 目标没有摄像头方框时的降级：屏幕中央爆一颗 +N */
.bn-fly-centre {
  position: fixed; z-index: 97; pointer-events: none;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  animation: bnCentrePop 2.2s ease forwards;
}
.bn-fly-centre span {
  font-size: 15px; font-weight: 900; color: #ffd75e;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .6);
}
@keyframes bnCentrePop {
  0%   { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
  22%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  40%  { transform: translate(-50%, -50%) scale(1); }
  78%  { opacity: 1; }
  100% { transform: translate(-50%, -90%) scale(.9); opacity: 0; }
}
/* 方框受奖高亮 */
.tile.bn-hit {
  box-shadow: 0 0 0 3px #ffc93c, 0 0 26px rgba(255, 195, 50, .75);
  animation: bnLift .8s ease;
}
@keyframes bnLift {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-5px); }
}
/* 方框上弹出的奖章 + +N */
.tile .bn-badge {
  position: absolute; left: 50%; top: 6px; transform: translateX(-50%) scale(0);
  display: flex; align-items: center; gap: 4px; z-index: 6;
  padding: 3px 9px 3px 5px; border-radius: 999px;
  background: rgba(28, 18, 0, .78); border: 1px solid rgba(255, 200, 60, .7);
  color: #ffd75e; font-size: 13px; font-weight: 900; white-space: nowrap;
  animation: bnBadgePop .5s cubic-bezier(.2, 1.5, .4, 1) forwards;
}
.tile .bn-badge.out { animation: bnBadgeOut .4s ease forwards; }
@keyframes bnBadgePop {
  from { transform: translateX(-50%) scale(0) rotate(-12deg); opacity: 0; }
  to   { transform: translateX(-50%) scale(1) rotate(0); opacity: 1; }
}
@keyframes bnBadgeOut {
  to { transform: translateX(-50%) translateY(-10px) scale(.85); opacity: 0; }
}

/* 下课确认 */
#endConfirm {
  position: fixed; inset: 0; z-index: 96; background: rgba(3, 8, 18, .72);
  display: flex; align-items: center; justify-content: center;
}
.ec-card {
  width: 340px; background: #16233c; border: 1px solid #2b4a6f; border-radius: 16px;
  padding: 20px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
}
.ec-ic { font-size: 30px; }
.ec-t { font-size: 16px; font-weight: 800; margin: 8px 0 6px; color: #fff; }
.ec-d { font-size: 12.5px; color: #9fb4cf; line-height: 1.7; }
.ec-tip { color: #6f8bb0; font-size: 11.5px; }
.ec-btns { display: flex; gap: 10px; margin-top: 18px; }
.ec-btns button { flex: 1; border: none; border-radius: 10px; padding: 10px 0; font-size: 13.5px; cursor: pointer; }
.ec-no { background: #1e2c44; color: #a9bdd6; }
.ec-yes { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; font-weight: 800; }

/* 课程已结束遮罩 */
#classOver {
  position: fixed; inset: 0; z-index: 98;
  background: radial-gradient(circle at 50% 35%, #17335c, #060d18);
  display: flex; align-items: center; justify-content: center;
}
.co-inner { text-align: center; padding: 24px; max-width: 92vw; }
.co-t1 { font-size: 22px; font-weight: 900; color: #fff; letter-spacing: 1px; }
.co-t2 { font-size: 13px; color: #8fa6c0; margin-top: 8px; }
.co-board {
  margin: 20px auto 0; width: 300px; max-width: 84vw;
  background: #0f1d33; border: 1px solid #24405f; border-radius: 12px;
  padding: 12px 14px; text-align: left;
}
.co-bt { font-size: 12px; color: #f5b942; font-weight: 700; margin-bottom: 8px; }
.co-bi { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.co-bi .r { margin-left: auto; color: #ffd75e; font-weight: 700; }
.co-bi .rk { width: 18px; color: #94a3b8; font-size: 12px; }
.co-note { font-size: 12px; color: #7f93ad; margin-top: 14px; }

#body { flex: 1; display: flex; min-height: 0; }

/* 主区域 = 主舞台 + 一排上台位（不换行，超出横滑） */
#main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
/* 主舞台 = 共享屏幕 / 白板，占满整块区域（不预留底栏，屏幕尽可能大） */
#stage {
  flex: 1; min-height: 0; position: relative; overflow: hidden;
  padding: 0;
}
#stageBar {
  position: absolute; left: 20px; top: 16px; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  background: rgba(10,18,32,.72); border: 1px solid #24405f;
  padding: 4px 8px 4px 10px; border-radius: 9px;
  font-size: 12px; color: #b6c8de;
}
#stageBar #btnSwap {
  background: #1d4ed8; color: #fff; border: none; border-radius: 6px;
  padding: 3px 9px; font-size: 12px; cursor: pointer;
}
#stageBar #btnSwap:active { background: #1e40af; }
#stageMenu {
  position: absolute; left: 20px; top: 48px; z-index: 6;
  background: #12203a; border: 1px solid #2b4a6f; border-radius: 10px;
  padding: 6px; min-width: 170px; max-height: 320px; overflow-y: auto;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
#stageMenu button {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; color: #dbe6f5;
  padding: 8px 10px; border-radius: 7px; font-size: 13px; cursor: pointer;
}
#stageMenu button:hover { background: #1c3050; }
#stageMenu button.on { background: #1d4ed8; color: #fff; }

/* 摄像头不再占主舞台，退化为右下角一排 PiP 小窗（浮在共享屏幕/白板上方） */
#strip {
  position: absolute; right: 12px; bottom: 12px; left: auto; z-index: 6;
  display: flex; gap: 8px; align-items: flex-end;
  max-width: calc(100% - 24px); pointer-events: none;
  overflow-x: auto; overflow-y: hidden;
}
#strip::-webkit-scrollbar { height: 6px; }
#strip::-webkit-scrollbar-thumb { background: #24405f; border-radius: 3px; }

/* 小窗条翻页条（方案 A）：浮在小窗条上方右侧，人多时出现 */
#stripNav {
  position: absolute; right: 12px; bottom: 101px; z-index: 7;
  display: flex; align-items: center; gap: 4px;
  background: rgba(12,26,44,.88); border: 1px solid #24405f; border-radius: 14px;
  padding: 3px 6px; box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
#stripNav button {
  width: 24px; height: 22px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 6px; cursor: pointer; padding: 0;
}
#stripNav button:hover { background: rgba(255,255,255,.12); }
#stripNav button:disabled { opacity: .3; cursor: default; background: transparent; }
#stripNav .nv { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
#stripNav .nv.l { border-right: 7px solid #cfe0f5; }
#stripNav .nv.r { border-left: 7px solid #cfe0f5; }
#stripNav button:disabled .nv.l { border-right-color: #cfe0f5; }
#stripNav button:disabled .nv.r { border-left-color: #cfe0f5; }
#stripPageNo { color: #cfe0f5; font-size: 12px; min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }

/* 舞台内那块占满整个主舞台（屏幕共享=尽可能大）；摄像头 PiP 小窗 */
#stage .tile { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; z-index: 2; }
#strip .tile { flex: 0 0 auto; width: 144px; height: 81px; pointer-events: auto; box-shadow: 0 6px 18px rgba(0,0,0,.45); }

/* 白板 / 共享屏幕占位（默认主舞台内容，未共享屏幕时显示） */
#wbPlaceholder {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: #eef2f7; color: #64748b; text-align: center; padding: 20px;
}
#wbPlaceholder .wb-title { font-size: 17px; font-weight: 800; color: #334155; }
#wbPlaceholder .wb-sub { font-size: 13px; margin-top: 8px; line-height: 1.6; }

.tile {
  position: relative; background: #1e293b; border-radius: 10px; overflow: hidden;
  aspect-ratio: 16 / 9; border: 2px solid transparent;
}
.tile.screen { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.tile.local { border-color: #22d3ee; }
.tile.teacher { border-color: #f59e0b; }
.tile .video { width: 100%; height: 100%; background: #0b1220; }
.tile .video video { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* 屏幕共享走 SDK 的「直播模式」：video 会被包进一个 display:grid 的 wrapper
   （data-trtc-video-wrapper）。这层不写尺寸就会出现「能听到声音但画面全黑」，
   所以把 wrapper 也撑满，并让里面的 video 占满 grid 单元格。 */
.tile .video [data-trtc-video-wrapper] {
  width: 100%; height: 100%; display: grid; grid-template: 1fr / 1fr;
}
.tile .video [data-trtc-video-wrapper] > * { min-width: 0; min-height: 0; }
.tile .video [data-trtc-video-wrapper] video {
  grid-area: 1 / 1; width: 100%; height: 100%; object-fit: contain; background: #000;
}
.tile .name {
  position: absolute; left: 8px; bottom: 6px; z-index: 3;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px;
  padding: 2px 8px; border-radius: 6px; max-width: 70%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile .badge {
  position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; z-index: 3;
}
.tile .badge span {
  font-size: 11px; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.5);
}
.badge .hand { background: #f59e0b; color: #1e293b; font-weight: 700; }
/* ★ 角标里的「静音 / 关摄像头」也改成图标（2026-10-21）：
   以前是文字「静音」「关摄像头」，小窗只有 144px 宽，两个字就横跨半张卡片，
   而且和左上角的设备图标重复表达同一件事。现在 = 红底/灰底 + 图形 + 白斜杠。 */
.badge .mic-off, .badge .cam-off {
  position: relative; padding: 3px 5px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.badge .mic-off { background: #dc2626; color: #fff; }
.badge .cam-off { background: #64748b; color: #fff; }
.badge .ic-slash {
  position: absolute; left: 50%; top: 50%; width: 15px; height: 2px;
  background: #fff; border-radius: 1px;
  transform: translate(-50%, -50%) rotate(-45deg);
  pointer-events: none; z-index: 2;
}
/* 摄像头已关：盖住残留的最后一帧，明确告诉老师"现在没有在拍" */
.tile .cam-mask {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: #0b1220; color: #94a3b8; font-size: 13px; letter-spacing: .5px;
}

/* ===== 音量波动条（谁在说话） =====
   ★ z-index 3 必须高于 .cam-mask(2)：学生默认只开麦不开摄像头，
     摄像头黑着的时候更需要一眼看出「谁在说话」。
   ★ 做成有底+描边的小胶囊：静音时柱子只有 4px，纯色柱子贴在深色画面上根本看不见
     （第一版就是没做底，现场反馈"根本没有音量柱子"）。
   四根柱子的 transition-delay 依次错开，音量每 150ms 刷新一次就会像波浪一样流动。 */
.tile .vol {
  position: absolute; right: 5px; bottom: 5px; z-index: 3;
  display: flex; align-items: flex-end; gap: 3px;
  height: 19px; padding: 0 5px 3px;
  border-radius: 7px;
  background: rgba(4, 10, 20, .66);
  border: 1px solid rgba(255, 255, 255, .18);
  pointer-events: none;
}
.tile .vol i {
  display: block; width: 3.5px; height: 4px; border-radius: 2px;
  background: #9db6d0;
  transition: height .14s linear, background-color .18s linear;
}
.tile .vol i:nth-child(2) { transition-delay: .03s; }
.tile .vol i:nth-child(3) { transition-delay: .06s; }
.tile .vol i:nth-child(4) { transition-delay: .09s; }
.tile.speaking .vol i { background: #4ade80; }
/* 说话时贴一圈内发光边（用 outline 而不是 border，不会顶动布局）。
   内缩 2px 画在边框内侧，和 .local/.teacher 的边框颜色不打架。 */
.tile.speaking { outline: 2px solid rgba(74, 222, 128, .9); outline-offset: -2px; }

/* ===== 小窗上的设备按钮（只建在本地那一格）=====
   ★ 位置：左上角。底部左侧已经被 .name 占用、右下角是 .vol 音量柱，
     塞在底部会互相压住；左上角 .badge（举手/静音提示）只在非本地格出现，不冲突。
   ★ 144×81 的小窗里按钮必须够小（22px）又要够点得中；移动端缩到 20px。
   ★ 图标纯 CSS 画（.ic-mic / .ic-cam）：SVG 经 innerHTML 注入在微信 X5 会整块空白。 */
.tile .devbtns {
  position: absolute; left: 5px; top: 5px; z-index: 4;
  display: flex; gap: 4px;
}
.tile .devbtns .db {
  width: 22px; height: 22px; padding: 0; margin: 0;
  position: relative;      /* 斜杠 .ic-slash 以按钮自己为定位基准 */
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer;
  background: rgba(4, 10, 20, .72);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #e2e8f0;
  transition: background-color .15s linear, border-color .15s linear;
}
.tile .devbtns .db:hover { background: rgba(30, 58, 95, .92); border-color: rgba(147, 197, 253, .7); }
/* .off = 该设备当前是关着的（麦克风静音 / 摄像头关闭）→ 红底白字，一眼看出「现在没开」 */
.tile .devbtns .db.off { background: #dc2626; border-color: #f87171; color: #fff; }
/* .locked = 被老师关掉且锁定，学员自己点不开 → 暗红 + 虚线边，和「我自己关的」区分 */
.tile .devbtns .db.locked { background: #7f1d1d; border-style: dashed; border-color: #fca5a5; }
/* .busy = 老师点了「静音/关摄」，等学员回执（最多 8 秒）→ 变灰禁用，防连点 */
.tile .devbtns .db.busy { background: rgba(71, 85, 105, .92); border-color: #64748b; color: #cbd5e1; cursor: wait; opacity: .9; }
.tile .devbtns .db:disabled { cursor: not-allowed; }

/* --- 麦克风图标：圆头 + 支杆 + 底座（3 个 CSS 形状，不用 SVG） ---
   ★ 同一套图标在「小窗设备按钮」「花名册管控按钮」「小窗右上角角标」三处复用，
     只靠父选择器区分，避免复制三份（改一处漏一处 —— 之前就吃过这个亏）。 */
.tile .db .ic-mic, #roster .ib .ic-mic, .tile .badge .ic-mic { position: relative; width: 11px; height: 12px; display: block; }
.tile .db .ic-mic::before, #roster .ib .ic-mic::before, .tile .badge .ic-mic::before {   /* 胶囊话筒头 */
  content: ''; position: absolute; left: 2.5px; top: 0;
  width: 6px; height: 8px; border-radius: 3px;
  background: currentColor;
}
.tile .db .ic-mic::after, #roster .ib .ic-mic::after, .tile .badge .ic-mic::after {    /* U 形支架 + 竖杆 */
  content: ''; position: absolute; left: 0.5px; top: 4px;
  width: 10px; height: 6px; box-sizing: border-box;
  border: 1.5px solid currentColor; border-top: none;
  border-radius: 0 0 5px 5px;
}
/* 静音时加一道斜杠：比单纯变红更明确（红色也可能是「被锁定」） */
.tile .db.off .ic-mic::before, #roster .ib.dev.off .ic-mic::before,
.tile .db.off .ic-mic::after, #roster .ib.dev.off .ic-mic::after { opacity: .85; }
.tile .db .ic-slash, #roster .ib .ic-slash {
  position: absolute; left: 50%; top: 50%; width: 15px; height: 2px;
  background: #fff; border-radius: 1px;
  transform: translate(-50%, -50%) rotate(-45deg);
  display: none; pointer-events: none; z-index: 2;
}
.tile .db.off .ic-slash, #roster .ib.dev.off .ic-slash { display: block; }

/* --- 摄像头图标：机身 + 右侧镜头梯形 --- */
.tile .db .ic-cam, #roster .ib .ic-cam, .tile .badge .ic-cam { position: relative; width: 13px; height: 11px; display: block; }
.tile .db .ic-cam::before, #roster .ib .ic-cam::before, .tile .badge .ic-cam::before {   /* 机身 */
  content: ''; position: absolute; left: 0; top: 1px;
  width: 9px; height: 9px; box-sizing: border-box;
  border: 1.5px solid currentColor; border-radius: 2px;
}
.tile .db .ic-cam::after, #roster .ib .ic-cam::after, .tile .badge .ic-cam::after {    /* 镜头（用三角形近似摄像头的出画标志） */
  content: ''; position: absolute; right: 0; top: 3.5px;
  width: 0; height: 0;
  border-top: 2.5px solid transparent;
  border-bottom: 2.5px solid transparent;
  border-right: 4px solid currentColor;
  transform: scaleX(-1);
}

/* ===== 侧栏 ===== */
#side {
  width: 300px; background: #111c33; border-left: 1px solid #1e293b;
  display: flex; flex-direction: column;
}
.tabs { display: flex; border-bottom: 1px solid #1e293b; }
.tabs button {
  flex: 1; padding: 12px; background: none; border: none; color: #94a3b8;
  font-size: 14px; cursor: pointer;
}
.tabs button.active { color: #60a5fa; border-bottom: 2px solid #1976d2; }
.panel { flex: 1; overflow-y: auto; }
#roster { list-style: none; padding: 6px 8px; }
/* ★ 单行（2026-10-20 定稿）：
   一行 = 圆点 + 姓名(固定 4 字宽) + 标签 + 右侧图标按钮组。
   上一版「两行」虽然名字能看全，但一行学员要占两行高度，20 人班滚半天；
   改成单行 + 控件全部图标化后，一行就能放完，姓名宽度反而更稳定。 */
#roster li {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 8px; margin-bottom: 3px;
  border-radius: 8px; font-size: 14px; overflow: hidden;
}
#roster li:nth-child(odd) { background: #0b1426; }
#roster .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; flex: 0 0 auto; }
#roster .dot.off { background: #64748b; }
#roster .tag {
  flex: 0 0 auto; font-size: 11px; padding: 1px 5px;
  border-radius: 6px; background: #f59e0b; color: #1e293b;
}
#roster .tag.me { background: #2563eb; color: #fff; }
#roster .tag.hand { padding: 1px 3px; font-size: 12px; background: #f59e0b; }
/* ★ 姓名固定 4 个字宽：中文名最多 4 个字，第 5 个字起 ellipsis（悬停 title 看全名）。
   宽度取 5em 而不是 4em —— 省略号本身要占 1 个字宽，4em 会让 5 字以上的名字只露出 3 个字。
   flex 基准 5em + 允许收缩 → 极端窄屏只会压缩姓名，按钮不会被挤出可视区。 */
#roster li .nm {
  flex: 1 1 5em; max-width: 5em; min-width: 2em;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
#roster li .nm.me { color: #93c5fd; }
/* 右侧图标按钮组：始终贴右，和姓名之间留出的空间给它 */
#roster .acts { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
#roster .ib {
  position: relative; width: 24px; height: 24px; padding: 0; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer;
  background: #14253d; border: 1px solid #2b4a6f; color: #9fc2e8;
}
#roster .ib:hover { background: #1c3350; }
#roster .ib:disabled { opacity: .55; cursor: not-allowed; }
/* 上台：选中（.on）时高亮成琥珀色 */
#roster .ib.up.on { background: #f59e0b; color: #1e293b; border-color: #f59e0b; }
/* 发奖：紫色底 + 金色小奖章，不用文字 */
#roster .ib.give { background: #7c3aed; border-color: #7c3aed; color: #fff; }
#roster .ib.give:hover { background: #6d28d9; }
#roster .ib.give .bean { --m: 15px; }
/* .off = 该设备当前是关着的（已静音 / 已关摄像头）→ 红底白图标 + 斜杠 */
#roster .ib.dev.off { background: #b91c1c; color: #fff; border-color: #b91c1c; }
/* .busy = 指令已发出、等学员回执（最多 8 秒），期间禁用防连点 */
#roster .ib.dev.busy { background: #475569; color: #cbd5e1; border-color: #475569; cursor: wait; opacity: .85; }
/* --- 上台图标：向上箭头（纯 CSS 三角 + 竖杆，微信 X5 安全） --- */
#roster .ic-up { position: relative; width: 11px; height: 13px; display: block; }
#roster .ic-up::before {
  content: ''; position: absolute; left: 0; top: 0; width: 0; height: 0;
  border-left: 5.5px solid transparent; border-right: 5.5px solid transparent;
  border-bottom: 6px solid currentColor;
}
#roster .ic-up::after {
  content: ''; position: absolute; left: 4px; top: 6px;
  width: 3px; height: 7px; background: currentColor; border-radius: 1px;
}

/* 老师管控条：全体静音 */
#ctlBar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-bottom: 1px solid #1e293b; background: #0b1426;
}
#ctlBar #btnMuteAll {
  padding: 5px 12px; font-size: 12px; cursor: pointer; border-radius: 7px; white-space: nowrap;
  background: #14253d; color: #9fc2e8; border: 1px solid #2b4a6f;
}
#ctlBar #btnMuteAll:hover { background: #1c3350; }
#ctlBar #btnMuteAll.on { background: #b91c1c; color: #fff; border-color: #b91c1c; }
#ctlHint { font-size: 11px; color: #7f9cc0; line-height: 1.4; }
/* 被老师远程锁定的本地控制按钮态 */
.ctrl.locked { background: #b91c1c; color: #fff; }

/* 本地设备降级提示（麦克风/摄像头没开起来时常驻在本机 tile 上） */
/* 缩略图只有 144×81，塞不下整句提示 → 只在主舞台/大格显示，缩略图靠红色边框提示 */
.dev-hint {
  position: absolute; left: 6px; right: 6px; bottom: 26px; z-index: 3;
  display: none; flex-direction: column; gap: 3px; pointer-events: none;
}
#stage .dev-hint, .tile.local .dev-hint { display: flex; }
#strip .tile .dev-hint { display: none; }
.dev-hint > div {
  background: rgba(185, 28, 28, .92); color: #fff;
  font-size: 11px; line-height: 1.35; padding: 4px 7px; border-radius: 6px;
  word-break: break-word;
}
/* 设备未就绪时本地格加红边，缩略图里也能一眼看出「这个人没麦/没摄像头」 */
.tile.local.dev-bad { border-color: #ef4444 !important; }

/* ===== 答题明细（姓名 × 题号） ===== */
#panelBoard { display: flex; flex-direction: column; padding: 10px; gap: 8px; }
#boardTop { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
#boardMeta { font-size: 12px; color: #8ba7c7; }
#boardExport, #boardSave {
  padding: 5px 10px; font-size: 12px; cursor: pointer; border-radius: 7px;
  background: #14253d; color: #9fc2e8; border: 1px solid #2b4a6f;
}
#boardSave { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
#boardWrap { flex: 1; overflow: auto; }
#boardTable { border-collapse: collapse; font-size: 12px; width: 100%; }
#boardTable th, #boardTable td { padding: 5px 7px; border-bottom: 1px solid #1e293b; text-align: center; white-space: nowrap; }
#boardTable th:first-child, #boardTable td:first-child { text-align: left; position: sticky; left: 0; background: #101c31; }
#boardTable thead th { color: #8ba7c7; font-weight: 600; }
#boardTable td.ok { color: #34d399; }
#boardTable td.no { color: #f87171; }
#boardTable td.none { color: #475569; }
#boardTable tfoot td { color: #e2e8f0; font-weight: 600; border-top: 1px solid #2b4a6f; }
#boardSaveRow { display: flex; align-items: center; gap: 8px; }
#boardSaveMsg { font-size: 12px; color: #8ba7c7; }
/* ===== 聊天气泡窗（点「聊天」弹出，再点收起） ===== */
#chatPop {
  position: fixed; right: 316px; bottom: 84px; z-index: 46;
  width: 330px; height: 420px; max-height: 70vh;
  display: none; flex-direction: column;
  background: #101c31; border: 1px solid #24405f; border-radius: 14px;
  box-shadow: 0 18px 46px rgba(0,0,0,.55); overflow: hidden;
}
#chatPop.open { display: flex; }
#chatPop .cp-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid #1e293b;
  font-size: 14px; font-weight: 700; color: #dbe6f5;
  cursor: move; user-select: none; touch-action: none;
}
#chatPop.dragging { user-select: none; }
#chatPop.dragging .cp-head { cursor: grabbing; }
/* 右下角拖拽抓手：缩放聊天窗尺寸（纯 CSS 边框画斜纹，微信 WebView 也安全） */
#chatPop .cp-resize {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px;
  cursor: nwse-resize; touch-action: none; z-index: 7;
}
#chatPop .cp-resize::before {
  content: ''; position: absolute; right: 4px; bottom: 4px; width: 10px; height: 10px;
  border-right: 2px solid #4c6b90; border-bottom: 2px solid #4c6b90; border-radius: 0 0 3px 0;
}
#chatPop .cp-resize::after {
  content: ''; position: absolute; right: 8px; bottom: 8px; width: 5px; height: 5px;
  border-right: 2px solid #34506e; border-bottom: 2px solid #34506e;
}
#chatPop.resizing { user-select: none; }
#chatPop.resizing .cp-resize { border-color: #60a5fa; }
#chatPop .cp-x {
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  border: 1px solid #2b4a6f; background: #14253d; color: #9fb8cf;
  font-size: 15px; line-height: 1;
}
#chatPop .cp-x:hover { background: #1b3454; color: #fff; }
#chatMsgs { flex: 1; min-height: 0; padding: 10px 12px; overflow-y: auto; font-size: 13px; line-height: 1.55; }
#chatMsgs .msg { margin-bottom: 8px; word-break: break-word; }
#chatMsgs .msg b { color: #60a5fa; margin-right: 2px; }
#chatMsgs .sys { color: #64748b; font-style: italic; }
.chat-input { flex: 0 0 auto; display: flex; gap: 8px; padding: 9px 18px 9px 9px; border-top: 1px solid #1e293b; }
.chat-input input {
  flex: 1; min-width: 0; padding: 9px 10px; border-radius: 9px;
  border: 1px solid #334155; background: #0b1426; color: #e2e8f0; font-size: 13px;
}
.chat-input input:focus { outline: none; border-color: #1976d2; }
.chat-input button {
  flex: 0 0 auto; padding: 9px 14px; background: #1976d2; color: #fff;
  border: none; border-radius: 9px; cursor: pointer; font-size: 13px;
}
/* 控制条「聊天」上的未读小圆点 */
#btnChat.has-new { position: relative; }
#btnChat.has-new::after {
  content: ''; position: absolute; top: 6px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%; background: #f59e0b;
  box-shadow: 0 0 0 2px #111c33;
}

/* ===== 控制条 ===== */
#controls {
  display: flex; gap: 10px; justify-content: center; align-items: center;
  padding: 12px; background: #111c33; border-top: 1px solid #1e293b;
}
.ctrl {
  padding: 10px 16px; border-radius: 10px; border: none; cursor: pointer;
  background: #1e293b; color: #e2e8f0; font-size: 14px;
}
.ctrl.active { background: #1976d2; }
.ctrl.off { background: #7f1d1d; }
.ctrl.screen.active { background: #0891b2; }
/* 省流模式：默认灰，开启后琥珀色（和「共享屏幕」的青色、静音的红色都区分开） */
.ctrl.eco { background: #334155; color: #cbd5e1; font-size: 13px; padding: 10px 12px; }
.ctrl.eco.on { background: #d97706; color: #fff; font-weight: 700; }
/* 课堂录制：默认灰，录制中变红 + 闪烁圆点 + 按钮上直接显示计时 */
.ctrl.rec { background: #334155; color: #cbd5e1; font-size: 13px; padding: 10px 12px; }
.ctrl.rec.on { background: #dc2626; color: #fff; font-weight: 700; }
.ctrl.rec.on::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; margin-right: 6px; vertical-align: middle;
  animation: recBlink 1s steps(1, end) infinite;
}
@keyframes recBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .25; } }
#status {
  position: fixed; bottom: 148px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.7); color: #fff; padding: 6px 14px; border-radius: 8px;
  font-size: 13px; display: none;
}

@media (max-width: 720px) {
  #side { width: 100%; position: fixed; inset: auto 0 64px 0; height: 45%; z-index: 5; display: none; }
  #side.open { display: flex; }
  #strip { right: 8px; bottom: 8px; }
  #strip .tile { width: 96px; height: 54px; }
  #strip .tile .vol { right: 3px; bottom: 3px; gap: 2px; height: 17px; padding: 0 3px 2px; }
  #strip .tile .vol i { width: 2.5px; }
  #stripNav { right: 8px; bottom: 70px; }
  #stage { padding: 0; }
  #chatPop { right: 10px; left: 10px; width: auto; bottom: 76px; height: 52vh; }
  /* 手机上不需要缩放抓手（窗口本来就贴边自适应） */
  #chatPop .cp-resize { display: none; }
  /* 手机上舞台窄，批注条整体缩小并贴右上角 */
  #penbar { right: 4px; top: 4px; transform: scale(.85); transform-origin: right top; }
  /* 手机屏只有 360~430px 宽，284px 的右浮窗会吃掉大半屏幕 → 改成顶部横条 */
  #answerCard { left: 8px; right: 8px; top: 8px; width: auto; max-height: 48%; }
  .ac-box { padding: 10px 12px 10px; }
}

/* ===== 答题面板（侧栏） ===== */
/* switchTab 会把 display 设为 flex，必须显式纵向排列，否则题库/出题区/统计会横向挤成一条 */
#panelQuiz { padding: 14px; gap: 8px; overflow-y: auto; flex-direction: column; align-items: stretch; }
#panelQuiz > * { flex: 0 0 auto; }

/* ===== 备课题库 ===== */
#bankBox { border: 1px solid #223a59; border-radius: 10px; padding: 8px 10px; background: #0d192c; }
.bank-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: #9fc2e8; }
.bank-head b { color: #60a5fa; }
#bankAdd {
  padding: 3px 9px; font-size: 12px; cursor: pointer; border-radius: 6px;
  background: #14253d; color: #9fc2e8; border: 1px solid #2b4a6f;
}
#bankList { list-style: none; margin-top: 6px; max-height: 190px; overflow-y: auto; }
#bankList li { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; font-size: 12.5px; }
#bankList li:nth-child(odd) { background: #0b1426; }
#bankList .bt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dbe6f5; }
#bankList .bs { font-size: 11px; color: #f59e0b; }
#bankList .go, #bankList .del {
  padding: 2px 7px; font-size: 11px; cursor: pointer; border-radius: 5px; white-space: nowrap;
}
#bankList .go { background: #1d4ed8; color: #fff; border: none; }
#bankList .del { background: transparent; color: #64748b; border: 1px solid #2b4a6f; }
#bankList li.empty { color: #64748b; font-size: 12px; justify-content: center; }
#bankEditor { margin-top: 8px; }
#bankText {
  width: 100%; min-height: 110px; resize: vertical; padding: 8px;
  border-radius: 8px; border: 1px solid #334155; background: #0f1b30;
  color: #e2e8f0; font-size: 12.5px; font-family: inherit;
}
.bank-actions { display: flex; gap: 8px; margin-top: 6px; }
.bank-actions button {
  flex: 1; padding: 6px; font-size: 12.5px; cursor: pointer; border-radius: 7px;
  background: #14253d; color: #9fc2e8; border: 1px solid #2b4a6f;
}
.bank-actions button:first-child { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
#composeHead {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: #93b4a6; margin-top: 4px;
}
#composeHead button {
  padding: 2px 9px; font-size: 11.5px; cursor: pointer; border-radius: 6px;
  background: transparent; color: #8ba7c7; border: 1px solid #2b4a6f;
}
#quizCompose.collapsed { display: none !important; }
.qz-label { font-size: 12px; color: #93b4a6; margin: 8px 0 4px; font-weight: 700; }
#qzTitle {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 52px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid #334155;
  background: #0f1b30; color: #e2e8f0; font-size: 13px; font-family: inherit;
}
.qz-opt {
  width: 100%; box-sizing: border-box; margin-bottom: 6px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid #334155;
  background: #0f1b30; color: #e2e8f0; font-size: 13px;
}
#qzTitle:focus, .qz-opt:focus { outline: none; border-color: #1976d2; }
.qz-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
/* 选项行：左边字母徽章 + 输入框。选项内容留空时，学生端就只看到这个字母 */
.qz-opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.qz-opt-letter {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: #1e293b; color: #93b4a6; font-size: 12px; font-weight: 700;
}
.qz-opt-row .qz-opt { margin-bottom: 0; flex: 1 1 auto; min-width: 0; }
#qzOptCtl { display: flex; gap: 8px; margin: 2px 0 10px; }
.qz-optbtn {
  width: 34px; height: 30px; padding: 0; border-radius: 8px; cursor: pointer;
  border: 1px solid #334155; background: #1e293b; color: #cbd5e1;
  font-size: 17px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.qz-optbtn:hover:not(:disabled) { border-color: #1976d2; color: #fff; }
.qz-optbtn:disabled { opacity: .35; cursor: default; }
.qz-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.qz-tip { font-size: 11px; color: #6b8296; font-weight: 400; margin-left: 4px; }
.qz-label b { color: #cbd5e1; }
#qzAnswer {
  padding: 6px 10px; border-radius: 8px; border: 1px solid #334155;
  background: #0f1b30; color: #e2e8f0; font-size: 13px;
}
.qz-btn {
  width: 100%; padding: 10px; border: none; border-radius: 10px; cursor: pointer;
  background: #1976d2; color: #fff; font-size: 14px; font-weight: 700;
}
.qz-btn.ghost { background: #1e293b; color: #cbd5e1; font-weight: 500; }
.qz-btn:disabled { opacity: .45; cursor: default; }
.qz-hint { font-size: 12px; color: #7f9bb3; margin-top: 8px; line-height: 1.6; }
.qz-qtitle { font-size: 13.5px; color: #e2e8f0; font-weight: 700; margin-bottom: 10px; line-height: 1.5; }
#qzRBars { display: flex; flex-direction: column; gap: 8px; }
.qz-bar-row { font-size: 12.5px; color: #cbd5e1; }
.qz-bar-head { display: flex; justify-content: space-between; margin-bottom: 3px; gap: 8px; }
.qz-bar-track { height: 16px; background: #0f1b30; border-radius: 8px; overflow: hidden; }
.qz-bar-fill { height: 100%; width: 0; background: #1976d2; border-radius: 8px; transition: width .35s ease; }
.qz-bar-fill.correct { background: #16a34a; }
.qz-bar-fill.wrong { background: #b91c1c; }
.qz-meta { font-size: 12px; color: #93b4a6; margin: 10px 0; }
.qz-actions { display: flex; gap: 8px; }
.qz-actions .qz-btn { flex: 1; }

/* ===== 学生答题卡 =====
   ★ 右侧浮窗（2026-10-20 改）：旧版是 position:fixed;inset:0 的全屏遮罩，
     学生一答题就把老师共享在屏幕上的题目整个盖住——这正是要解决的问题。
     现在贴在 #body 右上角（正好压在成员栏上方）：
     ① 屏幕一点不挡 ② top:50px 避开成员/答题两个 tab，仍能切标签页
     ③ 不带背景遮罩，屏幕该亮还是亮。 */
#answerCard {
  position: absolute; right: 12px; top: 50px; z-index: 40;
  width: 284px; max-height: calc(100% - 62px);
  display: flex; align-items: flex-start;
}
.ac-box {
  width: 100%; max-height: calc(100% - 4px); overflow-y: auto;
  background: rgba(11, 21, 38, .94); border: 1px solid #24405f;
  border-radius: 14px; padding: 14px 14px 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .55); position: relative;
}
.ac-x {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  border: 1px solid #2b4a6f; background: #14253d; color: #9fb8cf;
  border-radius: 7px; font-size: 13px; line-height: 1; cursor: pointer;
}
.ac-x:hover { background: #1b3454; color: #fff; }
.ac-title { font-size: 14.5px; font-weight: 800; color: #fff; line-height: 1.5; margin-bottom: 12px; padding-right: 28px; }
.ac-done {
  display: block; width: 100%; margin-top: 10px; padding: 10px;
  border: 0; border-radius: 10px; background: #1d4ed8; color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.ac-done:hover { background: #2563eb; }
/* 答题卡收起后的回看按钮：右下角浮动，学生端专用 */
#acReopen {
  position: fixed; right: 18px; bottom: 92px; z-index: 36;
  padding: 11px 16px; border: 0; border-radius: 22px;
  background: #1d4ed8; color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: 0 8px 22px rgba(29,78,216,.45); cursor: pointer;
}
#acReopen:hover { background: #2563eb; }
.ac-opt {
  display: block; width: 100%; text-align: left; box-sizing: border-box;
  margin-bottom: 8px; padding: 11px 13px; border-radius: 11px;
  border: 1.5px solid #2b4a6f; background: #14253d; color: #e2e8f0;
  font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s;
}
.ac-opt:hover { background: #1b3454; }
/* 选项全都没文字（题目在老师屏幕上）→ 字母横向排成网格，卡片只占两三行高，
   最大程度把屏幕留给学生看题 */
#acOptions.letter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 8px; }
#acOptions.letter-row .ac-opt { margin-bottom: 0; text-align: center; }
/* 选项没有文字时：只显示一个大字母，像考试答题卡，手机上更好点 */
.ac-opt.letter-only {
  justify-content: center; font-size: 22px; font-weight: 700;
  letter-spacing: 2px; min-height: 58px; text-align: center;
}
.ac-opt.picked { border-color: #42a5f5; background: #12395c; }
.ac-opt.right { border-color: #16a34a; background: #0f3320; }
.ac-opt.wrong { border-color: #b91c1c; background: #3a1414; }
.ac-opt:disabled { cursor: default; }
.ac-foot { font-size: 13px; color: #93b4a6; margin-top: 6px; min-height: 20px; line-height: 1.5; }

/* ===== 画笔批注层 ===== */
#body { position: relative; }
#drawCanvas {
  position: absolute; z-index: 9; display: none;
  pointer-events: none; border-radius: 10px;
}
#drawCanvas.active { pointer-events: auto; cursor: crosshair; touch-action: none; }

/* ===== 批注工具栏：浮在舞台右侧的「单列」图标条 =====
   ★ 用户明确要求「共享屏幕尺寸一点都不能变」→ 必须 absolute 浮层，不参与布局。
   ★ 用户明确要求「竖版、排成一列」→ 单列 grid，一个按钮一行，不许折成多列。
   ★ 挂在 #main（position:relative）里，所以贴的是「舞台右边缘」而不是视口右边缘
     （挂 #app 会被右侧 300px 的成员栏挡住）。
   ★ 顶部对齐 + 底部预留 100px：右下角是学员 PiP 小窗条，居中对齐时下半截会被它压住。
   ★ 全图标、无中文标签；图标一律用 CSS 形状 + currentColor 画，不用 SVG innerHTML
     （微信 X5 会把 SVG innerHTML 渲染成空白）。 */
#penbar {
  position: absolute; right: 8px; top: 8px;
  z-index: 12;
  display: none; grid-template-columns: 34px; gap: 2px; justify-content: center;
  padding: 5px; border-radius: 12px;
  background: rgba(11, 22, 38, .95); border: 1px solid #24405f;
  box-shadow: 0 10px 28px rgba(0,0,0,.5);
  max-height: calc(100% - 116px); overflow-y: auto; overscroll-behavior: contain;
}
#penbar.on { display: grid; }
#penbar::-webkit-scrollbar { width: 5px; }
#penbar::-webkit-scrollbar-thumb { background: #24405f; border-radius: 3px; }

/* 分隔线横跨整行 */
#penbar .pb-sep { grid-column: 1 / -1; height: 1px; background: #24405f; margin: 1px 2px; }

/* 所有可点格子统一 34 宽、单列 */
#penbar .pb-tool, #penbar .pb-act, #penbar .pb-colors i, #penbar .pb-widths i {
  width: 34px; padding: 0; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid #2b4a6f; background: #14253d;
  color: #cbd5e1; cursor: pointer;
}
#penbar .pb-tool, #penbar .pb-act { height: 28px; }
#penbar .pb-tool:hover, #penbar .pb-act:hover { background: #1b3454; }
#penbar .pb-tool.on { background: #1d4ed8; border-color: #3b82f6; color: #fff; }
#penbar .pb-act.danger { color: #fca5a5; border-color: #7f1d1d; }

/* —— 图标（CSS 形状，颜色跟随 currentColor，选中时自动变白）—— */
#penbar .pb-i { position: relative; width: 18px; height: 18px; display: block; }
#penbar .pb-i::before, #penbar .pb-i::after { content: ''; position: absolute; box-sizing: border-box; }

/* 选择：光标箭头（三角 + 细尾巴，缩到 18px 也认得出是指针） */
#penbar .i-sel::before {
  left: 4px; top: 2px; width: 0; height: 0;
  border-left: 12px solid currentColor;
  border-top: 8px solid transparent; border-bottom: 8px solid transparent;
  transform: rotate(-45deg); transform-origin: left center;
}
#penbar .i-sel::after {
  left: 3px; top: 12px; width: 2px; height: 7px; border-radius: 1px;
  background: currentColor; transform: rotate(-45deg); transform-origin: left top;
}
/* 画笔：斜杆 + 笔尖 */
#penbar .i-pen::before {
  left: 2px; bottom: 3px; width: 12px; height: 2.5px; border-radius: 2px;
  background: currentColor; transform: rotate(-45deg); transform-origin: left center;
}
#penbar .i-pen::after {
  right: 1px; top: 1px; width: 5px; height: 5px; border-radius: 1px;
  background: currentColor; transform: rotate(45deg);
}
/* 荧光笔：斜向粗黄条 */
#penbar .i-mk::before {
  left: 1px; top: 5px; width: 15px; height: 7px; border-radius: 1px;
  background: #facc15; opacity: .9; transform: rotate(-25deg);
}
/* 直线 */
#penbar .i-ln::before { left: 1px; top: 8px; width: 16px; height: 2px; border-radius: 2px; background: currentColor; }
/* 箭头 */
#penbar .i-ar::before { left: 1px; top: 8px; width: 13px; height: 2px; border-radius: 2px; background: currentColor; }
#penbar .i-ar::after {
  right: 1px; top: 4px; width: 0; height: 0;
  border-left: 7px solid currentColor;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
/* 方框 / 圆圈 */
#penbar .i-rc::before { inset: 3px 1px; border: 2px solid currentColor; border-radius: 2px; }
#penbar .i-el::before { inset: 3px 1px; border: 2px solid currentColor; border-radius: 50%; }
/* 文字：A */
#penbar .i-tx::before {
  left: 0; top: 0; width: 18px; height: 18px;
  content: 'A'; text-align: center; line-height: 18px;
  font-size: 14px; font-weight: 800; color: currentColor;
  font-family: Georgia, "Times New Roman", serif;
}
/* 橡皮 */
#penbar .i-er::before {
  left: 2px; top: 5px; width: 13px; height: 8px;
  border: 2px solid currentColor; border-radius: 2px; transform: rotate(-20deg);
}
/* 撤销：左箭头 */
#penbar .i-undo::before { left: 4px; top: 8px; width: 12px; height: 2px; border-radius: 2px; background: currentColor; }
#penbar .i-undo::after {
  left: 1px; top: 4px; width: 0; height: 0;
  border-right: 7px solid currentColor;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
/* 清空：垃圾桶 */
#penbar .i-clr::before {
  left: 3px; top: 6px; width: 12px; height: 10px;
  border: 2px solid currentColor; border-top: 0; border-radius: 0 0 3px 3px;
}
#penbar .i-clr::after { left: 2px; top: 3px; width: 14px; height: 2px; border-radius: 2px; background: currentColor; }
/* 收起：× */
#penbar .i-x::before { left: 3px; top: 8px; width: 12px; height: 2px; background: currentColor; transform: rotate(45deg); }
#penbar .i-x::after  { left: 3px; top: 8px; width: 12px; height: 2px; background: currentColor; transform: rotate(-45deg); }

/* 颜色：5 格竖着排（单列），格子本身就是色块。
   ★ 必须加一圈内描边：最深那格是 #111827，和面板底色几乎一样，不加边会看成"空格子"。 */
#penbar .pb-colors { display: flex; flex-direction: column; gap: 2px; }
#penbar .pb-colors i {
  height: 17px; border-radius: 5px; border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .38);
}
#penbar .pb-colors i.on { border-color: #fff; box-shadow: 0 0 0 1px #3b82f6, inset 0 0 0 1px rgba(255,255,255,.38); }

/* 粗细：3 格竖着排，格内画一根横线，线越粗笔越粗 */
#penbar .pb-widths { display: flex; flex-direction: column; gap: 2px; }
#penbar .pb-widths i { height: 20px; }
#penbar .pb-widths i::before { content: ''; display: block; border-radius: 2px; background: currentColor; }
#penbar .pb-widths i[data-w="2"]::before { width: 10px; height: 2px; }
#penbar .pb-widths i[data-w="4"]::before { width: 13px; height: 4px; }
#penbar .pb-widths i[data-w="8"]::before { width: 17px; height: 7px; }
#penbar .pb-widths i.on { background: #1d4ed8; border-color: #3b82f6; color: #fff; }

/* 批注文字输入框（textarea，支持 Ctrl+Enter 换行）
   ★ 行高必须写 1.25：与 classroom.js 里 paintMark / textBox 的行高口径一致，
     否则输入框里看到的两行间距和落到画布上的不一样，用户会觉得"跳了一下"。 */
.pb-text-input {
  position: fixed; z-index: 60; min-width: 150px; max-width: min(78vw, 640px);
  padding: 4px 8px; border-radius: 9px; border: 2px solid #3b82f6;
  background: #fff; font-size: 16px; font-weight: 600; outline: none;
  line-height: 1.25; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  resize: none;                       /* 关掉右下角拖拽手柄 */
  overflow: hidden;                   /* 高度由 JS 自适应，不要滚动条 */
  white-space: pre-wrap;              /* 保留用户输入的换行与缩进，超长自动折行 */
  box-shadow: 0 8px 22px rgba(0,0,0,.3);
}
.pb-text-input::placeholder { color: #94a3b8; font-weight: 400; font-size: 14px; }
