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

/* hidden 必须真的隐藏：.call / .dashPage 都带 position:fixed + display:flex，
   作者样式会盖掉浏览器对 [hidden] 的默认 display:none，导致隐藏页铺满全屏挡住入口 */
[hidden] { display: none !important; }

:root {
  --bg: #0b0d12;
  --bg2: #141821;
  --line: rgba(255, 255, 255, .075);
  --fg: #eef2f9;
  --dim: #8b94a7;
  --accent: #3d7dff;
  --accent-soft: rgba(61, 125, 255, .15);
  --red: #e8484c;
  --green: #2fbf71;
  --radius: 20px;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 手机上点击不延迟、不触发双击缩放，滚动交给浏览器 */
body { touch-action: manipulation; }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
svg { display: block; }

/* ---------------- 入会 / 登录 ---------------- */
.lobby {
  min-height: 100%;
  min-height: 100vh;   /* iOS 15.4 以下不认 dvh，先给 vh 兜底 */
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(61, 125, 255, .18) 0%, transparent 62%),
    radial-gradient(700px 400px at 90% 110%, rgba(120, 80, 255, .12) 0%, transparent 60%),
    var(--bg);
}

.card {
  width: 100%;
  max-width: 420px;
  background: rgba(20, 24, 33, .86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px 22px;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.card h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: .4px; }
.card .sub { margin: 0 0 18px; color: var(--dim); font-size: 13px; }

/* 品牌头：logo + 名称 */
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08);
}
.brand-tx { min-width: 0; }
.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand .sub { margin: 3px 0 0; font-size: 12px; color: var(--dim); }
.card label { display: block; margin: 14px 0 6px; font-size: 12px; color: var(--dim); }

.card input {
  width: 100%;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 8, 12, .7);
  color: var(--fg);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.card input:focus { border-color: var(--accent); background: rgba(6, 8, 12, .95); }

