/* ==================================================================
   云会 · 样式表
   结构：基础 / 大厅 / 会议 / 侧栏 / 弹窗 / 响应式
   ================================================================== */

:root {
  --bg: #070b16;
  --bg-soft: #0a1120;
  --surface: #0e1729;
  --surface-2: #121d33;
  --surface-3: #17233c;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.26);
  --text: #e9eefb;
  --muted: #91a1bd;
  --muted-2: #6b7a96;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.8);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100dvh;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.36);
}

/* ------------------------------------------------------------------
   大厅
   ------------------------------------------------------------------ */

.lobby {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 700px at 12% -12%, rgba(99, 102, 241, 0.24), transparent 60%),
    radial-gradient(900px 620px at 92% 8%, rgba(34, 211, 238, 0.15), transparent 55%),
    linear-gradient(180deg, #070b16 0%, #060a13 100%);
}

.lobby::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 0%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 65% at 50% 0%, #000 25%, transparent 78%);
  pointer-events: none;
}

.lobby-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.55;
}

.lobby-glow-a {
  width: 420px;
  height: 420px;
  background: rgba(99, 102, 241, 0.28);
  top: 6%;
  left: -140px;
}

.lobby-glow-b {
  width: 360px;
  height: 360px;
  background: rgba(34, 211, 238, 0.16);
  right: -120px;
  bottom: 4%;
}

.lobby-header {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 36px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.4);
  color: #fff;
}

.brand-mark .icon {
  width: 22px;
  height: 22px;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.brand-text {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: 0.4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-text em {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.4px;
  color: var(--muted-2);
}

.lobby-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secure-pill,
.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(14, 23, 41, 0.6);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.secure-pill .icon {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.version-pill {
  color: var(--muted-2);
}

.lobby-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: auto;
  padding: 28px 36px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  gap: clamp(32px, 5vw, 90px);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: rgba(99, 102, 241, 0.1);
  color: #c7d2fe;
  font-size: 12.5px;
  letter-spacing: 0.3px;
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14);
}

.lobby-intro h1 {
  margin: 26px 0 18px;
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.1;
  letter-spacing: -1.5px;
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(100deg, #a5b4fc 0%, #22d3ee 55%, #6ee7b7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro-text {
  max-width: 470px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.75;
}

.feature-list {
  margin: 34px 0 30px;
  display: grid;
  gap: 14px;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(18, 29, 51, 0.75);
  color: #a5b4fc;
}

.feature-icon .icon {
  width: 19px;
  height: 19px;
}

.feature-list b {
  display: block;
  font-size: 14.5px;
  font-weight: 650;
  margin-bottom: 3px;
}

.feature-list small {
  color: var(--muted-2);
  font-size: 12.5px;
}

.intro-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted-2);
  font-size: 12.5px;
}

.intro-foot b {
  color: var(--text);
  font-weight: 650;
}

.avatar-stack {
  display: flex;
}

.avatar-stack span {
  width: 30px;
  height: 30px;
  margin-left: -9px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--c), rgba(255, 255, 255, 0.16));
  border: 2px solid #08101e;
  color: #fff;
  font-size: 11px;
  font-weight: 650;
}

.avatar-stack span:first-child {
  margin-left: 0;
}

/* ------------------------------------------------------------------
   加入卡片 / 预览
   ------------------------------------------------------------------ */

.join-wrap {
  width: 100%;
  max-width: 420px;
  justify-self: end;
}

