/* Tela H5 网页版 · 蓝白扁平
   配色 token 与桌面端 clients/desktop/renderer/style.css、安卓 ui/Theme.kt 完全一致,
   同一套值抄过来,不许在这里另调一套 —— 三端配色必须改一处改全部。
   扁平化三条硬规矩(与桌面端同):
     1) 不用渐变、不用装饰性投影 —— 纯色块 + 1px 分隔线;
     2) 圆角统一 8px(胶囊按钮 999px 除外);
     3) 字号只走 --fs-* 那几档。
   H5 独有的一档是 --fs-input:16px —— iOS Safari 对字号小于 16px 的输入框会在聚焦时
   自动放大整个页面,且放大后不会自己缩回去,版式当场崩掉。业界通行解法只有两个:
   锁死缩放(伤可访问性)或输入框用 16px。这里选后者。 */
:root {
  --bg-deep: #f8f9ff;
  --bg-panel: #ffffff;
  --bg-panel-2: #eef2f8;
  --bg-input: #ffffff;
  --line: #e0e4ea;
  --primary: #1976d2;
  --primary-bright: #2196f3;
  --on-primary: #ffffff;
  --text: #1a1c1e;
  --text-dim: #5a6572;
  --bubble-me: #1976d2;
  --bubble-peer: #ffffff;
  --bubble-peer-text: #1a1c1e;
  --radius: 8px;
  --fs-display: 24px;
  --fs-title: 18px;
  --fs-lead: 15px;
  --fs-body: 14px;
  --fs-sm: 12.5px;
  --fs-xs: 11px;
  --fs-input: 16px;
  --danger: #c62828;
  --blue-hover: #e3f2fd;
  --blue-light: #bbdefb;
  /* 安全区(刘海屏/底部横条);非 iOS 上 env() 取不到值时回落 0 */
  --sa-top: env(safe-area-inset-top, 0px);
  --sa-bot: env(safe-area-inset-bottom, 0px);
  --topbar-h: 52px;
  --tabbar-h: 56px;
}

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

/* 🔴 这一条必须排在所有组件样式【之前】声明、并且带 !important。
   浏览器内置的 [hidden]{display:none} 优先级只有 (0,1,0),跟 .icon-btn / .btn-ghost /
   .row 这类单类选择器完全打平;本表后加载 ⇒ 层叠规则让组件样式赢 ⇒ 元素上设了
   hidden 属性、JS 里 el.hidden=true 全都【不起作用】,该藏的照样显示。
   实测就是这么漏的:单聊里"群成员"按钮一直挂在标题栏上,而 el.hidden 读出来是 true,
   所以只断言 .hidden 属性的测试会全绿 —— 判据必须是计算后的可见性。
   下面各处 .xxx[hidden] 的补丁保留着不删:它们是同一问题的局部修法,留着也是文档。 */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: var(--fs-body);
  background: var(--bg-deep);
  color: var(--text);
  overscroll-behavior: none;
}
body {
  /* 移动端浏览器地址栏收缩会让 100vh 比可视区大,底部导航被顶出屏幕。
     dvh 是为此而生的单位;不支持的老浏览器回落到 100% 高度(配合 html,body{height:100%})。 */
  height: 100dvh;
  /* 🔴 整站默认不可选中,是为了让长按去触发我们自己的操作表、而不是弹系统选中框。
     但这条【必须】给消息内容和输入框开口子 —— 0919 甲方反馈"发的链接复制不了",
     根因就是这一行把聊天记录一起锁死了,而复制是聊天最基本的功能。
     只锁界面外壳(导航/按钮/标题),不锁内容。 */
  -webkit-user-select: none; user-select: none;
  -webkit-text-size-adjust: 100%;
}
/* 消息内容、输入框:可以选中、可以长按弹系统菜单复制 */
.bubble, .msg-from, input, textarea {
  -webkit-user-select: text; user-select: text;
  -webkit-touch-callout: default;
}
/* 图片气泡不需要选中文字,长按留给"保存图片"的系统菜单 */
.bubble.img { -webkit-user-select: none; user-select: none; }
input, button, textarea { font-family: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* 图标 */
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ico.dim { color: var(--text-dim); width: 18px; height: 18px; }

/* ==================== 通用控件 ==================== */
.btn-primary {
  display: block; width: 100%; padding: 12px; border-radius: var(--radius);
  background: var(--primary); color: var(--on-primary);
  font-size: var(--fs-lead); font-weight: 600;
}
.btn-primary:disabled { opacity: .55; }
.btn-outline {
  display: block; width: 100%; padding: 12px; border-radius: var(--radius);
  border: 1px solid var(--primary); color: var(--primary); background: transparent;
  font-size: var(--fs-lead); font-weight: 600;
}
.btn-ghost {
  display: block; width: 100%; padding: 12px; border-radius: var(--radius);
  border: 1px solid var(--line); color: var(--text-dim); background: transparent;
  font-size: var(--fs-body);
}
.btn-danger {
  display: block; width: calc(100% - 24px); margin: 16px 12px; padding: 12px;
  border-radius: var(--radius); border: 1px solid var(--line);
  color: var(--danger); background: var(--bg-panel); font-size: var(--fs-body);
}
.btn-text { color: var(--primary); font-size: var(--fs-body); padding: 6px 4px; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius); color: var(--text); flex-shrink: 0;
}
.icon-btn:disabled { opacity: .35; }
.icon-btn.send { color: var(--primary); }

