:root {
  --bg: #f2f6fc;
  --text: #16203a;
  --muted: #64708a;
  --line: rgba(22, 32, 58, 0.10);
  --panel: #ffffff;
  --panel-2: rgba(22, 32, 58, 0.06);
  --surface-gray: #f2f4f7;
  --accent: #0fae7c;
  --accent-2: #4c7dff;
  --danger: #f04452;
  --radius: 22px;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  overscroll-behavior: none;
}

body {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 46% at 12% -6%, rgba(61, 220, 151, 0.18), transparent 62%),
    radial-gradient(50% 42% at 92% 4%, rgba(91, 140, 255, 0.16), transparent 60%),
    radial-gradient(70% 60% at 50% 110%, rgba(61, 220, 151, 0.10), transparent 60%);
  z-index: 0;
}

.hidden { display: none !important; }

.view {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  animation: fade 0.35s ease both;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.boot-view {
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.boot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: var(--muted);
}
.boot-card .brand-logo { width: 52px; height: 52px; }
.boot-card p { margin: 0; font-size: 13px; }

/* ───────────── 加入页 ───────────── */

.join-view {
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px
    calc(env(safe-area-inset-bottom, 0px) + 24px);
}

/* 内容不满一屏时垂直居中，超过一屏时从顶部开始正常滚动（不会把顶部裁掉） */
.join-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  margin: auto 0;
}

.card {
  width: min(402px, 100%);
  padding: 26px 24px 24px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 32, 58, 0.065), rgba(22, 32, 58, 0.028));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(22, 32, 58, 0.06);
}

.join-card { animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }

.brand-mark {
  position: relative;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 15px;
  background: linear-gradient(140deg, var(--accent), #26b6a4 60%, var(--accent-2));
  box-shadow: 0 12px 30px -12px rgba(61, 220, 151, 0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 13px;
}

.brand-mark span {
  width: 4px;
  border-radius: 2px;
  background: #04140e;
  opacity: 0.8;
}
.brand-mark span:nth-child(1) { height: 7px; }
.brand-mark span:nth-child(2) { height: 13px; }
.brand-mark span:nth-child(3) { height: 19px; }

.brand-text h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.4px;
}
.brand-text p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.field { margin-bottom: 14px; }

.field label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}

.field-hint { font-size: 11px; opacity: 0.65; }

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

input::placeholder { color: #5d6577; }

input:focus {
  border-color: rgba(61, 220, 151, 0.5);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.1);
  background: rgba(0, 0, 0, 0.4);
}

.input-row { display: flex; gap: 8px; align-items: center; }
.input-row input { flex: 1; min-width: 0; }

.btn {
  width: 100%;
  height: 49px;
  border: 0;
  border-radius: 15px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.18s ease, opacity 0.18s;
}