button.primary {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  border-radius: 13px;
  background: linear-gradient(180deg, #4b87ff, #2f6bed);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(47, 107, 237, .35);
}
button.primary:disabled { opacity: .5; box-shadow: none; }

.err { color: var(--red); font-size: 13px; margin: 10px 0 0; min-height: 18px; }
.hint { color: #5d6678; font-size: 12px; margin: 12px 0 0; }

/* ---------------- 会议页 ---------------- */
.call {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 0;
  overflow: hidden;
  background:
    radial-gradient(1000px 520px at 50% -12%, rgba(61, 125, 255, .14) 0%, transparent 60%),
    radial-gradient(800px 500px at 85% 115%, rgba(120, 80, 255, .10) 0%, transparent 62%),
    var(--bg);
}

/* 顶栏 */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  flex-shrink: 0;
}

.bar .left, .bar .right { display: flex; align-items: center; gap: 8px; }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(47, 191, 113, .6);
  animation: pulse 2.2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 191, 113, .55); }
  70% { box-shadow: 0 0 0 8px rgba(47, 191, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag.dim {
  color: var(--dim);
  font-weight: 500;
  background: rgba(255, 255, 255, .03);
}

.status { color: #5f6879; font-size: 12px; white-space: nowrap; }

button.ghost {
  padding: 8px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--fg);
  transition: background .15s;
}
button.ghost:hover { background: rgba(255, 255, 255, .12); }

button.danger {
  padding: 8px 16px;
  border-radius: 11px;
  background: linear-gradient(180deg, #f05a5e, #d83b40);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 6px 18px rgba(216, 59, 64, .3);
}
button.danger:hover { filter: brightness(1.08); }

/* 视频网格 */
.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 4px 16px 8px;
  grid-template-columns: repeat(1, 1fr);
  grid-auto-rows: 1fr;
  align-content: center;
}
.grid.n2 { grid-template-columns: repeat(2, 1fr); }
.grid.n3 { grid-template-columns: repeat(2, 1fr); }
.grid.n4 { grid-template-columns: repeat(2, 1fr); }
.grid.n5, .grid.n6 { grid-template-columns: repeat(2, 1fr); }
.grid.n7, .grid.n8 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 900px) {
  .grid.n3 { grid-template-columns: repeat(3, 1fr); }
  .grid.n4 { grid-template-columns: repeat(2, 1fr); }
  .grid.n5, .grid.n6 { grid-template-columns: repeat(3, 1fr); }
  .grid.n7, .grid.n8 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------------- 聚焦模式 ----------------
   有人共享屏幕时：共享那块铺满整片区域，
   其他人收成右下角的小浮窗，自上而下叠放。
   没人共享时回到等分网格，每格一个大头像。 */
.grid.spot {
  position: relative;
  display: block;
  padding: 4px 16px 8px;
}

.grid.spot .tile.spotlight {
  position: absolute;
  inset: 4px 16px 8px;
}

.grid.spot .tile:not(.spotlight) {
  position: absolute;
  right: 28px;
  bottom: calc(22px + var(--i, 0) * 96px);
  width: clamp(116px, 15vw, 178px);
  height: clamp(76px, 9.8vw, 118px);
  border-radius: 14px;
  z-index: 6;
  background: rgba(14, 17, 25, .97);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .62);
  animation: spotIn .22s ease;
}

/* 浮窗里的头像按比例缩小，名字条贴着底部 */
.grid.spot .tile:not(.spotlight) .ava { gap: 5px; padding: 5px; }
.grid.spot .tile:not(.spotlight) .ava .ring { width: 52px; padding: 2px; }
.grid.spot .tile:not(.spotlight) .ava .aname { font-size: 11px; }
.grid.spot .tile:not(.spotlight) .ava .astate,
.grid.spot .tile:not(.spotlight) .host-tag,
.grid.spot .tile:not(.spotlight) .mute-mark { display: none; }
.grid.spot .tile:not(.spotlight) .name { font-size: 10.5px; left: 8px; bottom: 7px; padding: 3px 8px; }
.grid.spot .tile:not(.spotlight) .badge { font-size: 9.5px; top: 7px; right: 7px; padding: 3px 7px; }

@keyframes spotIn {
  from { opacity: 0; transform: scale(.94); }
}

/* 共享画面右上角的全屏按钮：竖屏手机上看 16:9 只是一条横带，全屏才看得清 */
.fsbtn,
.fitbtn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 9;
  width: 40px;
  height: 40px;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(10, 13, 20, .66);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: background .18s, transform .18s;
}
/* 两个按钮并排放在右上角：铺满（左）+ 全屏（右） */
.fitbtn { right: 60px; }
.fitbtn.on { background: rgba(61, 125, 255, .72); border-color: rgba(140, 185, 255, .6); }
.grid.spot .tile.spotlight .fsbtn { display: flex; }
.grid.spot .tile.spotlight .fitbtn { display: flex; }
/* 「共享中」角标让开两个按钮，否则叠在一起 */
.grid.spot .tile.spotlight .badge { right: 112px; }
.fsbtn:hover { background: rgba(61, 125, 255, .58); }
.fsbtn:active { transform: scale(.94); }
.fsbtn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 点全屏后独占整屏：去掉圆角、纯黑底、按比例塞满 */
.tile:fullscreen,
.grid.spot .tile.spotlight:fullscreen {
  border-radius: 0;
  border: 0;
  background: #000;
  width: 100vw;
  height: 100vh;
}
.tile:fullscreen video { object-fit: contain; }
.tile:fullscreen .fsbtn { top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); }
.tile:fullscreen .fitbtn { top: max(10px, env(safe-area-inset-top)); right: calc(max(10px, env(safe-area-inset-right)) + 50px); }

/* 「铺满」模式：竖屏下把 16:9 放大约 3 倍铺满舞台，四周被裁掉，靠拖动看其余部分。
   用 object-position 平移，不触发重排、不重新解码。 */
.tile.spotlight.fill video {
  object-fit: cover;
  touch-action: none;
  cursor: grab;
}
.tile.spotlight.fill:active video { cursor: grabbing; }
/* 铺满时右上角按钮压一层浅阴影，避免和画面同色看不清 */
.tile.spotlight.fill .fsbtn,
.tile.spotlight.fill .fitbtn { box-shadow: 0 2px 10px rgba(0, 0, 0, .55); }

