/* 项目自有组件层。通用件（卡片、表单、按钮、表格、徽章、提示、栅格、间距）一律用
   Bootstrap 5.3 的类，这个文件只补 Bootstrap 没有的东西：麦位、头像、聊天气泡、
   状态灯、房间号芯片、窄屏的表格卡片化。加载顺序必须晚于 bootstrap.min.css。 */

/* 工具类（d-flex 等）会盖掉浏览器默认的 [hidden] 规则；页面里大量元素靠 hidden 属性
   显隐，必须显式压回去。 */
[hidden] { display: none !important; }

/* ---- 品牌标记 ---- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: linear-gradient(135deg, var(--bs-primary), var(--bs-purple)); box-shadow: 0 0 12px rgba(13, 110, 253, .5); flex: none; }

/* ---- 头像 ---- */
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #0b0a14;
}
.avatar.lg { width: 62px; height: 62px; font-size: 22px; }

/* ---- 说话时的光圈动画（教室页的讲师胶囊复用） ---- */
@keyframes pulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }

/* ---- 听众小胶囊 ---- */
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 6px;
  border-radius: 999px; background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); font-size: 13px;
}
.chip .avatar { width: 24px; height: 24px; font-size: 11px; }

/* ---- 房间号芯片（点击复制） ---- */
.code-chip {
  font-family: var(--bs-font-monospace); letter-spacing: 2px; font-size: 15px; font-weight: 700; padding: 5px 11px;
  border-radius: var(--bs-border-radius); background: var(--bs-tertiary-bg);
  border: 1px dashed var(--bs-border-color); cursor: pointer; color: var(--bs-emphasis-color);
}

/* ---- 空状态占位框（Bootstrap 没有虚线边框工具类） ---- */
.empty-hint {
  padding: 34px 20px; text-align: center; color: var(--bs-secondary-color);
  border: 1px dashed var(--bs-border-color); border-radius: var(--bs-border-radius-lg);
  background: var(--bs-body-bg);
}

/* ---- 状态灯 ---- */
.led { width: 9px; height: 9px; border-radius: 50%; background: var(--bs-secondary-bg); border: 1px solid var(--bs-border-color); flex: none; }
.led.ok { background: var(--bs-success); border-color: var(--bs-success); box-shadow: 0 0 9px rgba(25, 135, 84, .6); }
.led.bad { background: var(--bs-danger); border-color: var(--bs-danger); box-shadow: 0 0 9px rgba(220, 53, 69, .6); }
.led.pending { background: var(--bs-warning); border-color: var(--bs-warning); box-shadow: 0 0 9px rgba(255, 193, 7, .6); }

/* ---- 教室大卡片：登录后进厅就是「进入我的教室」 ---- */
.classroom { display: block; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-xl); padding: 18px; background: var(--bs-body-bg); }
.classroom .cover, .cover-edit .cover { width: 100%; height: 148px; object-fit: cover; border-radius: var(--bs-border-radius-lg); display: block; margin-bottom: 14px; }
.classroom .cover.ph { display: grid; place-items: center; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); font-size: 13px; margin-bottom: 14px; }
.cover-edit input[type="file"] { font-size: 12.5px; }

/* ---- 统计块 ---- */
.stat { padding: 12px 14px; border-radius: var(--bs-border-radius-lg); background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); }
.stat b { display: block; font-size: 22px; font-weight: 700; line-height: 1.3; }
.stat span { font-size: 12px; color: var(--bs-secondary-color); }