.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn.primary {
  margin-top: 6px;
  color: #04140e;
  background: linear-gradient(135deg, #48e6a3, #29bbaa);
  box-shadow: 0 16px 34px -18px rgba(61, 220, 151, 0.9), inset 0 1px 0 rgba(22, 32, 58, 0.35);
}

.btn.primary:hover { filter: brightness(1.05); }

.btn.danger { margin-top: 6px; color: #fff; background: linear-gradient(135deg, #ff6675, #e13f5c); box-shadow: 0 16px 34px -20px rgba(240,68,82,.85); }

.btn.ghost {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn.small { height: 42px; font-size: 13px; margin-top: 10px; font-weight: 500; }

.btn-mini {
  flex: none;
  height: 47px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-mini:hover { background: var(--panel-2); color: var(--text); }
.btn-mini.ok { color: var(--accent); border-color: rgba(61, 220, 151, 0.4); }

.hint {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}

.error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #ff9aa3;
  background: rgba(255, 93, 108, 0.1);
  border: 1px solid rgba(255, 93, 108, 0.22);
}

.footnote {
  margin: 0;
  max-width: 300px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ───────────── 通话页 ───────────── */

.call-view {
  z-index: 3;
  padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
  background: var(--surface-gray);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  flex: none;
}

.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 13px;
  color: #c3cbdb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6);
  animation: pulse 2.4s infinite;
  flex: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

.dot-sep { color: #4b5364; }

.sas {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  padding: 5px 12px;
  border-radius: 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.sas-label { font-size: 10.5px; letter-spacing: 1.2px; color: var(--muted); }

.sas-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 2.5px;
  line-height: 1.25;
  color: #6f7789;
}

.sas:not(.pending) {
  border-color: rgba(61, 220, 151, 0.35);
  background: rgba(61, 220, 151, 0.08);
}
.sas:not(.pending) .sas-code { color: var(--accent); }

.grid {
  flex: 1;
  display: grid;
  /* 列数由 app.js 按人数和视口宽度显式设置，避免 auto-fit 按最大轨道数算导致挤成一列 */
  grid-template-columns: minmax(0, 220px);
  grid-auto-rows: min-content;
  justify-content: center;
  align-content: safe center;
  gap: 14px;
  padding: 18px 16px;
  overflow-y: auto;
  min-height: 0;
  width: 100%;
  margin: 0 auto;
}

.tile {
  position: relative;
  width: 100%;
  max-width: 220px;
  justify-self: center;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 32, 58, 0.055), rgba(22, 32, 58, 0.02));
  transition: border-color 0.2s, box-shadow 0.25s, background 0.25s;
  animation: pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  overflow: hidden;
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

.tile.speaking {
  border-color: rgba(61, 220, 151, 0.4);
  background: linear-gradient(180deg, rgba(61, 220, 151, 0.1), rgba(22, 32, 58, 0.02));
  box-shadow: 0 20px 44px -28px rgba(61, 220, 151, 0.75);
}

.avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 23px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(140deg, var(--c1, #3ddc97), var(--c2, #5b8cff));
  box-shadow: inset 0 0 0 1px rgba(22, 32, 58, 0.18);
  transition: box-shadow 0.18s, transform 0.12s;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #fff;
}

.tile.speaking .avatar {
  transform: scale(calc(1 + var(--level, 0) * 0.07));
  box-shadow:
    inset 0 0 0 1px rgba(22, 32, 58, 0.22),
    0 0 0 calc(2px + var(--level, 0) * 9px) rgba(61, 220, 151, 0.16);
}

.tile-name {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 88%;
  font-size: 13px;
  color: var(--text);
}

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

.mute-flag {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 93, 108, 0.14);
  color: #ff8b95;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s, transform 0.2s;
}

.tile.muted .mute-flag { opacity: 1; transform: none; }
.mute-flag svg { width: 12px; height: 12px; }

.tile-status {
  position: absolute;
  bottom: 9px;
  font-size: 10px;
  color: #6b7488;
  letter-spacing: 0.2px;
}

.waiting {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 2px;
  font-size: 13px;
  color: #98a1b3;
  text-align: center;
}

.stats {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 16px 2px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stat-sep { width: 1px; height: 9px; background: var(--line); }

.controls {
  flex: none;
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 14px 0 calc(env(safe-area-inset-bottom, 0px) + 22px);
}

.ctl {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.12s, background 0.18s, border-color 0.18s, color 0.18s;
}

.ctl:active { transform: scale(0.94); }
.ctl svg { width: 25px; height: 25px; }
.ctl .i-off { display: none; }

.ctl.muted {
  background: rgba(255, 93, 108, 0.16);
  border-color: rgba(255, 93, 108, 0.34);
  color: #ff8b95;
}
.ctl.muted .i-on { display: none; }
.ctl.muted .i-off { display: block; }

.ctl.danger {
  background: linear-gradient(140deg, #ff5d6c, #e13f77);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 18px 36px -18px rgba(255, 93, 108, 0.85);
}

.ctl.danger svg.hangup { transform: rotate(135deg); }

.chat-ctl { position: relative; }
.chat-unread {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border: 2px solid var(--bg);
}

.chat-panel {
  position: absolute;
  z-index: 30;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 98px);
  width: min(560px, calc(100% - 24px));
  height: min(68dvh, 600px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(22, 32, 58, 0.10);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px -24px rgba(22, 32, 58, 0.45);
  animation: chat-in 0.22s ease both;
}

@keyframes chat-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.chat-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.chat-title { min-width: 0; }
.chat-title h2 { margin: 0; font-size: 16px; font-weight: 700; }
.chat-title p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }

.chat-actions { display: flex; gap: 6px; flex: none; }
.chat-actions button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.chat-actions button:active { background: var(--panel-2); }

.chat-messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  background: #f5f7fb;
}

.chat-empty {
  margin: auto;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.chat-empty strong { color: var(--text); font-size: 13px; font-weight: 600; }

.chat-row { display: flex; align-items: flex-start; justify-content: flex-start; gap: 8px; }
.chat-row.chat-mine { justify-content: flex-end; flex-direction: row-reverse; }
.chat-message-avatar { width: 46px; height: 46px; flex: none; border-radius: 15px; font-size: 18px; }

.chat-bubble {
  min-width: 0;
  max-width: 84%;
  padding: 10px 12px 8px;
  border: 1px solid rgba(22, 32, 58, 0.08);
  border-radius: 16px 16px 16px 5px;
  background: #fff;
  box-shadow: 0 8px 22px -18px rgba(22, 32, 58, 0.5);
}

.chat-mine .chat-bubble {
  border-color: rgba(15, 174, 124, 0.18);
  border-radius: 16px 16px 5px 16px;
  background: rgba(15, 174, 124, 0.10);
}

.chat-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1;
}

.chat-sender { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ttl { flex: none; font-variant-numeric: tabular-nums; }
.chat-ttl.expiring { color: var(--danger); font-weight: 700; }

.chat-form {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-form textarea {
  flex: 1;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  max-height: 96px;
  padding: 10px 12px;
  resize: none;
  border: 1px solid rgba(22, 32, 58, 0.12);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  outline: none;
}
.chat-form textarea:focus { border-color: rgba(15, 174, 124, 0.55); }
.chat-form textarea::placeholder { color: #8a94a8; }

.chat-send {
  flex: none;
  width: 58px;
  height: 42px;
  border: 0;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.chat-send:disabled { opacity: 0.4; cursor: default; }
.chat-send:active:not(:disabled) { filter: brightness(0.95); }

.chat-foot {
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 108px);
  transform: translate(-50%, 8px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(18, 23, 34, 0.94);
  border: 1px solid var(--line);
  color: #d5dbe8;
  font-size: 12.5px;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  z-index: 60;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.9);
}

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

/* ───────────── 信息弹层 ───────────── */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  background: rgba(4, 6, 10, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.2s ease both;
}

.sheet-card {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 24px 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
  border-radius: 26px 26px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #10141d;
  animation: slideUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

@keyframes slideUp {
  from { transform: translateY(28px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.sheet-card h2 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }

.sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid rgba(22, 32, 58, 0.05);
}
.sheet-row b { color: var(--text); font-weight: 500; }

.sheet-block { margin-top: 18px; }
.sheet-label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.4px; }

.sheet-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: #a4adbf;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(22, 32, 58, 0.035);
  border: 1px solid rgba(22, 32, 58, 0.05);
}

.peer-detail { display: flex; flex-direction: column; gap: 6px; }
.peer-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(22, 32, 58, 0.03);
}
.peer-line b { color: #cdd5e4; font-weight: 500; }
.peer-line .ok { color: var(--accent); }
.peer-line .warn { color: #f5c451; }
.peer-line .bad { color: #ff8b95; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

#inviteInput { font-size: 12px; height: 42px; }

.sheet .btn { margin-top: 20px; }

/* ───────────── 配对模式 ───────────── */

.mode-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
}

.mode-btn {
  flex: 1;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.mode-btn.active {
  background: rgba(22, 32, 58, 0.09);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(22, 32, 58, 0.06);
}

.pair-note {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

#pairPanel .btn { margin-top: 10px; }

.code-label {
  margin: 16px 0 7px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.code-area {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.32);
  color: #c9d2e3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.2px;
  resize: none;
  outline: none;
  word-break: break-all;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.code-area:focus {
  border-color: rgba(61, 220, 151, 0.45);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.09);
}

.pair-status {
  margin: 12px 0 0;
  min-height: 16px;
  font-size: 12px;
  color: var(--accent);
}

.turn-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.turn-box summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--muted);
  outline: none;
}

.turn-box[open] summary { margin-bottom: 10px; }

.turn-note {
  margin: 0 0 10px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #7d8798;
}

.turn-box input {
  height: 40px;
  font-size: 13px;
  margin-bottom: 8px;
}

.turn-box .input-row input { margin-bottom: 0; }
.turn-box .input-row { margin-bottom: 8px; }

.turn-status {
  margin: 8px 0 0;
  min-height: 14px;
  font-size: 11.5px;
  color: var(--accent);
}

.netcheck {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.32);
  color: #c9d2e3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
}

.pair-tip {
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: #7d8798;
}

.qr-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.qr-box canvas {
  width: 100%;
  max-width: 300px;
  height: auto;
  image-rendering: pixelated;
}

.qr-tip {
  margin: 0;
  font-size: 11.5px;
  color: #4a5568;
}

.btn-row {
  display: flex;
  gap: 8px;
}

.btn-row .btn {
  flex: 1;
  margin-top: 10px;
}

.scanner {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #000;
  display: flex;
  flex-direction: column;
}

.scanner video {
  flex: 1;
  width: 100%;
  object-fit: cover;
  min-height: 0;
}

.scanner-bar {
  display: flex;
  justify-content: center;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: #000;
}

.scanner-bar .btn {
  max-width: 240px;
}

@media (min-width: 620px) {
  .sheet { align-items: center; }
  .sheet-card { border-radius: 26px; border-bottom: 1px solid var(--line); max-height: 80dvh; }
}

@media (max-width: 380px) {
  .controls { gap: 14px; }
  .ctl { width: 56px; height: 56px; }
  .chat-panel { left: 8px; right: 8px; width: calc(100% - 16px); bottom: calc(env(safe-area-inset-bottom, 0px) + 90px); }
  .chat-header { padding: 12px; }
  .chat-title p { font-size: 10px; }
  .chat-actions button { padding: 0 8px; font-size: 11px; }
  .chat-foot span:last-child { display: none; }
}

@media (max-height: 560px) {
  .brand { margin-bottom: 16px; }
  .card { padding: 20px; }
  .grid { padding: 12px 16px; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(118px, 158px)); }
  .avatar { width: 50px; height: 50px; font-size: 19px; }
  .controls { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); }
  .ctl { width: 54px; height: 54px; }
}

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

/* 通话信息里的昵称输入框 */
.nick-edit {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(22, 32, 58, 0.14);
  background: rgba(22, 32, 58, 0.06);
  color: #e6ecf5;
  font-size: 14px;
}
.nick-edit:focus { outline: none; border-color: #3ddc97; }
/* 听筒 / 免提切换 */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.audio-btn {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(22, 32, 58, 0.16);
  background: rgba(22, 32, 58, 0.06);
  color: #cfd8e6;
  font-size: 13px;
  line-height: 1;
}
.audio-btn.speaker {
  border-color: #3ddc97;
  color: #3ddc97;
  background: rgba(61, 220, 151, 0.12);
}
/* ══════════ 亮色主题补充 ══════════ */

/* 通话页：只隐藏诊断用的统计条和重复的 ⓘ 按钮；
   安全码必须可见——它是防中间人的最后一环，藏在 CSS 里等于没有。 */
#stats, #infoBtn { display: none !important; }

/* 安全码胶囊：顶栏右上角，浅色主题 */
#sasBtn.sas {
  border: 1px solid rgba(22, 32, 58, 0.12);
  background: #fff;
  border-radius: 13px;
  padding: 5px 12px;
}
#sasBtn.sas .sas-code { color: var(--text); }
#sasBtn.sas.pending { opacity: 0.55; }
#sasBtn.sas:not(.pending) {
  border-color: rgba(15, 174, 124, 0.38);
  background: rgba(15, 174, 124, 0.08);
}
#sasBtn.sas:not(.pending) .sas-code { color: var(--accent); }
#meetingInviteBtn {
  white-space: nowrap;
}

/* 听筒/免提：放在原来 ⓘ 的位置，样式和圆形控制键一致 */
.audio-ctl {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text);
}
.audio-ctl.speaker {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(15, 174, 124, 0.10);
}

/* 主表面统一成白色卡片 */
.card, .tile, .pill, .sheet-card {
  background: #fff !important;
  border: 1px solid rgba(22, 32, 58, 0.08);
  box-shadow: 0 16px 40px -30px rgba(22, 32, 58, 0.45);
}
.btn.primary {
  box-shadow: 0 14px 30px -18px rgba(15, 174, 124, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.sas-label { color: var(--muted); }
input, textarea, .code-area {
  background: #fff;
  color: var(--text);
  border-color: rgba(22, 32, 58, 0.12);
}
/* 顶栏文字对比度 */
.pill { color: var(--text); }
.pill .dot-sep { color: var(--muted); }
.empty-title { color: var(--text); }
/* 手绘芯片图标 */
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(22, 32, 58, 0.10);
  box-shadow: 0 8px 18px -12px rgba(22, 32, 58, 0.5);
  object-fit: contain;
}
/* ══════════ 进入后选模式 ══════════ */
#modeChooser {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 16px;
  border-radius: 18px;
  border: 1px solid rgba(22, 32, 58, 0.10);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  box-shadow: 0 10px 24px -22px rgba(22, 32, 58, 0.55);
}
.mode-card:active {
  transform: scale(0.985);
  border-color: rgba(18, 184, 134, 0.45);
}
.mode-icon {
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--accent);
}
.mode-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.mode-main {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.mode-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.mode-arrow {
  flex: none;
  font-size: 22px;
  color: rgba(22, 32, 58, 0.25);
  line-height: 1;
}
.back-btn {
  width: auto !important;
  align-self: flex-start;
  margin: 0 0 12px 0;
  height: 34px;
  padding: 0 14px 0 10px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid rgba(22, 32, 58, 0.10);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.back-btn:active {
  background: rgba(22, 32, 58, 0.05);
}
/* ══════════ 发起界面：只有二维码 + 复制 + 转发 ══════════ */
.qr-actions {
  margin-top: 14px;
}
.qr-actions .btn {
  flex: 1;
}
.answer-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.answer-row input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(22, 32, 58, 0.12);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.answer-row input:focus {
  border-color: rgba(18, 184, 134, 0.55);
}
.answer-row .btn {
  flex: none;
  width: auto;
  padding: 0 18px;
  height: 44px;
}
#pairQrBox {
  margin-top: 6px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(22, 32, 58, 0.08);
}
#pairQrCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 280px;
  margin: 0 auto;
  border-radius: 8px;
}
/* 发起方界面：只留二维码 + 复制 + 转发，其余全部隐藏 */
#pairPanel.offering .pair-note,
#pairPanel.offering .pair-tip,
#pairPanel.offering #pairInBlock,
#pairPanel.offering #pairStatus,
#pairPanel.offering #pairResetBtn,
#pairPanel.offering #turnBox,
#pairPanel.offering #netCheckBtn,
#pairPanel.offering #netCheckBox {
  display: none !important;
}
/* ══════════ 两人会议：数字口令 ══════════ */
#pairNumBox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.num-input {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(22, 32, 58, 0.12);
  background: #fff;
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 8px;
  text-align: center;
  outline: none;
}
.num-input:focus { border-color: rgba(18, 184, 134, 0.55); }
.num-input::placeholder { font-size: 15px; font-weight: 400; letter-spacing: 1px; color: var(--muted); }