/* 卡片 */
.tile {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(120% 110% at 50% 0%, rgba(255, 255, 255, .045) 0%, transparent 58%),
    #0e1119;
  border: 1px solid var(--line);
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, box-shadow .2s;
}
.tile.self { border-color: rgba(61, 125, 255, .32); box-shadow: inset 0 0 0 1px rgba(61, 125, 255, .12); }
.tile.screen { background: #000; border-color: rgba(61, 125, 255, .45); }

/* 层级：画面 0 < 头像 1 < 角标 3 */
.tile video { z-index: 0; }
.ava { z-index: 1; }
.tile .name, .tile .badge, .host-tag, .mute-mark { z-index: 3; }

/* 只有一个人时头像更大，避免大片空白 */
.tile:only-child .ava .ring { width: clamp(128px, 34vmin, 220px); }
.tile:only-child .ava .aname { font-size: clamp(17px, 2.6vmin, 22px); }

/* 默认不显示视频，只有共享 / 开摄像头时露出 */
.tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.tile.cam video, .tile.screen video { opacity: 1; }
.tile.cam video { object-fit: cover; }
.tile.mirror video { transform: scaleX(-1); }

/* 大头像（未共享时的默认视图） */
.ava {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: opacity .2s;
  padding: 18px;
}
.tile.cam .ava, .tile.screen .ava { opacity: 0; pointer-events: none; }

.ava .ring {
  width: clamp(112px, 32vmin, 196px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .06) 45%, rgba(61, 125, 255, .45));
  box-shadow: 0 14px 36px rgba(0, 0, 0, .55);
  transition: transform .25s;
}

/* 两个人（管理员 + 一个参会人）时是最常见的场景，头像再大一圈 */
.grid.n2 .ava .ring { width: clamp(124px, 30vmin, 220px); }
.tile.self .ava .ring {
  background: linear-gradient(160deg, #6aa0ff, #3d7dff 45%, rgba(120, 80, 255, .9));
  box-shadow: 0 14px 36px rgba(47, 107, 237, .35);
}
.ava .ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #fff;
}

.ava .aname {
  font-size: clamp(15px, 2.2vmin, 19px);
  font-weight: 600;
  letter-spacing: .3px;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.ava .astate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6f7889;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .05);
}
.ava .astate i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6f7889;
  display: block;
}
.tile.screen .ava .astate { display: none; }

/* 共享 / 开摄像头时的名字条 */
.tile .name {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 84px);
  padding: 5px 11px;
  border-radius: 9px;
  background: rgba(6, 8, 12, .72);
  border: 1px solid rgba(255, 255, 255, .07);
  backdrop-filter: blur(10px);
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity .2s;
}
.tile.cam .name, .tile.screen .name { opacity: 1; }

/* 共享中角标 */
.tile .badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 9px;
  background: rgba(61, 125, 255, .92);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  backdrop-filter: blur(8px);
}
.tile .badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 2s infinite;
}

/* 主持人标记 */
.host-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #cfd8ea;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

/* 静音标记 */
.mute-mark {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(232, 72, 76, .92);
  color: #fff;
}
.tile.mic-off .mute-mark { display: flex; }
.mute-mark svg { width: 14px; height: 14px; }

/* 底部控制条 */
.dock {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
}
.dock-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px;
  border-radius: 22px;
  background: rgba(18, 22, 30, .82);
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .55);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.dock-inner::-webkit-scrollbar { display: none; }

