/* TeleBird · 纸飞机移动端风格
 * 配色对齐 Telegram 浅色主题：#F5F5F5 背景 / #FFFFFF 卡片 / #2179D2 强调蓝
 * 保留暗色主题变量（切换功能不破坏），默认浅色。
 */
:root {
  --bg: #F5F5F5;
  --panel: #FFFFFF;
  --accent: #2179D2;
  --accent-soft: rgba(33, 121, 210, 0.1);
  --text: #1c1c1e;
  --text-2: #8e8e93;
  --divider: #ececf0;
  --bubble-own: #effdde;
  --bubble-other: #FFFFFF;
  --danger: #e06c6c;
  --ok: #4caf50;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 0, 0, 0.05);
  --shadow-nav: 0 4px 18px rgba(0, 0, 0, 0.14);
  --radius: 14px;
}
html[data-theme="dark"] {
  --bg: #0e1621;
  --panel: #17212b;
  --accent: #5eb5f7;
  --accent-soft: rgba(94, 181, 247, 0.15);
  --text: #f5f5f5;
  --text-2: #8e98a3;
  --divider: rgba(255, 255, 255, 0.08);
  --bubble-own: #2b5278;
  --bubble-other: #182533;
  --danger: #ef6c6c;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-nav: 0 4px 18px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
}
button { font-family: inherit; font-size: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input, textarea { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }
svg { display: block; }
a { text-decoration: none; color: var(--accent); }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.18); border-radius: 4px; }

/* ================= 登录页 ================= */
#auth-screen {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px; overflow-y: auto;
}
.auth-box { width: 360px; max-width: 100%; display: flex; flex-direction: column; gap: 10px; }
.auth-logo { width: 72px; height: 72px; margin: 0 auto; color: var(--accent); }
.auth-logo svg { width: 72px; height: 72px; }
.auth-box h1 { text-align: center; font-size: 26px; font-weight: 800; color: var(--accent); }
.auth-sub { text-align: center; color: var(--text-2); font-size: 12px; line-height: 1.6; }
.tabs { display: flex; background: var(--panel); border-radius: 12px; padding: 4px; margin-top: 8px; }
.tabs .tab { flex: 1; padding: 9px 0; border-radius: 9px; color: var(--text-2); font-weight: 600; }
.tabs .tab.active { background: var(--accent); color: #fff; }
.auth-box input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--divider); border-radius: 12px;
  background: var(--panel); color: var(--text); outline: none; margin-top: 6px;
}
.auth-box input:focus { border-color: var(--accent); }
.auth-box .primary {
  margin-top: 8px; padding: 12px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600;
}
#auth-screen button.primary:active { opacity: 0.85; }
.auth-hint { text-align: center; color: var(--text-2); font-size: 12px; margin-top: 4px; }
.msg { text-align: center; color: var(--accent); font-size: 12px; min-height: 18px; padding-top: 4px; }

/* ================= 主界面容器 ================= */
#app-screen { position: fixed; inset: 0; z-index: 10; }
#mobile-app { position: relative; width: 100%; height: 100%; max-width: 520px; margin: 0 auto; background: var(--bg); }

/* ================= 页面切换 ================= */
.page { display: none; position: absolute; inset: 0; flex-direction: column; overflow-y: auto; padding-bottom: 108px; }
.page.active { display: flex; }

/* ================= 顶栏 ================= */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 8px; background: var(--bg);
}
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-title { font-size: 19px; font-weight: 800; color: var(--accent); letter-spacing: -0.2px; }
.tb-actions { display: flex; align-items: center; gap: 2px; }
.tb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; color: var(--text);
}
.tb-btn:active { background: var(--accent-soft); color: var(--accent); }
.tb-btn svg { width: 22px; height: 22px; }
.tb-btn.on { color: var(--accent); background: var(--accent-soft); }