.join-card {
  position: relative;
  padding: 16px;
  border-radius: 26px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(165deg, rgba(20, 31, 54, 0.94), rgba(10, 17, 32, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.join-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(129, 140, 248, 0.5), transparent 35%, transparent 70%, rgba(34, 211, 238, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.preview {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 17px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(99, 102, 241, 0.22), transparent 62%),
    linear-gradient(160deg, #16223a, #0a1120 70%);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(4, 8, 18, 0.72));
  pointer-events: none;
}

#previewVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: #050912;
}

#previewVideo.mirror {
  transform: scaleX(-1);
}

.preview.has-video #previewVideo {
  opacity: 1;
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.preview.has-video .preview-placeholder {
  opacity: 0;
  pointer-events: none;
}

.preview-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.preview-placeholder-text {
  font-size: 12px;
  color: var(--muted);
  max-width: 82%;
  text-align: center;
  line-height: 1.5;
}

.preview-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 99px;
  background: rgba(6, 11, 22, 0.66);
  border: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(10px);
  font-size: 11px;
  color: #dbe4f7;
}

.preview-chip.ghost {
  margin-left: auto;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  line-height: 24px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.preview-toolbar {
  position: absolute;
  bottom: 13px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 7px;
  border-radius: 99px;
  background: rgba(7, 12, 24, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(14px);
  z-index: 3;
}

.round-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.12);
  color: #e6ecfa;
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.round-btn:hover {
  background: rgba(148, 163, 184, 0.22);
  transform: translateY(-1px);
}

.round-btn .icon {
  width: 18px;
  height: 18px;
}

.round-btn .i-off {
  display: none;
}

.round-btn.is-off {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

.round-btn.is-off .i-on {
  display: none;
}

.round-btn.is-off .i-off {
  display: block;
}

.join-form {
  padding: 18px 6px 6px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field input,
.field select,
.modal-body select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(7, 12, 24, 0.72);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  appearance: none;
}

.field input::placeholder {
  color: #5b6a86;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.7);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
  background: rgba(9, 15, 30, 0.9);
}

.room-input input {
  padding-right: 70px;
}

.text-btn {
  position: absolute;
  right: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.14);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.18s ease;
}

.text-btn:hover {
  background: rgba(99, 102, 241, 0.26);
}

.btn-primary {
  width: 100%;
  height: 52px;
  margin-top: 4px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(120deg, #6366f1, #4f46e5 55%, #0891b2);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.34);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 16px 34px rgba(79, 70, 229, 0.42);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.btn-primary .icon {
  width: 18px;
  height: 18px;
}

.btn-primary.small {
  width: auto;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: 10px;
  margin: 0;
}

.form-note {
  margin-top: 12px;
  text-align: center;
  font-size: 11.5px;
  color: #62708a;
  line-height: 1.55;
}

.form-error {
  margin-top: 2px;
  font-size: 12px;
  color: #fda4af;
  line-height: 1.55;
}

.join-tip {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 12px;
}

.join-tip .icon {
  width: 14px;
  height: 14px;
}

.lobby-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 36px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #4f5d78;
  font-size: 11.5px;
}

/* ------------------------------------------------------------------
   会议布局
   ------------------------------------------------------------------ */

.meeting {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 620px at 50% -18%, rgba(56, 74, 130, 0.35), transparent 62%),
    radial-gradient(900px 500px at 100% 100%, rgba(8, 145, 178, 0.1), transparent 60%),
    #070b16;
  overflow: hidden;
}

.meeting-header {
  flex: 0 0 auto;
  height: 66px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 22, 0.6);
  backdrop-filter: blur(14px);
  z-index: 8;
}

.meeting-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.meeting-title {
  min-width: 0;
}

.meeting-title h1 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

.meeting-meta {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.meta-btn,
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.meta-btn {
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: 6px;
  color: var(--muted);
  transition: background 0.16s ease, color 0.16s ease;
}

.meta-btn:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.meta-btn .icon,
.meta-item .icon {
  width: 13px;
  height: 13px;
  opacity: 0.8;
}

.meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.4);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}

.status-dot.offline {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.14);
}

.meeting-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.07);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #dbe4f7;
  font-size: 12.5px;
  font-weight: 550;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.btn-ghost:hover {
  background: rgba(148, 163, 184, 0.14);
  border-color: var(--line-strong);
}

.btn-ghost .icon {
  width: 15px;
  height: 15px;
}

.danger-text {
  color: #fca5a5;
}

.danger-text:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
}

.meeting-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.stage {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------------------------- 视频网格 ---------------------------- */

.video-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  padding: 20px 20px 116px;
  overflow: auto;
  align-content: center;
  align-items: center;
  justify-content: center;
}

