/* ============================================================
   天穹会议 · 网页通话页（/th）
   沿用工作台的浅色卡片语言，通话态切深色舞台。
   ============================================================ */

.th-body {
  background: var(--bg);
  overflow-x: hidden;
}

/* ------------------------------ 通用 ------------------------------ */

.th-body .brand { display: inline-flex; align-items: center; gap: 9px; }
.th-body .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(22, 119, 255, 0.28);
}
.th-body .brand-mark svg { width: 17px; height: 17px; fill: #fff; }
/* iOS：禁止横屏时自动放大字号，去掉按钮点击时的灰色高亮块 */
.th-body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.th-body .brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.th-body .field { display: grid; gap: 6px; }
.th-body .form-error {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--red-strong);
}
.th-body .form-error.show { display: flex; }
.th-body .form-error .ico { width: 14px; height: 14px; flex: 0 0 auto; }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--blue-600);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.link:hover { color: var(--blue-700); text-decoration: underline; }

/* ------------------------------ 入口 ------------------------------ */

.th-lobby {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 460px at 8% -8%, #e8f1ff 0%, rgba(232, 241, 255, 0) 62%),
    radial-gradient(700px 420px at 96% 6%, #f0f6ff 0%, rgba(240, 246, 255, 0) 58%),
    var(--bg);
}

.th-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}
.th-top-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--ink-500);
  font-size: 11.5px;
  backdrop-filter: blur(6px);
}
.th-top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.th-login-link {
  font-size: 12.5px;
  color: var(--ink-500);
  padding: 4px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.th-login-link:hover { color: var(--blue-700); border-bottom-color: currentColor; }
.th-top-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-300);
}
.th-top-link { margin-left: auto; }

.th-main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 28px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 396px;
  gap: 56px;
  align-items: center;
}

.th-intro { max-width: 560px; }

.th-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--blue-700);
  letter-spacing: 0.02em;
}
.th-kicker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.12);
}

.th-intro h1 {
  margin-top: 14px;
  font-size: 40px;
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.028em;
  color: var(--ink-900);
}

.th-lead {
  margin-top: 16px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-600);
  max-width: 460px;
}

.th-points {
  margin-top: 30px;
  display: grid;
  gap: 16px;
}
.th-points li { display: flex; gap: 12px; align-items: flex-start; }
.th-point-ico {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-600);
  box-shadow: var(--shadow-xs);
}
.th-point-ico .ico { width: 16px; height: 16px; }
.th-points b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-800);
  line-height: 1.4;
}
.th-points em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-500);
}

.th-scan {
  margin-top: 34px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(8px);
}
.th-scan-code {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line-soft);
  overflow: hidden;
  flex: 0 0 auto;
}
.th-scan-code svg, .th-scan-code img { width: 100%; height: 100%; display: block; }
.th-scan-text { display: grid; gap: 3px; }
.th-scan-text b { font-size: 13px; font-weight: 600; color: var(--ink-800); }
.th-scan-text span { font-size: 12px; color: var(--ink-500); }

/* 入会卡片 */
.th-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 26px 26px 22px;
  display: grid;
  gap: 16px;
}
.th-card-head { display: grid; gap: 4px; }
.th-card-title { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink-900); }
.th-card-sub { font-size: 12.5px; color: var(--ink-500); }

.th-card .input { height: 44px; }
.th-card .input-no {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.14em;
  padding-left: 13px;
}
.th-card .input-no::placeholder {
  font-family: var(--font);
  font-size: 13.5px;
  letter-spacing: 0;
  color: var(--ink-300);
}
.th-hint { font-size: 11.5px; color: var(--ink-400); line-height: 1.5; }

.th-card-foot {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-400);
}
.th-card-foot .ico { width: 13px; height: 13px; margin-top: 2px; flex: 0 0 auto; }

/* ------------------------------ 通话 ------------------------------ */

.th-call {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #0d1014;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  animation: th-call-in 0.36s var(--ease-out) both;
}
@keyframes th-call-in {
  from { opacity: 0; transform: scale(1.015); }
  to   { opacity: 1; transform: none; }
}

.th-stage {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, #1b2027 0%, #0d1014 62%),
    #0d1014;
}

.th-remote-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(34px) saturate(1.1) brightness(0.55);
  transform: scale(1.12);
  background: #0d1014;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.th-remote-bg.live { opacity: 1; }