/* ================= 头像 ================= */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #66b2f0, #3b8fd9); color: #fff; font-weight: 700; font-size: 20px;
  user-select: none; box-shadow: var(--shadow);
}
.avatar-xl { width: 108px; height: 108px; font-size: 44px; box-shadow: 0 4px 18px rgba(0,0,0,0.14); }

/* ================= 搜索框 ================= */
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  margin: 2px 12px 10px; padding: 9px 12px;
  background: var(--panel); border-radius: 12px; color: var(--text-2);
  box-shadow: var(--shadow);
}
.search-wrap svg { width: 18px; height: 18px; flex-shrink: 0; }
.search-wrap input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: 14px;
}
.search-wrap input::placeholder { color: var(--text-2); }

/* 搜索结果 */
#search-results {
  margin: 0 12px 8px; background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; max-height: 46vh; overflow-y: auto;
}
.search-sep {
  padding: 8px 14px 4px; font-size: 12px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.4px;
}
#search-results .chat-item { border-bottom: 1px solid var(--divider); border-radius: 0; }

/* ================= 过滤标签 ================= */
#filter-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 12px 10px; white-space: nowrap;
  scrollbar-width: none;
}
#filter-tabs::-webkit-scrollbar { display: none; }
.ft {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--panel); color: var(--text-2); box-shadow: var(--shadow); flex-shrink: 0;
}
.ft.active { background: var(--accent); color: #fff; }

/* ================= 聊天列表 ================= */
#chat-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 12px 8px; }
.chat-list-empty { padding: 48px 20px; text-align: center; color: var(--text-2); font-size: 14px; line-height: 2; }
.chat-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border-radius: var(--radius); padding: 10px 12px;
  box-shadow: var(--shadow); cursor: pointer;
}
.chat-item.active { background: var(--accent-soft); }
.chat-item:active { transform: scale(0.985); }
.ci-body { flex: 1; min-width: 0; }
.ci-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ci-title {
  font-weight: 700; color: var(--text); font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.ci-top-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ci-muted { display: inline-flex; color: var(--text-2); }
.ci-muted svg { width: 14px; height: 14px; }
.ci-time { font-size: 12px; color: var(--text-2); flex-shrink: 0; }
.ci-preview {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px;
  font-size: 13px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ci-badge {
  flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; margin-left: 8px;
}
.ci-badge.over { background: #e0e0e0; color: #666; }
.ci-secret { font-size: 12px; color: var(--accent); margin-top: 1px; }

/* ================= 浮动操作按钮 ================= */
.fab {
  position: fixed; right: max(16px, calc(50% - 244px)); bottom: 104px; z-index: 9;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(33, 121, 210, 0.45);
  transition: transform 0.15s ease;
}
.fab:active { transform: scale(0.92); }
.fab svg { width: 26px; height: 26px; }

/* ================= 新建菜单（从 FAB 弹出） ================= */
.new-menu {
  position: fixed; right: max(12px, calc(50% - 248px)); bottom: 168px; z-index: 12;
  width: 230px; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-nav);
  overflow: hidden; padding: 6px;
}
.new-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  border-radius: 10px; text-align: left;
}
.new-menu button:active { background: var(--accent-soft); }
.new-menu button svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.new-menu button span { display: flex; flex-direction: column; min-width: 0; }
.new-menu .nm-desc { font-size: 11px; color: var(--text-2); }

/* ================= 底部导航 ================= */
#tab-bar {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 11;
  display: flex; gap: 4px; padding: 6px; width: calc(100% - 24px); max-width: 496px;
  background: var(--panel); border-radius: 20px; box-shadow: var(--shadow-nav);
}
.tab-btn {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 14px; color: var(--text-2); transition: all 0.15s ease;
}
.tab-btn .tab-ic { display: inline-flex; position: relative; }
.tab-btn .tab-ic svg { width: 24px; height: 24px; }
.tab-btn .tab-lb { font-size: 11px; font-weight: 600; }
.tab-btn.active { color: var(--accent); background: var(--accent-soft); }
.tab-badge {
  position: absolute; top: 2px; right: calc(50% - 22px); min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--panel);
}