.video-grid[data-count="1"] {
  grid-template-columns: minmax(0, 900px);
}

.video-grid[data-count="1"] .tile {
  width: min(100%, calc((100dvh - 230px) * 1.6));
  justify-self: center;
}

.video-grid[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

.video-grid[data-count="3"],
.video-grid[data-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .video-grid[data-share="1"][data-count] {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    padding-top: 12px;
  }

  .video-grid[data-share="1"] .tile.sharing {
    order: -1;
  }
}

.tile {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 150px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background:
    radial-gradient(circle at 50% 40%, rgba(99, 102, 241, 0.16), transparent 60%),
    linear-gradient(155deg, #111c31, #090f1d 75%);
  isolation: isolate;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tile:hover {
  border-color: rgba(148, 163, 184, 0.28);
}

.tile.speaking {
  border-color: rgba(52, 211, 153, 0.65);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.55), 0 0 32px rgba(52, 211, 153, 0.16);
}

.tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050912;
  transition: opacity 0.25s ease;
  z-index: 1;
}

.tile video.mirror {
  transform: scaleX(-1);
}

.tile.sharing video {
  object-fit: contain;
  transform: none;
  background: #03060d;
}

.tile.self-sharing video {
  opacity: 0;
}

.tile.self-sharing .tile-avatar {
  opacity: 0;
}

.tile-self-share {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: #e2e8f0;
  background:
    radial-gradient(circle at 50% 42%, rgba(99, 102, 241, 0.28), transparent 62%),
    linear-gradient(160deg, #0a1120, #05080f);
}

.tile-self-share .icon {
  width: clamp(28px, 4vw, 40px);
  height: clamp(28px, 4vw, 40px);
  color: #a5b4fc;
}

.tile-self-share strong {
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 600;
}

.tile-self-share small {
  font-size: clamp(10px, 1.1vw, 12px);
  color: #94a3b8;
}

.tile.video-off video {
  opacity: 0;
}

.tile-avatar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 0;
}

.tile:not(.video-off) .tile-avatar {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.avatar-circle {
  width: clamp(64px, 9vw, 104px);
  height: clamp(64px, 9vw, 104px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 700;
  color: #fff;
  background: var(--c, #6366f1);
  background: linear-gradient(135deg, var(--c, #6366f1), color-mix(in srgb, var(--c, #6366f1) 45%, #0b1120));
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  user-select: none;
}

.tile-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 26px 12px 10px;
  background: linear-gradient(180deg, transparent, rgba(3, 7, 16, 0.82));
  pointer-events: none;
}

.tile-name {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 550;
  color: #eef3ff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.tile-name .name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.host-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 17px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: #fcd34d;
  font-size: 9.5px;
  font-weight: 650;
}

.tile-mic {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 9, 18, 0.66);
  color: #cbd5e1;
  flex: 0 0 auto;
}

.tile-mic .icon {
  width: 13px;
  height: 13px;
}

.tile-mic.muted {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.45);
}

.tile-mic.hidden {
  display: none;
}

.tile-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 9px;
  border-radius: 99px;
  background: rgba(6, 11, 22, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(8px);
  font-size: 10.5px;
  font-weight: 550;
  color: #e2e8f0;
}

.badge-pill.hand {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.32);
  background: rgba(120, 53, 15, 0.42);
  animation: handPulse 1.6s ease-in-out infinite;
}

.badge-pill.share {
  color: #a5f3fc;
  border-color: rgba(34, 211, 238, 0.3);
  background: rgba(8, 51, 68, 0.5);
}

.badge-pill .icon {
  width: 12px;
  height: 12px;
}

@keyframes handPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.tile-expand {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 11, 22, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
  opacity: 0;
  backdrop-filter: blur(8px);
  transition: opacity 0.18s ease, background 0.18s ease;
}

.tile:hover .tile-expand {
  opacity: 1;
}

.tile-expand:hover {
  background: rgba(30, 41, 59, 0.9);
}

.tile-expand .icon {
  width: 14px;
  height: 14px;
}

.tile-connecting {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(5, 9, 18, 0.55);
  color: #cbd5e1;
  font-size: 12px;
  backdrop-filter: blur(2px);
}

.tile.connected .tile-connecting {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.28);
  border-top-color: #a5b4fc;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------- 等待提示 ---------------------------- */

.waiting-hint {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(129, 140, 248, 0.26);
  background: rgba(13, 20, 38, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.4);
  max-width: calc(100% - 40px);
}

.waiting-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.waiting-text b {
  font-size: 12.5px;
  font-weight: 650;
}

.waiting-text span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------- 控制栏 ------------------------------ */

.control-bar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(11, 18, 33, 0.86);
  backdrop-filter: blur(22px);
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.55);
  max-width: calc(100% - 24px);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.control-divider {
  width: 1px;
  height: 38px;
  background: var(--line);
  margin: 0 6px;
}

.control-btn {
  position: relative;
  width: 62px;
  height: 60px;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #c3cee4;
  transition: background 0.16s ease, color 0.16s ease;
}

.control-btn:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #fff;
}

