/* ============================================================
   私密会议 · 样式
   移动端优先，深色隐私风格
   ============================================================ */

:root {
  --bg: #07090d;
  --bg-soft: #0d1117;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f5f9;
  --text-dim: #98a2b3;
  --text-faint: #667085;
  --accent: #4d7cfe;
  --accent-2: #7b5cff;
  --accent-soft: rgba(77, 124, 254, 0.16);
  --danger: #ff4d5e;
  --danger-soft: rgba(255, 77, 94, 0.14);
  --ok: #2ed3a7;
  --radius: 20px;
  --radius-sm: 13px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior: none;

  /* 防截屏辅助：禁止选中 / 长按菜单 / 拖拽 */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(58% 42% at 18% 0%, rgba(77, 124, 254, 0.2), transparent 70%),
    radial-gradient(48% 38% at 92% 8%, rgba(123, 92, 255, 0.16), transparent 72%),
    radial-gradient(60% 45% at 50% 108%, rgba(46, 211, 167, 0.07), transparent 72%);
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
  font-family: inherit;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ------------------------------------------------------------
   页面容器
   ------------------------------------------------------------ */
.view {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateX(14px);
  transition: opacity 0.22s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.22s;
}

.view.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 4px 18px calc(28px + var(--safe-b));
  position: relative;
  z-index: 1;
}

/* ------------------------------------------------------------
   通用组件
   ------------------------------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-t)) 18px 8px;
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(77, 124, 254, 0.35);
}

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

.brand-text {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  margin-right: 42px;
}

.topbar-spacer {
  width: 42px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}

.icon-btn:active {
  transform: scale(0.94);
  background: var(--surface-2);
}

.hero {
  padding: 26px 4px 26px;
}

.hero h1 {
  font-size: 29px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #fff 30%, #b9c7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 13.5px;
  letter-spacing: 0.01em;
}

/* 未配置服务器提示 */
.setup-hint {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 196, 107, 0.34);
  background: rgba(255, 196, 107, 0.1);
  color: #ffd79a;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.setup-hint:active {
  transform: scale(0.99);
}

.setup-hint .icon {
  width: 16px;
  height: 16px;
  flex: none;
  stroke-width: 1.9;
}

.setup-hint .chev {
  margin-left: auto;
  transform: rotate(-90deg);
  opacity: 0.55;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card + .card {
  margin-top: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.card-head h2 {
  font-size: 17px;
  font-weight: 600;
}

.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 7px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.tag-accent {
  color: #a9c0ff;
  background: var(--accent-soft);
  border-color: rgba(77, 124, 254, 0.3);
}

.card-desc {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 16px;
}

.input {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 16px;
  padding: 0 15px;
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.input::placeholder {
  color: var(--text-faint);
}

.input:focus {
  border-color: rgba(77, 124, 254, 0.6);
  background: rgba(0, 0, 0, 0.38);
  box-shadow: 0 0 0 4px rgba(77, 124, 254, 0.12);
}

.input-inline {
  height: 40px;
  text-align: right;
  border: none;
  background: transparent;
  padding: 0;
  width: auto;
  min-width: 0;
  flex: 1;
  font-size: 15px;
}

.input-inline:focus {
  box-shadow: none;
  background: transparent;
}

.btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.18s, background 0.18s, box-shadow 0.18s;
}

.btn:active {
  transform: scale(0.975);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px rgba(77, 124, 254, 0.3);
}

.btn-primary:disabled {
  opacity: 0.36;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-lg {
  height: 52px;
  margin-top: 14px;
  border-radius: 15px;
  font-size: 15.5px;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  height: 42px;
  font-size: 14px;
  margin-top: 10px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--text-faint);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* 8 位会话码输入 */
.code-wrap {
  position: relative;
  margin: 4px 0 2px;
}

.code-slots {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}

.code-slots i {
  height: 52px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-style: normal;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.code-slots i.filled {
  border-color: rgba(77, 124, 254, 0.45);
  background: rgba(77, 124, 254, 0.1);
}

.code-slots i.caret {
  border-color: var(--accent);
  background: rgba(77, 124, 254, 0.14);
  box-shadow: 0 0 0 3px rgba(77, 124, 254, 0.12);
}

.code-real {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.01;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
}

/* 隐私提示 */
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: center;
  margin-top: 22px;
  padding: 0 12px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.privacy-note .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  flex: none;
}

/* ------------------------------------------------------------
   房间
   ------------------------------------------------------------ */
.view-room {
  background: #05070a;
}

.room-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  flex: none;
  z-index: 5;
}

.room-bar .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: transparent;
  border-color: transparent;
}

.code-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.code-pill .icon {
  width: 15px;
  height: 15px;
  color: var(--text-faint);
  stroke-width: 1.9;
}

.code-pill:active {
  background: var(--surface-2);
}

.room-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(46, 211, 167, 0.6);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 211, 167, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(46, 211, 167, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 211, 167, 0);
  }
}