/* ================= 联系人页 ================= */
#contact-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 12px 8px; }
.contact-group-title { padding: 2px 4px 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.card {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid var(--divider); cursor: pointer;
}
.card-row:last-child { border-bottom: 0; }
.card-row:active { background: var(--accent-soft); }
.cr-ic {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.cr-ic svg { width: 20px; height: 20px; }
.cr-body { flex: 1; min-width: 0; }
.cr-title { font-size: 15px; font-weight: 600; color: var(--text); }
.cr-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.cr-label { font-size: 15px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.cr-value { font-size: 14px; color: var(--text-2); flex-shrink: 0; }
.cr-arrow { color: var(--text-2); flex-shrink: 0; }
.cr-arrow svg { width: 18px; height: 18px; }
.contact-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 14px;
  border-bottom: 1px solid var(--divider); cursor: pointer;
}
.contact-item:last-child { border-bottom: 0; }
.contact-item:active { background: var(--accent-soft); }
.contact-item .avatar { width: 44px; height: 44px; font-size: 18px; }

/* ================= 设置页 ================= */
#settings-content { display: flex; flex-direction: column; gap: 10px; padding: 4px 12px 8px; }
.settings-profile { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; }
.settings-profile:active { background: var(--accent-soft); }
.settings-profile .avatar { width: 64px; height: 64px; font-size: 26px; }
.sp-info { flex: 1; min-width: 0; }
.sp-name { font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-user { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* ================= 个人资料页 ================= */
#profile-content { padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.profile-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0 4px; }
.ph-name { font-size: 22px; font-weight: 800; color: var(--text); }
.ph-status { font-size: 13px; color: var(--ok); font-weight: 600; }
.profile-actions { display: flex; gap: 8px; }
.pbtn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 4px; font-size: 12px; color: var(--text-2); font-weight: 600;
}
.pbtn:active { background: var(--accent-soft); color: var(--accent); }
.pbtn svg { width: 22px; height: 22px; color: var(--accent); }
.profile-hint { text-align: center; color: var(--text-2); font-size: 12px; margin-top: 4px; }

/* ================= 聊天详情 ================= */
#chat-detail {
  position: absolute; inset: 0; z-index: 15; display: flex; flex-direction: column;
  background: var(--bg);
}
#chat-detail.hidden { display: none; }
#chat-header {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--bg);
}
.ch-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.ch-info .avatar { width: 40px; height: 40px; font-size: 17px; }
#ch-title { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 12px; color: var(--text-2); }
.ch-actions { display: flex; align-items: center; gap: 4px; }
.chip {
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
  background: var(--panel); color: var(--text-2); box-shadow: var(--shadow);
}
.chip.on { background: var(--accent); color: #fff; }

.center-hint {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--text-2); font-size: 14px; text-align: center; line-height: 1.8;
  z-index: 1; pointer-events: none;
}
.ph-logo { width: 72px; height: 72px; color: var(--accent); opacity: 0.55; }
.ph-logo svg { width: 72px; height: 72px; }

/* 消息区 */
#messages {
  flex: 1; overflow-y: auto; padding: 10px 12px;
  background: var(--bg);
}
.msg-row { display: flex; margin-bottom: 6px; }
.msg-row.own { justify-content: flex-end; }
.msg-row.center { justify-content: center; }
.msg-row .bubble {
  position: relative; max-width: 78%;
  background: var(--bubble-other); color: var(--text);
  border-radius: 12px; padding: 8px 12px 6px;
  font-size: 14px; line-height: 1.5; word-break: break-word;
  box-shadow: var(--shadow);
}
.msg-row.own .bubble { background: var(--bubble-own); }
.bubble.secret { border: 1px dashed var(--danger); }
.bubble.deleted { opacity: 0.55; font-style: italic; }
.bubble.service-msg { background: transparent; box-shadow: none; color: var(--text-2); font-size: 12px; padding: 2px 8px; }
.bubble .sender { display: block; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.bubble .reply {
  font-size: 12px; color: var(--text-2); border-left: 3px solid var(--accent);
  padding: 2px 8px; margin: 4px 0; background: var(--accent-soft); border-radius: 4px;
}
.bubble .meta { text-align: right; font-size: 11px; color: var(--text-2); margin-top: 2px; user-select: none; }
.bubble code {
  background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 5px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
}
.bubble a { color: var(--accent); text-decoration: underline; word-break: break-all; }
.msg-actions { display: none; }
.msg-row:hover .msg-actions { display: flex; gap: 6px; align-self: center; margin-left: 6px; }
.msg-actions button {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
  background: var(--panel); border-radius: 999px; padding: 3px 8px; color: var(--text-2);
  box-shadow: var(--shadow);
}
.msg-actions button svg { width: 13px; height: 13px; }
.date-sep {
  text-align: center; font-size: 12px; color: var(--text-2);
  margin: 10px 0 6px; opacity: 0.9;
}
.typing { font-size: 12px; color: var(--text-2); padding: 4px 4px 8px; font-style: italic; }
.file-msg { display: flex; align-items: center; gap: 10px; }
.file-msg .icon { color: var(--accent); flex-shrink: 0; }
.file-msg .icon svg { width: 34px; height: 34px; }
.loading { display: flex; justify-content: center; padding: 40px 0; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--divider); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; color: var(--text-2); padding: 40px 16px; line-height: 1.9; }
.msg-row.hl .bubble { animation: hl 1.6s ease; }
@keyframes hl { 0%, 60% { background: #fff3bf; } 100% { background: var(--bubble-other); } }
.fail-tip { color: var(--danger); font-size: 11px; text-align: center; margin-top: 2px; }
.bubble.failed { background: rgba(224, 108, 108, 0.12); }

/* 语音消息 */
.voice-msg { display: flex; align-items: center; gap: 8px; min-width: 190px; max-width: 240px; }
.v-play {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.v-play svg { width: 16px; height: 16px; }
.v-play.playing { opacity: 0.85; }
.v-wave { display: flex; align-items: center; gap: 2px; flex: 1; height: 30px; overflow: hidden; }
.v-wave i { width: 3px; border-radius: 2px; background: var(--accent); opacity: 0.45; display: block; }
.v-dur { font-size: 11px; color: var(--text-2); white-space: nowrap; }

/* 消息翻译 */
.trans {
  font-size: 12px; color: var(--text-2); margin-top: 4px; padding-top: 4px;
  border-top: 1px dashed var(--divider); word-break: break-word;
}
.trans.loading-tr { color: var(--accent); border-top: 0; }
.msg-actions button.on { color: var(--accent); background: var(--accent-soft); }

/* 群成员卡片 / 成员详情 */
.m-card { display: flex; align-items: center; gap: 8px; padding: 8px 2px; }
.m-card.clickable { cursor: pointer; border-radius: 10px; }
.m-card.clickable:hover { background: var(--accent-soft); }
.m-detail-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--divider);
  font-size: 13px; color: var(--text-2);
}
.m-detail-row:last-of-type { border-bottom: 0; }
.m-detail-row b { color: var(--text); font-weight: 600; text-align: right; word-break: break-all; }

/* 频道横幅 */
#channel-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; font-size: 12px; color: var(--text-2);
  background: var(--panel); border-top: 1px solid var(--divider);
}
#channel-banner-text { flex: 1; min-width: 0; }