.control-btn-icon {
  position: relative;
  width: 38px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn-icon .icon {
  width: 20px;
  height: 20px;
}

.control-btn .i-off {
  display: none;
}

.control-btn.is-off {
  color: #fca5a5;
}

.control-btn.is-off .control-btn-icon {
  background: rgba(248, 113, 113, 0.14);
  border-radius: 9px;
}

.control-btn.is-off .i-on {
  display: none;
}

.control-btn.is-off .i-off {
  display: block;
}

.control-btn.active {
  color: #a5f3fc;
  background: rgba(34, 211, 238, 0.12);
}

.control-btn.pending {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.12);
}

.control-btn.active .i-on {
  display: none;
}

.control-btn.active .i-off {
  display: block;
}

.control-label {
  font-size: 10px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  opacity: 0.9;
}

.leave-btn {
  width: 66px;
  color: #fecaca;
  background: rgba(220, 38, 38, 0.16);
}

.leave-btn:hover {
  background: rgba(220, 38, 38, 0.28);
  color: #fff;
}

.unread-badge {
  position: absolute;
  top: -3px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: linear-gradient(120deg, #f43f5e, #fb7185);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.5);
}

/* ---------------------------- 表情选择 ---------------------------- */

.reaction-picker {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  gap: 4px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(13, 20, 38, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
  animation: pickerIn 0.16s ease;
}

@keyframes pickerIn {
  from { opacity: 0; transform: translate(-50%, 6px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.reaction-picker button {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-size: 21px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.reaction-picker button:hover {
  background: rgba(148, 163, 184, 0.16);
  transform: translateY(-2px) scale(1.08);
}

/* ------------------------------------------------------------------
   侧栏 · 聊天 · 参会者
   ------------------------------------------------------------------ */

.side-panel {
  flex: 0 0 340px;
  width: 340px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: rgba(8, 13, 25, 0.86);
  backdrop-filter: blur(18px);
  z-index: 7;
}

.panel-tabs {
  flex: 0 0 auto;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

.panel-tab {
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.16s ease, color 0.16s ease;
}

.panel-tab:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
}

.panel-tab.active {
  color: #e6ecfa;
  background: rgba(99, 102, 241, 0.16);
}

.tab-count {
  min-width: 19px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 600;
}

.icon-btn {
  width: 32px;
  height: 32px;
  margin-left: auto;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background 0.16s ease, color 0.16s ease;
}

.icon-btn:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 聊天 */

.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.8;
  padding: 30px 10px;
}

.chat-empty .icon {
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  display: block;
  opacity: 0.45;
}

.chat-system {
  align-self: center;
  max-width: 90%;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
}

.chat-msg {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  max-width: 100%;
}

.chat-msg.own {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--c, #6366f1), rgba(9, 15, 28, 0.9));
  margin-top: 2px;
}

.chat-body {
  min-width: 0;
  max-width: calc(100% - 40px);
}

.chat-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 4px;
}

.chat-msg.own .chat-head {
  flex-direction: row-reverse;
}

.chat-name {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.chat-time {
  font-size: 9.5px;
  color: #5d6b85;
}

.chat-bubble {
  padding: 9px 12px;
  border-radius: 4px 13px 13px 13px;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-msg.own .chat-bubble {
  border-radius: 13px 4px 13px 13px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.55), rgba(67, 56, 202, 0.4));
  border-color: rgba(129, 140, 248, 0.3);
}

.chat-line {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}

.chat-msg.own .chat-line {
  flex-direction: row-reverse;
}

.chat-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.chat-msg:hover .chat-actions,
.chat-msg:focus-within .chat-actions {
  opacity: 1;
  transform: none;
}

.chat-action {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7a94;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease;
}

.chat-action:hover {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.18);
}

.chat-action .icon {
  width: 13px;
  height: 13px;
}

.chat-bubble.media {
  width: 210px;
  max-width: 100%;
  padding: 4px;
}

.chat-bubble.media .chat-text {
  padding: 6px 7px 5px;
}

.chat-image {
  width: 100%;
  max-height: 280px;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(7, 12, 24, 0.85);
  cursor: zoom-in;
}

.chat-image img {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.chat-image-failed {
  padding: 24px 10px;
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
}

.chat-msg.recalled .chat-bubble {
  background: rgba(148, 163, 184, 0.06);
  border-style: dashed;
  color: var(--muted-2);
  font-size: 11.5px;
  font-style: italic;
}

/* 聊天工具栏 / 图片附件 */

.chat-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 0;
}

.chat-toolbar > span {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted-2);
}

.chat-clear-btn {
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
  transition: color 0.15s ease, background 0.15s ease;
}

.chat-clear-btn:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.14);
}