.ctl {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 66px;
  height: 58px;
  border-radius: 16px;
  color: #939dae;
  font-size: 11px;
  transition: background .15s, color .15s, transform .1s;
  flex-shrink: 0;
  user-select: none;
}
.ctl:hover { background: rgba(255, 255, 255, .06); color: var(--fg); }
.ctl:active { transform: scale(.96); }
.ctl svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.ctl.on { background: rgba(61, 125, 255, .16); color: #a6c2ff; }
.ctl.active { background: rgba(61, 125, 255, .9); color: #fff; }
.ctl.warn { background: rgba(232, 72, 76, .16); color: #ff9ea1; }
.ctl.disabled, .ctl:disabled { opacity: .34; cursor: not-allowed; }
.ctl.disabled:hover, .ctl:disabled:hover { background: none; }

/* 图标按状态切换：默认显示 ic-on，加了 .warn / .off 显示 ic-off */
.ctl .ic-off { display: none; }
.ctl.warn .ic-on, .ctl.off .ic-on { display: none; }
.ctl.warn .ic-off, .ctl.off .ic-off { display: block; }

.ctl.leave { color: #ff9ea1; }
.ctl.leave:hover { background: rgba(232, 72, 76, .16); }

/* 被主持人强制静音：按钮禁用 + 暗红 */
.ctl.locked {
  background: rgba(232, 72, 76, .1);
  color: #c98a8d;
  opacity: .75;
}

/* ---------------- 断线重连横幅 ---------------- */
.netbar {
  position: fixed;
  left: 50%;
  /* 顶栏高度约 52px，放在它下面，避免盖住会议号和连接状态 */
  top: calc(env(safe-area-inset-top) + 52px);
  transform: translateX(-50%);
  z-index: 130;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 24px);
  padding: 9px 17px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  animation: netIn .22s ease;
}
.netbar.waiting { background: rgba(214, 62, 66, .94); color: #fff; }
.netbar.waiting::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: netPulse 1s ease-in-out infinite;
}
.netbar.ok { background: rgba(47, 191, 113, .94); color: #04160c; font-weight: 600; }

@keyframes netIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
@keyframes netPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .2; }
}

@keyframes fadeIn { from { opacity: 0; } }

/* ---------------- 成员管理侧板 ---------------- */
.members {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 85;
  display: flex;
  flex-direction: column;
  width: min(350px, 88vw);
  background: rgba(13, 16, 23, .97);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(22px);
  box-shadow: -24px 0 70px rgba(0, 0, 0, .55);
  animation: memIn .2s ease;
}
@keyframes memIn {
  from { opacity: 0; transform: translateX(18px); }
}

.m-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 10px 16px;
}
.m-head h4 { margin: 0; font-size: 15px; font-weight: 600; }
.m-close {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 20px;
  line-height: 1;
  color: var(--dim);
}
.m-close:hover { background: rgba(255, 255, 255, .08); color: var(--fg); }

.m-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--line);
}
.m-tools .hint { margin: 0; font-size: 11px; }
.m-tools .ghost.warn {
  background: rgba(232, 72, 76, .16);
  border-color: rgba(232, 72, 76, .4);
  color: #ff9ea1;
}

.m-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px calc(18px + env(safe-area-inset-bottom));
}

.m-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  transition: background .15s;
}
.m-item:hover { background: rgba(255, 255, 255, .04); }

.m-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, .12);
}

.m-info { flex: 1; min-width: 0; }
.m-info b {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-sub { font-size: 11.5px; color: var(--dim); }

.m-act { display: flex; gap: 6px; flex-shrink: 0; }
.m-act button { padding: 6px 10px; font-size: 11.5px; border-radius: 9px; white-space: nowrap; }
.m-act [disabled] { opacity: .5; cursor: default; }

.m-self {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--dim);
  background: rgba(255, 255, 255, .05);
}

/* 房间列表里的锁定角标 */
.ri-lock {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(232, 72, 76, .14);
  color: #ff9ea1;
}