.field { display: block; margin-bottom: 14px; }
.field[hidden] { display: none; }
.field-label { display: block; font-size: var(--fs-sm); color: var(--text-dim); margin-bottom: 6px; }
.field input {
  display: block; width: 100%; padding: 11px 12px;
  font-size: var(--fs-input);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-input); color: var(--text);
}
.field input:focus { outline: none; border-color: var(--primary); }
.form-error, .auth-error { color: var(--danger); font-size: var(--fs-sm); min-height: 18px; margin-bottom: 8px; }

.avatar {
  width: 42px; height: 42px; border-radius: var(--radius);
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-lead); font-weight: 600; flex-shrink: 0;
}
.avatar.lg { width: 64px; height: 64px; font-size: var(--fs-display); }

.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: var(--fs-xs);
  display: inline-flex; align-items: center; justify-content: center;
}
.badge[hidden] { display: none; }
.count { color: var(--text-dim); font-size: var(--fs-sm); margin-left: 4px; }
.empty { padding: 32px 16px; text-align: center; color: var(--text-dim); font-size: var(--fs-sm); }

/* ==================== 登录页 ==================== */
.auth {
  height: 100%; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; padding-top: calc(24px + var(--sa-top));
  background: var(--bg-deep);
}
/* .auth{display:flex} 与浏览器内置 [hidden]{display:none} 优先级打平,
   本表后加载会赢,登录页会一直盖在主界面上 —— 必须显式补这条。桌面端踩过。 */
.auth[hidden] { display: none; }
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 20px;
}
.brand { text-align: center; margin-bottom: 22px; }
.brand-mark {
  width: 56px; height: 56px; margin: 0 auto 10px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-display); font-weight: 700;
  color: var(--on-primary); background: var(--primary);
}
.brand h1 { font-size: var(--fs-display); letter-spacing: 2px; color: var(--primary); font-weight: 600; margin: 4px 0 2px; }
.brand-sub { font-size: var(--fs-sm); color: var(--text-dim); }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab { flex: 1; padding: 10px 0; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text-dim); font-size: var(--fs-body); }
.tab.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.tab:disabled { opacity: .5; }
#totpBackBtn { margin-top: 10px; }
.build-tag { margin-top: 18px; text-align: center; font-size: var(--fs-xs); color: var(--text-dim); }