/* ================= 输入区 ================= */
#composer { background: var(--bg); padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); }
#reply-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border-radius: 12px 12px 0 0; padding: 6px 10px;
  font-size: 12px; color: var(--text-2);
}
#reply-bar button { color: var(--accent); display: inline-flex; }
#reply-bar svg { width: 16px; height: 16px; }
.composer-row {
  position: relative; display: flex; align-items: flex-end; gap: 6px;
  background: var(--panel); border-radius: 16px; padding: 6px 8px; box-shadow: var(--shadow);
}
.composer-row > button {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; color: var(--accent);
}
.composer-row > button:active { background: var(--accent-soft); }
.composer-row svg { width: 22px; height: 22px; }
#btn-send { background: var(--accent); color: #fff; }
#input-editor {
  flex: 1; min-width: 0; min-height: 36px; max-height: 120px; overflow-y: auto;
  outline: none; padding: 7px 6px; font-size: 15px; color: var(--text);
}
#input-editor:empty::before { content: attr(data-placeholder); color: var(--text-2); }
#emoji-panel {
  position: absolute; bottom: 52px; left: 8px; z-index: 8;
  width: 280px; max-width: calc(100% - 16px); max-height: 240px; overflow-y: auto;
  background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-nav);
  padding: 10px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
}
#emoji-panel button { font-size: 22px; padding: 4px; border-radius: 8px; text-align: center; }
#emoji-panel button:active { background: var(--accent-soft); }

