:root {
  --primary: #6c5ce7;
  --primary-dark: #5a4bd1;
  --danger: #e74c3c;
  --warn: #f39c12;
  --bg: #f7f5fb;
  --panel-bg: #ffffff;
  --text: #2d2a3a;
  --text-muted: #8b87a0;
  --border: #e5e2f0;
  --card-back: #6c5ce7;
  --used: #c9c5d6;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(45, 42, 58, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ---------- 视图切换 ---------- */
.view { display: none; height: 100vh; }
.view.active { display: flex; }

/* ---------- 通用组件 ---------- */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .15s, background .15s;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #eae6ff; color: var(--primary-dark); }
.btn-ghost { background: #f0eef7; color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
  outline: none;
}
.input:focus { border-color: var(--primary); }
.input-sm { padding: 6px 10px; font-size: 13px; width: auto; }

.hint { color: var(--text-muted); font-size: 12px; margin-top: 8px; text-align: center; min-height: 16px; }
.hint.error { color: var(--danger); }

/* ---------- 入口选择 ---------- */
#view-entry { align-items: center; justify-content: center; }
.entry-box, .auth-box {
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 360px;
  max-width: 90vw;
  text-align: center;
}
.entry-box .btn { padding: 14px 16px; font-size: 15px; }
.auth-box h2 { margin-bottom: 4px; }

/* ---------- 首页 ---------- */
#view-home { align-items: center; justify-content: center; }
#view-admin-auth { align-items: center; justify-content: center; }
.home-box {
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 360px;
  max-width: 90vw;
  text-align: center;
}
.logo { font-size: 24px; margin-bottom: 8px; color: var(--primary-dark); }
.subtitle { color: var(--text-muted); margin-bottom: 28px; }
.divider { color: var(--text-muted); margin: 16px 0; font-size: 12px; }
.join-row { display: flex; gap: 8px; }
.join-row .input { flex: 1; text-transform: uppercase; letter-spacing: 2px; }

/* ---------- 进入前准备 ---------- */
#view-precheck { align-items: center; justify-content: center; }
.precheck-box {
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  width: 420px;
  max-width: 94vw;
  max-height: 94vh;
  overflow-y: auto;
}
.precheck-box h2 { margin-bottom: 16px; }
.device-check { text-align: center; margin-bottom: 16px; }
#preview-video {
  width: 100%;
  height: 180px;
  background: #1a1a2e;
  border-radius: 8px;
  object-fit: cover;
}
.device-status { display: flex; gap: 8px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }

#host-settings-block {
  background: #f7f5ff;
  border: 1px dashed var(--primary);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
}
#host-settings-block .block-title {
  font-size: 14px;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
#join-password-block { margin: 14px 0; }
#join-password-block .input { border-color: var(--primary); }