/* ---- 聊天：文字 / 图片 / 录音 / 视频 ---- */
.chat-log {
  height: min(46vh, 420px); overflow-y: auto; overscroll-behavior: contain;
  /* 往上翻历史时自己补偿滚动位置（room.js 的 loadOlder），不能让浏览器的
     scroll anchoring 也来抢一次，否则两处各补一半，视口照样漂。 */
  overflow-anchor: none;
  display: flex; flex-direction: column; gap: 12px; padding: 12px;
  border-radius: var(--bs-border-radius-lg); background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color);
}
.chat-item { max-width: 78%; align-self: flex-start; }
.chat-item.me { align-self: flex-end; text-align: right; }
.chat-who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--bs-secondary-color); margin-bottom: 5px; }
.chat-item.me .chat-who { justify-content: flex-end; }
.chat-who .avatar { width: 26px; height: 26px; font-size: 12px; }
.chat-text {
  display: inline-block; text-align: left; padding: 10px 13px; font-size: 14px; line-height: 1.6;
  border-radius: 4px var(--bs-border-radius-lg) var(--bs-border-radius-lg) var(--bs-border-radius-lg);
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  word-break: break-word; white-space: normal;
}
.chat-item.me .chat-text { background: var(--bs-primary-bg-subtle); border-color: var(--bs-primary-border-subtle); border-radius: var(--bs-border-radius-lg) 4px var(--bs-border-radius-lg) var(--bs-border-radius-lg); }
/* 聊天附件：图片是缩略图、点开走页内浮层；语音和视频在列表里只是按钮，
   不挂 <audio> / <video>——每条消息各挂一个播放器会自己把流量和解码全拉下来。 */
.chat-media-btn { padding: 0; border: 0; background: none; display: block; cursor: pointer; }
.chat-img { max-width: 240px; max-height: 240px; border-radius: var(--bs-border-radius-lg); display: block; border: 1px solid var(--bs-border-color); }
.chat-voice { display: inline-flex; align-items: center; gap: 10px; width: 240px; max-width: 70vw; padding: 10px 14px; text-align: left;
  cursor: pointer; border: 1px solid var(--bs-border-color); border-radius: 16px; background: var(--bs-body-bg); color: inherit; }