/* ================= 模态框 / 浮层 ================= */
.overlay {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.4);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal {
  width: 100%; max-width: 420px; max-height: 84vh; overflow-y: auto;
  background: var(--panel); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-nav);
}
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 10px; color: var(--text); }
.modal input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--divider); border-radius: 10px;
  background: var(--bg); color: var(--text); outline: none; margin-top: 6px;
}
.modal input:focus { border-color: var(--accent); }
.row { display: flex; gap: 8px; }
.row .primary { flex: 1; padding: 9px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; }
.member-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 2px;
  border-bottom: 1px solid var(--divider); font-size: 13px; color: var(--text);
}
.member-row:last-child { border-bottom: 0; }
.member-row .tag, .modal .tag { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; }
.g-op, .ci-op, .x-join, .sess-kick {
  font-size: 11px; padding: 4px 9px; border-radius: 999px; color: var(--accent);
  background: var(--accent-soft); font-weight: 600;
}
.x-join { flex-shrink: 0; }
#g-selected { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; }
#g-selected .member-row { border: 1px solid var(--divider); border-radius: 999px; padding: 3px 8px; background: var(--bg); }
.g-rm { color: var(--danger); font-weight: 700; margin-left: 4px; }

@media (max-width: 360px) {
  .tb-btn { width: 32px; height: 32px; }
  .tb-btn svg { width: 20px; height: 20px; }
  .fab { right: 12px; }
  .new-menu { right: 8px; }
}