.lock-flag {
  display: grid;
  place-items: center;
  color: #ffc46b;
}

.lock-flag .icon {
  width: 14px;
  height: 14px;
}

.stage {
  flex: 1;
  min-height: 0;
  position: relative;
  padding: 0 10px;
}

.video-grid {
  height: 100%;
  display: grid;
  gap: 8px;
  align-content: center;
  justify-content: center;
  grid-template-columns: 1fr;
}

.video-grid[data-count="2"] {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
}

.video-grid[data-count="3"],
.video-grid[data-count="4"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

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

.video-grid[data-count="7"],
.video-grid[data-count="8"],
.video-grid[data-count="9"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.tile {
  position: relative;
  border-radius: 17px;
  overflow: hidden;
  background: linear-gradient(160deg, #161c26, #0c1016);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 0;
  min-width: 0;
  animation: tileIn 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  isolation: isolate;
}

@keyframes tileIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}

.tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a0e14;
  transition: opacity 0.2s;
}

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

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

.tile-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s;
  background: radial-gradient(70% 70% at 50% 30%, rgba(77, 124, 254, 0.16), transparent 70%);
}

.tile.video-off .tile-fallback {
  opacity: 1;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 600;
  color: #e6ecff;
  background: linear-gradient(140deg, rgba(77, 124, 254, 0.55), rgba(123, 92, 255, 0.42));
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.tile-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 10px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  font-size: 12px;
}

.tile-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.tile-icons {
  display: flex;
  gap: 3px;
  color: rgba(255, 255, 255, 0.55);
}

.tile-icons .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.tile-icons .on {
  color: #dbe6ff;
}

.tile-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  padding: 2.5px 7px;
  border-radius: 6px;
  color: #cddafe;
  background: rgba(77, 124, 254, 0.32);
  border: 1px solid rgba(77, 124, 254, 0.42);
  backdrop-filter: blur(6px);
}

.tile.speaking {
  border-color: rgba(46, 211, 167, 0.75);
  box-shadow: 0 0 0 2px rgba(46, 211, 167, 0.25);
}

.tile.is-self .tile-badge {
  color: #d6fff4;
  background: rgba(46, 211, 167, 0.2);
  border-color: rgba(46, 211, 167, 0.38);
}