.admin-rooms {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  text-align: left;
}
.admin-rooms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.admin-rooms-header h4 { font-size: 13px; color: var(--text-muted); }
.admin-rooms-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-room-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #faf9ff;
  border-radius: 6px;
  font-size: 13px;
}
.admin-room-item .room-info { flex: 1; }
.admin-room-item .room-info b { color: var(--primary-dark); font-family: monospace; }
.admin-room-item .status-text { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.admin-room-item .room-actions { display: flex; gap: 4px; }
.admin-room-empty { color: var(--text-muted); font-size: 12px; text-align: center; padding: 10px; }

.device-buttons { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.status-chip {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: #f0eef7;
}
.status-chip.ok { background: #e6f7ee; color: #27ae60; }
.status-chip.bad { background: #fdeaea; color: var(--danger); }

.field-label { display: block; font-size: 12px; color: var(--text-muted); margin: 12px 0 6px; }
.rules { background: #faf9ff; border-radius: 8px; padding: 14px 16px; margin: 12px 0; font-size: 13px; line-height: 1.7; }
.rules h3 { font-size: 14px; margin-bottom: 6px; }
.rules ol { padding-left: 20px; }
.agree { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 12px 0; }

/* ---------- 房间布局 ---------- */
#view-room { flex-direction: column; }
/* ---------- 房间布局 ---------- */
#view-room { flex-direction: column; }

.role-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.role-banner.host { background: linear-gradient(90deg, #6c5ce7, #8b7cff); }
.role-banner.participant { background: linear-gradient(90deg, #6b7280, #9ca3af); }
.role-icon { font-size: 16px; }

.room-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: 12px;
  gap: 12px;
}

.video-panel {
  flex: 1 1 40%;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  min-width: 0;
  max-width: 45%;
}
.video-header {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.video-header b { color: var(--text); }
.hint-inline { color: var(--primary); font-size: 12px; margin-left: 4px; }

/* 视频排列切换（大画面 / 宫格） */
.video-layout-toggle {
  display: flex;
  gap: 4px;
  margin-left: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}
.vlt-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}
.vlt-btn.active {
  background: var(--primary);
  color: #fff;
}

/* 宫格模式：视频网格（桌面端手动切换；列数由 JS 按人数自适应） */
.video-grid.layout-grid {
  display: grid;
  align-content: start;
}

.video-grid {
  flex: 1;
  display: flex;
  flex-direction: column; /* 上下排列：每个视频占满一行，画面更大更清晰 */
  gap: 8px;
  padding: 10px 0;
  overflow-y: auto;
}
.video-cell {
  position: relative;
  background: #1a1a2e;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  min-width: 0;
  flex-shrink: 0; /* 禁止 flex 压缩，保持 4:3 比例（超出部分滚动） */
}
.video-cell video { width: 100%; height: 100%; object-fit: cover; }
.video-view { position: absolute; inset: 0; }
.video-view video { width: 100%; height: 100%; object-fit: cover; }
.video-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-cell .cell-name {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.video-cell .cell-status {
  position: absolute;
  right: 6px;
  top: 6px;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.video-controls { display: flex; gap: 8px; justify-content: center; padding-top: 8px; }

.card-panel {
  flex: 1 1 60%;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  min-width: 0;
}
.card-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}
.card-mode-info { font-size: 13px; color: var(--text-muted); }
.card-actions { display: flex; align-items: center; gap: 8px; }
.selected-count { font-size: 12px; color: var(--primary-dark); }

#card-grid {
  display: block;
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  align-content: start;
}

/* 卡牌分区：图卡 / 字卡 各自一个 section，section 之间留明显间距避免"重叠" */
.card-section {
  margin-top: 40px;
  padding: 18px 14px 12px;
  background: rgba(108,92,231,.08);
  border-radius: 10px;
  border: 2px solid var(--primary);
}
.card-section:first-child {
  margin-top: 0;
}
.card-section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  letter-spacing: 4px;
  padding-left: 8px;
  border-left: 5px solid var(--primary);
  text-shadow: 0 1px 0 rgba(108,92,231,.15);
}

/* 抽中后展示：图卡 / 字卡 分两区，一行三张自由排列（可上下滚动） */
.drawn-display {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 分区分类栏（每个参与者本地操作，不同步） */
.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: #f5f4fa;
  border-radius: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.cat-filter {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
}
.cat-filter.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.cat-filter:not(.active)::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-color, #cbd5e1);
  margin-right: 6px;
  vertical-align: middle;
}

/* 卡牌右下角的分区切换标签 */
.drawn-card .category-tag {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  cursor: pointer;
  z-index: 4;
  pointer-events: auto;
}
.drawn-card .category-tag:hover { background: rgba(0, 0, 0, .75); }

/* 分区选择菜单（浮层） */
.category-menu {
  position: fixed;
  display: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  padding: 6px;
  z-index: 10001;
  min-width: 132px;
}
.category-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
}
.category-menu-item:hover { background: rgba(108, 92, 231, .1); }
.category-menu-item .cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.category-menu-add { color: var(--primary); font-weight: 600; }
.cat-filter.cat-add { color: var(--primary); border-style: dashed; }

.drawn-section {
  background: rgba(108,92,231,.06);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 14px 12px 10px;
}
.drawn-section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
  letter-spacing: 3px;
  padding-left: 8px;
  border-left: 5px solid var(--primary);
}
.drawn-grid-section {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.drawn-grid-section .drawn-card {
  flex: 0 0 calc((100% - 16px) / 3); /* 一行 3 张 */
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}
.drawn-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid var(--primary);
  box-shadow: 0 6px 20px rgba(108,92,231,.3);
}
.drawn-card.word-card { background: #fff; }
.drawn-card .word-box {
  position: absolute;
  top: 10px;
  left: 10px;
  border: 2px solid #ef4444;
  color: #ef4444;
  background: #fff;
  padding: 6px 14px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 2px;
}
.drawn-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drawn-card.word-card { background: #fff; position: relative; }
.drawn-card.word-card .word-frame {
  position: absolute;
  top: 14%;
  left: 14%;
  right: 14%;
  bottom: 14%;
  border: 2.5px solid #ef4444;
  pointer-events: none;
  z-index: 0;
}
.drawn-card.word-card .word-text {
  position: absolute;
  color: #000;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
  z-index: 2;
}
.drawn-card.word-card .word-top { top: 4%; left: 50%; transform: translateX(-50%); }
.drawn-card.word-card .word-bottom { bottom: 4%; left: 50%; transform: translateX(-50%); }
.drawn-card.word-card .word-left { left: 2%; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; letter-spacing: 3px; }
.drawn-card.word-card .word-right { right: 2%; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; letter-spacing: 3px; }

.image-preview-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: zoom-out;
  padding: 24px;
}
.image-preview-mask img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .55);
  cursor: default;
}
.image-preview-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: none;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.image-preview-close:hover { background: rgba(255,255,255,.3); }

/* 图卡拖入字卡组合 */
.drawn-card.dragging { opacity: .5; cursor: grabbing; }
.drawn-card.drop-target { box-shadow: 0 0 0 4px rgba(239,68,68,.5); }
.drawn-card .composed-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 60%;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  z-index: 1;
  cursor: grab;
}
.drawn-card .composed-overlay:active { cursor: grabbing; }
.drawn-card .word-box { z-index: 2; }
.drawn-card.is-composed {
  border-color: #ef4444;
  border-style: solid;
  position: relative;
}
.drawn-card.is-composed::after {
  content: "✓ 已组合（可继续拖到其他字卡）";
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  background: rgba(239,68,68,.92);
  color: #fff;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  text-align: center;
  z-index: 3;
}
.drawn-card[draggable="true"] { cursor: grab; }
.drawn-card[draggable="true"]:active { cursor: grabbing; }
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
}
.card-grid .card {
  flex: 0 0 calc((100% - 16px) / 3); /* 一行 3 张：100% - 2个gap(8px) / 3 */
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}

/* ---------- 卡牌 ---------- */
.card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s, box-shadow .12s, border .12s;
  user-select: none;
  overflow: hidden;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(45,42,58,.16); }
.card.face-up { background: #fff; border: 2px solid var(--border); }
.card.face-up img { width: 100%; height: 100%; object-fit: cover; }
.card.face-up .card-num {
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255,255,255,.8);
  padding: 0 4px;
  border-radius: 3px;
}
/* 图卡放大按钮（右上角） */
.card .card-zoom-btn {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: zoom-in;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  z-index: 6;
  pointer-events: auto;
}
.card .card-zoom-btn:hover {
  background: #fff;
  transform: scale(1.15);
}
.card.word-card { background: #fff; border: 1px solid #e5e7eb; position: relative; }
.card.word-card .word-frame {
  position: absolute;
  top: 14%;
  left: 14%;
  right: 14%;
  bottom: 14%;
  border: 2px solid #ef4444;
  pointer-events: none;
}
.card.word-card .word-text {
  position: absolute;
  color: #000;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}
.card.word-card .word-top { top: 4%; left: 50%; transform: translateX(-50%); }
.card.word-card .word-bottom { bottom: 4%; left: 50%; transform: translateX(-50%); }
.card.word-card .word-left { left: 2%; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; letter-spacing: 2px; }
.card.word-card .word-right { right: 2%; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; letter-spacing: 2px; }

.card.face-down { background: var(--card-back); border: 2px solid var(--primary-dark); }
.card.face-down .card-back-num { color: #fff; font-size: 16px; font-weight: 600; opacity: .9; }
.card.face-down::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 5px;
}

.card.selected {
  border-color: var(--primary);
  border-width: 4px;
  box-shadow: 0 0 0 4px rgba(108,92,231,.45), 0 10px 24px rgba(108,92,231,.4);
  transform: translateY(-6px) scale(1.05);
  z-index: 5;
}
.card.selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  z-index: 6;
}
.card.drawn {
  transform: scale(1.35);
  z-index: 5;
  box-shadow: 0 4px 18px rgba(108,92,231,.45);
  border-color: var(--primary);
}
.card.drawn::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 6px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
}

.card.used {
  cursor: not-allowed;
  opacity: .55;
  filter: grayscale(.5);
}
.card.used::before {
  content: "已使用";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 1;
}

.card.flipped { cursor: default; border: 2px solid var(--primary); }

/* ---------- 引导者控制面板 ---------- */
.host-panel {
  flex: 0 0 260px;
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow-y: auto;
}
.host-panel h3 { font-size: 15px; margin-bottom: 12px; color: var(--primary-dark); }
.panel-section { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.panel-section h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.toggle-row { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 6px 0; }
.drawn-list { font-size: 12px; color: var(--text-muted); word-break: break-all; }
.participant-list { margin-bottom: 8px; }
.participant-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
}
.participant-item .remove-btn {
  border: none;
  background: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
}
.participant-item .host-tag { color: var(--primary); font-size: 11px; }

/* ---------- 总览弹层 ---------- */
.overview-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.overview-box {
  background: var(--panel-bg);
  border-radius: var(--radius);
  width: 80vw;
  max-width: 900px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}
.overview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.overview-grid { overflow-y: auto; }

/* ---------- 感谢页 ---------- */
#view-thankyou { align-items: center; justify-content: center; }
.thankyou-box { text-align: center; }
.thankyou-box h1 { font-size: 32px; margin-bottom: 12px; color: var(--primary-dark); }
.thankyou-box p { color: var(--text-muted); margin-bottom: 24px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .room-layout { flex-direction: column; }
  .video-panel { flex: 1 1 auto; max-height: 45vh; max-width: 100%; }
  .card-panel { flex: 1 1 auto; }
  .host-panel { flex: 0 0 auto; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
  /* 手机/平板：视频区改回小格子网格，一屏能看多人（桌面端保持上下大画面） */
  .video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-content: start;
  }
  .video-cell { aspect-ratio: 4 / 3; }
  /* 移动端隐藏排列切换按钮（固定宫格） */
  .video-layout-toggle { display: none; }
}