.chat-clear-btn .icon {
  width: 12px;
  height: 12px;
}

.chat-attachments {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 12px 0;
}

.chat-attach {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b1220;
}

.chat-attach img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.9;
}

.chat-attach.uploading img {
  opacity: 0.4;
}

.chat-attach .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
}

.chat-attach.error {
  border-color: rgba(248, 113, 113, 0.55);
}

.chat-attach.error img {
  opacity: 0.2;
}

.chat-attach .attach-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  text-align: center;
  font-size: 9.5px;
  line-height: 1.3;
  color: #fca5a5;
}

.attach-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(3, 6, 12, 0.78);
  z-index: 2;
}

.attach-remove .icon {
  width: 10px;
  height: 10px;
}

.chat-panel.drag-over {
  position: relative;
}

.chat-panel.drag-over::after {
  content: '松开鼠标发送图片';
  position: absolute;
  inset: 8px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(129, 140, 248, 0.65);
  border-radius: 12px;
  background: rgba(11, 18, 32, 0.78);
  color: #c7d2fe;
  font-size: 13px;
  pointer-events: none;
}

.chat-image-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--line);
  transition: color 0.15s ease, background 0.15s ease;
}

.chat-image-btn:hover {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.16);
}

.chat-image-btn .icon {
  width: 18px;
  height: 18px;
}

@media (hover: none) {
  .chat-actions {
    opacity: 1;
    transform: none;
  }
}

.chat-form {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--line);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(7, 12, 24, 0.75);
  font-size: 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.chat-form input::placeholder {
  color: #5b6a86;
}

.chat-form input:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.send-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  transition: filter 0.16s ease, transform 0.16s ease;
}

.send-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.send-btn .icon {
  width: 17px;
  height: 17px;
}

/* 参会者 */

.people-panel {
  overflow-y: auto;
  padding: 14px;
}

.host-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.btn-soft {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.07);
  color: #d7e0f2;
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.btn-soft:hover {
  background: rgba(148, 163, 184, 0.14);
  border-color: var(--line-strong);
}

.btn-soft.active {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fcd34d;
}

.btn-soft .icon {
  width: 14px;
  height: 14px;
}

.people-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 11px;
  transition: background 0.16s ease;
}

.person:hover {
  background: rgba(148, 163, 184, 0.06);
}

