/* BlackBoard M0 — 浅色白板界面 */

:root {
  --ink: #16181d;
  --ink-2: #5a6070;
  --ink-3: #8d93a1;
  --line: #e3e5ea;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --accent: #16181d;
  --green: #16a34a;
  --amber: #ca8a04;
  --orange: #ea580c;
  --red: #dc2626;
  --slate: #475569;
  --radius: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--ink);
  font: 400 13px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; cursor: pointer; }

/* ─────────── 入口 ─────────── */
.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--surface-2);
}
.gate[hidden] { display: none; }

.gate-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 15px;
}
.brand-mark {
  width: 16px; height: 16px;
  border-radius: 4px;
  background: var(--ink);
}
.brand-tag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
}

.gate-hint {
  margin: 14px 0 18px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 17px;
  letter-spacing: 3px;
  text-transform: uppercase;
  outline: none;
}
.field input:focus { border-color: var(--ink); }

.device-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
}
.device-row code {
  font: 500 13px/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 1px;
  color: var(--ink);
}
/* 昵称输入框：复用 .field input 底子，但中文昵称不要字距/大写那套连接码样式 */
.device-row input {
  flex: 1;
  min-width: 0;
  height: 36px;
  font-size: 15px;
  letter-spacing: normal;
  text-transform: none;
}

.gate-actions { display: flex; gap: 8px; margin-top: 16px; }