.th-remote {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* 具体用 cover 还是 contain 由脚本按"画面比例 vs 容器比例"决定：
     横屏内容放竖屏手机 → cover 铺满；竖屏内容放电脑 → contain 完整显示。
     两者都不拉伸，也不留黑边。这里给 cover 作为首帧前的默认值。 */
  object-fit: cover;
  object-position: center;
  background: transparent;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.th-remote.live { opacity: 1; }

/* ------------------------------ 多人网格 ------------------------------
   一人一格。排法：1 人铺满 / 2 人上下 / 3 人一排 / 4 人上三下一 /
   5 人上三下二 / 6 人上三下三 / 更多人三列往下加行。
   格子全部绝对定位，换布局只改 left/top/width/height —— 不重建 DOM，
   移动端（X5）一旦把 <video> 挪到别的父节点就可能不再出画，这条必须守住。 */
.th-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.th-tile {
  position: absolute;
  overflow: hidden;
  border-radius: 12px;
  background: #151a20;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: left 0.26s var(--ease-out), top 0.26s var(--ease-out),
              width 0.26s var(--ease-out), height 0.26s var(--ease-out),
              border-radius 0.26s var(--ease-out);
  will-change: left, top, width, height;
}

/* 主画面（开着摄像头的那一位）去掉圆角，铺满整块 */
.th-tile.main {
  border-radius: 0;
  box-shadow: none;
  background: #0d1014;
}

.th-tile-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #0f1318;
  display: block;
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}
.th-tile-video.live { opacity: 1; }

/* 本地画面照镜子：不镜像的话，抬手时屏幕里是反的 */
.th-tile.self .th-tile-video { transform: scaleX(-1); }

.th-tile-avatar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 100% at 50% 0%, #2a313b 0%, #171b21 100%);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  transition: opacity 0.2s var(--ease);
}
.th-tile-avatar.hide { opacity: 0; }
.th-tile-avatar span { line-height: 1; }

.th-tile-name {
  position: absolute;
  left: 7px;
  bottom: 7px;
  max-width: calc(100% - 38px);
  height: 19px;
  padding: 0 7px;
  border-radius: 5px;
  background: rgba(9, 12, 16, 0.56);
  backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.94);
  font-size: 10.5px;
  line-height: 19px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.th-tile-mic {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: rgba(9, 12, 16, 0.56);
  color: #ff8a8a;
  display: none;
  align-items: center;
  justify-content: center;
}
.th-tile-mic .ico { width: 11px; height: 11px; }
.th-tile.muted .th-tile-mic { display: flex; }

/* 格子很小的时候把角标收起来，免得糊成一团 */
.th-tile.tiny .th-tile-name { display: none; }
.th-tile.tiny .th-tile-mic { display: none !important; }


.th-empty {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 0 24px 80px;
  color: rgba(255, 255, 255, 0.92);
  /* 底下现在是自己的格子（深底 + 大字头像），不加这层遮罩就全透上来，
     文字和头像叠在一起什么都看不清。 */
  background: #0d1014;
  transition: opacity 0.25s var(--ease);
}
.th-empty.hide { opacity: 0; pointer-events: none; }
.th-empty-ico {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.th-empty-ico .ico { width: 24px; height: 24px; color: rgba(255, 255, 255, 0.6); }
.th-empty b { font-size: 15px; font-weight: 600; }
.th-empty span {
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.48);
  max-width: 300px;
}
.th-empty .btn { margin-top: 12px; }
.th-empty .btn .ico { width: 14px; height: 14px; }

/* 本地画面 */
.th-self {
  position: absolute;
  right: 20px;
  bottom: 108px;
  width: 200px;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: #1a1f26;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease);
  z-index: 3;
}
.th-self:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.8); }
.th-self:active { transform: scale(0.98); }
.th-self.dragging { transition: none; opacity: 0.9; }

.th-local {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #1a1f26;
  transform: scaleX(-1);
  display: block;
}
.th-local.no-mirror { transform: none; }
.th-local.hide { display: none; }

.th-self-avatar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 100% at 50% 0%, #2a313b 0%, #171b21 100%);
  color: rgba(255, 255, 255, 0.9);
  font-size: 28px;
  font-weight: 500;
}
.th-self-avatar.hide { display: none; }