.conn-banner {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  background: rgba(255, 196, 107, 0.16);
  color: #ffd79a;
  border: 1px solid rgba(255, 196, 107, 0.32);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

/* 底部控制栏 */
.controls {
  flex: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 12px 8px calc(14px + var(--safe-b));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
}

.ctl {
  position: relative;
  border: none;
  background: transparent;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
  transition: color 0.15s, transform 0.12s;
}

.ctl:active {
  transform: scale(0.93);
}

.ctl .icon {
  width: 46px;
  height: 46px;
  padding: 12px;
  border-radius: 15px;
  background: var(--surface-2);
  color: #e7edf8;
  border: 1px solid var(--line);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.ctl[data-on="false"] .icon {
  background: rgba(255, 255, 255, 0.9);
  color: #10151d;
  border-color: transparent;
}

.ctl-danger .icon {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(255, 77, 94, 0.32);
}

.ctl:disabled {
  opacity: 0.42;
}

.badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(24px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
  border: 2px solid #05070a;
}

/* ------------------------------------------------------------
   设置
   ------------------------------------------------------------ */
.group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(14px);
}

.group-title {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  padding: 14px 0 6px;
  font-weight: 500;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.group-title + .row {
  border-top: none;
}

.row.col {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 0;
}

.row.col > span {
  font-size: 13px;
  color: var(--text-dim);
}

.row > span:first-child {
  color: var(--text);
  font-size: 14.5px;
  flex: none;
}

.group .row .input:not(.input-inline) {
  height: 42px;
  font-size: 15px;
  border-radius: 10px;
}

.hint {
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-faint);
  padding: 4px 0 10px;
}

.hint code {
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 11.5px;
  color: #c3cfe6;
}

.test-result {
  font-size: 12.5px;
  padding: 0 0 12px;
  color: var(--text-dim);
  min-height: 4px;
}

.test-result.ok {
  color: var(--ok);
}

.test-result.err {
  color: #ff8a95;
}

.version {
  text-align: center;
  color: var(--text-faint);
  font-size: 11.5px;
  padding: 18px 0 6px;
}

/* ------------------------------------------------------------
   权限引导
   ------------------------------------------------------------ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(4, 6, 10, 0.88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transition: opacity 0.3s, visibility 0.3s;
}

.gate[hidden] {
  display: none;
}

/* ---------------- 首页隐私公告 ---------------- */

.notice {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 6, 10, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow-y: auto;
}

.notice[hidden] {
  display: none;
}

.notice-card {
  width: 100%;
  max-width: 420px;
  margin: auto;
  background: linear-gradient(180deg, rgba(28, 34, 46, 0.96), rgba(13, 17, 23, 0.98));
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 22px 20px 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.62);
  animation: gateIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.notice-top {
  text-align: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.notice-badge {
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px rgba(77, 124, 254, 0.36);
}

.notice-badge .icon {
  width: 24px;
  height: 24px;
}

.notice-top h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.notice-sub {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-faint);
}

.notice-body {
  padding: 14px 2px 12px;
}

.notice-body p {
  font-size: 12.5px;
  line-height: 1.72;
  color: var(--text-dim);
}

.notice-body strong {
  color: var(--text);
  font-weight: 600;
}

.notice-list {
  list-style: none;
  margin: 12px 0;
  display: grid;
  gap: 9px;
}

.notice-list li {
  position: relative;
  padding-left: 15px;
  font-size: 12.5px;
  line-height: 1.66;
  color: var(--text-dim);
}

.notice-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.notice-list b {
  color: var(--text);
  font-weight: 600;
  margin-right: 3px;
}

.notice-warn {
  margin-top: 4px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 77, 94, 0.1);
  border: 1px solid rgba(255, 77, 94, 0.22);
  color: #ff9aa5 !important;
  font-size: 12px !important;
}

.notice-foot {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
}

.notice-card .btn-lg {
  margin-top: 4px;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, rgba(28, 34, 46, 0.92), rgba(14, 18, 25, 0.96));
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  padding: 26px 22px 20px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: gateIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes gateIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}

.gate-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(77, 124, 254, 0.35);
}

.gate-icon .icon {
  width: 28px;
  height: 28px;
}

.gate-card h2 {
  font-size: 20px;
  font-weight: 650;
  margin-bottom: 8px;
}

.gate-desc {
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.65;
  margin-bottom: 18px;
}

.gate-list {
  list-style: none;
  text-align: left;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.gate-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-dim);
  padding: 5px 0;
}

.gate-list .icon {
  width: 15px;
  height: 15px;
  color: var(--ok);
  stroke-width: 2.4;
}

.gate .btn-ghost {
  margin-top: 8px;
  height: 44px;
  background: transparent;
  border-color: transparent;
  color: var(--text-faint);
  font-size: 13.5px;
  font-weight: 500;
}

/* ------------------------------------------------------------
   底部抽屉
   ------------------------------------------------------------ */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.sheet[hidden] {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s;
}

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

.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: #11151d;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--line-strong);
  padding: 8px 16px calc(16px + var(--safe-b));
  animation: sheetUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}

.sheet-panel-auto {
  padding-bottom: calc(10px + var(--safe-b));
}

@keyframes sheetUp {
  from {
    transform: translateY(100%);
  }
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  margin: 4px auto 10px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 12px;
}

.sheet-head h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-count {
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 2px 7px;
  font-weight: 500;
}

.text-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px;
}

.member-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}