.linkish {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 0;
  border: none;
  background: none;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkish:active { color: var(--ink); }

.primary, .secondary {
  flex: 1;
  height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 500;
}
.primary { background: var(--accent); color: #fff; }
.primary:active { opacity: .85; }
.primary[disabled] { opacity: .5; }
.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }

.gate-foot {
  margin: 14px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
}

.ghost {
  background: none;
  border: none;
  color: var(--ink-2);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
}
.ghost:active { background: var(--surface-2); }

/* ─────────── 课堂 ─────────── */
.room {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.room[hidden] { display: none; }

.topbar {
  flex: 0 0 auto;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  z-index: 3;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.room-code {
  font: 500 13px/1 ui-monospace, Menlo, monospace;
  letter-spacing: 2px;
}
.divider { width: 1px; height: 14px; background: var(--line); }
.page-info { font-size: 12px; color: var(--ink-3); }

.topbar-right { display: flex; align-items: center; gap: 6px; }

/* 连接状态：图标 + ms */
.link {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  transition: border-color .2s;
}
.link:active { background: var(--surface-2); }
.link-icon { display: flex; align-items: center; height: 12px; }
.link-icon svg { display: block; }
.link-text {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  min-width: 26px;
  text-align: left;
}
.link[data-tier="great"] .link-text { color: var(--green); }
.link[data-tier="good"]  .link-text { color: var(--amber); }
.link[data-tier="fair"]  .link-text { color: var(--orange); }
.link[data-tier="poor"]  .link-text { color: var(--red); }

.icon-btn {
  height: 30px;
  padding: 0 10px;
  border: none;
  background: none;
  color: var(--ink-3);
  font-size: 12px;
  border-radius: 15px;
}
.icon-btn:active { background: var(--surface-2); }

/* 画布舞台 */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  touch-action: none;
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#cv-live { pointer-events: none; }
#cv-ui { pointer-events: none; }

/* 画布 + 右侧页栏横排；页栏不抢画布宽度以外的空间 */
.room-body {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

.pages-rail {
  flex: 0 0 96px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
  z-index: 2;
}
.pages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.page-thumb {
  position: relative;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.page-thumb canvas {
  display: block;
  width: 100%;
  height: auto;
}
.page-thumb span {
  position: absolute;
  left: 4px;
  bottom: 3px;
  font: 600 10px/1 ui-monospace, Menlo, monospace;
  color: #6b7280;
  background: rgba(255, 255, 255, .82);
  padding: 2px 4px;
  border-radius: 4px;
}
.page-thumb.is-on {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .18);
}
.page-add {
  flex: 0 0 auto;
  padding: 8px 4px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
}
.page-add:hover { border-color: #2563eb; color: #2563eb; }

@media (max-width: 720px) {
  .pages-rail { flex-basis: 68px; padding: 8px 6px; }
  .page-thumb span { font-size: 9px; }
}

/* 工具条：三行（绘图工具 / 颜色粗细 / 操作），窄屏每行横向滚动 */
.toolbar {
  flex: 0 0 auto;
  position: relative;
  padding: 7px 10px calc(7px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  z-index: 3;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.toolbar-row::-webkit-scrollbar { display: none; }
/* 颜色行上下留 4px 让选中圈不被 overflow 裁；用行 padding 而非色块组 margin，
   保证色块/粗细/滑块共享同一内容盒中线（margin 会把色块组顶离中线） */
.toolbar-row.attrs { padding: 4px 0; }

.row-sep { flex: 0 0 auto; width: 1px; height: 20px; background: var(--line); }

.tools, .widths, .swatches { display: flex; gap: 4px; align-items: center; }
/* 选中色块的外圈（inset:-4px）会伸出按钮外；行容器 overflow-x:auto 会裁掉它，
   色块组贴行左缘时左半圈看不见——左留 5px 把圈让出来（上下空间由行 padding 提供） */
.swatches { margin-left: 5px; }

.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.tool.is-on { background: var(--ink); color: #fff; }

/* 图形按钮上的当前形状名小徽标 */
.shape-cur {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(127, 127, 127, .18);
  font-size: 10px;
}
.tool.is-on .shape-cur { background: rgba(255, 255, 255, .22); }

/* 图形弹层：浮在工具条上方；固定 5 列 minmax(0,1fr) 防窄屏被 nowrap 标签撑破 */
.shape-pop {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 10px;
  width: min(430px, calc(100vw - 20px));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(16, 18, 24, .16);
  z-index: 40;
}
.shape-pop[hidden] { display: none; }
.shape-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 6px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
}
.shape-opt svg { width: 34px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.shape-opt span { font-size: 10.5px; white-space: nowrap; }
.shape-opt:hover { background: var(--line); }
.shape-opt.is-on { border-color: #2563eb; color: #2563eb; background: rgba(37, 99, 235, .08); }

.swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--c);
  padding: 0;
  position: relative;
}
.swatch.is-on::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}

.width {
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
}
.width i { display: block; width: 14px; background: var(--ink-2); border-radius: 2px; }
.width.is-on { background: var(--surface-2); border-color: var(--line); }
.width.is-on i { background: var(--ink); }

#width-range { flex: 0 0 auto; width: 110px; accent-color: var(--ink); cursor: pointer; }

/* 当前色块按钮：点开弹出选择器（向上弹，不遮画布） */
.color-pop-wrap { position: relative; flex: 0 0 auto; }
.swatch-current {
  /* block：inline-block 会在 block 包裹层里按基线排版，基线下方的字体 descent
     把按钮顶高约 2px，导致与同行色点/粗细不对齐；block 后包裹层高度=按钮高度 */
  display: block;
  width: 26px; height: 26px;
  border-radius: 7px;
  border: 2px solid var(--line);
  background: var(--c);
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1.5px #fff;
}
.swatch-current:hover { border-color: var(--ink-3); }

.color-pop {
  /* fixed：工具行 overflow-x:auto 会裁剪绝对定位弹层，JS 打开时按按钮坐标定位 */
  position: fixed;
  left: 0;
  top: 0;
  width: 216px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 18, 24, .14);
  z-index: 30;
}
.color-pop[hidden] { display: none; }
.color-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.color-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--c);
  padding: 0;
  position: relative;
  cursor: pointer;
}
.color-dot.is-on::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}
/* 自定义色板：色相×饱和度场（按当前明度渲染）+ 右侧明度条，PS 式拖拽取色 */
.cp { display: flex; gap: 6px; margin-top: 10px; }
.cp-main {
  position: relative;
  flex: 0 0 auto;
  width: 176px; height: 150px;
  cursor: crosshair;
  touch-action: none;
}
.cp-main canvas { display: block; width: 100%; height: 100%; border-radius: 4px; }
.cp-cursor {
  position: absolute;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
  pointer-events: none;
}
.cp-side {
  position: relative;
  flex: 0 0 auto;
  width: 14px; height: 150px;
  cursor: pointer;
  touch-action: none;
}
.cp-side canvas { display: block; width: 100%; height: 100%; border-radius: 3px; }
.cp-mark {
  position: absolute;
  right: -5px;
  width: 0; height: 0;
  margin-top: -5px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid var(--ink);
  pointer-events: none;
}
.cp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.cp-hex { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.cp-preview {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--c);
  box-shadow: inset 0 0 0 1.5px #fff;
}

/* 操作行：清屏二次确认的 armed 态 */
.ops .ghost { flex: 0 0 auto; }
#btn-clear.armed { background: #dc2626; border-color: #dc2626; color: #fff; }
.ops .ghost:disabled { opacity: .38; cursor: default; }

/* 文字输入框：绝对定位在点击处，失焦提交 */
#text-input {
  position: absolute;
  z-index: 6;
  min-width: 200px;
  max-width: 340px;
  padding: 8px 10px;
  border: 1.5px dashed #2563eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.35;
  resize: both;
  outline: none;
  box-shadow: 0 4px 16px rgba(16, 18, 24, .12);
}
#text-input[hidden] { display: none; }

/* 工具光标提示：擦除/框选是两个独立工具，直选不弹层 */
.stage[data-tool="eraser"] { cursor: cell; }
.stage[data-tool="lasso"] { cursor: crosshair; }
.stage[data-tool="laser"] { cursor: crosshair; }
.stage[data-tool="text"] { cursor: text; }
.stage[data-tool="select"] { cursor: default; }
.stage[data-tool="shape"] { cursor: crosshair; }

.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.stat { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 诊断浮层 */
.diag {
  position: absolute;
  top: 52px;
  right: 10px;
  width: 258px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 18, 24, .10);
  z-index: 5;
}
.diag[hidden] { display: none; }

/* 成员面板：与诊断浮层同款，挂在顶栏下；多人换讲在这里选目标 */
.members-pop {
  position: absolute;
  top: 52px;
  right: 10px;
  width: 248px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 18, 24, .10);
  z-index: 6;
}
.members-pop[hidden] { display: none; }