.th-self-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: rgba(9, 12, 16, 0.56);
  backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.92);
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
}
.th-self-state {
  position: absolute;
  right: 7px;
  top: 7px;
  height: 20px;
  padding: 0 6px;
  border-radius: 5px;
  background: rgba(22, 119, 255, 0.86);
  color: #fff;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(4px);
}
.th-self-state.hide { display: none; }
.th-self-state .ico { width: 11px; height: 11px; }

/* 点一下小窗：主次画面互换，远端缩到角落，自己铺满 */
.th-stage.swapped .th-self {
  inset: 0;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #0d1014;
  z-index: 1;
}
.th-stage.swapped .th-self:hover { transform: none; box-shadow: none; }
.th-stage.swapped .th-self .th-local { object-fit: contain; background: #0d1014; }
.th-stage.swapped .th-self .th-self-tag {
  left: 16px;
  bottom: calc(96px + env(safe-area-inset-bottom));
}
.th-stage.swapped .th-remote-bg { opacity: 0 !important; }
.th-stage.swapped .th-remote {
  inset: auto 20px calc(108px + env(safe-area-inset-bottom)) auto;
  width: 200px;
  height: 150px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  background: #1a1f26;
  object-fit: cover;
  z-index: 3;
  opacity: 1;
}

/* 顶部 HUD */
.th-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 30px;
  background: linear-gradient(180deg, rgba(8, 10, 13, 0.72) 0%, rgba(8, 10, 13, 0) 100%);
  pointer-events: none;
}
.th-hud > * { pointer-events: auto; }
.th-hud-left, .th-hud-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.th-hud-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.th-hud-mark svg { width: 15px; height: 15px; fill: rgba(255, 255, 255, 0.9); }

.th-hud-no {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.th-hud-no:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.th-hud-no .ico { width: 12px; height: 12px; opacity: 0.6; }
.th-hud-no .mono { letter-spacing: 0.1em; }

.th-hud-timer {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.46);
  letter-spacing: 0.06em;
}