.pair-code-big {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 10px;
  color: var(--text);
  text-indent: 10px;
  margin: 6px 0 4px;
}
.pair-code-actions {
  margin-top: 10px;
  width: 100%;
  max-width: 260px;
}
/* 配对码：文本形式展示（等宽、可滚动、可全选） */
.code-out {
  width: 100%;
  min-height: 142px;
  max-height: 180px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(22, 32, 58, 0.12);
  background: #fff;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-all;
  resize: none;
  outline: none;
  margin-bottom: 12px;
}
.code-out:focus { border-color: rgba(18, 184, 134, 0.55); }
/* ══════════ 两人会议：开始页只留两个按钮 ══════════ */
#pairPanel .pair-note,
#pairPanel .pair-tip,
#pairPanel #turnBox,
#pairPanel #netCheckBtn,
#pairPanel #netCheckBox {
  display: none !important;
}
/* 离线兜底提示条 */
.offline-banner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 176, 32, 0.12);
  border: 1px solid rgba(255, 176, 32, 0.35);
  color: #8a5a00;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}
/* ══════════ 接听方：只有粘贴框 + 两个按钮，生成后只有码和复制/转发 ══════════ */
#pairPanel.answering .answer-row,
#pairPanel.answering #pairStatus,
#pairPanel.answering #pairResetBtn {
  display: none !important;
}
.code-in {
  width: 100%;
  min-height: 130px;
  max-height: 180px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(22, 32, 58, 0.12);
  background: #fff;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-all;
  resize: none;
  outline: none;
  margin-bottom: 12px;
}
.code-in:focus { border-color: rgba(18, 184, 134, 0.55); }
.code-in::placeholder {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: var(--muted);
}
#pairInBlock .btn-row .btn {
  flex: 1;
}
.offline-retry {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(138, 90, 0, 0.35);
  background: rgba(255, 255, 255, 0.7);
  color: #8a5a00;
  font-size: 12px;
  cursor: pointer;
}
.offline-retry:active { background: rgba(255, 255, 255, 0.95); }
/* 点击反馈动画：按下时缩小 + 提亮，松手回弹 */
.btn, .mode-card, .back-btn, .offline-retry, .btn-mini {
  transition: transform .09s ease, filter .09s ease, box-shadow .12s ease;
}
.btn:active, .mode-card:active, .back-btn:active,
.offline-retry:active, .btn-mini:active {
  transform: scale(0.955);
  filter: brightness(1.08);
}
.btn:disabled {
  transform: scale(0.97);
  filter: brightness(0.95);
  opacity: 0.85;
}
/* ══════════ 生成回答码的过渡界面 ══════════ */
#pairGenerating {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 34px 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(22, 32, 58, 0.08);
}
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(18, 184, 134, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.generating-text {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* ───────── 好友与群聊 ───────── */
.home-view { background: var(--surface-gray); --home-bg: var(--surface-gray); }
.home-top {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px; flex: none;
  background: var(--home-bg); border-bottom: 1px solid var(--line);
}
.home-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 7px; flex: none; }
.home-action-menu {
  position: fixed; z-index: 55; top: calc(env(safe-area-inset-top, 0px) + 58px); right: 12px;
  width: 196px; padding: 6px; border-radius: 12px; background: #2f3033;
  box-shadow: 0 16px 38px -16px rgba(15,23,42,.65);
}
.home-action-menu::before {
  content: ''; position: absolute; top: -6px; right: 43px; width: 12px; height: 12px;
  background: #2f3033; transform: rotate(45deg); border-radius: 2px 0 0 0;
}
.home-action-menu button {
  position: relative; display: flex; align-items: center; width: 100%; height: 48px; padding: 0 12px;
  border: 0; border-radius: 8px; background: transparent; color: #fff; font: 500 15px/1 inherit;
  text-align: left; cursor: pointer;
}
.home-action-menu button:active { background: #45464a; }
.home-action-menu svg { width: 22px; height: 22px; flex: none; margin-right: 12px; }
.home-action-menu .menu-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #f04452; color: #fff; font: 700 11px/20px inherit; text-align: center; }
.home-action-menu .menu-badge.hidden { display: none; }
.header-action {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer;
}
.header-action svg { width: 21px; height: 21px; }
.header-action.plus,
.header-action.settings { background: rgba(15,174,124,.11); color: var(--accent); }
.header-action.plus { font-size: 25px; line-height: 1; }
.home-logo {
  grid-column: 2; grid-row: 1; justify-self: center;
  width: auto; height: 44px; object-fit: contain; pointer-events: none; user-select: none;
}
.header-action:active { background: var(--panel-2); }
.social-status {
  display: inline-flex; align-items: center; gap: 5px; margin-right: 2px;
  color: var(--muted); font-size: 10px; white-space: nowrap;
}
.social-status i { width: 6px; height: 6px; border-radius: 50%; background: #f0a33a; }
.social-status.online i { background: var(--accent); box-shadow: 0 0 0 3px rgba(15,174,124,.12); }
.social-status.offline i { background: #a3adbd; }
.home-scroll {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 0 calc(env(safe-area-inset-bottom, 0px) + 28px);
}
.home-section {
  width: min(680px, 100%); margin: 0 auto 12px; padding: 0;
  background: var(--home-bg); border: 0; border-radius: 0; box-shadow: none;
}
.section-heading { padding: 16px 18px 8px; margin: 0; }
.section-heading h2 { margin: 0; font-size: 16px; color: var(--text); }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.conversation-section { margin-top: 8px; padding-bottom: 8px; }
.social-list { padding: 0 10px 6px; }
.social-row { border-bottom: 1px solid var(--line); border-radius: 0; }
.social-row:last-child { border-bottom: 0; }
.list-empty { padding: 20px 18px 26px; }

/* ───────── 首次注册 ───────── */
.register-view {
  display: flex; align-items: center; justify-content: flex-start; padding: 24px; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  background: linear-gradient(160deg, #f7fffc 0%, var(--bg) 48%, #eef6ff 100%);
}
.register-card {
  flex: none; width: min(420px, 100%); margin: auto 0; padding: 30px 24px 24px; border: 1px solid var(--line);
  border-radius: 24px; background: #fff; box-shadow: 0 24px 70px -38px rgba(22,32,58,.45);
  text-align: center;
}
.register-card .brand-logo { width: 64px; height: 64px; margin-bottom: 14px; }
.register-card h1 { margin: 0; font-size: 23px; }
.register-card > p { margin: 9px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.register-card label { display: block; margin-bottom: 8px; color: var(--text); font-size: 13px; font-weight: 650; text-align: left; }
.register-card input { width: 100%; height: 48px; }
.register-card .register-avatar-label { margin-top: 18px; }
.register-card .profile-avatar-row { text-align: left; }
.register-card .profile-avatar-grid { margin-bottom: 0; text-align: left; }
.register-card .btn { width: 100%; margin-top: 14px; }
.register-card > small { display: block; margin-top: 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.auth-switch { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.auth-switch button, .auth-text-button { border: 0; background: transparent; color: var(--accent); font: 650 12px inherit; padding: 4px; cursor: pointer; }
.auth-text-button { display: block; width: 100%; margin-top: 10px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.account-sync-note { margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.recovery-code { margin: 4px 0 14px; padding: 16px 12px; border-radius: 14px; background: var(--panel-2); color: var(--text); font: 700 20px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; text-align: center; word-break: break-all; user-select: all; }
.identity-card > label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.identity-card input { height: 44px; }
.identity-card .btn-mini { height: 44px; }
.friend-code-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.friend-code-row div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.friend-code-row span { font-size: 13px; font-weight: 650; color: var(--text); }
.friend-code-row small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 17px; color: var(--text); }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.round-add {
  width: 36px; height: 36px; border-radius: 12px; border: 0; flex: none;
  background: rgba(15,174,124,.11); color: var(--accent); font-size: 24px; line-height: 1; cursor: pointer;
}
.heading-actions { display: flex; align-items: center; gap: 10px; }
.text-action { border: 0; background: transparent; color: var(--accent); font: 600 13px inherit; cursor: pointer; padding: 8px 2px; }
.social-list { display: flex; flex-direction: column; gap: 4px; }
.social-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 8px;
  border: 0; border-radius: 15px; background: transparent; color: var(--text);
  text-align: left; cursor: pointer; transition: background .15s ease;
}
.social-row:hover, .social-row:active { background: var(--panel-2); }
.social-row.friend-row { cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.social-row.friend-row.pressing { background: var(--panel-2); }
.social-avatar {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none; overflow: hidden;
  border-radius: 15px; color: #fff; font-size: 18px; font-weight: 700;
  background: linear-gradient(140deg, #34d399, #0d9488);
}
.social-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.social-row:nth-child(n) .social-avatar.group-avatar { display: grid; gap: 1px; padding: 0; background: var(--surface-gray); }
.group-avatar .group-avatar-tile { width: 100%; height: 100%; min-width: 0; border-radius: 0; font-size: 9px; box-shadow: 0 0 0 1px var(--surface-gray); }
.group-avatar[data-count="2"] .group-avatar-tile { font-size: 10px; }
.group-avatar[data-count="3"] .group-avatar-tile { font-size: 10px; }
.group-avatar[data-count="3"] .group-avatar-tile:first-child { font-size: 16px; }
.group-avatar[data-count="4"] .group-avatar-tile { font-size: 10px; }
.group-avatar[data-count="many"] .group-avatar-tile { font-size: 8px; }
.social-row:nth-child(3n+2) .social-avatar { background: linear-gradient(140deg,#60a5fa,#2563eb); }
.social-row:nth-child(3n+3) .social-avatar { background: linear-gradient(140deg,#a78bfa,#6d28d9); }
.social-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.social-row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.social-row-main small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 11px;
}
.social-row-main small.online { color: var(--accent); }
.social-row-time { color: #98a2b3; font-size: 10px; white-space: nowrap; }
.social-row-end { display: flex; align-items: center; gap: 8px; flex: none; }
.social-unread {
  display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
}
.row-arrow { color: #a3adbd; font-size: 22px; }
.missed-call-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 4px; }
.missed-call-heading strong { color: var(--danger); font-size: 13px; }
.missed-call-entry { display: flex; align-items: center; gap: 2px; }
.missed-call-row { flex: 1; min-width: 0; }
.missed-call-row .social-avatar { background: linear-gradient(140deg, #fda4af, #e11d48); }
.missed-call-row small { color: var(--danger); }
.missed-call-action { flex: none; color: var(--accent); font-size: 13px; font-weight: 650; }
.missed-call-clear { width: 34px; height: 40px; border: 0; background: transparent; color: #98a2b3; font-size: 22px; line-height: 1; cursor: pointer; }
.list-empty { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 24px 12px; color: var(--muted); text-align: center; }
.list-empty strong { color: var(--text); font-size: 13px; }
.list-empty span { max-width: 310px; font-size: 11px; line-height: 1.7; }
.friend-action-layer {
  position: fixed; inset: 0; z-index: 180; display: block;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.friend-action-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.friend-action-card {
  position: fixed; display: flex; flex-direction: column; width: min(240px, calc(100vw - 32px)); padding: 12px;
  border-radius: 20px; background: #fff; box-shadow: 0 30px 80px -30px rgba(15,23,42,.6);
}
.friend-action-item {
  display: block; width: 100%; height: 84px; padding: 0 16px; border: 0; border-radius: 13px;
  background: transparent; color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 22px; font-weight: 400;
  line-height: 1.2; letter-spacing: 0; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.friend-action-item + .friend-action-item { border-top: 1px solid #f0f2f5; border-radius: 0; }
.friend-action-item:hover, .friend-action-item:active { background: #f2f4f7; }
.friend-action-item.danger { color: #ef4444; }
.privacy-note { width: min(680px,100%); margin: 4px auto 0; color: var(--muted); font-size: 11px; line-height: 1.8; text-align: center; }

/* ───────── 社交会话 ───────── */
.social-chat-view { background: var(--surface-gray); }
.social-chat-top {
  position: relative;
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 12px;
  background: var(--surface-gray); border-bottom: 1px solid var(--line);
}
.chat-back { width: 38px; height: 38px; flex: none; border: 0; border-radius: 12px; background: transparent; color: var(--text); font-size: 28px; line-height: 1; cursor: pointer; }
.chat-back:active { background: var(--panel-2); }
.chat-group-invite {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 38px; margin-left: auto;
  padding: 0 11px; border: 0; border-radius: 12px; background: rgba(15,174,124,.11); color: var(--accent);
  font: 650 12px/1 inherit; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.chat-group-invite svg { width: 18px; height: 18px; }
.chat-group-invite:active { background: rgba(15,174,124,.2); }
.social-chat-top.group-chat .social-chat-title { right: 104px; }
.social-chat-title { position: absolute; left: 64px; right: 64px; min-width: 0; text-align: center; pointer-events: none; }
.social-chat-title h1 { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-messages {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 12px; padding: 18px 16px;
}
.social-messages .chat-row { width: 100%; }
.social-messages .chat-bubble { max-width: calc(100% - 54px); }
.social-messages .chat-mine .chat-bubble { max-width: calc(100% - 54px); }
.chat-image { display: block; width: min(280px, 62vw); max-height: 340px; object-fit: cover; border-radius: 13px; cursor: pointer; }
.chat-file {
  display: flex; align-items: center; gap: 11px; min-width: min(270px, 62vw); padding: 11px;
  border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.65);
}
.chat-file-icon { display: grid; place-items: center; width: 38px; height: 42px; flex: none; border-radius: 10px; background: rgba(15,174,124,.1); color: var(--accent); font-size: 10px; font-weight: 800; }
.chat-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.chat-file-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.chat-file-main small { color: var(--muted); font-size: 10px; }
.chat-file-save { flex: none; border: 0; border-radius: 9px; padding: 8px 10px; background: var(--accent); color: #fff; font: 600 11px inherit; cursor: pointer; }
.chat-progress { height: 4px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: var(--panel-2); }
.chat-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s ease; }
.chat-voice {
  display: grid; grid-template-columns: 22px auto minmax(46px, 1fr); align-items: center; gap: 9px;
  width: min(210px, 58vw); padding: 0; border: 0; background: transparent; color: var(--accent);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.chat-voice svg { width: 22px; height: 22px; pointer-events: none; }
.chat-voice-time { min-width: 30px; color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.chat-voice-track { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(15,174,124,.16); }
.chat-voice-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); }
.chat-voice.playing svg { animation: voice-speaker .8s ease-in-out infinite alternate; }
@keyframes voice-speaker { to { opacity: .55; transform: scale(.92); } }
.meeting-invite-btn { height: 38px; padding: 0 13px; border: 1px solid rgba(15,174,124,.22); border-radius: 12px; background: rgba(15,174,124,.1); color: var(--accent); font: 650 13px inherit; cursor: pointer; }
.meeting-friend-picker { display: flex; flex-direction: column; gap: 5px; }
.meeting-friend-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px; border: 0; border-radius: 13px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.meeting-friend-row:hover, .meeting-friend-row:active { background: var(--panel-2); }
.meeting-friend-row:disabled { cursor: default; opacity: .7; }
.meeting-friend-row .social-avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 15px; }
.meeting-friend-row strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.meeting-friend-row > span:last-child { flex: none; color: var(--accent); font-size: 12px; }
.meeting-batch-bar { flex: none; padding: 12px 14px; border-top: 1px solid rgba(15,174,124,.16); background: #f4fff9; box-shadow: 0 -10px 28px -24px rgba(15,174,124,.7); }
.meeting-batch-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.meeting-batch-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meeting-batch-copy strong { color: var(--text); font-size: 13px; }
.meeting-batch-copy span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.meeting-batch-actions { display: flex; gap: 7px; flex: none; }
.meeting-batch-actions button { height: 34px; padding: 0 11px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: 600 12px inherit; cursor: pointer; }
.meeting-batch-actions button:last-child { background: var(--panel-2); color: var(--muted); }
.meeting-batch-friends { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.meeting-batch-friends:empty { display: none; }
.meeting-batch-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text); font-size: 11px; }
.meeting-batch-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meeting-batch-avatar { width: 24px; height: 24px; flex: none; border-radius: 50%; font-size: 10px; }
.meeting-batch-chip button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--panel-2); color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.transfer-bar { display: flex; justify-content: space-between; gap: 12px; padding: 8px 18px; background: rgba(15,174,124,.08); color: var(--accent); font-size: 11px; }
.social-composer { flex: none; padding: 10px 14px calc(env(safe-area-inset-bottom, 0px) + 12px); background: var(--surface-gray); border-top: 1px solid var(--line); }
.social-composer { position: relative; }
.composer-row { display: flex; align-items: flex-end; gap: 9px; }
.composer-row textarea { flex: 1; min-width: 0; max-height: 100px; padding: 11px 13px; resize: none; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--text); font: 14px/1.5 inherit; outline: none; }
.composer-row textarea:focus { border-color: rgba(15,174,124,.55); }
.composer-row button { flex: none; height: 42px; padding: 0 17px; border: 0; border-radius: 13px; background: linear-gradient(135deg, #48e6a3, #29bbaa); color: #04140e; font: 650 13px inherit; cursor: pointer; }
.composer-row button:disabled { opacity: .4; cursor: default; }
.composer-plus { width: 42px; padding: 0 !important; background: rgba(15,174,124,.11) !important; color: var(--accent) !important; font-size: 25px !important; font-weight: 500 !important; line-height: 1; }
.composer-voice { display: grid; place-items: center; width: 42px; padding: 0 !important; background: rgba(15,174,124,.11) !important; color: var(--accent) !important; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.composer-voice svg { width: 22px; height: 22px; pointer-events: none; }
.composer-voice.recording { background: var(--danger) !important; color: #fff !important; animation: voice-pulse 1s ease-in-out infinite; }
.social-voice-status {
  position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; width: 82px; height: 82px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 24px; background: rgba(28,36,34,.94);
  box-shadow: 0 12px 34px rgba(0,0,0,.24); color: #fff; pointer-events: none;
}
.voice-recording-mic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: rgba(255,255,255,.12); }
.voice-recording-mic svg { width: 24px; height: 24px; }
.social-voice-status.canceling .voice-recording-mic { background: rgba(255,255,255,.18); }
@keyframes voice-pulse { 50% { opacity: .65; } }
.composer-menu { position: absolute; z-index: 25; right: 14px; bottom: calc(100% - 5px); width: 204px; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 18px 45px -20px rgba(22,32,58,.5); }
.composer-menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px; border: 0; border-radius: 11px; background: transparent; color: var(--text); font: 650 13px inherit; text-align: left; cursor: pointer; }
.composer-menu button:hover, .composer-menu button:active { background: var(--panel-2); }
.composer-menu i { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; background: rgba(15,174,124,.1); color: var(--accent); font-size: 17px; font-style: normal; }
.chat-video { display: block; width: min(260px, 62vw); max-height: 360px; border-radius: 12px; background: #111827; }
.chat-location { display: block; width: min(258px, 64vw); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--text); text-align: left; cursor: pointer; }
.chat-location-map { display: block; width: 100%; height: 118px; object-fit: cover; background: #e8eee9; }
.chat-location.no-map .chat-location-map { background: linear-gradient(145deg, #e7efe9, #dce7df); }
.chat-location-map-placeholder { position: relative; }
.chat-location-map-placeholder::before,
.chat-location-map-placeholder::after { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); content: ''; }
.chat-location-map-placeholder::before { width: 34px; height: 34px; border: 4px solid #fff; border-radius: 50%; background: #16a36a; box-shadow: 0 6px 14px rgba(15, 88, 57, .2); }
.chat-location-map-placeholder::after { width: 8px; height: 8px; margin-top: -2px; border-radius: 50%; background: #fff; }
.chat-location-info { display: grid; gap: 4px; padding: 10px 12px 11px; }
.chat-location strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.chat-location small { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.location-picker-open { overscroll-behavior: none; }
.location-picker { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; overflow: hidden; background: var(--surface-gray); }
.location-picker-header { position: relative; z-index: 3; display: grid; grid-template-columns: 76px minmax(0, 1fr) 76px; align-items: center; flex: none; min-height: calc(58px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 10px 0; border-bottom: 1px solid var(--line); background: var(--surface-gray); }
.location-picker-header h1 { margin: 0; font-size: 18px; font-weight: 650; text-align: center; }
.location-picker-header button { height: 42px; padding: 0 8px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font: 600 15px inherit; cursor: pointer; }
.location-picker-header button.primary { color: var(--accent); }
.location-picker-header button:disabled { opacity: .4; cursor: default; }
.location-map-area { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #edf1ee; }
.location-map { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.location-map:active { cursor: grabbing; }
.location-center-pin { position: absolute; left: 50%; top: 50%; width: 32px; height: 42px; transform: translate(-50%, -100%); filter: drop-shadow(0 5px 6px rgba(15, 88, 57, .25)); pointer-events: none; }
.location-center-pin span { position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border: 3px solid #fff; border-radius: 50%; background: #16a36a; }
.location-center-pin span::after { position: absolute; left: 7px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: #fff; content: ''; }
.location-center-pin::after { position: absolute; left: 11px; top: 24px; width: 10px; height: 15px; background: #16a36a; clip-path: polygon(0 0, 100% 0, 50% 100%); content: ''; }
.location-map-controls { position: absolute; right: 14px; bottom: 164px; display: grid; overflow: hidden; border: 1px solid rgba(22, 32, 58, .12); border-radius: 12px; background: rgba(255, 255, 255, .96); box-shadow: 0 8px 24px rgba(22, 32, 58, .13); }
.location-map-controls button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: var(--text); font: 400 25px/1 inherit; cursor: pointer; }
.location-map-controls button + button { border-top: 1px solid var(--line); }
.location-locate { position: absolute; left: 14px; bottom: 158px; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid rgba(22, 32, 58, .12); border-radius: 50%; background: rgba(255, 255, 255, .96); box-shadow: 0 8px 24px rgba(22, 32, 58, .13); color: var(--accent); cursor: pointer; }
.location-locate:disabled { opacity: .5; }
.location-locate svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.location-attribution { position: absolute; right: 7px; bottom: 4px; padding: 2px 5px; border-radius: 4px; background: rgba(255, 255, 255, .78); color: #65716a; font-size: 9px; pointer-events: none; }
.location-panel { position: relative; z-index: 2; flex: none; max-height: 48dvh; padding: 12px 12px calc(10px + env(safe-area-inset-bottom, 0px)); overflow: hidden; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; background: #fff; box-shadow: 0 -12px 36px rgba(22, 32, 58, .08); }
.location-search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #f4f5f7; }
.location-search svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.location-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 15px/1.4 inherit; }
.location-search input::-webkit-search-cancel-button { display: none; }
.location-selected { margin-top: 9px; }
.location-selected-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 7px 4px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; cursor: default; }
.location-selected-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: rgba(15, 174, 124, .1); color: var(--accent); }
.location-selected-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.location-selected-item > span:last-child { display: grid; gap: 3px; min-width: 0; }
.location-selected-item strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.location-selected-item small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.location-results { max-height: 30dvh; margin-top: 4px; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.location-result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 5px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--text); text-align: left; cursor: pointer; }
.location-result:last-child { border-bottom: 0; }
.location-result > span { display: grid; gap: 4px; min-width: 0; }
.location-result strong { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.location-result small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.location-distance { flex: none; color: var(--accent) !important; white-space: nowrap; }
.location-empty { padding: 14px 4px; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-height: 620px) {
  .location-panel { max-height: 52dvh; padding-top: 8px; }
  .location-map-controls { bottom: 138px; }
  .location-locate { bottom: 132px; }
  .location-results { max-height: 22dvh; }
}
.media-record-dialog { z-index: 80; background: rgba(15,23,42,.72); }
.media-record-card { width: min(420px, 100%); padding: 16px; border-radius: 20px; background: #fff; box-shadow: 0 24px 70px rgba(15,23,42,.3); }
.media-record-card header { display: flex; justify-content: center; padding: 2px 0 14px; }
.media-record-card h2 { margin: 0; font-size: 17px; }
.media-preview { display: grid; place-items: center; min-height: 220px; overflow: hidden; border-radius: 14px; background: #111827; }
.media-preview video { width: 100%; max-height: 52vh; object-fit: contain; }
.media-audio-preview { display: grid; place-items: center; gap: 10px; width: 100%; height: 220px; color: #fff; }
.media-audio-preview span { color: #ef4444; font-size: 28px; animation: voice-pulse 1s infinite; }
.media-audio-preview strong { font-size: 30px; font-variant-numeric: tabular-nums; }
.media-record-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.media-record-actions button { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); font: 650 14px inherit; }
.media-record-actions button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.media-record-actions button:disabled { opacity: .45; }

/* ───────── 弹窗 ───────── */
.dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15,23,42,.42); backdrop-filter: blur(5px); }
.fullscreen-dialog { padding: 0; background: var(--surface-gray); backdrop-filter: none; -webkit-backdrop-filter: none; }
.fullscreen-dialog .dialog-card { display: flex; flex-direction: column; width: 100%; height: 100dvh; max-height: none; padding: 0; overflow: hidden; border-radius: 0; background: var(--surface-gray); box-shadow: none; }
.fullscreen-dialog .dialog-card > header { position: relative; z-index: 2; flex: none; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; min-height: 64px; margin: 0; padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px; border-bottom: 1px solid var(--line); background: var(--surface-gray); }
.fullscreen-dialog .dialog-card h2 { grid-column: 2; grid-row: 1; text-align: center; font-size: 18px; }
.fullscreen-dialog #socialDialogClose,
.fullscreen-dialog #meetingDialogClose { grid-column: 1; grid-row: 1; width: 42px; height: 42px; border-radius: 13px; background: transparent; color: var(--text); font-size: 32px; line-height: 1; }
.fullscreen-dialog #socialDialogBody,
.fullscreen-dialog #roomPanel { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 20px 18px calc(env(safe-area-inset-bottom, 0px) + 28px); -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; touch-action: pan-y; }
.dialog-card { width: min(430px,100%); max-height: 84dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px; border-radius: 23px; background: #fff; box-shadow: 0 30px 90px -30px rgba(15,23,42,.6); }
.dialog-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-card h2 { margin: 0; font-size: 18px; }
.dialog-card > header button { width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--panel-2); color: var(--muted); font-size: 23px; cursor: pointer; }
.dialog-card p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.meeting-dialog .dialog-card { padding: 20px; }
.meeting-dialog .dialog-card input {
  border-color: var(--line); background: #fff; color: var(--text);
}
.meeting-dialog .dialog-card input::placeholder { color: #98a2b3; }
.meeting-dialog .dialog-card input:focus {
  border-color: rgba(15,174,124,.55); background: #fff;
  box-shadow: 0 0 0 4px rgba(15,174,124,.1);
}
.meeting-dialog .btn-mini { background: #fff; color: var(--text); }
.meeting-dialog .error { color: #c92a3b; background: #fff1f2; border-color: #fecdd3; }
.meeting-dialog .server-hint { color: var(--muted); }
.dialog-card textarea { width: 100%; min-height: 120px; padding: 12px; resize: vertical; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: #fff; font: 13px/1.6 inherit; }
.dialog-card label.field-label { display: block; margin: 12px 0 7px; color: var(--muted); font-size: 12px; }
.dialog-search { display: flex; gap: 8px; margin-top: 10px; }
.add-friend-dialog .dialog-search { margin-top: 0; }
.dialog-search input { flex: 1; min-width: 0; height: 52px; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: #fff; font: 16px/1.5 inherit; outline: none; }
.dialog-search input:focus { border-color: rgba(15,174,124,.55); }
.dialog-search .btn { flex: none; height: 52px; margin: 0; padding: 0 20px; font-size: 15px; }
.add-friend-dialog .dialog-search .btn { flex: 0 0 72px; width: 72px; height: 52px; padding: 0 10px; font-size: 14px; }
.profile-avatar-row { display: flex; align-items: center; gap: 16px; margin: 2px 0 16px; }
.profile-avatar-preview { width: 76px; height: 76px; border-radius: 22px; font-size: 28px; }
.profile-avatar-controls { display: flex; flex: 1; flex-wrap: wrap; gap: 8px; }
.profile-avatar-controls .btn { margin: 0; }
.profile-avatar-tabs { display: flex; gap: 4px; margin: 9px 0 8px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2); }
.profile-avatar-tab { display: inline-flex; flex: 1 1 0; align-items: center; justify-content: center; gap: 5px; min-width: 0; height: 38px; margin: 0; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; color: #55627b; font-family: inherit; font-size: 13px; font-weight: 650; line-height: 1; cursor: pointer; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.profile-avatar-tab:hover:not(.active) { color: var(--text); }
.profile-avatar-tab:focus-visible { outline: 2px solid rgba(15,174,124,.45); outline-offset: 1px; }
.profile-avatar-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(22,32,58,.12), inset 0 0 0 1px rgba(22,32,58,.05); }
.profile-avatar-tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 17px; padding: 0 5px; border-radius: 999px; background: rgba(22,32,58,.08); color: #3f4b66; font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.profile-avatar-tab.active .profile-avatar-tab-count { background: rgba(15,174,124,.14); color: #0b6b4e; }
.profile-avatar-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; max-height: 276px; margin-bottom: 16px; padding: 3px 3px 3px 6px; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: rgba(15,174,124,.45) transparent; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-2); }
.profile-avatar-grid::-webkit-scrollbar { width: 5px; }
.profile-avatar-grid::-webkit-scrollbar-track { background: transparent; }
.profile-avatar-grid::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(15,174,124,.45); }
.profile-avatar-option { display: grid; place-items: center; width: 100%; aspect-ratio: 1; min-width: 0; margin: 0 !important; padding: 3px !important; border: 2px solid transparent !important; border-radius: 11px; background: #fff !important; cursor: pointer; }
.profile-avatar-option img { display: block; width: 100%; height: 100%; border-radius: 7px; object-fit: contain; pointer-events: none; }
.profile-avatar-option:hover, .profile-avatar-option:active { border-color: rgba(15,174,124,.35) !important; }
.profile-avatar-option.selected { border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(15,174,124,.14); }
.profile-name-input, .profile-name-input:focus { background: #fff; scroll-margin-bottom: 180px; }
.settings-language-select { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--text); font: 15px/1.5 inherit; outline: none; }
.settings-language-select:focus { border-color: rgba(15,174,124,.55); box-shadow: 0 0 0 4px rgba(15,174,124,.1); }
.search-results { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.search-result { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 8px; border: 0; border-radius: 13px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.search-result:hover, .search-result:active { background: var(--panel-2); }
.search-result .social-avatar { width: 40px; height: 40px; border-radius: 13px; font-size: 16px; }
.search-result-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.search-result-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.search-result-main small { color: var(--muted); font-size: 10px; }
.search-result-action { flex: none; border: 0; border-radius: 9px; padding: 7px 11px; background: rgba(15,174,124,.11); color: var(--accent); font: 650 11px inherit; }
.search-result:disabled { cursor: default; opacity: .65; }
.search-result:disabled .search-result-action { background: var(--panel-2); color: var(--muted); }
.search-empty { padding: 14px 8px 4px; text-align: center; }
.account-card { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.account-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.account-card-label { color: var(--muted); font-size: 11px; }
.account-card-uid { color: var(--text); font: 700 17px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.account-card-actions { display: flex; flex: none; gap: 6px; }
.account-card-actions .btn { width: auto; height: 36px; margin: 0; padding: 0 12px; border-radius: 10px; font-size: 12px; }
.add-friend-actions { display: flex; gap: 8px; margin-top: 10px; }
.add-friend-actions .btn { flex: 1; height: 40px; margin: 0; font-size: 12px; border-radius: 11px; }
.add-friend-scan { display: flex; gap: 7px; margin-top: 8px; }
.add-friend-scan .btn { flex: 1; height: 38px; margin: 0; padding: 0 6px; border-radius: 10px; font-size: 11px; }
.search-result-card { cursor: default; }
.search-result-card:hover, .search-result-card:active { background: transparent; }
.search-result-card .search-result-action { flex: none; width: auto; height: 34px; margin: 0; padding: 0 12px; border-radius: 9px; font-size: 12px; box-shadow: none; }
.friend-qr-canvas { display: block; width: min(280px, 72vw); height: auto; margin: 4px auto 10px; border-radius: 12px; background: #fff; }
.friend-qr-uid { margin: 0 0 4px; text-align: center; color: var(--text); font: 650 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.request-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.request-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 10px; border: 1px solid var(--line); border-radius: 15px; background: #fff; text-align: left; color: var(--text); }
.request-row .social-avatar { width: 42px; height: 42px; border-radius: 13px; font-size: 16px; }
.request-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.request-main strong { font-size: 13px; }
.request-main small { color: var(--muted); font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.request-main p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.request-actions { display: flex; flex-direction: column; gap: 5px; flex: none; }
.request-actions .btn { width: auto; height: 30px; margin: 0; padding: 0 9px; border-radius: 8px; font-size: 11px; }
.request-row-button { width: 100%; cursor: pointer; }
.request-row-button:active { background: var(--panel-2); }
.request-row .request-action { flex: none; width: auto; height: 32px; margin: 0; padding: 0 10px; border-radius: 8px; font-size: 11px; }
.request-detail-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.request-detail-head .social-avatar { width: 48px; height: 48px; border-radius: 15px; font-size: 18px; }
.request-detail-head div { display: flex; flex-direction: column; gap: 4px; }
.request-detail-head strong { font-size: 15px; }
.request-detail-head small { color: var(--muted); font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.message-request-text { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); color: var(--text); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.account-card-main small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.account-privacy-row { display: flex; align-items: center; gap: 9px; margin: 12px 0; color: var(--text); font-size: 13px; }
.account-privacy-row input { width: 18px; height: 18px; }
.account-entry-button { margin: 2px 0 4px; height: 44px; font-size: 13px; }
.account-uid-edit .btn { flex: 0 0 82px; width: 82px; height: 52px; margin: 0; padding: 0 10px; border-radius: 14px; font-size: 14px; }
.account-uid-edit input:disabled { color: var(--muted); background: var(--panel-2); }
.dialog-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--muted); font-size: 11px; }
.dialog-divider::before, .dialog-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.meeting-invite-avatar { width: 64px; height: 64px; margin: 0 auto 4px; border-radius: 20px; font-size: 24px; }
.dialog-actions { display: flex; gap: 9px; margin-top: 14px; }
.dialog-actions .btn { margin: 0; }
.settings-background-button { width: 100%; margin-top: 14px; }
.settings-version-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--muted); font-size: 13px; }
.settings-version-row strong { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.group-picker { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; margin-top: 8px; }
.group-pick { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; cursor: pointer; }
.group-pick:hover { background: var(--panel-2); }
.group-pick input {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; flex: none; margin: 0; padding: 0;
  border: 1.5px solid #c7cfdb; border-radius: 6px; background: #fff;
  box-shadow: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.group-pick input:focus { border-color: #c7cfdb; background: #fff; box-shadow: none; }
.group-pick input:checked, .group-pick input:checked:focus {
  border-color: var(--accent); background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.4 8.6l3.1 3.1 6.1-6.4'/%3E%3C/svg%3E");
  background-size: 12px 12px; background-position: center; background-repeat: no-repeat;
}
.group-pick .social-avatar { width: 36px; height: 36px; border-radius: 12px; font-size: 15px; }
.group-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.group-pick small { color: var(--muted); font-size: 10px; }
#groupNameInput, #groupNameInput:focus { background: #fff; }
.dialog-error { color: var(--danger) !important; }
.home-menu { display: flex; flex-direction: column; gap: 8px; }
.home-menu .btn { width: 100%; justify-content: flex-start; }
.code-box { padding: 12px; border-radius: 12px; background: var(--panel-2); color: var(--text); font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-all; user-select: all; }
.update-dialog { z-index: 60; }
.update-version { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.update-version span { color: var(--accent); font-size: 25px; font-weight: 750; letter-spacing: -.5px; }
.update-version small { color: var(--muted); font-size: 11px; }
.update-notes-label { margin: 0 0 6px !important; color: var(--text) !important; font-size: 12px !important; font-weight: 650; }
.update-notes { max-height: 220px; overflow-y: auto; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); color: var(--muted); font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.update-progress { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.update-progress-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.update-progress-label strong { color: var(--accent); font-size: 11px; }
.update-progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(120, 135, 155, .18); }
.update-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
.update-progress.failed .update-progress-label span { color: var(--danger); }
.update-progress.failed .update-progress-track span { background: var(--danger); }
.update-dialog .btn:disabled { cursor: default; opacity: .65; }
.background-guide-dialog { z-index: 65; }
.background-guide-intro { margin: -4px 0 16px !important; }
.background-guide-list { display: flex; flex-direction: column; gap: 10px; }
.background-guide-step { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.background-guide-index { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 9px; background: rgba(15,174,124,.11); color: var(--accent); font-size: 12px; font-weight: 750; }
.background-guide-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.background-guide-main strong { color: var(--text); font-size: 13px; }
.background-guide-main small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.background-guide-main small.done { color: var(--accent); }
.background-guide-step .btn-mini { flex: none; height: 38px; margin: 0; padding: 0 12px; border-radius: 11px; font-size: 11px; }
.background-guide-step .btn-mini:disabled { cursor: default; opacity: .65; }

@media (max-width: 380px) {
  .home-top { padding-left: 12px; padding-right: 12px; }
  .social-status span { display: none; }
  .home-scroll { padding-left: 0; padding-right: 0; }
}
@media (min-width: 720px) {
  .social-messages { padding-left: max(24px, calc((100% - 760px) / 2)); padding-right: max(24px, calc((100% - 760px) / 2)); }
  .social-composer { padding-left: max(20px, calc((100% - 760px) / 2)); padding-right: max(20px, calc((100% - 760px) / 2)); }
}

/* ══════════ 视频通话：格子里的摄像头画面 ══════════ */
.tile-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  background: #0b1020;
  display: none;
  z-index: 1;
}
.tile.has-video .tile-video { display: block; }
.tile.has-video .avatar { display: none; }
.tile.has-video .tile-name {
  z-index: 3;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  border-radius: 8px;
  padding: 2px 8px;
}
.tile.has-video .mute-flag { z-index: 3; }
.tile { position: relative; overflow: hidden; }