.chat-voice-ico { width: 0; height: 0; flex: none; margin-left: 2px; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
/* 播放中换成两条竖杠，一眼看得出这条正在响。 */
.chat-voice.playing .chat-voice-ico { width: 11px; height: 13px; margin-left: 0; border: 0 solid currentColor; border-left-width: 4px; border-right-width: 4px; }
.chat-voice-bar { flex: 1 1 auto; height: 4px; border-radius: 2px; background: rgba(128, 128, 128, .38); overflow: hidden; }
.chat-voice-bar i { display: block; height: 100%; width: 0; background: currentColor; }
.chat-voice-time { flex: none; font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; }
.chat-video { display: grid; place-items: center; gap: 6px; width: 300px; max-width: 70vw; aspect-ratio: 16 / 9; cursor: pointer;
  border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); background: #000; color: #fff; }
.chat-video-ico { width: 0; height: 0; border-left: 16px solid currentColor; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.chat-video-cap { font-size: 12px; opacity: .78; letter-spacing: .04em; }
.media-view { display: block; max-width: 100%; max-height: 62vh; max-height: min(62vh, 62dvh); margin: 0 auto; border-radius: 8px; background: #000; }
/* 看片子的浮层要够大，黑底上不留白边。 */
.ov-media .modal-dialog { max-width: min(1100px, 94vw); }
.ov-media .modal-body { display: grid; padding: 10px; }
/* iPhone 上这张图会「打开放不下、又关不掉」：76vh 量的是 Safari 收起工具条之后的大视口，
   弹窗被居中的网格顶出屏幕上沿，× 落在工具条底下，整层还不滚。
   这里改成顶部对齐 + 安全区内边距 + 允许整层滚动：内容再高也先看见头，拇指那颗
   「关闭」始终在流里，滚到底就点得到。 */
.dialog-mask.ov-media {
  place-items: start center;
  align-items: start;
  overflow-y: auto;
  padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
}
.ov-media .modal-dialog { margin: 0 auto; min-height: 0; }
/* 图再高也只让图区自己滚：头和「关闭」始终钉在视口里，iPhone 上不存在「滚出屏幕外关不掉」。 */
.ov-media .modal-content { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); background: #0b0a14; border-color: rgba(255, 255, 255, .16); }
.ov-media .modal-body { min-height: 0; overflow: auto; }
.ov-media .modal-title { color: #e8eaf6; }
.ov-media .modal-header { border-bottom-color: rgba(255, 255, 255, .12); }
.ov-media .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.ov-media-foot { border-top-color: rgba(255, 255, 255, .12); }
.rec-bar { margin-top: 12px; padding: 10px 14px; border-radius: var(--bs-border-radius-lg); background: var(--bs-danger-bg-subtle); border: 1px solid var(--bs-danger-border-subtle); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bs-danger); animation: pulse2 1s ease-in-out infinite; flex: none; }
@keyframes pulse2 { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ---- 自定义确认/输入框（Bootstrap modal 的外观，但不需要 Bootstrap JS） ---- */
.dialog-mask {
  /* Bootstrap 把这些变量声明在 .modal 上；这里没有 .modal 祖先，得自己带一份，
     否则 .modal-content 的背景和圆角会解析成空值而变成透明。 */
  --bs-modal-width: 500px;
  --bs-modal-padding: 1rem;
  --bs-modal-margin: 0.5rem;
  --bs-modal-color: ;
  --bs-modal-bg: var(--bs-body-bg);
  --bs-modal-border-color: var(--bs-border-color-translucent);
  --bs-modal-border-width: var(--bs-border-width);
  --bs-modal-border-radius: var(--bs-border-radius-lg);
  --bs-modal-box-shadow: var(--bs-box-shadow-sm);
  --bs-modal-inner-border-radius: calc(var(--bs-border-radius-lg) - (var(--bs-border-width)));
  --bs-modal-header-padding-x: 1rem;
  --bs-modal-header-padding-y: 1rem;
  --bs-modal-header-padding: 1rem 1rem;
  --bs-modal-header-border-color: var(--bs-border-color);
  --bs-modal-header-border-width: var(--bs-border-width);
  --bs-modal-title-line-height: 1.5;
  --bs-modal-footer-gap: 0.5rem;
  --bs-modal-footer-bg: ;
  --bs-modal-footer-border-color: var(--bs-border-color);
  --bs-modal-footer-border-width: var(--bs-border-width);
  position: fixed; inset: 0; z-index: 1055; display: grid; place-items: center;
  background: rgba(0, 0, 0, .5);
}
.dialog-mask .modal-dialog { max-width: min(var(--bs-modal-width), 100vw - var(--bs-modal-margin) * 2); margin: var(--bs-modal-margin); }
/* 讲师可以自己写「点击开启声音」那句提示，粘进来一条不带空格的长链接也会把弹窗撑破：
   上面把弹窗宽度钉在视口之内，这里再允许这种长串在任意位置断行。 */
#sound-text { overflow-wrap: anywhere; }
.dialog-mask .modal-content { width: 100%; }
.dialog-mask .modal-title { font-size: 17px; }

/* ---- 手机：单列、拇指可点、宽表格拆成卡片而不是横向滑动 ---- */
@media (max-width: 720px) {
  .brand { font-size: 16px; }

  /* 后台侧栏在手机上横过来，变成顶部可左右滑的菜单条 */
  .side-nav { flex-direction: row !important; overflow-x: auto; padding-bottom: 6px; }
  /* width:auto 是必需的：list-group-item 默认撑满容器，横过来之后第二条菜单会被推到屏幕外，
     两项菜单还得先滑一下才看得见。 */
  .side-nav > * { flex: 0 0 auto; width: auto; white-space: nowrap; }

  .classroom .cover, .cover-edit .cover { height: 132px; }

  /* iOS Safari 在字号小于 16px 的输入框上会自动放大页面 */
  .form-control, .form-select, textarea.form-control { font-size: 16px; }
  .btn-sm { padding: 9px 13px; font-size: 13px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }

  /* 表格：每行拆成一张小卡片，字段名由 data-label 提供 */
  .stack thead { display: none; }
  .stack, .stack tbody, .stack tr, .stack td { display: block; width: 100%; }
  .stack tr {
    margin-bottom: 10px; padding: 4px 12px;
    border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); background: var(--bs-body-bg);
  }
  .stack td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 9px 0; text-align: left; border-bottom: 1px dashed var(--bs-border-color);
  }
  .stack td:last-child { border-bottom: none; }
  .stack td::before {
    content: attr(data-label); flex: 0 0 auto;
    color: var(--bs-secondary-color); font-size: 11.5px; font-weight: 600;
  }
  .stack td.text-end { text-align: left; }
  .stat b { font-size: 19px; }
  .chat-log { height: 52vh; }
  .chat-item { max-width: 88%; }
}

/* =====================================================================
   教室皮肤（/room）：暗色 + 一屏，参考抖音语音厅「上面舞台、下面聊天」。
   整段作用域在 body.vh-room 之下，/admin、/teacher、大厅继续用上面的
   Bootstrap 浅色样式，两边互不影响。
   ===================================================================== */

body.vh-room {
  /* Bootstrap 的深色变量再往「紫蓝夜店」方向压一档，页面里所有控件跟着走。 */
  --vh-glass: rgba(255, 255, 255, .05);
  --vh-line: rgba(255, 255, 255, .11);
  --vh-ink: #e8eaf6;
  --vh-muted: rgba(232, 234, 246, .58);
  --bs-body-bg: #0b0e18;
  --bs-body-color: var(--vh-ink);
  --bs-emphasis-color: #fff;
  --bs-border-color: var(--vh-line);
  --bs-secondary-color: var(--vh-muted);
  --bs-tertiary-bg: var(--vh-glass);
  height: 100vh;                  /* 不支持 dvh 的老浏览器兜底，一屏靠它 */
  height: 100dvh;
  overflow: hidden;              /* 一屏：整页不滚，只有舞台和聊天记录各自内滚 */
  margin: 0;
  color: var(--vh-ink);
  background: radial-gradient(115% 78% at 50% -14%, #2c1e55 0%, #141a34 42%, #080b14 100%) fixed;
}
body.vh-room .btn-primary {
  --bs-btn-bg: #7c5cff; --bs-btn-border-color: #7c5cff;
  --bs-btn-hover-bg: #8d71ff; --bs-btn-hover-border-color: #8d71ff;
  --bs-btn-active-bg: #6a4bf0; --bs-btn-active-border-color: #6a4bf0;
  --bs-btn-disabled-bg: #4b3f7a; --bs-btn-disabled-border-color: #4b3f7a;
}
body.vh-room .btn-outline-light {
  --bs-btn-color: #dfe3f5; --bs-btn-border-color: rgba(255, 255, 255, .22);
  --bs-btn-hover-bg: rgba(255, 255, 255, .14); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: rgba(255, 255, 255, .3);
  --bs-btn-disabled-color: rgba(223, 227, 245, .4); --bs-btn-disabled-border-color: rgba(255, 255, 255, .12);
}
body.vh-room .form-control {
  background: rgba(255, 255, 255, .06); border-color: var(--vh-line); color: var(--vh-ink);
}
body.vh-room .form-control::placeholder { color: rgba(232, 234, 246, .38); }
body.vh-room .form-control:focus { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(124, 92, 255, .7); box-shadow: 0 0 0 .2rem rgba(124, 92, 255, .2); }

/* ---- 外壳 ---- */
.vh-wrap {
  display: flex; flex-direction: column; gap: 10px;
  height: 100vh; height: 100dvh; max-width: 1180px; margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) 12px calc(10px + env(safe-area-inset-bottom));
}
.vh-top { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 42px; }
.vh-panel { background: var(--vh-glass); border: 1px solid var(--vh-line); border-radius: 20px; padding: 12px 14px; }
/* 只有「被移出 / 房间已关闭 / 载入失败」这种终态才有这一组：舞台收起后它占住中间，
   而不是像以前那样在顶上常驻一条提示（那条会把整屏高度挤掉）。
   !important 用来盖掉 Bootstrap 的 .mb-3，否则上下不对称。 */
#msg-box { margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#msg { margin: 0 !important; text-align: center; font-size: 15px; }

/* ---- 进房前的邀请码 ---- */
.vh-invite-title { font-weight: 600; margin-bottom: 4px; }

/* ---- 左上角的讲师 ---- */
/* 头像 + 名字 + 语音状态挤成一枚胶囊，占掉原来产品名的位置。
   它同时还是讲师的「席位」：EQ 条和 .speaking 光圈继续由 tickMeters 按 data-uid 驱动。 */
.vh-teacher-slot { flex: none; }
.vh-teacher {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--vh-line);
}
.vh-teacher.live {
  background: linear-gradient(90deg, rgba(124, 92, 255, .28), rgba(255, 255, 255, .05));
  border-color: rgba(124, 92, 255, .5); box-shadow: 0 6px 18px rgba(15, 8, 45, .45);
}
.vh-teacher .avatar { position: relative; width: 34px; height: 34px; font-size: 14px; color: #0b0a14; flex: none; }
.vh-teacher-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.vh-teacher .name { font-size: 13px; font-weight: 600; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh-teacher .sub { font-size: 11px; color: var(--vh-muted); white-space: nowrap; }
.vh-teacher .sub .badge { font-size: 10.5px; padding: 1px 6px; }
.vh-teacher .eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; flex: none; }
.vh-teacher .eq i { width: 2px; height: 3px; border-radius: 2px; background: linear-gradient(180deg, #22d3ee, #8b5cf6); transition: height .1s linear; }
.vh-teacher.speaking .avatar::after {
  content: ""; position: absolute; left: -2px; top: -2px; width: 34px; height: 34px;
  border-radius: 50%; border: 2px solid #22d3ee; animation: pulse 1.15s ease-out infinite;
}
.vh-teacher-ph { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .06); flex: none; }

/* ---- 房间名 / 房间号 ---- */
.vh-room-id { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vh-room-name { font-size: 14px; font-weight: 600; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 在线人数：只有讲师和管理员看得见的读数 ---- */
.vh-online { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12.5px; color: var(--vh-muted); white-space: nowrap; }
.vh-online-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .16); flex: none; }

/* ---- 主体：聊天区整块占满，讲师胶囊在 header 左上角 ---- */
.vh-main { flex: 1 1 auto; min-height: 0; display: flex; }
body.vh-room .code-chip { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .2); color: #fff; font-size: 13.5px; }

/* ---- 讲师控制台：现在挤在 header 最右，只剩灯和按钮 ---- */
.vh-host { display: flex; align-items: center; gap: 8px; flex: none; }
.vh-led-row { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--vh-muted); white-space: nowrap; }
.vh-host-ctrl { display: inline-flex; align-items: center; gap: 8px; }
.vh-cta {
  background: linear-gradient(135deg, #8b5cf6, #22d3ee); border: 0; color: #071018; font-weight: 700;
  padding: 9px 20px; border-radius: 999px; box-shadow: 0 8px 22px rgba(124, 92, 255, .38);
}
.vh-cta:hover { background: linear-gradient(135deg, #9d74ff, #3ddcf7); color: #071018; }
.vh-note { flex: 1 1 200px; min-width: 0; font-size: 12px; line-height: 1.55; color: var(--vh-muted); margin: 0; }

/* ---- 右上角两枚图标：出口和设置随时够得着，又不占一栏高度 ---- */
/* margin-left:auto：header 在手机上折行时，这一组会被推到第二行的最右，仍然贴着右上角。 */
.vh-top-btns { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.vh-ico {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none; cursor: pointer;
  border-radius: 50%; border: 1px solid var(--vh-line); background: rgba(255, 255, 255, .06); color: var(--vh-ink);
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.vh-ico:hover { border-color: rgba(124, 92, 255, .7); background: rgba(124, 92, 255, .18); color: #fff; }
.vh-ico:focus-visible { outline: 2px solid rgba(124, 92, 255, .85); outline-offset: 2px; }
.vh-ico svg { width: 17px; height: 17px; display: block; }

/* ---- 听众：页面上不再有列表，只有教室管理抽屉里的一张成员表 ---- */
.vh-sheet-members { flex: 1 1 240px; min-width: 0; }
.vh-aud-staff { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vh-aud-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 8px; }
.vh-aud {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  padding: 10px 6px 8px; border-radius: 16px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--vh-line); font-size: 12px;
}
.vh-aud .avatar { width: 38px; height: 38px; font-size: 15px; color: #0b0a14; }
.vh-aud-name { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh-aud-btns { display: flex; gap: 5px; margin-top: 1px; }
.vh-aud.muted { border-color: rgba(255, 193, 7, .42); }
.vh-aud .tag { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 193, 7, .16); color: #ffd66b; }
.vh-aud .btn { --bs-btn-padding-y: 0; --bs-btn-padding-x: 7px; --bs-btn-font-size: 11px; }
.vh-aud-empty { font-size: 12.5px; color: var(--vh-muted); padding: 6px 2px; }

/* ---- 聊天：整块占满主体，出口和教室管理都在顶部 header 的右上角 ---- */
.vh-chat {
  position: relative; flex: 1 1 auto; min-width: 0;
  min-height: 0; display: flex; flex-direction: column; gap: 8px;
  background: var(--vh-glass); border: 1px solid var(--vh-line); border-radius: 20px; padding: 10px 12px;
}
.vh-chat-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; color: var(--vh-muted); }
.vh-chat-head .small { font-weight: 400; letter-spacing: 0; }
body.vh-room .vh-chat .chat-log {
  height: auto; flex: 1 1 auto; min-height: clamp(40px, 11vh, 110px); min-height: clamp(40px, 11dvh, 110px); gap: 10px;
  background: transparent; border: 0; padding: 4px 2px;
}
/* 空记录提示浮在记录区中间：它一旦占位，一屏里的聊天记录就没了。 */
body.vh-room .vh-chat #chat-empty {
  position: absolute; left: 12px; right: 12px; top: 46%; text-align: center; padding: 0; pointer-events: none;
}
body.vh-room .vh-chat .chat-text {
  background: rgba(255, 255, 255, .07); border-color: var(--vh-line); color: var(--vh-ink);
  border-radius: 6px 16px 16px 16px;
}
body.vh-room .vh-chat .chat-item.me .chat-text {
  background: linear-gradient(135deg, rgba(139, 92, 246, .34), rgba(34, 211, 238, .2));
  border-color: rgba(124, 92, 255, .45); border-radius: 16px 6px 16px 16px;
}
body.vh-room .vh-chat .chat-who { color: rgba(232, 234, 246, .48); }
body.vh-room .vh-chat .chat-img,
body.vh-room .vh-chat .chat-video { border-color: var(--vh-line); }
body.vh-room .vh-chat .chat-voice { background: rgba(255, 255, 255, .07); border-color: var(--vh-line); color: var(--vh-ink); border-radius: 16px; }
body.vh-room .vh-chat .chat-item.me .chat-voice { background: linear-gradient(135deg, rgba(139, 92, 246, .34), rgba(34, 211, 238, .2)); border-color: rgba(124, 92, 255, .45); }
/* 附件按钮是键盘可聚焦的：给一圈明显的焦点光，而不是浏览器默认的方框。 */
.chat-media-btn:focus-visible,
.chat-voice:focus-visible,
.chat-video:focus-visible { outline: 2px solid #22d3ee; outline-offset: 2px; }
.vh-chat-foot { position: relative; flex: none; display: grid; gap: 8px; }
.vh-composer { display: grid; gap: 8px; }
/* 输入框这一行就是整页最底下的东西：附件按钮挂在它左边，功能面板浮在上方而不是占一行。 */
.vh-composer-row { position: relative; display: flex; align-items: flex-end; gap: 8px; }
.vh-input { flex: 1 1 auto; min-width: 0; max-height: 96px; resize: none; border-radius: 16px; }
.vh-send { border-radius: 16px; padding: 9px 20px; flex: none; }
.vh-plus {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--vh-line); background: rgba(255, 255, 255, .06);
  color: var(--vh-ink); font-size: 22px; line-height: 1;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.vh-plus[aria-expanded="true"] { transform: rotate(45deg); border-color: rgba(124, 92, 255, .7); background: rgba(124, 92, 255, .18); }
.vh-tools {
  position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 5;
  display: flex; flex-wrap: wrap; gap: 8px; padding: 8px;
  border-radius: 16px; border: 1px solid var(--vh-line);
  background: #161a2c; box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}
.vh-tools .btn { min-width: 78px; border-radius: 14px; }
/* 禁言时输入栏整条收起，这里只剩一句「只听只看」的软提示，看起来就不像一个能点的地方。 */
.vh-chat-foot .alert {
  border-radius: 16px; font-size: 13px; margin: 0;
  background: rgba(255, 193, 7, .12); border: 1px solid rgba(255, 193, 7, .3); color: #ffd66b;
}
body.vh-room .rec-bar { background: rgba(220, 53, 69, .16); border-color: rgba(220, 53, 69, .4); border-radius: 16px; }

/* ---- 抽屉：教室管理和链路诊断都浮在页面之上，不占一屏的空间 ---- */
.vh-sheet {
  /* 不用 inset 简写：老浏览器不认，抽屉会缩成一条。 */
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(4, 6, 14, .62);
}
.vh-sheet-panel {
  width: 100%; max-width: 640px; max-height: 78vh; max-height: 78dvh; display: flex; flex-direction: column; gap: 12px;
  background: #131828; border: 1px solid var(--vh-line); border-radius: 22px 22px 0 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
}
.vh-sheet-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
.vh-sheet-body { overflow-y: auto; min-height: 0; }
.vh-sheet-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
/* 成员表是一块会竖着长的网格，标签跟着顶对齐才不像被吊在半空。 */
#row-members { align-items: flex-start; }
.vh-sheet-row:first-child { border-top: 0; }
.vh-sheet-label { flex: none; font-size: 12px; font-weight: 700; color: var(--vh-muted); }
@media (min-width: 992px) {
  .vh-sheet { align-items: center; }
  .vh-sheet-panel { border-radius: 22px; }
}

/* ---- 手机宽度：header 只留「讲师 + 讲话 + 两枚图标」，房间名/房间号让给聊天区 ---- */
@media (max-width: 720px) {
  .vh-top { gap: 8px; }
  .vh-room-id { display: none; }
  .vh-teacher .name { max-width: 11ch; }
  /* 身份角标在手机上让路：讲师胶囊和控制台按钮已经把「谁在说话」说清楚了。 */
  #role-chip { display: none; }
  .vh-aud-list { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
}

/* =====================================================================
   用户端外观（大厅 / + 教室 /room）：往「青春」方向调一档 ——
   更亮的渐变、更圆的角、更轻的浮起。整段只作用在 body.vh-hall 和
   body.vh-room 上，/admin 与 /teacher 一处都不跟着变。
   ===================================================================== */

/* ---- 教室背景：原来只有一片顶光，现在补上三色极光（紫 / 青 / 桃）。
   教室页是一屏布局（body 不滚，滚的是聊天区自己），所以这里不写
   background-attachment:fixed —— 它没有视觉作用，只会让整屏极光跟着重绘。 ---- */
body.vh-room {
  background:
    radial-gradient(54% 38% at 10% 2%, rgba(139, 92, 246, .40) 0%, rgba(139, 92, 246, 0) 62%),
    radial-gradient(48% 34% at 92% 10%, rgba(34, 211, 238, .26) 0%, rgba(34, 211, 238, 0) 60%),
    radial-gradient(62% 42% at 76% 100%, rgba(244, 114, 182, .22) 0%, rgba(244, 114, 182, 0) 62%),
    radial-gradient(115% 78% at 50% -14%, #2c1e55 0%, #141a34 42%, #080b14 100%);
}
/* 玻璃面板提一档 opacity：底下有了极光，太透会让文字对比掉下来。 */
body.vh-room .vh-panel,
body.vh-room .vh-chat { background: rgba(255, 255, 255, .07); }

/* ---- 气泡：更圆的角 + 自己发的换成实心渐变 ---- */
body.vh-room .vh-chat .chat-text {
  padding: 11px 15px; border-radius: 10px 20px 20px 20px;
  box-shadow: 0 4px 16px rgba(4, 6, 18, .38);
}
body.vh-room .vh-chat .chat-item.me .chat-text {
  /* 半透明渐变在极光底上会跟着变色，说句话变成「看运气」；这里铺实心渐变并把字色定白，
     对比度不再依赖背景。 */
  background: linear-gradient(135deg, #8b5cf6 0%, #6d5cf7 46%, #22d3ee 132%);
  border-color: rgba(139, 92, 246, .62);
  border-radius: 20px 10px 20px 20px;
  color: #fff;
}
body.vh-room .vh-chat .chat-who .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .16); }
body.vh-room .vh-chat .chat-time {
  font-size: 11px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08);
}
body.vh-room .vh-chat .chat-img { border-radius: 16px; }

/* ---- 「↓ 回到最新」：往上翻历史时唯一把人带回底部的入口 ---- */
.vh-latest {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); z-index: 4;
  padding: 8px 16px; border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee); color: #071018;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 10px 24px rgba(6, 8, 24, .55);
}
.vh-latest:hover { filter: brightness(1.08); }
.vh-latest:focus-visible { outline: 2px solid #22d3ee; outline-offset: 2px; }

/* ---- 输入栏与发送：圆到底、发送键用同一支渐变笔 ---- */
body.vh-room .vh-input { border-radius: 20px; padding: 10px 16px; }
body.vh-room .vh-send {
  background: linear-gradient(135deg, #8b5cf6, #22d3ee); border: 0; color: #071018; font-weight: 700;
  border-radius: 20px; box-shadow: 0 8px 20px rgba(124, 92, 255, .34);
}
body.vh-room .vh-send:hover { filter: brightness(1.08); color: #071018; }
body.vh-room .vh-send:disabled { filter: none; opacity: .55; }

/* ---- 大厅：顶部一抹淡紫，卡片圆起来、浮起来，主按钮换成教室那支渐变 ---- */
body.vh-hall { background-image: linear-gradient(180deg, #eef0ff 0%, rgba(248, 250, 252, 0) 340px); }
/* 登录卡带着 .shadow-sm，那条规则是 !important，直接写 .card 的 box-shadow 会被它顶掉；
   改覆盖它引用的变量，整个大厅的浅阴影统一成这一档。 */
body.vh-hall { --bs-box-shadow-sm: 0 10px 28px rgba(30, 27, 75, .07); }
body.vh-hall .card {
  border: 1px solid rgba(124, 92, 255, .16); border-radius: 18px;
  box-shadow: 0 10px 28px rgba(30, 27, 75, .07);
}
body.vh-hall .card-header {
  background: linear-gradient(90deg, rgba(139, 92, 246, .10), rgba(34, 211, 238, .08));
  border-bottom-color: rgba(124, 92, 255, .14);
  border-radius: 18px 18px 0 0;
  font-weight: 700; font-size: 13.5px;
}
body.vh-hall .classroom .cover,
body.vh-hall .classroom .cover.ph { border-radius: 16px; box-shadow: 0 8px 22px rgba(30, 27, 75, .12); }
body.vh-hall .classroom { transition: transform .18s ease; }
body.vh-hall .classroom:hover { transform: translateY(-2px); }
body.vh-hall #form-login .btn-primary,
body.vh-hall #btn-mine {
  background: linear-gradient(135deg, #8b5cf6, #22d3ee); border: 0; color: #071018; font-weight: 700;
  border-radius: 999px; padding: 11px 18px; box-shadow: 0 8px 20px rgba(124, 92, 255, .3);
}
body.vh-hall #form-login .btn-primary:hover,
body.vh-hall #btn-mine:hover { filter: brightness(1.06); color: #071018; }