/* ==================== 页面骨架 ==================== */
.page {
  position: absolute; inset: 0; bottom: calc(var(--tabbar-h) + var(--sa-bot));
  display: flex; flex-direction: column; background: var(--bg-deep);
}
.page[hidden] { display: none; }
#mainView { position: absolute; inset: 0; }
#mainView[hidden] { display: none; }

.topbar {
  display: flex; align-items: center; gap: 6px;
  height: calc(var(--topbar-h) + var(--sa-top)); padding: var(--sa-top) 8px 0;
  background: var(--bg-panel); border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.topbar-title { flex: 1; font-size: var(--fs-title); font-weight: 600; padding-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar.dark { background: #16181c; border-bottom-color: #2a2e35; color: #fff; }
.ws-status { font-size: var(--fs-sm); color: var(--text-dim); padding-right: 10px; }
.ws-status.online { color: var(--primary); }

.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.subnav { display: flex; background: var(--bg-panel); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.subnav-tab {
  flex: 1; padding: 11px 0; font-size: var(--fs-body); color: var(--text-dim);
  border-bottom: 2px solid transparent; display: flex; align-items: center; justify-content: center; gap: 4px;
}
.subnav-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 底部导航 */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--sa-bot)); padding-bottom: var(--sa-bot);
  display: flex; background: var(--bg-panel); border-top: 1px solid var(--line);
}
.tabbar-btn {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-dim); font-size: var(--fs-xs);
}
.tabbar-btn.active { color: var(--primary); }
.badge.dot { position: absolute; top: 6px; left: 50%; margin-left: 6px; }

/* ==================== 列表行 ==================== */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; background: var(--bg-panel); border-bottom: 1px solid var(--line);
}
.row:active { background: var(--blue-hover); }
.row.active { background: var(--blue-hover); }
.row-meta { flex: 1; min-width: 0; }
.row-name { font-size: var(--fs-lead); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: var(--fs-sm); color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row-tail { font-size: var(--fs-xs); color: var(--text-dim); flex-shrink: 0; }
/* 联系人行右侧的 ⋯:改好友名称的可见入口。点它不能连带打开会话(见 renderContacts 里的 stopPropagation)。*/
.row-more {
  flex-shrink: 0; background: none; border: 0; padding: 4px 8px; margin-left: 4px;
  color: var(--text-dim); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 6px;
}
.row-more:active { background: rgba(255,255,255,.08); }

.req-btns { display: flex; gap: 8px; flex-shrink: 0; }
.btn-accept { padding: 7px 14px; border-radius: var(--radius); background: var(--primary); color: var(--on-primary); font-size: var(--fs-sm); }
.btn-reject { padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--line); color: var(--text-dim); font-size: var(--fs-sm); }
.btn-accept:disabled, .btn-reject:disabled { opacity: .5; }
.add-btn { padding: 7px 14px; border-radius: var(--radius); background: var(--primary); color: var(--on-primary); font-size: var(--fs-sm); flex-shrink: 0; }
.add-btn:disabled { background: var(--bg-panel-2); color: var(--text-dim); }

.searchbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: var(--bg-panel); border-bottom: 1px solid var(--line);
}
.searchbar input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: var(--fs-input); color: var(--text);
}
.searchbar input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ==================== 我 ==================== */
.profile-head {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 16px; background: var(--bg-panel); border-bottom: 1px solid var(--line);
}
.profile-id { flex: 1; min-width: 0; }
.profile-name { font-size: var(--fs-title); font-weight: 600; }
.profile-no { font-size: var(--fs-sm); color: var(--text-dim); margin-top: 3px; }
.profile-no #profileUsername { color: var(--text); font-weight: 600; letter-spacing: .5px; }
.copy-hint { margin-left: 8px; color: var(--primary); font-size: var(--fs-xs); }
.profile-ws { display: flex; align-items: center; gap: 5px; font-size: var(--fs-sm); color: var(--text-dim); }
.profile-ws-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--text-dim); }
.profile-ws-dot.online { background: var(--primary); }