/* ---------------- 窄屏适配（手机为主要使用场景） ---------------- */
@media (max-width: 700px) {
  /* iOS 只在输入框字号 < 16px 时自动缩放整页，入会页必须 16px */
  .lobby {
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  /* margin:auto 比 align-items:center 稳：内容超高时归零，能从顶部开始滚 */
  .lobby > .card { margin: auto; max-width: 440px; }
  .card { padding: 22px 18px 18px; border-radius: 18px; }
  .card input { font-size: 16px; padding: 13px; }

  .bar { padding: 10px 12px; gap: 6px; }
  .bar .left { min-width: 0; flex: 1 1 0; overflow: hidden; }
  .bar .right { flex-shrink: 0; gap: 6px; }
  .status { display: none; }
  .tag { padding: 6px 11px; font-size: 12.5px; max-width: 46vw; }
  .tag.dim { display: none; }
  /* 拇指可点：至少 38px 高 */
  button.ghost, button.danger { padding: 9px 13px; font-size: 12.5px; min-height: 38px; }

  .grid { padding: 4px 10px 6px; gap: 10px; grid-auto-rows: minmax(150px, 1fr); overflow-y: auto; }
  .grid.n2, .grid.n3, .grid.n4, .grid.n5, .grid.n6, .grid.n7, .grid.n8 { grid-template-columns: 1fr; }

  /* 手机上聚焦模式：共享画面铺满，其余头像横排在右下角 */
  .grid.spot { padding: 2px 8px 4px; overflow: hidden; }
  .grid.spot .tile.spotlight { inset: 2px 8px 4px; border-radius: 14px; }

  /* 竖屏放 16:9 只能显示成一条横带，把上方黑区利用起来放提示 */
  .grid.spot .tile.spotlight::after {
    content: '双击画面放大 · 右上角可全屏';
    position: absolute;
    top: 62px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 7;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .13);
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
  }
  /* 铺满之后黑区没了，提示会压住画面，直接收掉 */
  .grid.spot .tile.spotlight.fill::after { display: none; }
  .fsbtn,
  .fitbtn { width: 44px; height: 44px; top: 8px; right: 8px; }
  .fitbtn { right: 58px; }
  .fsbtn svg,
  .fitbtn svg { width: 21px; height: 21px; }
  .grid.spot .tile:not(.spotlight) {
    width: 88px;
    height: 58px;
    right: calc(14px + var(--i, 0) * 96px);
    bottom: 14px;
    border-radius: 10px;
  }
  .grid.spot .tile:not(.spotlight) .ava .ring { width: 38px; }
  /* 窄屏浮窗太小，只留一张脸，文字全去掉免得被裁 */
  .grid.spot .tile:not(.spotlight) .ava .aname { display: none; }
  .grid.spot .tile:not(.spotlight) .name { display: none; }

  /* 手机屏幕本身小，头像反而要更大才看得清 */
  .ava { gap: 10px; padding: 14px; }
  .ava .ring { width: clamp(126px, 36vmin, 200px); }
  .grid.n2 .ava .ring { width: clamp(132px, 38vmin, 210px); }
  .tile:only-child .ava .ring { width: clamp(150px, 42vmin, 240px); }

  .dock { padding: 8px 8px calc(12px + env(safe-area-inset-bottom)); }
  .dock-inner { gap: 2px; padding: 6px; }
  .ctl { width: 58px; height: 54px; border-radius: 15px; }
  .ctl span { font-size: 10px; }
  .ctl svg { width: 19px; height: 19px; }

  .toast { bottom: 92px; font-size: 12px; }

  /* 手机上成员面板铺满，按钮收紧 */
  .members { width: 100%; border-left: 0; }
  .m-act button { padding: 7px 10px; font-size: 11.5px; min-height: 34px; }
  .netbar { font-size: 12px; padding: 8px 14px; }
}

/* 手机横屏：纵向空间紧张，顶栏和工具栏收窄，按钮只留图标 */
@media (max-height: 520px) and (orientation: landscape) {
  .bar { padding: 6px 10px 4px; }
  .tag { padding: 4px 9px; font-size: 11.5px; max-width: 40vw; }
  button.ghost, button.danger { padding: 6px 10px; font-size: 11.5px; min-height: 32px; }

  /* 横过来画面本来就快满屏了，提示收掉、按钮缩小别挡内容 */
  .grid.spot .tile.spotlight::after { display: none; }
  .fsbtn { width: 38px; height: 38px; top: 6px; right: 6px; }
  .fsbtn svg { width: 18px; height: 18px; }

  .grid { padding: 2px 10px; gap: 8px; }
  .ava { gap: 6px; padding: 8px; }
  .ava .ring { width: clamp(88px, 24vmin, 148px); }
  .grid.n2 .ava .ring { width: clamp(88px, 24vmin, 148px); }
  .ava .astate { display: none; }
  .ava .aname { font-size: 13px; }

  .dock { padding: 4px 10px calc(6px + env(safe-area-inset-bottom)); }
  .dock-inner { padding: 5px; gap: 2px; }
  .ctl { width: 56px; height: 42px; border-radius: 13px; }
  .ctl span { display: none; }
  .ctl svg { width: 20px; height: 20px; }

  .toast { bottom: 64px; }
  .grid.spot .tile:not(.spotlight) { width: 92px; height: 60px; }
}