.members-head {
  font-size: 12px;
  color: var(--ink-2);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.members-list { max-height: 264px; overflow: auto; }

.member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.member-row:last-child { border-bottom: none; }

.member-name {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role { font-size: 11px; color: var(--ink-3); }
.member-role.is-host { color: var(--green); }

.member-hand { font-size: 12px; padding: 3px 10px; }

.members-count { margin: 8px 0 0; font-size: 11px; color: var(--ink-3); }

/* 移动端贴图来源：底部动作面板，大按钮好点 */
.img-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(22, 24, 29, .40);
}
.img-sheet[hidden] { display: none; }

.img-sheet-card {
  width: min(420px, 100%);
  margin: 0 12px calc(12px + var(--safe-b));
  padding: 10px;
  display: grid;
  gap: 8px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(16, 20, 30, .20);
}
.img-sheet-card button {
  padding: 15px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.img-sheet-card button:active { background: var(--line); }
.img-sheet-card button.ghost {
  font-weight: 400;
  color: var(--ink-2);
  background: var(--surface);
  border-color: transparent;
}

.diag-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.diag-head span:first-child { font-size: 12px; color: var(--ink-3); }
.diag-value { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }

.diag-list { margin: 0; padding: 6px 0 0; }
.diag-list > div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}
.diag-list dt { color: var(--ink-2); margin: 0; }
.diag-list dd { margin: 0; font-variant-numeric: tabular-nums; }

.diag-note {
  margin: 9px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

@media (max-width: 520px) {
  .toolbar-row { gap: 6px; }
  .stat { display: none; }
  #width-range { width: 76px; }
  .diag { right: 8px; left: 8px; width: auto; }
}

/* ─────────── 配对面板（M1-1）─────────── */
/*
  这个面板只干一件事：让家长隔着桌子能把两组数字念给孩子。
  所以码必须大、等宽、分两段（802 417），密钥用另一种字号区分层级——
  两者字号接近会念混，念混一次就要重新生成。
*/
.pair {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  /* 轨道锁死在视口内：auto 轨道会被长标题（nowrap）的 min-content 撑宽，
     手机上往期面板就是这样超出屏幕的 */
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 20px;
  background: rgba(22, 24, 29, .40);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.pair[hidden] { display: none; }

.pair-card {
  width: min(420px, 100%);
  min-width: 0;
  max-width: 100%;
  background: var(--surface);
  border-radius: 16px;
  padding: 26px 24px 22px;
  box-shadow: 0 18px 50px rgba(16, 20, 30, .20);
  text-align: center;
}

.pair-label { margin: 0; color: var(--ink-2); font-size: 12.5px; }

.pair-code {
  font: 600 clamp(34px, 11vw, 46px)/1.15 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .10em;
  font-variant-numeric: tabular-nums;
  padding: 12px 0 6px;
  color: var(--ink);
  user-select: all;
}

/* 加入等待：60 秒大数字倒计时 */
.wait-count {
  font: 700 clamp(48px, 16vw, 72px)/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  padding: 10px 0 2px;
  color: var(--ink);
}

/* host 审批弹窗：申请方设备名 */
.approve-name {
  font-weight: 600;
  font-size: clamp(20px, 6vw, 26px);
  line-height: 1.3;
  padding: 10px 0 2px;
  color: var(--ink);
  word-break: break-all;
}

.pair-note {
  margin: 14px 0 18px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-3);
}

.pair-actions { display: flex; gap: 10px; }
.pair-actions button { flex: 1; }

/* 换你讲：只在双人课堂出现，所以默认 hidden，由 JS 控制 */
#btn-handover { white-space: nowrap; }

/* 窄屏时顶栏三个按钮会挤，让"换你讲"优先保留、诊断图标退让 */
@media (max-width: 430px) {
  #btn-handover { padding-inline: 8px; font-size: 12px; }
}

/* ── 往期课程列表 ── */
.history-card { width: min(560px, 100%); text-align: left; }
.history-card .pair-label { text-align: center; }
/* 分类切换：在线课堂 / 单机课堂，选中态用 primary */
.history-tabs { display: flex; gap: 8px; margin-top: 12px; }
.history-tabs button { flex: 1; height: 34px; font-size: 12.5px; border-radius: 10px; }
.history-list {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  margin: 14px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 12px;
}
.history-main { flex: 1; min-width: 0; }
.history-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-meta { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); }
.history-actions { display: flex; gap: 6px; flex-shrink: 0; }
.history-actions button { flex: none; height: 32px; padding: 0 12px; font-size: 12px; border-radius: 10px; }
.history-card .pair-note { text-align: left; }

/* 窄屏：「继续/退出/结束」三个按钮收紧，别把历史项撑出面板 */
@media (max-width: 430px) {
  .history-item { gap: 8px; padding: 10px; }
  .history-actions { gap: 4px; }
  .history-actions button { padding: 0 8px; }
}

/* ── 回顾模式横幅：临时草稿提示 + 保存/丢弃 ── */
.review-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #fff7e6;
  border-bottom: 1px solid #f0e2c0;
  font-size: 12px;
  color: #8a6d3b;
}
.review-bar[hidden] { display: none; }
.review-actions { display: flex; gap: 8px; flex-shrink: 0; }
.review-actions button { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 10px; }
@media (max-width: 560px) {
  .review-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .review-actions { justify-content: center; }
}