.menu { margin-top: 12px; background: var(--bg-panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.menu-row {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; font-size: var(--fs-lead); border-bottom: 1px solid var(--line);
}
.menu-row:last-child { border-bottom: none; }
.menu-row:active { background: var(--blue-hover); }
.menu-row > span:first-child { flex: 1; }
.menu-value { color: var(--text-dim); font-size: var(--fs-body); }

.card { margin: 12px; padding: 16px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* ==================== 聊天 ==================== */
.chat-view {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; background: var(--bg-deep);
}
.chat-view[hidden] { display: none; }
.messages {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 8px;
}
.chat-placeholder { margin: auto; color: var(--text-dim); font-size: var(--fs-sm); text-align: center; }
.msg-row { display: flex; flex-direction: column; max-width: 78%; }
.msg-row.me { align-self: flex-end; align-items: flex-end; }
.msg-row.peer { align-self: flex-start; align-items: flex-start; }
.bubble {
  padding: 8px 11px; border-radius: var(--radius);
  font-size: var(--fs-body); line-height: 1.45;
  word-break: break-word; white-space: pre-wrap;
  background: var(--bubble-peer); color: var(--bubble-peer-text); border: 1px solid var(--line);
}
.msg-row.me .bubble { background: var(--bubble-me); color: var(--on-primary); border-color: var(--bubble-me); }
.bubble.recalled { background: var(--bg-panel-2); color: var(--text-dim); border-color: var(--line); font-style: normal; }
.msg-row.me .bubble.recalled { background: var(--bg-panel-2); color: var(--text-dim); border-color: var(--line); }
.bubble.img { padding: 4px; }
.bubble.img img { display: block; max-width: 100%; max-height: 260px; border-radius: 6px; }
.msg-from { font-size: var(--fs-xs); color: var(--text-dim); margin-bottom: 3px; }
.msg-row.me .msg-from { color: rgba(255,255,255,.8); }
.bubble .time { display: block; font-size: var(--fs-xs); color: var(--text-dim); margin-top: 3px; text-align: right; }
/* 消息里的网址。自己发的气泡是深色底,对方的是浅色底 —— 两种底上都得看得清,
   所以自己那边用 inherit + 下划线,对方那边用主题蓝。word-break 防止长网址把气泡撑破屏幕。*/
.bubble a.msg-link { color: var(--blue); text-decoration: underline; word-break: break-all; }
.msg-row.me .bubble a.msg-link { color: var(--on-primary); text-decoration: underline; }
.msg-row.me .bubble .time { color: rgba(255,255,255,.75); }
.read-state { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 2px; }

.composer {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 8px calc(8px + var(--sa-bot));
  background: var(--bg-panel); border-top: 1px solid var(--line); flex-shrink: 0;
}
.composer input {
  flex: 1; min-width: 0; padding: 10px 12px;
  font-size: var(--fs-input);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-input); color: var(--text);
}
.composer input:focus { outline: none; border-color: var(--primary); }

/* 登录页"记住用户名和密码" */
.auth-remember {
  display: flex; align-items: center; gap: 8px;
  margin: 2px 0 4px;
  font-size: 13px; color: var(--text-dim);
}
.auth-remember input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }

/* 表情面板。固定高度而不是 max-height:auto —— 展开/收起时输入栏位置要稳,
   否则在 iOS 上会和软键盘的高度变化叠在一起来回跳。 */
.emoji-panel {
  flex-shrink: 0;
  height: 210px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 6px calc(8px + var(--sa-bot));
  background: var(--bg-panel);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.emoji-panel .emoji-cell {
  font-size: 26px; line-height: 1;
  height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: none; border: none; padding: 0;
  /* 系统 emoji 字体:不指定的话部分安卓 WebView 会掉成豆腐块 */
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.emoji-panel .emoji-cell:active { background: var(--bg-panel-2); }
.emoji-panel .emoji-group {
  grid-column: 1 / -1;
  font-size: 12px; color: var(--text-dim);
  padding: 6px 4px 2px;
}

.drawer {
  position: absolute; inset: 0; z-index: 5;
  background: var(--bg-deep); display: flex; flex-direction: column;
  padding-top: var(--sa-top);
}
.drawer[hidden] { display: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--bg-panel); border-bottom: 1px solid var(--line);
  font-size: var(--fs-title); font-weight: 600;
}
.drawer-body { flex: 1; overflow-y: auto; }

/* ==================== 弹窗 / 操作表 ==================== */
.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%; max-width: 380px; max-height: 80vh; overflow-y: auto;
  background: var(--bg-panel); border-radius: var(--radius); padding: 20px;
}
.modal-title { font-size: var(--fs-title); font-weight: 600; margin-bottom: 14px; }
.modal-desc { font-size: var(--fs-body); color: var(--text-dim); line-height: 1.5; margin-bottom: 14px; word-break: break-all; }
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions > button { flex: 1; }
.kv { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.kv-k { color: var(--text-dim); flex-shrink: 0; width: 48px; }
.kv-v { flex: 1; word-break: break-all; color: var(--text); }
.radio-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-lead); }
.radio-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.pick-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: var(--fs-body); }
.pick-item:last-child { border-bottom: none; }
.pick-item input { width: 18px; height: 18px; accent-color: var(--primary); }

