:root {
  --brand: #2b5cff;
  --brand-2: #7b4dff;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #8b93a7;
  --line: #e6ebf4;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ok: #12b76a;
  --warn: #f79009;
  --danger: #f04438;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -12px rgba(16, 24, 40, .14);
}

* { box-sizing: border-box; }

/* hidden 属性必须能压住类上的 display（否则 [hidden] 会失效） */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font-family: inherit; }

/* ============================ 入口页 ============================ */
.landing {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px 56px;
  position: relative;
  overflow: hidden;
}

.landing::before,
.landing::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

.landing::before {
  width: 560px; height: 560px;
  background: rgba(43, 92, 255, .16);
  top: -220px; left: -140px;
}

.landing::after {
  width: 520px; height: 520px;
  background: rgba(123, 77, 255, .14);
  bottom: -240px; right: -140px;
}

.wrap {
  width: 100%;
  max-width: 940px;
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.brand-spacer { flex: 1; }

/* 管理员入口：放在右上角，低调但找得到 */
.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  color: #8b93a7;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(139, 147, 167, .28);
  background: transparent;
  transition: .15s;
}
.admin-link:hover { color: #2b5cff; border-color: rgba(43, 92, 255, .4); background: rgba(43, 92, 255, .06); }

/* 管理员面板 */
.pwd-now {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #f5f7fb;
  border: 1px solid #e6ebf4;
  margin-bottom: 16px;
  font-size: 13px;
  color: #667085;
}
.pwd-now b {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  color: #101828;
  letter-spacing: 1px;
}
.pwd-now .mini {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #2b5cff;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(43, 92, 255, .1);
}
.pwd-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #475467;
  margin-bottom: 7px;
}
.pwd-tip {
  font-size: 11.5px;
  color: #98a2b3;
  margin-top: 7px;
}

/* 管理面板加宽 */
.modal.modal-wide { max-width: 500px; }

.ad-sec {
  padding: 15px 0;
  border-top: 1px solid #eef2f8;
}
.ad-sec:first-of-type { border-top: 0; padding-top: 4px; }
.ad-title {
  font-size: 13px;
  font-weight: 700;
  color: #101828;
  margin-bottom: 10px;
}
.ad-row { display: flex; gap: 8px; align-items: center; }
.ad-row .input { flex: 1 1 auto; min-width: 0; }
/* .btn 全局是 width:100%，放进这个横排里会把输入框挤成一条缝，
   所以这里必须显式收回宽度，谁也别抢谁的空间 */
.ad-row .ad-mini-btn {
  width: auto;
  flex: none;
}
.ad-mini-btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13.5px;
  white-space: nowrap;
  width: auto;
  flex: none;
}

