/* ========== 主题变量：默认夜间（防窥：低亮度、低对比），[data-theme=light] 为日间 ========== */
:root {
  color-scheme: dark;
  --bg: #0e1013;
  --bg-chat: #12151a;
  --bg-bar: #171a20;
  --bg-panel: #1a1e25;
  --bg-input: #1f242c;
  --bg-hover: #242a33;
  --border: #262c35;
  --text: #c9ced6;
  --text-muted: #757d89;
  --bubble: #1f242c;
  --bubble-text: #d3d8df;
  --mine: #2b5c3f;
  --mine-text: #dbe9df;
  --accent: #3f6f93;
  --accent-hover: #4a7fa6;
  --accent-text: #e8f0f7;
  --accent-soft: rgba(63,111,147,.2);
  --link: #8aa4d4;
  --success: #6aa87f;
  --danger: #e05d5d;
  --divider-bg: #262c35;
  --divider-text: #8a919b;
  --avatar-dim: .85;
  --img-dim: .78;
  --shadow: 0 4px 24px rgba(0,0,0,.5);
  --overlay: rgba(0,0,0,.6);
  --selection: rgba(84,145,210,.6);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ededed;
  --bg-chat: #ededed;
  --bg-bar: #f7f7f7;
  --bg-panel: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f0f0f0;
  --border: #dcdcdc;
  --text: #111;
  --text-muted: #888;
  --bubble: #ffffff;
  --bubble-text: #111;
  --mine: #95ec69;
  --mine-text: #111;
  --accent: #4b7fae;
  --accent-hover: #3f6f9a;
  --accent-text: #ffffff;
  --accent-soft: rgba(75,127,174,.12);
  --link: #576b95;
  --success: #2e9e5b;
  --danger: #fa5151;
  --divider-bg: #cfcfcf;
  --divider-text: #fff;
  --avatar-dim: 1;
  --img-dim: 1;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --overlay: rgba(0,0,0,.35);
  --selection: rgba(30,110,230,.32);
}

/* ========== 基础 ========== */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; color: inherit; }
input, textarea { font: inherit; color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
[hidden] { display: none !important; }
::selection { background: var(--selection); } /* 原来的 accent-soft 太淡，选中的文字几乎看不出来 */

.primary { background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px; padding: 11px 16px; font-weight: 500; transition: background .15s; }
.primary:hover { background: var(--accent-hover); }
.primary:disabled { opacity: .6; cursor: default; }
.link { background: none; border: 0; color: var(--link); padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.link:hover { background: var(--bg-hover); }
.link.me { font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--text-muted); font-weight: normal; font-size: 13px; }

/* 分段选择器（设置里的夜间/日间） */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; align-self: flex-start; }
.segmented button { background: none; border: 0; padding: 7px 20px; color: var(--text-muted); font-size: 14px; }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.active { background: var(--accent-soft); color: var(--text); font-weight: 500; }
.segmented button:hover:not(.active) { background: var(--bg-hover); }

/* 防泄密锁屏：连接断开后整页只剩这一层 */
.lock { position: fixed; inset: 0; z-index: 100; background: var(--bg); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; }
.lock svg { color: var(--text-muted); margin-bottom: 6px; }
.lock h1 { margin: 0; font-size: 26px; font-weight: 600; }
.lock p { margin: 0; color: var(--text-muted); font-size: 14px; }
.lock-sub { margin-top: 10px !important; }
.idle-form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; margin-top: 14px; }
.idle-form input { padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-input); text-align: center; font-size: 16px; }
.idle-form input:focus { outline: none; border-color: var(--accent); }
.idle-form .msg { margin: 0; min-height: 0; }
.idle-form .idle-user { border: 0; background: none; padding: 0; color: var(--text); font-weight: 600; font-size: 15px; pointer-events: none; }
.idle-hint { font-size: 12px !important; margin: -2px 0 0 !important; }
#idle .link { margin-top: 8px; }

/* ========== 登录 / 注册 ========== */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px; padding: 30px 26px; box-shadow: var(--shadow); }
.auth-title { margin: 0 0 22px; text-align: center; font-size: 22px; font-weight: 600; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { flex: 1; background: none; border: 0; padding: 10px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--link); border-bottom-color: var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input, .form-col input { padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-input); }
.auth-form input:focus, .form-col input:focus { outline: none; border-color: var(--accent); }
.hint { margin: 0; color: var(--text-muted); font-size: 13px; text-align: center; }
.msg { min-height: 20px; margin: 14px 0 0; text-align: center; font-size: 14px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--success); }