@media (max-width: 420px) {
  .ctl { width: 52px; }
  .ctl svg { width: 18px; height: 18px; }
  .ctl span { font-size: 9.5px; }
}

/* ---------------- 提示条 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%) translateY(6px);
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(22, 27, 36, .96);
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  font-size: 13px;
  max-width: 84vw;
  text-align: center;
  opacity: 0;
  animation: toastIn .18s forwards;
  z-index: 60;
}
@keyframes toastIn { to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* 铺满时右下角被头像浮窗占着，提示条挪到顶部按钮行下方，谁也不压 */
.toast.up {
  top: calc(124px + env(safe-area-inset-top));
  bottom: auto;
  transform: translateX(-50%) translateY(-6px);
  animation-name: toastInTop;
}
@keyframes toastInTop { to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------------- 通用 ---------------- */
.muted { color: #5d6678; font-weight: 400; font-size: 12px; }
.empty { color: #5d6678; font-size: 13px; padding: 24px 4px; text-align: center; }

/* ---------------- 管理后台 ---------------- */
.dashPage {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 0;
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(61, 125, 255, .12) 0%, transparent 60%),
    var(--bg);
}

.dash {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 16px;
  padding: 4px 16px 16px;
  overflow: hidden;
}

@media (max-width: 820px) {
  .dash { grid-template-columns: 1fr; overflow: auto; }
}

/* 管理后台也要能在手机上用：房间行改纵向，按钮铺满一行方便点 */
@media (max-width: 560px) {
  .dash { padding: 4px 10px 12px; gap: 10px; }
  .panel { padding: 16px 14px; border-radius: 16px; }
  .panel input { font-size: 16px; padding: 13px 12px; }
  .room-item { flex-direction: column; align-items: stretch; gap: 10px; padding: 13px; }
  .ri-no { font-size: 15px; }
  .ri-actions { justify-content: flex-end; }
  .ri-actions .ghost, .ri-actions .danger { flex: 1 1 auto; min-height: 40px; }
}

.panel {
  background: rgba(20, 24, 33, .78);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 18px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(14px);
}

.panel.grow { overflow: hidden; }

.panel h3 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.panel label { display: block; margin: 12px 0 6px; font-size: 12px; color: var(--dim); }
.panel label:first-of-type { margin-top: 0; }

.panel input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(6, 8, 12, .7);
  color: var(--fg);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.panel input:focus { border-color: var(--accent); }

.panel .primary { margin-top: 18px; padding: 12px; border-radius: 12px; }

.roomlist { overflow: auto; flex: 1; min-height: 0; padding-right: 4px; }

.room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .028);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  transition: background .15s;
}
.room-item:hover { background: rgba(255, 255, 255, .05); }

.ri-main { min-width: 0; }

.ri-no {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ri-name { font-size: 13px; font-weight: 400; color: var(--fg); opacity: .85; }

.ri-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(47, 191, 113, .14);
  color: #4fd68c;
}
.ri-live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4fd68c;
}

.ri-meta { margin-top: 7px; font-size: 12px; color: var(--dim); }

.ri-meta code.pwd {
  background: rgba(255, 255, 255, .07);
  padding: 2px 7px;
  border-radius: 6px;
  color: #ffd479;
  cursor: pointer;
  font-size: 12px;
}

.ri-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ri-actions .ghost, .ri-actions .danger { white-space: nowrap; }
.ri-actions [disabled] { opacity: .5; cursor: default; }