/* ================= 视频/语音通话 ================= */
#call-incoming, #call-active {
  position: fixed; inset: 0; z-index: 60; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  background: rgba(14, 22, 33, 0.96);
}
#call-incoming.hidden, #call-active.hidden { display: none; }
.call-ring { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px; width: 100%; max-width: 380px; }
.call-ring-avatar { width: 92px; height: 92px; font-size: 38px; margin-bottom: 4px; }
.call-ring-name { font-size: 19px; font-weight: 700; color: #fff; }
.call-ring-sub { font-size: 13px; color: rgba(255, 255, 255, 0.72); }
.call-ring-actions { display: flex; gap: 34px; margin-top: 26px; }
.call-ctl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--panel); color: var(--text);
  box-shadow: var(--shadow-nav);
}
.call-ctl:active { opacity: 0.8; }
.call-ctl svg { width: 24px; height: 24px; }
.call-ctl.on { color: var(--accent); background: var(--accent-soft); }
.call-ctl.off { background: var(--danger); color: #fff; }
.call-ctl-ok { background: var(--ok); color: #fff; }
.call-ctl-hangup { background: var(--danger); color: #fff; }

.call-stage { position: absolute; inset: 0; background: #0e1621; overflow: hidden; }
.call-stage video { position: absolute; object-fit: cover; width: 100%; height: 100%; background: #0e1621; }
#call-local {
  position: absolute; right: 14px; top: 76px; z-index: 3;
  width: 108px; height: 144px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25); object-fit: cover;
  box-shadow: var(--shadow-nav);
}
.call-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px 34px; color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
}
#call-status-name { font-size: 16px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#call-state { font-size: 12px; color: rgba(255, 255, 255, 0.78); }
#call-timer { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.92); font-variant-numeric: tabular-nums; }
.call-controls {
  position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.call-zoom-wrap {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: center; gap: 8px;
  background: rgba(14, 22, 33, 0.88); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px; padding: 7px 14px;
  box-shadow: var(--shadow-nav); backdrop-filter: blur(6px);
}
.call-zoom-wrap.hidden { display: none; }
.call-zoom-label { font-size: 12px; color: rgba(255, 255, 255, 0.78); user-select: none; }
#call-zoom { width: 150px; accent-color: var(--accent); cursor: pointer; }

#call-panel {
  position: absolute; left: 12px; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 6;
  background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-nav);
  padding: 12px; max-height: 42vh; display: flex; flex-direction: column;
}
#call-panel.hidden { display: none; }
.call-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.call-panel-title { font-size: 13px; font-weight: 700; color: var(--text); }
.call-speak { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.call-speak input { accent-color: var(--accent); }
.call-panel-langs { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.call-panel-langs select {
  flex: 1; min-width: 0; padding: 6px 8px; font-size: 12px; color: var(--text);
  background: var(--bg); border: 1px solid var(--divider); border-radius: 9px; outline: none;
}
.call-panel-langs select:focus { border-color: var(--accent); }
.call-arrow { color: var(--accent); font-weight: 700; }
#btn-call-sub-clear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; color: var(--text-2); flex-shrink: 0;
}
#btn-call-sub-clear:active { background: var(--accent-soft); color: var(--accent); }
#btn-call-sub-clear svg { width: 15px; height: 15px; }
.call-sub-unsupported { font-size: 12px; color: var(--text-2); padding: 8px 2px; }
#call-sub-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.call-sub-row {
  background: var(--bg); border-radius: 10px; padding: 6px 9px;
  border-left: 3px solid var(--accent);
}
.call-sub-src { font-size: 11px; color: var(--text-2); word-break: break-word; margin-bottom: 2px; }
.call-sub-trans { font-size: 13px; color: var(--text); font-weight: 600; word-break: break-word; }

.call-toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 80;
  max-width: 82%; background: rgba(28, 28, 30, 0.92); color: #fff;
  font-size: 13px; padding: 9px 16px; border-radius: 999px;
  box-shadow: var(--shadow-nav); opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease; text-align: center;
}
.call-toast.show { opacity: 1; }