.th-quality {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
}
.th-quality i { width: 3px; border-radius: 1px; background: rgba(255, 255, 255, 0.18); }
.th-quality i.q1 { height: 5px; }
.th-quality i.q2 { height: 9px; }
.th-quality i.q3 { height: 13px; }
.th-quality em {
  font-style: normal;
  margin-left: 5px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.5);
}
.th-quality.good i { background: #35c46a; }
.th-quality.fair i.q1, .th-quality.fair i.q2 { background: #e0a12a; }
.th-quality.bad i.q1 { background: #e5484d; }

.th-hud-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s var(--ease), transform 0.12s var(--ease);
}
.th-hud-btn:hover { background: rgba(255, 255, 255, 0.16); }
.th-hud-btn:active { transform: scale(0.94); }
.th-hud-btn .ico { width: 15px; height: 15px; }

/* 底部控制条 */
.th-controls {
  position: absolute;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(20, 24, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.th-ctrl {
  position: relative;
  width: 66px;
  height: 58px;
  border-radius: 13px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), transform 0.12s var(--ease);
}
.th-ctrl:hover { background: rgba(255, 255, 255, 0.1); }
.th-ctrl:active { transform: scale(0.96); }
.th-ctrl .ico { width: 20px; height: 20px; }
.th-ctrl-label { font-size: 10px; color: rgba(255, 255, 255, 0.5); letter-spacing: 0.01em; }

/* 关闭态：红底、白色图标，一眼看出"这路已经关了" */
.th-ctrl.off { background: rgba(229, 72, 77, 0.16); }
.th-ctrl.off .ico { color: #ff8185; }
.th-ctrl.off:hover { background: rgba(229, 72, 77, 0.26); }
.th-ctrl.off .th-ctrl-label { color: #ff9b9e; }

.th-ctrl.vcam-on { background: rgba(22, 119, 255, 0.9); }
.th-ctrl.vcam-on:hover { background: var(--blue-600); }
.th-ctrl.vcam-on .th-ctrl-label { color: rgba(255, 255, 255, 0.82); }
.th-ctrl.vcam-on .ico { color: #fff; }

.th-ctrl-leave {
  width: 74px;
  background: var(--red);
  color: #fff;
}
.th-ctrl-leave:hover { background: var(--red-strong); }
.th-ctrl-leave .th-ctrl-label { color: rgba(255, 255, 255, 0.82); }

.th-ctrl[disabled] { opacity: 0.32; cursor: not-allowed; }
.th-ctrl[disabled]:hover { background: transparent; }

/* 断线横幅 */
.th-banner {
  position: absolute;
  left: 50%;
  top: calc(64px + env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(26, 31, 40, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffd9a8;
  font-size: 12px;
  backdrop-filter: blur(8px);
}
.th-banner.hide { display: none; }
.th-banner .ico { width: 14px; height: 14px; }

/* 远端声音被浏览器拦下时的浮层：必须显眼、必须可点 */
.th-audio-tip {
  position: absolute;
  left: 50%;
  top: calc(64px + env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(37, 99, 235, 0.94);
  color: #fff;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 26px -10px rgba(37, 99, 235, 0.95);
  animation: thAudioPulse 2.2s ease-in-out infinite;
}
.th-audio-tip.hide { display: none; }
.th-audio-tip svg { width: 15px; height: 15px; flex: 0 0 15px; }
.th-audio-tip:active { transform: translateX(-50%) scale(0.97); }
@keyframes thAudioPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.035); }
}

/* 轻提示 */
.th-toast {
  position: absolute;
  left: 50%;
  bottom: calc(104px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(6px);
  z-index: 7;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(20, 24, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  backdrop-filter: blur(10px);
  max-width: calc(100% - 40px);
  text-align: center;
}
.th-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.th-toast.hide { display: none; }

/* ------------------------------ 弹层 ------------------------------ */

.th-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.th-sheet.hide { display: none; }
.th-sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 18, 0.52);
  backdrop-filter: blur(3px);
  animation: th-mask-in 0.2s var(--ease) both;
}
@keyframes th-mask-in { from { opacity: 0; } to { opacity: 1; } }

.th-panel {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: grid;
  gap: 16px;
  animation: th-panel-in 0.28s var(--ease-out) both;
}
@keyframes th-panel-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.th-panel-head { display: flex; align-items: flex-start; gap: 11px; }
.th-panel-ico {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
}
.th-panel-ico .ico { width: 17px; height: 17px; }
.th-panel-head h3 { font-size: 15px; font-weight: 600; color: var(--ink-900); line-height: 1.4; }
.th-panel-head p { margin-top: 2px; font-size: 12px; color: var(--ink-500); line-height: 1.5; }
.th-panel-head .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.th-panel-head .icon-btn .ico { width: 15px; height: 15px; }

/* 虚拟摄像头 */
.th-vcam-stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  /* 深色渐变而不是纯黑：竖屏视频在宽容器里两侧留白时，
     看起来像画框而不是"黑边" */
  background: radial-gradient(120% 100% at 50% 0%, #232a34 0%, #0e1217 100%);
  aspect-ratio: 16 / 10;
  max-height: 46vh;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.th-vcam-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: none;
}
.th-vcam-stage.has-video video { display: block; }

.th-vcam-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  padding: 16px;
}
.th-vcam-drop.hide { display: none; }
.th-vcam-drop-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.th-vcam-drop-ico .ico { width: 19px; height: 19px; color: rgba(255, 255, 255, 0.6); }
.th-vcam-drop b { font-size: 13px; font-weight: 600; }
.th-vcam-drop span { font-size: 11.5px; color: rgba(255, 255, 255, 0.45); }
.th-vcam-drop .btn { margin-top: 8px; }
.th-vcam-stage.dragover { box-shadow: inset 0 0 0 2px var(--blue-500); }

.th-vcam-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 22px 12px 9px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.66) 100%);
  color: #fff;
  font-size: 11.5px;
}
.th-vcam-meta.hide { display: none; }
.th-vcam-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-vcam-meta em { font-style: normal; color: rgba(255, 255, 255, 0.55); flex: 0 0 auto; }

.th-vcam-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.th-vcam-bar.hide { display: none; }
.th-vcam-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.th-vcam-btn:hover { background: var(--bg-soft); }
.th-vcam-btn .ico { width: 14px; height: 14px; }
.th-vcam-track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.th-vcam-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--blue-600);
  transition: width 0.2s linear;
}
.th-vcam-time { font-size: 10.5px; color: var(--ink-400); flex: 0 0 auto; }