.person-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--c, #6366f1), rgba(9, 15, 28, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.person-main {
  flex: 1;
  min-width: 0;
}

.person-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted-2);
}

.person-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}

.person-icons .icon {
  width: 14px;
  height: 14px;
}

.person-icons .off {
  color: #fca5a5;
}

.person-icons .hand-on {
  color: #fcd34d;
}

.person-actions {
  display: flex;
  gap: 3px;
  margin-left: 2px;
}

.person-action {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.person:hover .person-action,
.person-action:focus-visible {
  opacity: 1;
}

.person-action:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.person-action.danger:hover {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
}

.person-action .icon {
  width: 14px;
  height: 14px;
}

.panel-note {
  margin: 16px 6px 4px;
  color: #53617b;
  font-size: 10.5px;
  line-height: 1.6;
  text-align: center;
}

/* ------------------------------------------------------------------
   表情飘浮 / 提示
   ------------------------------------------------------------------ */

.reactions-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.float-reaction {
  position: absolute;
  bottom: 100px;
  font-size: 32px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4));
  animation: floatUp 2.4s cubic-bezier(0.16, 0.8, 0.3, 1) forwards;
  will-change: transform, opacity;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translateY(20px) scale(0.6); }
  15% { opacity: 1; transform: translateY(0) scale(1.1); }
  100% { opacity: 0; transform: translateY(-190px) scale(1); }
}

.toast-layer {
  position: fixed;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.94);
  color: #e2e8f0;
  font-size: 12.5px;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(14px);
  animation: toastIn 0.22s ease;
  max-width: 100%;
}

.toast.leaving {
  animation: toastOut 0.2s ease forwards;
}

.toast .icon {
  width: 15px;
  height: 15px;
  color: #a5b4fc;
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.3);
}

.toast.error .icon {
  color: #fca5a5;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px); }
}

/* ------------------------------------------------------------------
   设置弹窗
   ------------------------------------------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 14, 0.66);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease;
}

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

/* 图片查看器 */

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: rgba(2, 5, 12, 0.93);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.18s ease;
}

.image-viewer img {
  max-width: min(92vw, 1400px);
  max-height: 86vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}

.image-viewer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.14);
  transition: background 0.15s ease;
}

.image-viewer-close:hover {
  background: rgba(148, 163, 184, 0.26);
}

.image-viewer-close .icon {
  width: 19px;
  height: 19px;
}