.sheet {
  position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.4);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 10px;
  padding-bottom: calc(10px + var(--sa-bot));
}
.sheet[hidden] { display: none; }
.sheet-card { background: var(--bg-panel); border-radius: var(--radius); overflow: hidden; }
.sheet-item { display: block; width: 100%; padding: 15px; font-size: var(--fs-lead); text-align: center; border-bottom: 1px solid var(--line); }
.sheet-item:last-child { border-bottom: none; }
.sheet-item.danger { color: var(--danger); }
.sheet-cancel {
  width: 100%; margin-top: 8px; padding: 15px; border-radius: var(--radius);
  background: var(--bg-panel); font-size: var(--fs-lead); font-weight: 600;
}

.toasts { position: fixed; left: 0; right: 0; bottom: calc(80px + var(--sa-bot)); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: 80%; padding: 10px 16px; border-radius: var(--radius); background: rgba(26,28,30,.92); color: #fff; font-size: var(--fs-body); }

/* ==================== 通话 ==================== */
.call-banner {
  position: fixed; top: var(--sa-top); left: 8px; right: 8px; z-index: 80;
  display: flex; align-items: center; gap: 10px;
  padding: 10px; margin-top: 8px;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.call-banner[hidden] { display: none; }
.call-banner-meta { flex: 1; min-width: 0; }
.call-banner-name { font-size: var(--fs-lead); font-weight: 600; }
.call-banner-type { font-size: var(--fs-sm); color: var(--text-dim); }
.call-btn {
  width: 44px; height: 44px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
/* 接听绿/挂断红是通话场景的跨平台约定(与安卓 Theme.kt callAccept/callHangup 同值),
   属于语义色而非装饰色,不受"单一强调色"约束。 */
.call-btn.accept { background: #2e7d32; }
.call-btn.reject { background: #c62828; }
.call-btn.ctl { background: rgba(255,255,255,.16); }
.call-btn.ctl.on { background: #fff; color: #16181c; }

.call-overlay {
  position: fixed; inset: 0; z-index: 85; background: #16181c; color: #fff;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(40px + var(--sa-top)) 20px calc(30px + var(--sa-bot));
}
.call-overlay[hidden] { display: none; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #16181c; }
.call-local { position: absolute; top: calc(16px + var(--sa-top)); right: 16px; width: 96px; height: 128px; object-fit: cover; border-radius: var(--radius); background: #000; z-index: 2; }
.call-info { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.call-peer { font-size: var(--fs-title); font-weight: 600; }
.call-status { font-size: var(--fs-body); color: rgba(255,255,255,.7); }
.call-diag { font-size: var(--fs-xs); color: rgba(255,255,255,.6); text-align: center; line-height: 1.6; white-space: pre-line; padding: 10px; border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius); }
.call-diag[hidden] { display: none; }
.call-controls { position: relative; z-index: 2; margin-top: auto; display: flex; gap: 28px; align-items: center; }

/* ==================== 会议室 ==================== */
.meeting-room { position: fixed; inset: 0; z-index: 50; background: #16181c; color: #fff; display: flex; flex-direction: column; }
.meeting-room[hidden] { display: none; }
.mr-count { font-size: var(--fs-sm); color: rgba(255,255,255,.7); }
.mr-banner { padding: 10px 14px; background: #4a1d1d; color: #ffcdd2; font-size: var(--fs-sm); }
.mr-unlock { margin: 8px 14px; padding: 10px; border-radius: var(--radius); background: var(--primary); color: #fff; font-size: var(--fs-body); }
.mr-stage { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 6px; align-content: start; }
.mr-tile { position: relative; aspect-ratio: 3 / 4; background: #000; border-radius: var(--radius); overflow: hidden; }
.mr-tile video { width: 100%; height: 100%; object-fit: cover; }
.mr-tag { position: absolute; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: 4px; background: rgba(0,0,0,.6); font-size: var(--fs-xs); }
.mr-roster { max-height: 26vh; overflow-y: auto; border-top: 1px solid #2a2e35; padding: 8px 14px; }
.mr-roster-head { font-size: var(--fs-sm); color: rgba(255,255,255,.6); margin-bottom: 6px; }
.mr-p-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #22262c; font-size: var(--fs-body); }
.mr-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-badge { font-size: var(--fs-xs); padding: 2px 7px; border-radius: 4px; background: #2a2e35; color: rgba(255,255,255,.75); }
.mr-badge.host { background: var(--primary); color: #fff; }
.mr-badge.panelist { background: #2a3a4a; color: var(--blue-light); }
.mr-p-actions { display: flex; gap: 6px; }
.mr-p-actions button { padding: 4px 9px; border-radius: 4px; background: #2a2e35; color: #fff; font-size: var(--fs-xs); }
.mr-p-actions button.mr-danger { background: #4a1d1d; color: #ffcdd2; }
.mr-controls {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  padding: 10px 14px calc(10px + var(--sa-bot)); border-top: 1px solid #2a2e35;
}
.mr-controls[hidden] { display: none; }
.mr-ctl-btn { padding: 10px 16px; border-radius: var(--radius); background: #2a2e35; color: #fff; font-size: var(--fs-body); }
.mr-ctl-btn.on { background: var(--primary); }
.mr-ctl-btn.danger { background: #3a2222; color: #ffcdd2; }
.mr-ctl-btn.host-end { background: #c62828; color: #fff; }
.mr-toasts { position: fixed; left: 0; right: 0; bottom: calc(90px + var(--sa-bot)); z-index: 95; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.mr-toast { max-width: 80%; padding: 10px 16px; border-radius: var(--radius); background: rgba(255,255,255,.92); color: #16181c; font-size: var(--fs-body); }

/* 平板/桌面浏览器打开时限宽居中,避免行长过长 */
@media (min-width: 700px) {
  #mainView, .chat-view { max-width: 480px; left: 50%; transform: translateX(-50%); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .mr-stage { grid-template-columns: repeat(3, 1fr); }
}

/* Logo 图片样式 */
.brand-logo {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  margin-bottom: 16px;
}

/* 优化登录/注册标签切换效果 */
.tabs { 
  display: flex; 
  gap: 12px; 
  margin-bottom: 24px; 
  padding: 4px;
  background: var(--bg-card);
  border-radius: var(--radius);
}
.tab { 
  flex: 1; 
  padding: 12px 0; 
  border: none;
  border-radius: calc(var(--radius) - 2px);
  color: var(--text-dim); 
  font-size: var(--fs-body);
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}
.tab.active { 
  background: var(--primary); 
  color: var(--on-primary); 
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}
.tab:not(.active):hover {
  background: var(--bg-deep);
  color: var(--text);
}