/* ================= Ի״̬ ================= */
.st-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-right: 5px; vertical-align: -1px; background: var(--ok);
}
.st-dot.st-online { background: var(--ok); }
.st-dot.st-busy { background: #e5484d; }
.st-dot.st-away { background: #f5a623; }
.st-dot.st-invisible { background: #9aa5b1; }
#ch-status .st-dot, .ci-preview .st-dot, .ci-secret .st-dot, .ph-status .st-dot { vertical-align: -1px; }
.status-card { padding: 12px; display: block; }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.status-opt {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 4px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 13px; color: var(--text-2); cursor: pointer; background: var(--bg);
  transition: all 0.15s ease;
}
.status-opt:hover { border-color: var(--accent); color: var(--text); }
.status-opt.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.status-custom { display: flex; gap: 8px; }
.status-custom input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 13px; outline: none;
}
.status-custom input:focus { border-color: var(--accent); }
.status-custom button { flex-shrink: 0; font-size: 13px; padding: 8px 14px; }

/* ===== personalized status v2: cats / bg / expiry / detail ===== */
.st-inline { cursor: pointer; border-bottom: 1px dashed transparent; }
.st-inline:hover { border-bottom-color: var(--text-2); color: var(--text); }
.status-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.st-cat {
  padding: 5px 11px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2); font-size: 12px; cursor: pointer;
  transition: all 0.15s ease;
}
.st-cat:hover { border-color: var(--accent); color: var(--text); }
.st-cat.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.status-opt .st-emoj { font-size: 18px; line-height: 1; }
.status-opt .st-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-bg-row, .status-exp-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.st-bg-label { font-size: 12px; color: var(--text-2); min-width: 30px; }
.st-swatch {
  display: inline-block; width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent; flex-shrink: 0;
  transition: transform 0.12s ease;
}
.st-swatch:hover { transform: scale(1.12); }
.st-swatch.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.sw-online { background: linear-gradient(135deg, #34c759, #30b0c7); }
.sw-happy { background: linear-gradient(135deg, #ff9f43, #ff5e7e); }
.sw-coding { background: linear-gradient(135deg, #4f7cff, #7a5cff); }
.sw-travel { background: linear-gradient(135deg, #0fb9b1, #3d7bfd); }
.sw-sleeping { background: linear-gradient(135deg, #636e72, #2d3436); }
.sw-cute { background: linear-gradient(135deg, #ff6ec4, #ff9a9e); }
.st-exp {
  padding: 4px 12px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2); font-size: 12px; cursor: pointer;
  transition: all 0.15s ease;
}
.st-exp:hover { border-color: var(--accent); color: var(--text); }
.st-exp.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* status detail modal */
.status-detail { text-align: center; overflow: hidden; }
.sd-hero { padding: 26px 16px; color: #fff; margin: -18px -18px 14px; }
.sd-hero .sd-emoji { font-size: 44px; line-height: 1.2; }
.sd-hero .sd-text { font-size: 17px; font-weight: 600; margin-top: 6px; word-break: break-word; }
.sd-hero.bg-online, .sd-hero.bg-busy, .sd-hero.bg-away, .sd-hero.bg-invisible { background: linear-gradient(135deg, #34c759, #30b0c7); }
.sd-hero.bg-happy, .sd-hero.bg-excited, .sd-hero.bg-emo, .sd-hero.bg-chill, .sd-hero.bg-festive, .sd-hero.bg-cute, .sd-hero.bg-angry { background: linear-gradient(135deg, #ff9f43, #ff5e7e); }
.sd-hero.bg-coding, .sd-hero.bg-meeting, .sd-hero.bg-focus, .sd-hero.bg-studying, .sd-hero.bg-busywork, .sd-hero.bg-deadline, .sd-hero.bg-office { background: linear-gradient(135deg, #4f7cff, #7a5cff); }
.sd-hero.bg-travel, .sd-hero.bg-coffee, .sd-hero.bg-food, .sd-hero.bg-workout, .sd-hero.bg-music, .sd-hero.bg-gaming, .sd-hero.bg-shopping { background: linear-gradient(135deg, #0fb9b1, #3d7bfd); }
.sd-hero.bg-sleeping, .sd-hero.bg-relax, .sd-hero.bg-weekend, .sd-hero.bg-sick, .sd-hero.bg-meditating, .sd-hero.bg-pets, .sd-hero.bg-sleepy { background: linear-gradient(135deg, #636e72, #2d3436); }
.sd-name { font-size: 16px; font-weight: 700; }
.sd-meta { font-size: 13px; color: var(--text-2); margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.sd-online { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-radius: 10px; padding: 3px 10px; }
.sd-online.off { color: var(--text-2); background: var(--bg-2); }
.sd-close { margin-top: 14px; width: 100%; }


/* ===== dynamic status v3: cool animations ===== */
.status-anim-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.st-anim {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2); font-size: 12px; cursor: pointer;
  transition: all 0.15s ease;
}
.st-anim:hover { border-color: var(--accent); color: var(--text); }
.st-anim.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.st-anim-icon { font-size: 13px; line-height: 1; }
.st-anim.sel .st-anim-icon { animation: st-anim-bounce 1.2s ease infinite; }
@keyframes st-anim-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* hero container: relative + clip fx overflow */
.sd-hero { position: relative; overflow: hidden; }
.sd-hero .sd-emoji, .sd-hero .sd-text { position: relative; z-index: 2; }

/* 1. shimmer: gradient flow + oblique shine sweep */
.sd-hero.sd-anim-shimmer { background-size: 220% 220%; animation: sd-shimmer-bg 4.5s ease infinite; }
@keyframes sd-shimmer-bg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.sd-hero.sd-anim-shimmer .sd-shine {
  position: absolute; top: -25%; bottom: -25%; left: -45%; width: 42%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-18deg); z-index: 1; animation: sd-shine-sweep 2.8s ease-in-out infinite;
}
@keyframes sd-shine-sweep { 0% { left: -50%; } 55%, 100% { left: 135%; } }

/* 2. pulse: breathing glow + emoji beating */
.sd-hero.sd-anim-pulse { animation: sd-pulse-hero 2.4s ease-in-out infinite; }
@keyframes sd-pulse-hero {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.25); filter: brightness(1); }
  50% { box-shadow: 0 0 38px 8px rgba(255,255,255,0.45); filter: brightness(1.14); }
}
.sd-hero.sd-anim-pulse .sd-emoji { animation: sd-pulse-emoji 2.4s ease-in-out infinite; }
@keyframes sd-pulse-emoji { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.16); } }

/* 3. float: emoji bobbing + rising bubbles */
.sd-hero.sd-anim-float .sd-emoji { animation: sd-float 3s ease-in-out infinite; }
.sd-hero.sd-anim-wave .sd-emoji { animation: sd-float 2.6s ease-in-out infinite; }
@keyframes sd-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.sd-bubble {
  position: absolute; bottom: -18px; width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,0.35); z-index: 1; animation: sd-bubble-rise 3.8s ease-in infinite;
}
@keyframes sd-bubble-rise {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translateY(-130px) scale(1.15); opacity: 0; }
}

/* 4. sparkle: falling stars + emoji sway */
.sd-sp {
  position: absolute; top: -12px; z-index: 1; color: rgba(255,255,255,0.9);
  font-size: 14px; font-style: normal; animation: sd-sparkle-fall 3.4s linear infinite;
}
@keyframes sd-sparkle-fall {
  0% { transform: translateY(0) rotate(0deg) scale(0.6); opacity: 0; }
  12% { opacity: 1; }
  85% { opacity: 0.85; }
  100% { transform: translateY(160px) rotate(220deg) scale(1.1); opacity: 0; }
}
.sd-hero.sd-anim-sparkle .sd-emoji { animation: sd-spin-soft 4s ease-in-out infinite; }
@keyframes sd-spin-soft { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }

/* 5. wave: expanding rings */
.sd-wave {
  position: absolute; left: 50%; top: 45%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; border: 2px solid rgba(255,255,255,0.55); z-index: 1;
  animation: sd-wave-spread 4.2s ease-out infinite;
}
@keyframes sd-wave-spread {
  0% { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(6); opacity: 0; }
}

/* 6. none: disable all fx */
.sd-hero.sd-anim-none { animation: none; }
.sd-hero.sd-anim-none .sd-shine, .sd-hero.sd-anim-none .sd-sp,
.sd-hero.sd-anim-none .sd-wave, .sd-hero.sd-anim-none .sd-bubble { display: none; }

/* status dot breathing ring (detail / profile) */
.sd-meta .st-dot, .st-inline .st-dot { position: relative; }
.sd-meta .st-dot::after, .st-inline .st-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid rgba(140, 140, 140, 0.55); opacity: 0;
  animation: st-dot-ring 2.2s ease-out infinite;
}
.sd-meta .st-dot.st-online::after, .st-inline .st-dot.st-online::after { border-color: var(--ok); }
.sd-meta .st-dot.st-busy::after, .st-inline .st-dot.st-busy::after { border-color: #e5484d; }
.sd-meta .st-dot.st-away::after, .st-inline .st-dot.st-away::after { border-color: #f5a623; }
@keyframes st-dot-ring {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}