.th-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-600);
  cursor: pointer;
  user-select: none;
  flex: 0 0 auto;
}
.th-switch input { width: 13px; height: 13px; accent-color: var(--blue-600); margin: 0; }

.th-vcam-tip {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--blue-50);
  color: var(--ink-600);
  font-size: 11.5px;
  line-height: 1.6;
}
.th-vcam-tip .ico { width: 13px; height: 13px; color: var(--blue-600); margin-top: 2px; flex: 0 0 auto; }

.th-panel-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

/* 邀请 */
.th-invite-qr {
  width: 220px;
  height: 220px;
  margin: 2px auto 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.th-invite-qr svg, .th-invite-qr img { width: 100%; height: 100%; display: block; }
.th-invite-qr .th-qr-fail {
  font-size: 11.5px;
  color: var(--ink-400);
  text-align: center;
  line-height: 1.6;
  padding: 0 12px;
}

.th-invite-no {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-500);
}
.th-invite-no b { font-size: 15px; font-weight: 600; color: var(--ink-900); letter-spacing: 0.12em; }

.th-invite-link { display: flex; gap: 8px; }
.th-invite-link .input { height: 38px; font-size: 12px; color: var(--ink-600); }
.th-invite-link .btn { flex: 0 0 auto; }

.th-invite-note {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-400);
  line-height: 1.6;
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 980px) {
  .th-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 8px 22px 44px;
    align-items: start;
    /* 单列时不要再把两行拉高填满屏幕，否则标题和卡片之间会出现一大片空白 */
    align-content: start;
  }
  .th-intro { max-width: none; }
  .th-intro h1 { font-size: 32px; }
  .th-card { max-width: 460px; }
}

@media (max-width: 640px) {
  .th-top {
    padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  }
  .th-top-tag { display: none; }
  .th-main {
    padding: 6px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
    gap: 28px;
  }
  .th-kicker { font-size: 11.5px; }
  .th-intro h1 { font-size: 26px; line-height: 1.24; margin-top: 8px; }
  .th-lead { font-size: 13px; line-height: 1.7; margin-top: 10px; }
  /* 手机上先把"输入会议号"递到眼前：卖点和二维码都是给桌面端看的，
     手机用户不需要扫自己屏幕上这张码 */
  .th-points, .th-scan { display: none; }
  .th-card { padding: 18px 16px 16px; border-radius: 16px; gap: 14px; }

  .th-self {
    width: 116px;
    right: 12px;
    bottom: calc(96px + env(safe-area-inset-bottom));
    border-radius: 12px;
  }
  .th-controls {
    gap: 4px;
    padding: 6px;
    border-radius: 16px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right));
  }
  .th-ctrl { width: 60px; height: 54px; border-radius: 12px; }
  .th-ctrl .ico { width: 19px; height: 19px; }
  .th-ctrl-leave { width: 62px; }
  .th-hud {
    padding: calc(10px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 24px max(12px, env(safe-area-inset-left));
  }
  /* 顶栏图标按钮从 32 提到 38：手指能点到，仍能挤在会议号右边 */
  .th-hud-btn { width: 38px; height: 38px; border-radius: 10px; }
  .th-hud-btn .ico { width: 17px; height: 17px; }
  .th-hud-timer { display: none; }
  .th-quality em { display: none; }
  .th-toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .th-ctrl { width: 54px; }
  .th-ctrl-label { font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .th-call, .th-panel, .th-sheet-mask { animation: none; }
  .th-self { transition: none; }
}

/* 发起通话：登录客服专用，和「进入通话」上下排列但视觉上退一级 */


/* ------------------------------ iOS 专项 ------------------------------ */

/* Safari 在输入框字号小于 16px 时，聚焦会自动把页面放大一截，
   通话页一放大，底部控制条就被顶出屏幕。只对 iOS 生效，不动桌面端排版。 */
@supports (-webkit-touch-callout: none) {
  .th-body input,
  .th-body select,
  .th-body textarea,
  .th-body .input { font-size: 16px; }

  /* 会议号本身用等宽字，16px 会偏大，单独收一点回来（仍不低于 16） */
  .th-body .th-card .input-no { font-size: 16px; letter-spacing: 0.12em; }

  /* 有刘海的横屏：左右留出安全区，别让控制条压在圆角上 */
  .th-hud { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
}

/* ------------------------------ 会议门禁（锁定 / 密码 / 等待室） ------------------------------ */

.th-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 196, 74, 0.16);
  color: #ffd479;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.th-lock-pill .ico { width: 11px; height: 11px; }
.th-lock-pill.hide { display: none; }

.th-hud-btn { position: relative; }
.th-hud-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5a5f;
  box-shadow: 0 0 0 2px rgba(14, 18, 23, 0.85);
}
.th-hud-dot[hidden] { display: none; }