/* ========== 聊天布局 ========== */
.chat-page { overflow: hidden; }
.app { display: flex; flex-direction: column; height: 100dvh; max-width: 1000px; margin: 0 auto; background: var(--bg-chat); }
@media (min-width: 1032px) { .app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--bg-bar); border-bottom: 1px solid var(--border); }
.topbar-title { font-weight: 600; font-size: 17px; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
.app.dragover .messages { outline: 2px dashed var(--accent); outline-offset: -8px; background: var(--accent-soft); }
.time-divider { align-self: center; color: var(--divider-text); font-size: 12px; background: var(--divider-bg); padding: 2px 8px; border-radius: 4px; }
.notice { align-self: center; color: var(--text-muted); font-size: 12px; }

.msg-row { display: flex; gap: 10px; max-width: 78%; }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.avatar { width: 38px; height: 38px; border-radius: 6px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 16px; user-select: none; filter: brightness(var(--avatar-dim)); }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; border-radius: 5px; }
.c0 { background: #5b8def; } .c1 { background: #e9784f; } .c2 { background: #8e6ad8; } .c3 { background: #1aad8b; }
.c4 { background: #d9508a; } .c5 { background: #c58f1e; } .c6 { background: #3a9bd9; } .c7 { background: #6f8f2a; }

.msg-body { display: flex; flex-direction: column; min-width: 0; }
.msg-row.mine .msg-body { align-items: flex-end; }
.name { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }

.bubble { position: relative; padding: 9px 12px; border-radius: 6px; background: var(--bubble); color: var(--bubble-text); word-break: break-word; white-space: pre-wrap; max-width: 100%; }
.msg-row.mine .bubble { background: var(--mine); color: var(--mine-text); }
.bubble::before { content: ""; position: absolute; top: 13px; border: 6px solid transparent; }
.msg-row.theirs .bubble::before { left: -12px; border-right-color: var(--bubble); }
.msg-row.mine .bubble::before { right: -12px; border-left-color: var(--mine); }
.bubble.image, .bubble.file { padding: 0; background: transparent; white-space: normal; }
.bubble.image::before, .bubble.file::before { display: none; }
/* 夜间模式下图片默认压暗，悬停/触摸时恢复，减少旁人偷看到的信息 */
.bubble.image img { display: block; max-width: min(280px, 60vw); max-height: 340px; border-radius: 6px; background: var(--bubble); filter: brightness(var(--img-dim)); transition: filter .15s; }
.bubble.image img:hover { filter: none; }

.file-card { display: flex; align-items: center; gap: 10px; background: var(--bubble); color: var(--bubble-text); border-radius: 6px; padding: 10px 12px; width: 250px; max-width: 100%; text-decoration: none; }
.file-card:hover { background: var(--bg-hover); }
.file-icon { flex: none; width: 36px; height: 44px; border-radius: 4px; background: var(--accent-soft); color: var(--link); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; text-transform: uppercase; overflow: hidden; }
.file-meta { min-width: 0; }
.file-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 12px; color: var(--text-muted); }
.msg-row.pending .file-card { opacity: .7; }
.msg-row.pending .file-size.err { color: var(--danger); }

.read-state { font-size: 11px; color: var(--text-muted); margin-top: 3px; cursor: default; }
.read-state.done { color: var(--link); }

/* ========== 编辑区：工具栏 + 大输入区 + 底部发送 ========== */
.composer { background: var(--bg-bar); border-top: 1px solid var(--border); padding: 6px 16px calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; transition: border-color .15s; }
.composer:focus-within { border-top-color: var(--accent); }
.composer-tools { display: flex; align-items: center; gap: 2px; }
.tool { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--text-muted); }
.tool:hover { background: var(--bg-hover); color: var(--text); }
.tool:disabled { opacity: .5; cursor: default; }
.status { font-size: 12px; color: var(--text-muted); margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status.err { color: var(--danger); }
#input { width: 100%; min-height: 104px; max-height: 40vh; resize: none; border: 0; background: transparent; padding: 8px 6px; font-size: 15px; line-height: 1.6; overflow-y: hidden; }
#input:focus { outline: none; }
.composer-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.composer-hint { color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-send { padding: 8px 30px; border-radius: 8px; }

/* 手机：紧凑布局，输入框与发送按钮同一行 */
@media (max-width: 640px) {
  .composer { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "tools tools" "quote quote" "input send"; gap: 6px 8px; align-items: end; padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .composer-tools { grid-area: tools; }
  .tool span { display: none; }
  .tool.toggle span { display: inline; }
  .quote-bar { grid-area: quote; margin: 0; }
  #input { grid-area: input; min-height: 42px; max-height: 32vh; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font-size: 16px; line-height: 1.4; }
  #input:focus { border-color: var(--accent); }
  .composer-foot { grid-area: send; }
  .composer-hint { display: none; }
  .btn-send { padding: 10px 18px; }
  .msg-row { max-width: 88%; }
  .messages { padding: 12px; }
}

/* ========== 弹窗 ========== */
.modal { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal-box { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 460px; max-height: 84vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal-body { padding: 14px 18px 18px; overflow-y: auto; }
.section-title { font-size: 12px; color: var(--text-muted); margin: 14px 0 6px; }
.section-title:first-child { margin-top: 0; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: 0; }
.user-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .sub { color: var(--text-muted); font-size: 12px; margin-left: 6px; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 4px; background: var(--bg-hover); color: var(--text-muted); white-space: nowrap; }
.badge.pending { background: rgba(230,162,60,.15); color: #e6a23c; }
.badge.admin { background: var(--accent-soft); color: var(--link); }
.badge.online { background: rgba(58,155,217,.15); color: #4da3e0; }
.small { font-size: 13px; padding: 5px 11px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-panel); color: var(--text); white-space: nowrap; }
.small:hover { background: var(--bg-hover); }
.small.danger { color: var(--danger); border-color: var(--danger); }
.small.danger.armed { background: var(--danger); color: #fff; }
.small.ok { color: var(--link); border-color: var(--accent); }
.small:disabled { opacity: .5; cursor: default; }
.form-col { display: flex; flex-direction: column; gap: 10px; }
.form-col .label { font-size: 12px; color: var(--text-muted); margin-bottom: -4px; }
.form-col input[readonly] { color: var(--text-muted); background: var(--bg-hover); }
.form-col .msg { margin-top: 0; }
.stats { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.empty { color: var(--text-muted); font-size: 13px; text-align: center; padding: 12px 0; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 18px 0 14px; }

/* ========== 音视频通话 ========== */
/* 通话画面固定深色，不随日间/夜间主题变化 */
.call { position: fixed; inset: 0; z-index: 50; background: #0b0d10; color: #e6e9ee; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; visibility: hidden; }
.call.has-video .call-remote { visibility: visible; }
.call-peer { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 120px; text-align: center; padding: 0 24px; }
.call.has-video .call-peer { display: none; }
.call-peer .avatar { width: 88px; height: 88px; font-size: 36px; border-radius: 16px; filter: none; }
.call-name { font-size: 22px; font-weight: 600; max-width: 80vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-state { font-size: 14px; color: #9aa3ae; min-height: 20px; }
.call-time { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); font-size: 14px; color: #fff; background: rgba(0,0,0,.4); padding: 3px 12px; border-radius: 12px; font-variant-numeric: tabular-nums; }
.call-time:empty { display: none; }
.call-local { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; width: 240px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #1a1e25; box-shadow: 0 4px 16px rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.12); }
.call-local.mirror { transform: scaleX(-1); }
.call:not(.local-video) .call-local { display: none; }
.call-controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; padding: 24px 16px calc(28px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.call-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: #e6e9ee; font-size: 12px; min-width: 64px; }
.call-btn svg { box-sizing: content-box; padding: 16px; border-radius: 50%; background: rgba(255,255,255,.14); transition: background .15s; }
.call-btn:hover svg { background: rgba(255,255,255,.24); }
.call-btn:disabled { opacity: .5; cursor: default; }
.call-btn .off { display: none; }
.call-btn.off svg { background: #e6e9ee; color: #0b0d10; }
.call-btn.off .off { display: inline; }
.call-btn.danger svg { background: #e0443e; color: #fff; }
.call-btn.danger:hover svg { background: #c93a35; }
.call-btn.ok svg { background: #2e9e5b; color: #fff; }
.call-btn.ok:hover svg { background: #288a50; }
/* 按通话阶段显示不同按钮 */
.call:not([data-state="incoming"]) .incoming-only,
.call[data-state="incoming"] .in-call,
.call:not(.video) .video-only { display: none; }
.user-row .call-actions { display: flex; gap: 6px; }

@media (max-width: 640px) {
  .call-remote { object-fit: cover; }
  .call-local { width: 108px; aspect-ratio: 3 / 4; right: 12px; }
  .call-controls { gap: 14px; }
  .call-btn svg { padding: 14px; }
}

/* ========== 图片查看页 ========== */
.view-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: #0b0d10; }
.view-img { display: block; max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.view-download { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; padding: 7px 14px; border-radius: 8px; background: rgba(0,0,0,.55); color: #e6e9ee; font-size: 14px; text-decoration: none; }
.view-download:hover { background: rgba(0,0,0,.75); }

/* ========== 断线提示、引用、消息菜单、原图开关、提醒设置 ========== */
.net-banner { padding: 6px 16px; font-size: 13px; text-align: center; background: rgba(230,162,60,.15); color: #e6a23c; border-bottom: 1px solid var(--border); }
.idle-notice { color: var(--link) !important; font-weight: 500; }
.idle-notice:empty { display: none; }

.tool.toggle .tick { opacity: 0; transition: opacity .15s; }
.tool.toggle.on { color: var(--link); }
.tool.toggle.on .tick { opacity: 1; }

.quote-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; padding: 5px 6px 5px 10px; border-radius: 6px; background: var(--bg-hover); border-left: 3px solid var(--accent); font-size: 13px; color: var(--text-muted); }
.quote-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-cancel { background: none; border: 0; color: var(--text-muted); font-size: 18px; line-height: 1; padding: 2px 7px; border-radius: 4px; }
.quote-cancel:hover { background: var(--bg-panel); color: var(--text); }
/* 消息下方的引用块（同微信）：最多两行，点击跳到原消息 */
.quote { margin-top: 4px; max-width: 100%; padding: 4px 8px; border-radius: 4px; background: var(--bg-hover); color: var(--text-muted); font-size: 12px; line-height: 1.5; cursor: pointer; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quote:hover { color: var(--text); }
.msg-row.flash .bubble { animation: flash 1.4s ease; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }

.ctx-menu { position: fixed; z-index: 60; min-width: 120px; padding: 4px; border-radius: 8px; background: var(--bg-panel); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.ctx-menu button { background: none; border: 0; text-align: left; padding: 8px 14px; border-radius: 6px; font-size: 14px; color: var(--text); white-space: nowrap; }
.ctx-menu button:hover { background: var(--bg-hover); }
/* 触屏设备：除输入框外，长按任何地方（按钮、头像、通话界面……）都不弹出系统的选择 / 拷贝 / 链接预览菜单；
   消息气泡长按用自己的菜单。电脑上仍可用鼠标自由选择文字。 */
@media (hover: none) {
  .chat-page, .auth-page { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  .chat-page input, .chat-page textarea, .auth-page input { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
}
.clip-helper { position: fixed; top: 0; left: 0; opacity: 0; }

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.form-col .check input { width: 16px; height: 16px; padding: 0; margin: 0; border: 0; accent-color: var(--accent); }
.hint-line { font-size: 12px; color: var(--text-muted); }
.hint-line:empty { display: none; }

/* ========== 面容 ID / 触控 ID ========== */
.btn-passkey { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-passkey.ghost { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; color: var(--text); }
.btn-passkey.ghost:hover { background: var(--bg-hover); }
.btn-passkey:disabled { opacity: .6; cursor: default; }
.pk-list .user-row .sub { display: block; margin-left: 0; }

/* ========== 手机：整个页面不跟着滑动；图片长按不拖拽 ========== */
html, body { overscroll-behavior: none; }
.chat-page { position: fixed; inset: 0; width: 100%; }
.bubble img { -webkit-user-drag: none; }

/* ========== 视频消息：首帧预览 + 播放按钮 + 时长 ========== */
.bubble.video { padding: 0; background: transparent; white-space: normal; }
.bubble.video::before { display: none; }
.video-box { position: relative; width: 220px; max-width: 60vw; min-height: 120px; border-radius: 6px; overflow: hidden; background: #000; cursor: pointer; }
.video-box video { display: block; width: 100%; max-height: 360px; object-fit: cover; background: #000; filter: brightness(var(--img-dim)); }
.video-box.playing video { filter: none; }
.video-play { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.9); pointer-events: none; }
.video-play::after { content: ""; position: absolute; left: 18px; top: 13px; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; }
.video-dur { position: absolute; right: 7px; bottom: 5px; font-size: 12px; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.9); pointer-events: none; }
.video-box.playing .video-play, .video-box.playing .video-dur { display: none; }
.video-box.failed::after { content: "视频加载失败"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #ccc; font-size: 13px; }

/* ========== 断线重连 / 手机从后台切回时：聊天区毛玻璃，同步完成后再清晰显示 ========== */
.messages { transition: filter .2s; }
.app.syncing .messages { filter: blur(14px) saturate(.6); pointer-events: none; -webkit-user-select: none; user-select: none; }

/* ========== 启动 / 首次连接中的过渡画面：拿到最新内容后才消失 ========== */
.boot { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); text-align: center; padding: 24px; }
.boot-logo { width: 64px; height: 64px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot-text { margin: 0; color: var(--text); }
.boot-slow { margin: 0; max-width: 300px; font-size: 13px; color: var(--text-muted); opacity: 0; animation: boot-reveal .3s 6s forwards; }
.boot-slow a { color: var(--link); }
@keyframes boot-reveal { to { opacity: 1; } }

/* ========== 在线列表：每个账号的在线设备与活动状态 ========== */
.user-row.has-devs { border-bottom: 0; padding-bottom: 2px; }
.dev-list { margin: 0 0 4px; padding: 0 0 9px 58px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.dev-list:last-child { border-bottom: 0; }
.dev { margin: 3px 0; }
.dev-name { color: var(--text); margin-right: 6px; }
.dev-state { white-space: nowrap; }
.dev.active .dev-state { color: #fff; background: #e5484d; padding: 0 6px; border-radius: 4px; }