.modal {
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(165deg, #131f35, #0b1220);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px;
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.modal-head p {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.modal-body {
  padding: 4px 20px 10px;
}

.modal-body select {
  background-image: linear-gradient(45deg, transparent 50%, #7d8ba5 50%),
    linear-gradient(135deg, #7d8ba5 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 2px;
  cursor: pointer;
}

.switch-row > span:first-child {
  flex: 1;
  min-width: 0;
}

.switch-row b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

.switch-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.24);
  transition: background 0.18s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.switch-row input:checked + .switch {
  background: linear-gradient(120deg, #6366f1, #0891b2);
}

.switch-row input:checked + .switch::after {
  transform: translateX(18px);
}

.switch-row input:focus-visible + .switch {
  outline: 2px solid rgba(129, 140, 248, 0.8);
  outline-offset: 2px;
}

.modal-hint {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.14);
  color: #9fb0c9;
  font-size: 10.5px;
  line-height: 1.6;
}

.modal-hint .icon {
  width: 14px;
  height: 14px;
  color: var(--green);
  margin-top: 1px;
}

.modal-foot {
  padding: 12px 20px 20px;
}

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

@media (max-width: 1080px) {
  .lobby-main {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 36px;
    padding: 20px 28px 28px;
  }

  .lobby-intro h1 {
    font-size: 40px;
  }

  .join-wrap {
    max-width: 380px;
  }
}

@media (max-width: 860px) {
  .lobby-header {
    padding: 18px 20px 8px;
  }

  .lobby-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 12px 20px 24px;
    max-width: 520px;
  }

  .lobby-intro {
    max-width: none;
    text-align: center;
  }

  .eyebrow {
    margin: 0 auto;
  }

  .lobby-intro h1 {
    margin: 18px 0 12px;
    font-size: 34px;
  }

  .intro-text {
    margin: 0 auto;
    font-size: 13.5px;
  }

  .feature-list,
  .intro-foot {
    display: none;
  }

  .join-wrap {
    max-width: none;
    justify-self: stretch;
  }

  .lobby-footer {
    padding: 12px 20px 18px;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .secure-pill,
  .version-pill {
    display: none;
  }

  .meeting-header {
    height: 58px;
    padding: 0 12px;
  }

  .meeting-title h1 {
    max-width: 160px;
    font-size: 13.5px;
  }

  .meeting-meta {
    gap: 7px;
    font-size: 10.5px;
  }

  .meeting-meta .meta-sep:nth-of-type(3),
  .meeting-meta .meta-item:nth-last-child(1) {
    display: none;
  }

  .meeting-actions .btn-ghost {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .meeting-actions .btn-ghost span {
    display: none;
  }

  .meeting-body {
    position: relative;
  }

  .side-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 100%);
    flex-basis: auto;
    border-left: 1px solid var(--line);
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.45);
    animation: panelIn 0.22s ease;
    z-index: 20;
  }

  @keyframes panelIn {
    from { transform: translateX(24px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
  }

  .video-grid {
    padding: 12px 12px 104px;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .video-grid[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .video-grid[data-count="2"],
  .video-grid[data-count="3"],
  .video-grid[data-count="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .control-bar {
    bottom: 10px;
    padding: 7px 8px;
    border-radius: 17px;
    gap: 2px;
  }

  .control-btn {
    width: 52px;
    height: 54px;
  }

  .control-divider {
    margin: 0 2px;
  }

  .control-label {
    font-size: 9px;
  }

  .control-btn-icon .icon {
    width: 18px;
    height: 18px;
  }

  .leave-btn {
    width: 56px;
  }

  .waiting-hint {
    top: 10px;
    gap: 10px;
    padding: 8px 10px;
  }

  .waiting-text span {
    display: none;
  }

  .reaction-picker {
    bottom: 76px;
    flex-wrap: wrap;
    justify-content: center;
    width: 224px;
  }

  .toast-layer {
    bottom: 88px;
  }
}

@media (max-width: 600px) {
  .control-btn {
    width: 46px;
  }

  .control-label {
    display: none;
  }

  .control-btn {
    height: 48px;
  }

  .control-btn-icon {
    height: 32px;
  }

  .leave-btn {
    width: 48px;
  }

  .tile {
    aspect-ratio: 4 / 3;
    border-radius: 14px;
  }

  .video-grid[data-count="3"],
  .video-grid[data-count="4"],
  .video-grid[data-count="5"],
  .video-grid[data-count="6"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-grid {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    padding-top: 10px;
  }

  .tile-avatar .avatar-circle {
    width: 70px;
    height: 70px;
    font-size: 24px;
  }

  .join-card {
    padding: 12px;
  }

  .join-form {
    padding: 14px 4px 4px;
  }

  .meeting-title h1 {
    max-width: 110px;
  }

  .meeting-meta .meta-item:nth-of-type(2),
  .meeting-meta .meta-sep:nth-of-type(2) {
    display: none;
  }
}

/* ------------------------------------------------------------------
   安卓原生外壳（UA 含 YunhuiAndroid）：打开即见会议号输入
   ------------------------------------------------------------------ */

html.native-app .lobby-header {
  padding: 18px 20px 8px;
}

html.native-app .lobby-main {
  grid-template-columns: minmax(0, 1fr);
  max-width: 460px;
  padding: 0 20px 24px;
  gap: 0;
  align-items: start;
}

html.native-app .lobby-intro {
  display: none;
}

html.native-app .join-wrap {
  max-width: none;
  justify-self: stretch;
}

/* 安卓端只能加入会议：隐藏“新建”按钮 */
html.native-app #newRoomBtn {
  display: none;
}

html.native-app .room-input input {
  padding-right: 14px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}