/* 设置面板：每块一个卡片，界限清楚，不与等待室状态混在一起 */
.th-set { gap: 12px; }
.th-set-block {
  display: grid;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f9fb;
}
.th-set-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.th-set-head b { font-size: 12.5px; font-weight: 600; color: var(--ink-900); }
.th-set-head em { font-style: normal; font-size: 11px; color: var(--ink-500); }

.th-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.th-set-copy b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-900); }
.th-set-copy em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-500);
}

.th-set-form { display: flex; gap: 7px; }
.th-set-form .input { flex: 1; min-width: 0; height: 36px; font-size: 13px; }
.th-set-form .btn { flex: 0 0 auto; height: 36px; }
.th-set-tip { font-size: 10.5px; line-height: 1.55; color: var(--ink-500); }
.th-set-empty { padding: 4px 1px; font-size: 11.5px; color: var(--ink-500); }

/* 开关：用原生 checkbox 保键盘可达，外观自己画 */
.th-toggle { position: relative; flex: 0 0 auto; width: 44px; height: 26px; }
.th-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.th-toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d6dae2;
  transition: background 0.18s var(--ease);
}
.th-toggle span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.18s var(--ease);
}
.th-toggle input:checked + span { background: var(--blue-600); }
.th-toggle input:checked + span::after { transform: translateX(18px); }
.th-toggle input:focus-visible + span { outline: 2px solid var(--blue-500); outline-offset: 2px; }

.th-wait-list, .th-mate-list { display: grid; gap: 6px; }
.th-wait-item, .th-mate-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.th-wait-avatar {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-50);
  color: var(--blue-600);
  font-size: 11.5px;
  font-weight: 600;
}
.th-wait-info { flex: 1; min-width: 0; }
.th-wait-info b, .th-mate-item b {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.th-mate-item > b { flex: 1; min-width: 0; }
.th-wait-info b i, .th-mate-item b i {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--ink-500);
  background: #eef1f5;
  border-radius: 4px;
  padding: 1px 4px;
}
.th-wait-info em { display: block; margin-top: 1px; font-style: normal; font-size: 10.5px; color: var(--ink-500); }
.th-wait-actions { display: flex; gap: 5px; flex: 0 0 auto; }

.btn.btn-xs { height: 27px; padding: 0 9px; font-size: 11px; border-radius: 7px; }

/* 访客等待室：独立全屏层，压在所有弹层之上 */
.th-waitroom {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(120% 100% at 50% 0%, #1a2230 0%, #0b0f14 72%);
}
.th-waitroom.hide { display: none; }
.th-waitroom-card {
  width: min(340px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  text-align: center;
  color: #fff;
}
.th-waitroom-ico {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffd479;
}
.th-waitroom-ico .ico { width: 24px; height: 24px; }
.th-waitroom-title { font-size: 17px; font-weight: 600; letter-spacing: 0.01em; }
.th-waitroom-text {
  min-height: 21px;
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.62);
}
.th-waitroom-dots { display: flex; gap: 5px; margin: 2px 0 4px; }
.th-waitroom-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  animation: th-wait-bounce 1.2s infinite ease-in-out;
}
.th-waitroom-dots i:nth-child(2) { animation-delay: 0.15s; }
.th-waitroom-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes th-wait-bounce {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}
.th-waitroom .btn-secondary {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
  background: transparent;
}
.th-waitroom .btn-primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.th-waitroom .hide { display: none; }

@media (max-width: 420px) {
  .th-lock-pill { padding: 0 6px; }
  .th-lock-pill span { display: none; }
  .th-set { padding: 16px; }
  .th-wait-item { gap: 7px; }
}
.th-waitroom-dots.hide { display: none; }