/* ── 音视频：顶栏麦/摄按钮 + 右上角视频墙 ── */
.media-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  padding: 0;
}
.member-media { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }

.video-wall {
  position: absolute;
  top: 52px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;   /* 低于成员面板（6），弹层打开时盖在视频墙上 */
}
.video-wall[hidden] { display: none; }
.vtile {
  position: relative;
  width: 160px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: #101218;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(16, 18, 24, .16);
}
.vtile video { display: block; width: 100%; height: 100%; object-fit: cover; }
.vtile video.mirror { transform: scaleX(-1); }   /* 前摄自拍镜像，后摄不镜 */
.vname {
  position: absolute;
  left: 6px;
  bottom: 4px;
  max-width: 70%;
  font-size: 10.5px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vmic { position: absolute; right: 6px; bottom: 4px; display: inline-flex; color: #fff; }
.vmic svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.vflip {
  position: absolute;
  top: 4px;
  right: 4px;
  height: 22px;
  padding: 0 8px;
  border: none;
  border-radius: 11px;
  background: rgba(16, 18, 24, .55);
  color: #fff;
  font-size: 10.5px;
}
@media (max-width: 720px) {
  .video-wall { top: 48px; right: 8px; gap: 6px; }
  .vtile { width: 96px; height: 72px; border-radius: 8px; }
  .vname { font-size: 9px; }
  .vflip { height: 18px; padding: 0 6px; font-size: 9px; }
}
@media (max-width: 520px) {
  .media-btn { width: 30px; }
}