/* 时长步进 */
.timer-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  background: #f5f7fb;
  border: 1px solid #e6ebf4;
}
.step-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 600;
  color: #2b5cff;
  background: #fff;
  border: 1px solid #dbe3f1;
  transition: .14s;
}
.step-btn:hover { background: #eef3ff; border-color: #b9cbff; }
.step-btn:active { transform: scale(.94); }
.timer-val { display: flex; align-items: baseline; gap: 5px; min-width: 96px; justify-content: center; }
.timer-val b { font-size: 30px; font-weight: 800; color: #101828; letter-spacing: -.5px; }
.timer-val span { font-size: 12.5px; color: #8b93a7; }

.timer-quick {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.q-btn {
  flex: 1;
  min-width: 62px;
  height: 32px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475467;
  background: #f5f7fb;
  border: 1px solid #e6ebf4;
  transition: .14s;
}
.q-btn:hover { background: #eef3ff; color: #2b5cff; border-color: #b9cbff; }
.q-btn.danger { color: #d92d20; }
.q-btn.danger:hover { background: #fef3f2; border-color: #fda29b; }

/* 管理面板第一块：口令，做得显眼一点 */
.ad-sec.ad-first { padding-top: 6px; }
.ad-sec.ad-first .ad-title {
  font-size: 14.5px;
  color: #2b5cff;
}
.input.big {
  height: 50px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .5px;
  border-color: rgba(43, 92, 255, .35);
  background: #fff;
}
.input.big:focus { border-color: #2b5cff; box-shadow: 0 0 0 3px rgba(43, 92, 255, .12); }

/* 分享模式：两个单选 */
.share-mode {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.sm-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1.5px solid #e6ebf4;
  background: #fbfcfe;
  font-size: 12.5px;
  color: #475467;
  cursor: pointer;
  transition: .14s;
}
.sm-item:has(input:checked) {
  border-color: #2b5cff;
  background: rgba(43, 92, 255, .05);
  color: #2b5cff;
  font-weight: 600;
}
.sm-item input { accent-color: #2b5cff; margin: 0; flex: none; }

/* 当前生效的分享网址 */
.share-now {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 9px 13px;
  border-radius: 9px;
  background: rgba(18, 183, 106, .07);
  border: 1px solid rgba(18, 183, 106, .2);
  font-size: 12px;
  color: #027a48;
}
.share-now span { flex: none; font-weight: 600; }
.share-now b {
  font-weight: 600;
  color: #05603a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* 管理面板里的实时倒计时 */
.timer-live {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 13px;
  border-radius: 9px;
  background: rgba(43, 92, 255, .07);
  border: 1px solid rgba(43, 92, 255, .16);
  font-size: 12.5px;
  color: #475467;
}
.timer-live b {
  font-size: 19px;
  font-weight: 800;
  color: #2b5cff;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}
.timer-live.closed {
  background: rgba(240, 68, 56, .1);
  border-color: rgba(240, 68, 56, .3);
  color: #b42318;
}
.timer-live.closed b { font-size: 14px; color: #d92d20; }

.timer-live.urgent {
  background: rgba(240, 68, 56, .07);
  border-color: rgba(240, 68, 56, .22);
  color: #b42318;
}
.timer-live.urgent b { color: #d92d20; }

/* 总闸开关 */
.gate-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border-radius: 12px;
  background: #f5f7fb;
  border: 1px solid #e6ebf4;
}
.gate-info { flex: 1; min-width: 0; }
.gate-info b { display: block; font-size: 13.5px; color: #101828; margin-bottom: 3px; }
.gate-info span { font-size: 11.5px; color: #98a2b3; line-height: 1.5; }

.switch {
  position: relative;
  width: 52px; height: 30px;
  border-radius: 15px;
  background: #d0d5dd;
  flex: none;
  transition: .2s;
}
.switch i {
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .2);
  transition: .2s;
}
.switch.on { background: #12b76a; }
.switch.on i { left: 25px; }

/* 保存成功的浮动提示 */
.float-tip {
  position: fixed;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 12px 22px;
  border-radius: 10px;
  background: #101828;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .55);
  animation: tipIn .25s ease;
}
@keyframes tipIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  box-shadow: 0 6px 18px -6px rgba(43, 92, 255, .7);
}

.brand-mark svg { width: 21px; height: 21px; }

.hero {
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  gap: 40px;
  align-items: start;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 4.1vw, 46px);
  line-height: 1.18;
  letter-spacing: -1.2px;
  font-weight: 800;
}

h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--brand), var(--brand-2) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  margin: 0 0 26px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
  box-shadow: 0 2px 10px -4px rgba(16, 24, 40, .12);
  margin-bottom: 26px;
}

.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(18, 183, 106, .6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(18, 183, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); }
}

.live b { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 15px; }

/* 四个特性标签排成一排，窄屏也不换行 */
.feats { display: flex; flex-wrap: nowrap; gap: 7px; }

.feat {
  font-size: 12.5px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex: none;
}

.feat svg { width: 13px; height: 13px; color: var(--brand); flex: none; }

/* 手机上进一步压缩，保证一行放得下 */
@media (max-width: 420px) {
  .feats { gap: 5px; }
  .feat { font-size: 11.5px; padding: 5px 7px; gap: 4px; }
  .feat svg { width: 12px; height: 12px; }
}

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.card h2 {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: -.3px;
}

.card p.hint {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--ink-3);
}

label.field { display: block; margin-bottom: 16px; }

label.field span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
}

.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  background: #fbfcfe;
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
  transition: .16s;
}

.input::placeholder { color: #a8b0c2; }

.input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(43, 92, 255, .1);
}

.btn {
  height: 48px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: .16s;
  width: 100%;
}

.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(43, 92, 255, .75);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(43, 92, 255, .8); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover { border-color: #c9d3e6; background: #fafbff; }

.btn-ghost svg { color: var(--brand); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--ink-3);
  font-size: 12px;
}

.divider::before, .divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.tip {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.65;
  text-align: center;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .45);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 60;
  padding: 20px;
  animation: fade .18s ease;
  /* 手机屏幕矮的时候，弹窗会超出屏幕。这里必须允许滚动，
     否则下面的输入框和按钮永远看不到、也够不着。 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-items: start;      /* 内容高时从上往下排，不要居中裁掉上下 */
}

/* 屏幕够高时才真正居中；高了就靠滚动 */
@media (min-height: 900px) {
  .modal-mask { align-items: center; }
}

@keyframes fade { from { opacity: 0; } }

.modal {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 60px -12px rgba(16, 24, 40, .3);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.2);
  margin: auto;            /* 配合 align-items:start，短时仍居中 */
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes pop { from { transform: scale(.94); opacity: 0; } }

.modal h3 { margin: 0 0 6px; font-size: 17px; }
.modal .sub2 { margin: 0 0 20px; font-size: 13px; color: var(--ink-3); }
.modal .row { display: flex; gap: 10px; margin-top: 18px; }
.modal .row .btn { flex: 1; }

.err { color: var(--danger); font-size: 12.5px; margin-top: 9px; min-height: 17px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .brand { margin-bottom: 24px; }
}

/* ============================ 会议厅 ============================ */
.room {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0f1421;
  color: #e8ecf5;
  overflow: hidden;
}

.room.light-stage { background: var(--bg); }

.topbar {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: #131a29;
}

.room.light-stage .topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.topbar .logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -.2px;
  white-space: nowrap;
}

.topbar .logo .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.topbar .logo .brand-mark svg { width: 17px; height: 17px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12.5px;
  background: rgba(255, 255, 255, .07);
  color: #c3cbdd;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.room.light-stage .chip { background: #f1f4fa; color: var(--ink-2); }

.chip.live-chip { color: #7ee2b0; }
.room.light-stage .chip.live-chip { color: #0d8a52; }
.chip b { color: #fff; font-weight: 650; }
.room.light-stage .chip b { color: var(--ink); }

.spacer { flex: 1; }

/* 主讲人身份 + 倒计时：竖着排，电子表挂在名字下面 */
.host-zone {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: none;
}

.cd-clock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
}
/* 电子表数字：等宽、字距拉开，一眼看出是倒计时 */
.cd-clock b {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #9fe8b8;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 16px;
}
.cd-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34d399;
  flex: none;
  animation: cdBlink 1.4s ease-in-out infinite;
}
@keyframes cdBlink { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* 剩不到 5 分钟：转黄 */
.cd-clock.urgent b { color: #fbbf24; }
.cd-clock.urgent .cd-dot { background: #fbbf24; }
/* 到点：转红 */
.cd-clock.over b { color: #ff7a70; }
.cd-clock.over .cd-dot { background: #ff7a70; }

/* 手机上身份牌文字小一点，别把倒计时挤掉 */
@media (max-width: 700px) {
  .cd-clock b { font-size: 11px; letter-spacing: .6px; }
  .cd-clock { padding: 0 6px; }
}

/* 会议结束遮罩 */
.over-mask {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(9, 12, 20, .82);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  animation: overIn .25s ease;
}
@keyframes overIn { from { opacity: 0 } to { opacity: 1 } }
.over-card {
  width: min(380px, 88vw);
  padding: 34px 28px 26px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6);
}
.over-ico { font-size: 42px; line-height: 1; margin-bottom: 12px; }
.over-card h3 { margin: 0 0 8px; font-size: 19px; color: #101828; }
.over-card p { margin: 0 0 22px; font-size: 13.5px; color: #667085; line-height: 1.65; }
.over-btn {
  width: 100%;
  height: 46px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2b5cff, #7b4dff);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
}

.tb-btn {
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, .08);
  color: #dbe1ee;
  transition: .15s;
  white-space: nowrap;
}

.tb-btn:hover { background: rgba(255, 255, 255, .15); }
.tb-btn svg { width: 15px; height: 15px; }

.room.light-stage .tb-btn { background: #f1f4fa; color: var(--ink-2); }
.room.light-stage .tb-btn:hover { background: #e6ecf8; }

.tb-btn.danger { color: #ff9b94; }
.room.light-stage .tb-btn.danger { color: var(--danger); }

.tb-btn.primary {
  background: #2b5cff;
  color: #fff;
  font-weight: 650;
}
.tb-btn.primary:hover { background: #1f4de0; }
.room.light-stage .tb-btn.primary { background: #2b5cff; color: #fff; }
.room.light-stage .tb-btn.primary:hover { background: #1f4de0; }

/* 身份牌：谁都能看见，点开要口令 */
.tb-btn.host-badge {
  background: rgba(240, 68, 56, .16);
  color: #ffb4ae;
  border: 1px solid rgba(240, 68, 56, .3);
  font-weight: 650;
}
.tb-btn.host-badge:hover { background: rgba(240, 68, 56, .26); }
.tb-btn.host-badge.is-host {
  background: rgba(18, 183, 106, .2);
  color: #6fe3ae;
  border-color: rgba(18, 183, 106, .4);
}
.room.light-stage .tb-btn.host-badge {
  background: rgba(240, 68, 56, .1);
  color: #d92d20;
  border-color: rgba(240, 68, 56, .25);
}
.room.light-stage .tb-btn.host-badge.is-host {
  background: rgba(18, 183, 106, .12);
  color: #0d8a52;
  border-color: rgba(18, 183, 106, .3);
}

/* 锁定状态：锁上时高亮提醒 */
.tb-btn.locked {
  background: rgba(240, 68, 56, .22);
  color: #ffb4ae;
  box-shadow: 0 0 0 1px rgba(240, 68, 56, .35) inset;
}
.room.light-stage .tb-btn.locked {
  background: rgba(240, 68, 56, .12);
  color: #d92d20;
}

/* 说话音量：五格信号，讲话时上下来回跳 */
.voice-meter {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
}
.room.light-stage .voice-meter {
  background: #f1f4fa;
  border-color: var(--line);
}
.voice-meter i {
  display: block;
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: #56617a;
  transition: height .09s linear, background .12s;
}
.voice-meter.on i { background: #34d399; }
.voice-meter span {
  display: none;
}

/* 主体 */
.body {
  flex: 1;
  min-height: 0;
  display: flex;
}

.stage-wrap {
  flex: 1;
  min-width: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;   /* 上面是「缩略图+舞台」，下面是工具栏 */
  gap: 12px;
}

/* 缩略图和舞台并排的一行，撑满剩余高度 */
.stage-row {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
}

/* 左侧缩略图列表：像 PPT 的幻灯片窗格，多了就上下滚 */
.thumbs {
  flex: none;
  width: 116px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  padding: 8px 6px;
  scrollbar-width: thin;
}
.thumbs::-webkit-scrollbar { width: 6px; }
.thumbs::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .18); border-radius: 3px; }

.thumbs-inner { display: flex; flex-direction: column; gap: 7px; }

.thumb {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 7px;
  overflow: hidden;
  background: #0f1420;
  border: 2px solid transparent;
  padding: 0;
  transition: .14s;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.thumb span {
  position: absolute;
  left: 3px;
  bottom: 3px;
  min-width: 16px;
  height: 15px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 15px;
  color: #fff;
  background: rgba(17, 24, 39, .72);
}
.thumb:hover { border-color: rgba(43, 92, 255, .45); }
.thumb.sel { border-color: #2b5cff; box-shadow: 0 0 0 2px rgba(43, 92, 255, .22); }

.room.light-stage .thumbs { background: #f8fafc; border-color: #e6ebf4; }
.room.light-stage .thumb { background: #eef2f8; }
.room.light-stage .thumb.sel { border-color: #2b5cff; }

/* 手机屏幕窄，缩略图栏收窄一点 */
@media (max-width: 700px) {
  .thumbs { width: 76px; padding: 6px 4px; }
  .stage-wrap { padding: 10px; gap: 8px; }
}

.stage {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  border-radius: 10px;
  background: #171e2d;
  border: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.stage.has-doc { background: #0b0f18; }

/* 缩放比例提示，1 倍时自动隐藏 */
.zoom-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 12;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(17, 24, 39, .72);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

/* 缩放容器：双指捏合放大 / 缩小课件，画布批注跟着一起缩放 */
.zoom-wrap {
  position: relative;
  display: none;
  overflow: hidden;
  flex: none;
  touch-action: none;      /* 自己接管手势，避免浏览器整页缩放 */
}
.stage.has-doc .zoom-wrap { display: block; }

.zoom-wrap .slide-box {
  transform-origin: center center;
  will-change: transform;
}

.slide-box {
  position: relative;
  display: none;
  line-height: 0;
  /* 宽高由 JS 按舞台尺寸等比算出，保证画布与图片像素严格对齐 */
  flex: none;
}

.stage.has-doc .zoom-wrap .slide-box { display: block; }

.slide-box img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
  object-fit: fill;
}

#annotCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
}

#annotCanvas.drawing { cursor: crosshair; }

/* 课件两侧的大翻页键：不靠工具栏猜，直接摆在页面上 */
.page-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px; height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(17, 24, 39, .42);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 22px -8px rgba(0, 0, 0, .6);
  z-index: 12;
  transition: background .15s, transform .15s, opacity .15s;
  opacity: .82;
}
.page-nav svg { width: 24px; height: 24px; }
.page-nav.prev { left: 14px; }
.page-nav.next { right: 14px; }
.page-nav:hover:not(:disabled) { background: rgba(17, 24, 39, .72); opacity: 1; }
.page-nav.next:hover:not(:disabled) { transform: translateY(-50%) scale(1.06); }
.page-nav.prev:hover:not(:disabled) { transform: translateY(-50%) scale(1.06); }
.page-nav:disabled { opacity: .18; cursor: default; }

/* 页码浮在课件下方居中 */
.page-float {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  color: #e8ecf5;
  background: rgba(17, 24, 39, .55);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px);
  z-index: 11;
  pointer-events: none;
}
.page-float b { font-weight: 800; color: #fff; }

.room.light-stage .page-nav {
  background: rgba(255, 255, 255, .82);
  color: #101828;
  border-color: rgba(16, 24, 40, .1);
}
.room.light-stage .page-nav:hover:not(:disabled) { background: #fff; }
.room.light-stage .page-float {
  background: rgba(255, 255, 255, .85);
  color: #344054;
  border-color: rgba(16, 24, 40, .1);
}
.room.light-stage .page-float b { color: #101828; }

/* 在线人数：主讲人可加减，数字变化时轻轻跳一下 */
.cnt-btn {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  color: #cbd5e1;
  background: rgba(255, 255, 255, .1);
  flex: none;
  transition: .12s;
}
.cnt-btn:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.room.light-stage .cnt-btn { background: rgba(16, 24, 40, .07); color: #475467; }
.room.light-stage .cnt-btn:hover { background: rgba(16, 24, 40, .13); }

#onlineCount { display: inline-block; }
#onlineCount.bump-up { animation: bumpUp .45s cubic-bezier(.3, 1.5, .5, 1); }
#onlineCount.bump-down { animation: bumpDown .45s cubic-bezier(.3, 1.5, .5, 1); }

@keyframes bumpUp {
  0% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(2px, -4px) scale(1.35); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes bumpDown {
  0% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(-2px, 4px) scale(.78); }
  100% { transform: translate(0, 0) scale(1); }
}

/* ---------- 主讲人正在说话 ---------- */
#audioChip {
  background: rgba(18, 183, 106, .12);
  color: #0d8a52;
  border-color: rgba(18, 183, 106, .3);
  font-weight: 650;
}
#audioChip.live { animation: audioPulse 1.8s ease-in-out infinite; }

@keyframes audioPulse {
  0%, 100% { background: rgba(18, 183, 106, .12); }
  50% { background: rgba(18, 183, 106, .26); }
}

/* ---------- 字幕：从下往上冒，旧的被顶上去，停一会儿淡出 ---------- */
.subtitle-layer {
  position: absolute;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 760px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  pointer-events: none;
  z-index: 13;
}

.sub-line {
  max-width: 100%;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
  background: rgba(17, 24, 39, .62);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(8px);
  text-align: center;
  word-break: break-word;
  animation: subIn .3s cubic-bezier(.3, .9, .3, 1) both;
  transition: opacity .7s ease, transform .7s ease, margin .3s ease;
}
.sub-line b { font-weight: 800; margin-right: 7px; }
.sub-line.out { opacity: 0; transform: translateY(-14px); }

@keyframes subIn {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.room.light-stage .sub-line {
  background: rgba(255, 255, 255, .9);
  border-color: rgba(16, 24, 40, .1);
  color: #101828;
}

/* 发消息：拉长、往下放 */
.dm-bar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(92%, 780px);
  z-index: 15;
}

.dm-input {
  display: flex;
  align-items: center;
  height: 52px;
  border-radius: 13px;
  background: rgba(17, 24, 39, .62);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .7);
  padding: 0 7px 0 18px;
  min-width: 0;
}
.dm-input input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 15px;
  outline: none;
}
.dm-input input::placeholder { color: rgba(255, 255, 255, .5); }
.dm-input button {
  height: 38px;
  padding: 0 22px;
  border-radius: 9px;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  background: #2b5cff;
  flex: none;
  transition: .15s;
}
.dm-input button:hover { background: #1f4de0; }

.room.light-stage .dm-input {
  background: #fff;
  border-color: var(--line);
  color: #344054;
}
.room.light-stage .dm-input input { color: #101828; }
.room.light-stage .dm-input input::placeholder { color: #98a2b3; }

/* ---------- 禁言 ---------- */
.tool.muteall.on { background: rgba(240, 68, 56, .2); color: #ff9b94; }
.room.light-stage .tool.muteall.on { background: rgba(240, 68, 56, .12); color: #d92d20; }

.mini-btn.warn { color: #f79009; border-color: rgba(247, 144, 9, .3); }
.mini-btn.warn:hover { background: rgba(247, 144, 9, .12); }

.laser {
  position: absolute;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff5a52 0%, #ff2d20 45%, rgba(255, 45, 32, 0) 72%);
  box-shadow: 0 0 14px 4px rgba(255, 60, 48, .55);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s;
  z-index: 5;
}

.empty {
  text-align: center;
  padding: 24px;
  color: #6b7691;
}

.empty .rings {
  width: 84px; height: 84px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(43, 92, 255, .14);
  color: #7f9bff;
  position: relative;
}

.empty .rings::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(127, 155, 255, .35);
  animation: ripple 2.6s infinite;
}

@keyframes ripple {
  0% { transform: scale(1); opacity: .8; }
  100% { transform: scale(1.7); opacity: 0; }
}

.empty .rings svg { width: 34px; height: 34px; }
.empty h3 { margin: 0 0 8px; font-size: 16px; color: #dfe5f2; font-weight: 600; }
.empty p { margin: 0; font-size: 13px; line-height: 1.7; }

/* 底部工具条 */
.toolbar {
  flex: none;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #171e2d;
  border: 1px solid rgba(255, 255, 255, .07);
  flex-wrap: wrap;
}

.room.light-stage .toolbar {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px -8px rgba(16, 24, 40, .18);
}

.tool {
  height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 550;
  background: rgba(255, 255, 255, .07);
  color: #d6dde9;
  transition: .14s;
  white-space: nowrap;
}

.tool:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.tool:disabled { opacity: .38; cursor: not-allowed; }
.tool svg { width: 17px; height: 17px; flex: none; }

.room.light-stage .tool { background: #f1f4fa; color: var(--ink-2); }
.room.light-stage .tool:hover:not(:disabled) { background: #e6ecf8; }

.tool.on { background: rgba(43, 92, 255, .22); color: #9bb4ff; }
.room.light-stage .tool.on { background: rgba(43, 92, 255, .12); color: var(--brand); }

.tool.mic-on { background: rgba(18, 183, 106, .18); color: #6fe3ae; }
.room.light-stage .tool.mic-on { background: rgba(18, 183, 106, .12); color: #0d8a52; }

.tool.mic-off { background: rgba(240, 68, 56, .16); color: #ff9b94; }
.room.light-stage .tool.mic-off { background: rgba(240, 68, 56, .1); color: var(--danger); }

.tool.hand-on { background: rgba(247, 144, 9, .2); color: #ffc46b; }
.room.light-stage .tool.hand-on { background: rgba(247, 144, 9, .13); color: #b96e00; }

.tool-div { width: 1px; height: 24px; background: rgba(255, 255, 255, .1); margin: 0 2px; }
.room.light-stage .tool-div { background: var(--line); }

.tool.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(43, 92, 255, .9);
}

.tool.primary:hover:not(:disabled) { filter: brightness(1.06); }

/* 画笔设置 */
.pen-pop {
  position: absolute;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e2739;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: 12px;
  display: none;
  gap: 12px;
  align-items: center;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6);
  z-index: 20;
}

.room.light-stage .pen-pop {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.pen-pop.show { display: flex; }
.pen-pop .label { font-size: 11.5px; color: #8b93a7; margin-right: 2px; }

.swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: .13s;
}

.swatch.sel { border-color: #fff; transform: scale(1.15); }
.room.light-stage .swatch.sel { border-color: #101828; }

.width-btn {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .07);
}

.width-btn.sel { background: rgba(43, 92, 255, .3); }
.width-btn i { display: block; background: #dfe6f3; border-radius: 50%; }
.room.light-stage .width-btn i { background: #475467; }

/* 侧栏 */
.aside {
  width: 328px;
  flex: none;
  border-left: 1px solid rgba(255, 255, 255, .07);
  background: #131a29;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 桌面端点「菜单」也能收起 / 展开侧栏 */
.aside.closed { display: none; }

.room.light-stage .aside { background: #fff; border-left: 1px solid var(--line); }

/* 侧栏顶部：一键返回课件 */
.aside-head {
  padding: 10px 12px 0;
  flex: none;
}
.back-btn {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475467;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: .14s;
}
.back-btn:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.room.light-stage .back-btn { background: #f1f4fa; color: var(--ink-2); border-color: var(--line); }
.room.light-stage .back-btn:hover { background: #e6ecf8; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
  flex: none;
}

.tab {
  flex: 1;
  height: 34px;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 550;
  color: #8b93a7;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.room.light-stage .tab { color: var(--ink-3); }
.tab.sel { color: #fff; background: rgba(255, 255, 255, .06); }
.room.light-stage .tab.sel { color: var(--brand); background: #f5f8ff; }

.tab .badge {
  min-width: 17px; height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--warn);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.tab .badge[hidden] { display: none; }

.panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 16px;
  display: none;
}

.panel.sel { display: block; }

.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .13); border-radius: 4px; }
.room.light-stage .panel::-webkit-scrollbar-thumb { background: #d6ddea; }

.plist { display: flex; flex-direction: column; gap: 2px; }

.prow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 9px;
  transition: .13s;
}

.prow:hover { background: rgba(255, 255, 255, .05); }
.room.light-stage .prow:hover { background: #f7f9fe; }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  position: relative;
  letter-spacing: -.3px;
}

.avatar .ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: .12s;
}

.avatar.speaking .ring { border-color: #34d399; }
.avatar .mini {
  position: absolute;
  right: -3px; bottom: -3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #131a29;
  display: grid; place-items: center;
  border: 1.5px solid #131a29;
}

.room.light-stage .avatar .mini { background: #fff; border-color: #fff; }

.avatar .mini svg { width: 9px; height: 9px; color: #98a2b3; }
.avatar .mini.muted svg { color: #f97066; }

.pinfo { flex: 1; min-width: 0; }

.pname {
  font-size: 13.5px;
  font-weight: 550;
  color: #e2e8f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.room.light-stage .pname { color: var(--ink); }

.role-tag {
  font-size: 10px;
  padding: 1.5px 6px;
  border-radius: 5px;
  font-weight: 700;
  flex: none;
  letter-spacing: .2px;
}

.role-tag.host { background: rgba(43, 92, 255, .2); color: #9bb4ff; }
.role-tag.guest { background: rgba(18, 183, 106, .18); color: #6fe3ae; }
.room.light-stage .role-tag.host { background: #e8efff; color: var(--brand); }
.room.light-stage .role-tag.guest { background: #e3f8ed; color: #0d8a52; }

.pmeta { font-size: 11.5px; color: #7e879b; margin-top: 1px; }

/* 举手排队的序号 */
.qno {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #7e879b;
  background: rgba(255, 255, 255, .07);
}
.room.light-stage .qno { background: rgba(16, 24, 40, .06); color: #667085; }

.queue-empty {
  padding: 26px 12px;
  text-align: center;
  font-size: 12.5px;
  color: #7e879b;
}
.room.light-stage .queue-empty { color: #98a2b3; }

/* 主持开关：全员禁言 / 锁门 / 关课件，集中在侧栏顶部 */
.host-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 12px 0;
  flex: none;
}
.ht-btn {
  height: 34px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #d6dde9;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  white-space: nowrap;
  transition: .14s;
}
.ht-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .13); }
.ht-btn.on {
  background: rgba(240, 68, 56, .22);
  color: #ffb4ae;
  border-color: rgba(240, 68, 56, .35);
}
.room.light-stage .ht-btn {
  background: #f1f4fa;
  color: var(--ink-2);
  border-color: var(--line);
}
.room.light-stage .ht-btn:hover:not(:disabled) { background: #e6ecf8; }
.room.light-stage .ht-btn.on {
  background: rgba(240, 68, 56, .12);
  color: #d92d20;
  border-color: rgba(240, 68, 56, .28);
}

/* 语音条：说话时实时涨落，本人也能看到自己 */
.meter {
  margin-top: 3px;
  height: 3px;
  width: 100%;
  max-width: 92px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #34d399, #6ee7b7);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .06s linear;
}
.room.light-stage .meter { background: rgba(16, 24, 40, .09); }

.acts { display: flex; gap: 5px; flex: none; }

.mini-btn {
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, .09);
  color: #cfd7e6;
  transition: .13s;
}

.mini-btn:hover { background: rgba(255, 255, 255, .17); }
.room.light-stage .mini-btn { background: #eef2fa; color: var(--ink-2); }
.room.light-stage .mini-btn:hover { background: #e2e9f6; }

.mini-btn.ok { background: rgba(18, 183, 106, .2); color: #6fe3ae; }
.room.light-stage .mini-btn.ok { background: #e3f8ed; color: #0d8a52; }
.mini-btn.no { background: rgba(240, 68, 56, .16); color: #ff9b94; }
.room.light-stage .mini-btn.no { background: #fee9e7; color: var(--danger); }

.section-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #7e879b;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 14px 8px 8px;
}

.section-title:first-child { margin-top: 4px; }

.hand-empty {
  font-size: 12.5px;
  color: #6b7691;
  padding: 20px 8px;
  text-align: center;
  line-height: 1.7;
}

/* 聊天 */
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 4px 12px;
}

.msg { display: flex; gap: 9px; }
.msg .avatar { width: 26px; height: 26px; font-size: 11px; }
.msg-body { flex: 1; min-width: 0; }
.msg-head { font-size: 11.5px; color: #7e879b; margin-bottom: 3px; display: flex; gap: 6px; align-items: center; }
.msg-head b { color: #b8c2d6; font-weight: 600; }
.room.light-stage .msg-head b { color: var(--ink-2); }
.msg-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: #dde3ef;
  word-break: break-word;
  white-space: pre-wrap;
}

.room.light-stage .msg-text { color: var(--ink); }
.msg.sys .msg-text { color: #7e879b; font-size: 12.5px; font-style: normal; }

.chat-input {
  flex: none;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  gap: 8px;
}

.room.light-stage .chat-input { border-top: 1px solid var(--line); }

.chat-input input {
  flex: 1;
  height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .05);
  padding: 0 12px;
  font-size: 13.5px;
  color: #e8ecf5;
  outline: none;
}

.room.light-stage .chat-input input {
  border: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--ink);
}

.chat-input input:focus { border-color: var(--brand); }
.chat-input input::placeholder { color: #6b7691; }

.send-btn {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.send-btn svg { width: 16px; height: 16px; }

/* toast */
.toasts {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(20, 26, 40, .94);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .5);
  animation: toastIn .22s ease;
  max-width: 82vw;
}

@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* 上传进度 */
.upmask {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 24, .78);
  display: none;
  place-items: center;
  z-index: 30;
  backdrop-filter: blur(2px);
}

.upmask.show { display: grid; }
.upbox { text-align: center; color: #dbe1ee; }
.spinner {
  width: 34px; height: 34px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .18);
  border-top-color: #7f9bff;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 880px) {
  .body { position: relative; }

  .aside {
    position: fixed;
    top: 50px;
    right: 0;
    bottom: 0;
    width: min(86vw, 330px);
    z-index: 40;
    display: none;
    box-shadow: -18px 0 40px -16px rgba(0, 0, 0, .45);
  }

  .aside.open { display: flex; animation: slideIn .22s cubic-bezier(.3, .9, .3, 1); }

  @keyframes slideIn { from { opacity: 0; margin-right: -40px; } to { opacity: 1; margin-right: 0; } }

  /* 抽屉遮罩 */
  .aside.open::before {
    content: "";
    position: fixed;
    inset: 50px 0 0 0;
    background: rgba(15, 20, 33, .38);
    z-index: -1;
  }

  .stage-wrap { padding: 8px; gap: 8px; }

  /* 工具栏：窄屏也能横向滑动，文字必须保留（现在全靠汉字识别） */
  .toolbar { padding: 6px 8px; gap: 5px; flex-wrap: nowrap; overflow-x: auto; }
  .toolbar::-webkit-scrollbar { height: 0; }
  .tool {
    padding: 0 10px;
    min-width: 0;
    height: 36px;
    justify-content: center;
    flex: none;
    font-size: 12.5px;
  }
  /* 关键：不能隐藏文字，否则按钮变成一片空白 */
  .tool span { display: inline; white-space: nowrap; }
  .tool-div { display: none; }
  .spacer { display: none; }
  #chatBtn { display: none !important; }

  .topbar { height: 50px; padding: 0 10px; gap: 8px; }
  .topbar .logo span { display: none; }
  .chip { height: 27px; padding: 0 8px; font-size: 11.5px; }
  #roleChip { display: none; }
  .tb-btn { height: 30px; padding: 0 9px; font-size: 12px; gap: 5px; }
  /* 文字必须显示，否则认不出是分享还是锁定 */
  .tb-btn span { display: inline; white-space: nowrap; }
  .topbar { gap: 6px; overflow-x: auto; }
  .topbar::-webkit-scrollbar { height: 0; }
  #voiceMeter { display: none; }
}

@media (max-width: 430px) {
  #pageChip { font-size: 11px; }
  .tb-btn { padding: 0 7px; font-size: 11.5px; }
}


/* ---------------------------------------------------------- 全屏放映
   全屏时把工具栏、侧栏、缩略图都藏起来，只留课件本身。
   原生全屏和「伪全屏」（不支持 API 的手机浏览器）共用这套规则。 */
body.is-fs .toolbar,
body.is-fs .aside,
body.is-fs .thumbs,
body.is-fs .zoom-badge {
  display: none !important;
}
body.is-fs .stage-wrap { padding: 0; gap: 0; }
body.is-fs .stage {
  border-radius: 0;
  border: 0;
}
/* 全屏时退出按钮浮在右上角，不然退不出来 */
body.is-fs .topbar {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 60;
  background: transparent;
  border: 0;
  padding: 0;
  min-height: 0;
  pointer-events: none;
}
body.is-fs .topbar > * { pointer-events: auto; }
body.is-fs .topbar .brand-mini,
body.is-fs .topbar .spacer,
body.is-fs .topbar #beHostBtn,
body.is-fs .topbar #copyBtn,
body.is-fs .topbar #lockBtn,
body.is-fs .topbar #asideToggle,
body.is-fs .topbar .countdown { display: none !important; }

/* 伪全屏：铺满视口 */
body.pseudo-fs { overflow: hidden; }
body.pseudo-fs .room {
  position: fixed;
  inset: 0;
  z-index: 9998;
  max-height: none;
}


/* ============================================================
   管理面板：四张独立卡片，每张自带输入框和保存按钮。
   目标：手机上一眼看见、不用滚动、不用找。
   ============================================================ */
.card-ad {
  border: 1.5px solid #e6ebf4;
  border-radius: 12px;
  padding: 12px 14px 13px;
  margin-bottom: 11px;
  background: #fff;
}
.card-ad:last-of-type { margin-bottom: 0; }

.ca-label {
  font-size: 13px;
  font-weight: 700;
  color: #2b5cff;
  margin-bottom: 9px;
}

.ca-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 输入框：大、粗、带边框，绝不被挤扁 */
.ca-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1.5px solid #d7deeb;
  background: #fbfcfe;
  font-size: 16px;
  font-weight: 600;
  color: #101828;
  outline: none;
  letter-spacing: .3px;
}
.ca-input:focus {
  border-color: #2b5cff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(43, 92, 255, .1);
}
.ca-input::placeholder { font-weight: 400; color: #9aa3b8; letter-spacing: 0; }

/* 保存按钮：固定宽度，不抢输入框 */
.ca-btn {
  flex: none;
  width: auto;
  min-width: 68px;
  height: 46px;
  padding: 0 16px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2b5cff, #5b7cff);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.ca-btn:disabled { opacity: .65; }

.ca-unit { flex: none; font-size: 13px; color: #667085; }

.ca-quick { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.cq {
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid #e2e8f2;
  background: #f8fafc;
  font-size: 12px;
  color: #475467;
}
.cq:active { background: #eef2f8; }

.ca-status {
  margin-top: 9px;
  font-size: 12px;
  color: #667085;
  line-height: 1.5;
}
.ca-status b { color: #2b5cff; font-weight: 700; }
.ca-status.bad { color: #d92d20; font-weight: 600; }

.ca-gate { flex: 1; font-size: 14px; color: #101828; }

/* 面板本身：标题+关闭键永远吸顶，内容区自己滚。
   之前整块一起滚，屏幕矮的时候「关闭」被挤到最底下，
   用户看到的就是「弹窗出来了但没有关闭键，也进不去」。 */
.modal.modal-wide {
  max-width: 520px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);   /* 手机浏览器地址栏收放也不越界 */
  display: flex;
  flex-direction: column;
  overflow: hidden;                  /* 滚动交给 .m-body，头部不动 */
  padding: 0;
}
.m-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid rgba(16, 24, 40, .07);
  background: #fff;
  border-radius: 18px 18px 0 0;
}
.m-head h3 { margin: 0; font-size: 17px; flex: 1; }
.m-x {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 10px;
  font-size: 15px; line-height: 1;
  color: #667085;
  background: rgba(16, 24, 40, .06);
  display: grid; place-items: center;
}
.m-x:hover { background: rgba(16, 24, 40, .12); color: #101828; }
.m-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 18px 16px;
  overscroll-behavior: contain;
}
.modal.modal-wide h3 { margin: 0; font-size: 17px; }
/* 说明性的小字全部隐藏，只留能操作的东西 */
.modal.modal-wide .sub2 { display: none; }