.member {
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.member:last-child {
  border-bottom: none;
}

.member-main {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 2px;
  cursor: pointer;
}

.member-main .avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
  flex: none;
}

.member-avatar {
  position: relative;
  flex: none;
}

.member-avatar .mic-off-mark {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #2a3140;
  border: 2px solid #11151d;
  display: grid;
  place-items: center;
  color: #ff8a95;
}

.member-avatar .mic-off-mark .icon {
  width: 9px;
  height: 9px;
  stroke-width: 2.6;
}

.member-info {
  flex: 1;
  min-width: 0;
}

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

.role-tag {
  font-size: 10px;
  padding: 1.5px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: #a9c0ff;
  border: 1px solid rgba(77, 124, 254, 0.28);
  font-weight: 500;
  flex: none;
}

.member-sub {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-sub .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2;
}

.member-sub .on {
  color: var(--ok);
}

.member-main > .icon {
  color: var(--text-faint);
  width: 18px;
  height: 18px;
  transition: transform 0.22s;
}

.member.expanded .member-main > .icon {
  transform: rotate(180deg);
}

.member-actions {
  display: none;
  padding: 2px 2px 14px;
}

.member.expanded .member-actions {
  display: block;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.action-row > span {
  flex: none;
  width: 52px;
  font-size: 12px;
  color: var(--text-faint);
}

.chip {
  flex: 1;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chip:active {
  transform: scale(0.96);
}

.chip.on {
  background: var(--accent-soft);
  border-color: rgba(77, 124, 254, 0.4);
  color: #b9cbff;
}

.chip.warn {
  color: #ff9aa3;
  border-color: rgba(255, 77, 94, 0.28);
  background: var(--danger-soft);
}

.chip.danger {
  background: var(--danger-soft);
  border-color: rgba(255, 77, 94, 0.3);
  color: #ff8a95;
}

.chip .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

.sheet-tip {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-faint);
  padding: 10px 4px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  margin-top: 4px;
}

.menu-item {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}

.menu-item:first-of-type {
  border-top: none;
}

.menu-item .icon {
  width: 20px;
  height: 20px;
  color: var(--text-dim);
}

.menu-item:active {
  background: var(--surface);
}

.menu-danger {
  color: #ff8a95;
}

.menu-danger .icon {
  color: #ff8a95;
}

/* 确认弹窗 */
.dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
}

.dialog[hidden] {
  display: none;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.18s;
}

.dialog-card {
  position: relative;
  width: 100%;
  max-width: 330px;
  background: #161b24;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 22px 20px 16px;
  animation: gateIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.dialog-card h3 {
  font-size: 16.5px;
  margin-bottom: 8px;
}

.dialog-card p {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.65;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.dialog-actions .btn {
  height: 44px;
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + var(--safe-b));
  transform: translateX(-50%) translateY(8px);
  z-index: 95;
  max-width: 84vw;
  padding: 11px 18px;
  border-radius: 12px;
  background: rgba(28, 34, 46, 0.96);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 隐私遮罩 */
.shield {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #05070a;
  color: var(--text-dim);
}

.shield.show {
  display: flex;
}

.shield-icon {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

.shield p {
  font-size: 16px;
  color: var(--text);
  font-weight: 500;
}

.shield span {
  font-size: 12.5px;
  color: var(--text-faint);
}

/* 分享入口 */
.share-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 6px auto 0;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s;
}

.share-row .icon {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}

.share-row:active {
  color: var(--accent);
}

/* 窄屏（360dp 及以下）收紧会话顶栏，避免按钮挤压 */
@media (max-width: 380px) {
  .room-bar {
    gap: 7px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .room-bar .icon-btn {
    width: 34px;
    height: 34px;
  }
  .room-bar .code-pill {
    padding: 0 9px;
    font-size: 13.5px;
    letter-spacing: 0.05em;
  }
  .room-status {
    font-size: 11.5px;
    gap: 4px;
  }
}

/* 桌面端预览：居中手机画幅 */
@media (min-width: 720px) {
  body {
    background: #04060a;
  }
  .view {
    max-width: 460px;
    margin: 0 auto;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
  }
  .sheet-panel {
    max-width: 460px;
    margin: 0 auto;
  }
}
