/* ============================================================================
   wechat/web/css/app.css —— 微信桌面端网页复刻的全部样式
   结构：设计变量 → 基础/工具 → 登录 → 主框架 → 左侧导航 → 列表 → 会话
        → 输入区 → 右侧信息面板 → 通讯录 → 朋友圈 → 收藏/文件/小程序/设置
        → 搜索/弹层/提示 → 响应式/深色/动效
   目标：默认 1440×900 下与微信桌面端 4.x 的三栏比例、字号、留白和绿色一致。
   ========================================================================== */

:root {
  --green: #07c160;
  --green-dark: #06ad56;
  --green-soft: #e8f8ef;
  --red: #fa5151;
  --orange: #fa9d3b;
  --blue: #576b95;
  --rail: #2e2e2e;
  --rail-2: #262626;
  --rail-icon: #c9c9c9;
  --rail-active: #07c160;
  --list-bg: #f7f7f7;
  --list-hover: #ebebeb;
  --list-active: #dedede;
  --list-pinned: #efefef;
  --chat-bg: #f5f5f5;
  --panel: #ffffff;
  --panel-2: #f7f7f7;
  --bubble-in: #ffffff;
  --bubble-out: #95ec69;
  --text: #191919;
  --text-2: #7f7f7f;
  --text-3: #a6a6a6;
  --border: #e6e6e6;
  --border-2: #dcdcdc;
  --search-bg: #e9e9e9;
  --hover: rgba(0, 0, 0, 0.045);
  --active: rgba(0, 0, 0, 0.085);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.28);
  --rail-w: 64px;
  --list-w: 300px;
  --right-w: 300px;
  --header-h: 60px;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --rail: #1b1b1b;
  --rail-2: #151515;
  --rail-icon: #b5b5b5;
  --list-bg: #252525;
  --list-hover: #303030;
  --list-active: #3b3b3b;
  --list-pinned: #2a2a2a;
  --chat-bg: #1f1f1f;
  --panel: #252525;
  --panel-2: #2b2b2b;
  --bubble-in: #2c2c2c;
  --bubble-out: #3eb575;
  --text: #e8e8e8;
  --text-2: #a0a0a0;
  --text-3: #777777;
  --border: #343434;
  --border-2: #3d3d3d;
  --search-bg: #343434;
  --hover: rgba(255, 255, 255, 0.06);
  --active: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #ededed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; display: block; }
svg { display: block; }
::selection { background: rgba(7, 193, 96, 0.25); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.18); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); }
::-webkit-scrollbar-track { background: transparent; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); }

/* ---------------------------------------------------------------- 工具 */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.spacer { flex: 1 1 auto; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-2); }
.fine { font-size: 12px; color: var(--text-2); }
.icon-btn {
  width: 32px; height: 32px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.active { color: var(--green); background: var(--green-soft); }
.link-btn { color: var(--blue); background: none; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 18px; border-radius: 6px; font-size: 14px; font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s; white-space: nowrap;
}
.btn:disabled { opacity: 0.45; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--green-dark); }
.btn-ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(0.94); }
.btn-small { height: 28px; padding: 0 12px; font-size: 13px; }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 500; letter-spacing: 0;
}
.badge-dot { min-width: 8px; width: 8px; height: 8px; padding: 0; border-radius: 50%; }
.avatar { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: none; position: relative; user-select: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-emoji { line-height: 1; transform: translateY(1px); }
.avatar-initial { color: #fff; font-weight: 600; line-height: 1; }
.avatar-round { border-radius: 50% !important; }
.avatar-group { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px; background: var(--border); padding: 0; }
.avatar-cell { display: flex; align-items: center; justify-content: center; overflow: hidden; background: #ddd; }
.photo {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: 6px; color: #fff; min-height: 40px; isolation: isolate;
}
.photo-glow { position: absolute; width: 70%; height: 70%; border-radius: 50%; background: rgba(255, 255, 255, 0.28); filter: blur(18px); top: -20%; right: -12%; }
.photo-emoji { font-size: 44px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.18)); z-index: 1; }
.photo-label { position: absolute; left: 10px; bottom: 8px; font-size: 11px; color: rgba(255, 255, 255, 0.88); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); z-index: 1; }
.photo-upload img { width: 100%; height: 100%; object-fit: cover; }
.file-glyph {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; flex: none;
  background: color-mix(in srgb, var(--file-color) 12%, transparent); color: var(--file-color);
  border: 1px solid color-mix(in srgb, var(--file-color) 22%, transparent);
}
.file-glyph-label { font-size: 9px; font-weight: 800; letter-spacing: 0.3px; }
.empty-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-3); gap: 6px; padding: 30px; text-align: center; }
.empty-icon { color: var(--text-3); opacity: 0.55; margin-bottom: 6px; }
.empty-state h3 { font-size: 15px; font-weight: 500; color: var(--text-2); }
.empty-state p { font-size: 12px; max-width: 300px; line-height: 1.6; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(0, 0, 0, 0.12); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- 登录 */
.login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(1200px 700px at 18% 12%, #0d4f3c 0%, #062d25 46%, #041a16 100%);
}
.login-bg { position: absolute; inset: 0; overflow: hidden; }
.login-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.5; animation: blobFloat 18s ease-in-out infinite alternate; }
.blob-a { width: 460px; height: 460px; left: -120px; top: -110px; background: #0f9d6c; }
.blob-b { width: 540px; height: 540px; right: -160px; bottom: -180px; background: #0b6f8f; animation-delay: -6s; }
.blob-c { width: 280px; height: 280px; left: 48%; top: 62%; background: #7ac943; opacity: 0.28; animation-delay: -11s; }
.login-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 76%);
}
.login-bubble { position: absolute; font-size: 34px; opacity: 0.2; filter: blur(0.3px); animation: bubbleFloat 12s ease-in-out infinite; }
.bubble-a { left: 12%; top: 22%; }
.bubble-b { right: 14%; top: 18%; animation-delay: -3s; }
.bubble-c { left: 17%; bottom: 18%; animation-delay: -7s; }
@keyframes blobFloat { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(34px, -26px, 0) scale(1.08); } }
@keyframes bubbleFloat { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-18px) rotate(5deg); } }
.login-card {
  position: relative; z-index: 2; width: 400px; max-width: calc(100vw - 32px); padding: 38px 34px 22px;
  background: #ffffff; border-radius: 18px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  text-align: center;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; }
.login-logo { width: 56px; height: 56px; display: block; }
.login-brand-text { text-align: left; }
.login-brand-text h1 { font-size: 25px; line-height: 1.1; letter-spacing: 2px; font-weight: 600; color: #111; }
.login-brand-text p { font-size: 10px; letter-spacing: 3px; color: #9a9a9a; text-transform: uppercase; margin-top: 4px; }
.login-qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login-qr {
  position: relative; width: 216px; height: 216px; padding: 9px; background: #fff; border: 1px solid #e7e7e7;
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s;
}
.login-qr:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.11); }
.login-qr-art { display: block; width: 100%; height: 100%; }
.login-qr-art svg { width: 100%; height: 100%; }
.login-scanline {
  position: absolute; left: 9px; right: 9px; top: 9px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #07c160, transparent); box-shadow: 0 0 12px #07c160;
  animation: scan 2.6s ease-in-out infinite;
}
@keyframes scan { 0%, 100% { transform: translateY(0); opacity: 0; } 12% { opacity: 0.85; } 50% { transform: translateY(196px); opacity: 0.85; } 88% { opacity: 0; } }
.login-qr-status {
  position: absolute; inset: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(3px); border-radius: 6px; font-size: 13px; color: #333; z-index: 3;
}
.login-qr-status .status-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.login-qr-status .status-icon.pending { background: #f0f0f0; color: var(--green); }
.login-qr-caption { font-size: 12px; color: #8a8a8a; display: flex; align-items: center; gap: 6px; }
.login-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12); }
.login-status { font-size: 13px; color: #777; margin: 16px 0 4px; min-height: 20px; }
.login-demo {
  margin: 8px auto 0; padding: 8px 18px; border-radius: 999px; color: var(--green); background: var(--green-soft);
  font-size: 13px; font-weight: 500; transition: background 0.15s, transform 0.15s;
}
.login-demo:hover { background: #d9f4e5; transform: translateY(-1px); }
.login-note { font-size: 11px; line-height: 1.7; color: #a0a0a0; margin: 16px 0 12px; }
.login-footer { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: #b0b0b0; border-top: 1px solid #f0f0f0; padding-top: 12px; }
.login-footer-sep { color: #d5d5d5; }
html[data-theme="dark"] .login-card { background: #202224; }
html[data-theme="dark"] .login-brand-text h1 { color: #f0f0f0; }
html[data-theme="dark"] .login-brand-text p, html[data-theme="dark"] .login-note, html[data-theme="dark"] .login-footer { color: #8a8a8a; }
html[data-theme="dark"] .login-qr { background: #fff; }
html[data-theme="dark"] .login-footer { border-top-color: #383838; }
html[data-theme="dark"] .login-demo { background: rgba(7, 193, 96, 0.13); }

/* ---------------------------------------------------------------- 主框架 */
.main-screen {
  display: grid; grid-template-columns: var(--rail-w) var(--list-w) minmax(0, 1fr) 0;
  height: 100dvh; min-height: 0; background: var(--chat-bg); overflow: hidden;
  transition: grid-template-columns 0.22s ease;
}
.main-screen.right-open { grid-template-columns: var(--rail-w) var(--list-w) minmax(0, 1fr) var(--right-w); }
.main-screen.wide { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr) 0; }
.main-screen.wide.right-open { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr) var(--right-w); }
.main-screen.wide .list-pane { visibility: hidden; opacity: 0; pointer-events: none; }
.main-screen.right-open .right-pane { visibility: visible; opacity: 1; }
.main-screen.chat-open .content-pane { transform: none; }

/* ---------------------------------------------------------------- 左侧导航 */
.rail {
  background: var(--rail); color: var(--rail-icon); display: flex; flex-direction: column; align-items: center;
  padding: 22px 0 14px; gap: 4px; position: relative; z-index: 30; user-select: none;
}
.rail-avatar-btn { position: relative; margin-bottom: 18px; border-radius: 8px; }
.rail-avatar-btn:hover .rail-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.rail-avatar { transition: box-shadow 0.15s; }
.rail-status-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border: 2px solid var(--rail); border-radius: 50%; background: var(--green); }
.rail-nav { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.rail-btn {
  position: relative; width: 46px; height: 46px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: var(--rail-icon); transition: background 0.15s, color 0.15s, transform 0.15s;
}
.rail-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.rail-btn:active { transform: scale(0.96); }
.rail-btn.active { color: var(--rail-active); background: rgba(255, 255, 255, 0.08); }
.rail-btn.active::before { content: ""; position: absolute; left: -9px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--green); }
.rail-btn svg { width: 24px; height: 24px; }
.rail-badge { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; line-height: 16px; box-shadow: 0 0 0 2px var(--rail); }
.rail-badge.dot { min-width: 8px; width: 8px; height: 8px; padding: 0; }
.rail-spacer { flex: 1 1 auto; }
.rail-footer { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.rail-tip {
  position: absolute; left: 54px; top: 50%; transform: translateY(-50%) translateX(-4px); white-space: nowrap;
  background: rgba(0, 0, 0, 0.78); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 5px;
  opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; z-index: 40;
}
.rail-btn:hover .rail-tip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ---------------------------------------------------------------- 列表窗格 */
.list-pane {
  display: flex; flex-direction: column; min-width: 0; background: var(--list-bg);
  border-right: 1px solid var(--border); position: relative; z-index: 10; overflow: hidden;
  transition: opacity 0.2s;
}
.list-header {
  height: var(--header-h); flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border-bottom: 1px solid transparent;
}
.search-box {
  flex: 1 1 auto; min-width: 0; height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 8px;
  background: var(--search-bg); border-radius: 6px; color: var(--text-3); transition: background 0.15s, box-shadow 0.15s;
}
.search-box:focus-within { background: var(--panel); box-shadow: 0 0 0 1px var(--green); }
.search-box input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--text); }
.search-box input::placeholder { color: var(--text-3); }
.search-box .search-shortcut { font-size: 10px; color: var(--text-3); border: 1px solid var(--border-2); border-radius: 3px; padding: 0 4px; line-height: 15px; }
.plus-btn { width: 30px; height: 30px; border-radius: 6px; color: var(--text-2); display: flex; align-items: center; justify-content: center; flex: none; }
.plus-btn:hover { background: var(--hover); color: var(--text); }
.list-header-title { font-size: 15px; font-weight: 600; color: var(--text); flex: 1 1 auto; }
.list-header-actions { display: flex; align-items: center; gap: 2px; }
.list-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 2px 0 12px; }
.list-overlay { position: absolute; top: var(--header-h); right: 0; bottom: 0; width: 22px; pointer-events: none; z-index: 4; }
.list-overlay .contact-letter-index { pointer-events: auto; }
.list-footer { flex: none; }

.chat-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 64px; cursor: default;
  position: relative; transition: background 0.08s; user-select: none;
}
.chat-item:hover { background: var(--list-hover); }
.chat-item.active { background: var(--list-active); }
.chat-item.pinned { background: var(--list-pinned); }
.chat-item.pinned:hover { background: var(--list-hover); }
.chat-item.pinned.active { background: var(--list-active); }
.main-screen.compact .chat-item { min-height: 54px; padding: 7px 12px; }
.main-screen.compact .chat-item-avatar .avatar { width: 36px !important; height: 36px !important; }
.main-screen.compact .contact-row { padding: 5px 14px; }
.main-screen.compact .simple-row { padding: 7px 14px; }
.chat-item-avatar { position: relative; flex: none; }
.chat-item-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-top { display: flex; align-items: center; gap: 6px; }
.chat-name { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-time { flex: none; font-size: 11px; color: var(--text-3); }
.chat-preview-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-preview { flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-preview .mention { color: var(--red); }
.chat-flags { display: flex; align-items: center; gap: 4px; flex: none; color: var(--text-3); }
.chat-flags svg { width: 13px; height: 13px; }
.chat-unread { flex: none; }
.chat-pin-mark { position: absolute; right: 10px; top: 9px; color: var(--text-3); opacity: 0.8; }

.list-empty { padding: 42px 20px; text-align: center; color: var(--text-3); font-size: 13px; }

/* 通讯录列表 */
.contact-shortcuts { padding: 4px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.shortcut-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: default; }
.shortcut-row:hover { background: var(--list-hover); }
.shortcut-icon { width: 36px; height: 36px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.shortcut-label { flex: 1 1 auto; font-size: 14px; }
.shortcut-count { font-size: 12px; color: var(--text-3); }
.contact-section-title { padding: 8px 14px 4px; font-size: 12px; color: var(--text-3); font-weight: 500; }
.contact-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: default; }
.contact-row:hover { background: var(--list-hover); }
.contact-row.active { background: var(--list-active); }
.contact-row-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-row-sub { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-letter-index {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column;
  gap: 1px; z-index: 3; user-select: none; max-height: 80%; overflow: hidden;
}
.contact-letter-index button { width: 16px; height: 15px; font-size: 10px; color: var(--text-2); line-height: 15px; border-radius: 3px; }
.contact-letter-index button:hover { background: var(--hover); color: var(--green); }

/* 简单列表（收藏/文件/设置） */
.side-tabs { padding: 8px 10px; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px; }
.side-tab { padding: 4px 9px; border-radius: 4px; font-size: 12px; color: var(--text-2); }
.side-tab:hover { background: var(--hover); }
.side-tab.active { background: var(--green-soft); color: var(--green); font-weight: 500; }
.simple-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: default; }
.simple-row:hover { background: var(--list-hover); }
.simple-row.active { background: var(--list-active); }
.simple-row-main { flex: 1 1 auto; min-width: 0; }
.simple-row-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.simple-row-sub { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.simple-row-meta { font-size: 11px; color: var(--text-3); flex: none; }

/* ---------------------------------------------------------------- 会话主区 */
.content-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--chat-bg); position: relative; z-index: 5; }
.content-root { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.chat-view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--chat-bg); }
.chat-header {
  height: var(--header-h); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 20px;
  border-bottom: 1px solid var(--border); background: var(--chat-bg); position: relative; z-index: 4;
}
.chat-back { display: none; }
.chat-header-main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; }
.chat-title-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-title { font-size: 16px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-subtitle { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.chat-header .icon-btn { width: 34px; height: 34px; }
.chat-searchbar { height: 40px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--panel); }
.chat-searchbar input { flex: 1 1 auto; border: 0; outline: 0; background: transparent; font-size: 13px; }
.chat-searchbar .search-count { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.chat-searchbar .icon-btn { width: 26px; height: 26px; }

.chat-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 8px 20px 12px; }
.messages { display: flex; flex-direction: column; min-height: 100%; justify-content: flex-end; }
.date-sep { align-self: center; margin: 14px 0 10px; font-size: 11px; color: var(--text-3); padding: 2px 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.035); }
html[data-theme="dark"] .date-sep { background: rgba(255, 255, 255, 0.05); }
.system-msg { align-self: center; max-width: 78%; margin: 8px auto; font-size: 11.5px; line-height: 1.6; color: var(--text-3); text-align: center; padding: 2px 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.035); }
html[data-theme="dark"] .system-msg { background: rgba(255, 255, 255, 0.05); }
.msg-row { display: flex; align-items: flex-start; gap: 8px; margin: 7px 0; position: relative; }
.msg-row.out { flex-direction: row-reverse; }
.msg-row .msg-avatar { margin-top: 2px; cursor: pointer; }
.msg-content { max-width: min(62%, 560px); min-width: 0; display: flex; flex-direction: column; }
.msg-row.out .msg-content { align-items: flex-end; }
.msg-sender { font-size: 11.5px; color: var(--text-3); margin: 0 2px 3px; }
.bubble {
  position: relative; padding: 9px 12px; border-radius: 6px; background: var(--bubble-in); color: var(--text);
  font-size: 14.5px; line-height: 1.55; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.035); word-break: break-word;
  overflow-wrap: anywhere; max-width: 100%;
}
.bubble::before {
  content: ""; position: absolute; top: 12px; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.msg-row.in .bubble::before { left: -5px; border-right: 6px solid var(--bubble-in); }
.msg-row.out .bubble::before { right: -5px; border-left: 6px solid var(--bubble-out); }
.msg-row.out .bubble { background: var(--bubble-out); color: #0b2b16; }
html[data-theme="dark"] .msg-row.out .bubble { color: #eafff1; }
.bubble a.text-link { color: var(--blue); text-decoration: none; }
.bubble a.text-link:hover { text-decoration: underline; }
.msg-row.out .bubble a.text-link { color: #1d5b37; }
html[data-theme="dark"] .msg-row.out .bubble a.text-link { color: #d6ffe6; }
.mention { color: var(--red); font-weight: 500; }
.msg-row.out .mention { color: #b42318; }
.quote-block { border-left: 3px solid rgba(0, 0, 0, 0.16); background: rgba(0, 0, 0, 0.04); padding: 4px 8px; margin-bottom: 6px; border-radius: 3px; font-size: 12px; color: var(--text-2); line-height: 1.5; }
.msg-row.out .quote-block { border-left-color: rgba(0, 0, 0, 0.2); background: rgba(0, 0, 0, 0.06); color: #3b5c47; }
.msg-time-pop { position: absolute; top: -13px; font-size: 10px; color: var(--text-3); opacity: 0; transition: opacity 0.15s; white-space: nowrap; }
.msg-row:hover .msg-time-pop { opacity: 1; }
.msg-row.in .msg-time-pop { left: 44px; }
.msg-row.out .msg-time-pop { right: 44px; }
.msg-row.highlight .bubble { animation: highlightPulse 1.4s ease-out; }
@keyframes highlightPulse { 0% { box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.45); } 100% { box-shadow: 0 1px 1px rgba(0, 0, 0, 0.035); } }

/* 消息类型 */
.msg-image-wrap { padding: 3px; background: transparent; box-shadow: none; }
.msg-row.in .msg-image-wrap::before, .msg-row.out .msg-image-wrap::before { display: none; }
.msg-image-wrap .photo { width: 220px; max-width: 100%; aspect-ratio: 4 / 3; cursor: zoom-in; }
.msg-image-wrap .photo img { width: 100%; height: 100%; object-fit: cover; }
.msg-row.out .msg-image-wrap { background: transparent; }
.voice-bubble { display: flex; align-items: center; gap: 8px; min-width: 78px; cursor: pointer; user-select: none; }
.voice-bubble .voice-icon { color: var(--text-2); flex: none; }
.msg-row.out .voice-bubble .voice-icon { color: #2c6b46; }
.voice-wave { display: flex; align-items: center; gap: 2px; height: 18px; flex: 1 1 auto; }
.voice-wave i { display: block; width: 2px; border-radius: 2px; background: currentColor; opacity: 0.55; }
.voice-duration { font-size: 11px; color: var(--text-2); flex: none; }
.voice-bubble.playing .voice-wave i { animation: wave 0.65s ease-in-out infinite alternate; }
.voice-bubble.playing .voice-wave i:nth-child(2n) { animation-delay: -0.2s; }
.voice-bubble.playing .voice-wave i:nth-child(3n) { animation-delay: -0.4s; }
@keyframes wave { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }
.file-card { display: flex; align-items: center; gap: 10px; width: 268px; max-width: 100%; padding: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow-sm); cursor: pointer; text-align: left; }
.msg-row.out .file-card { background: rgba(255, 255, 255, 0.92); }
.file-card-message { border: 0; box-shadow: none; padding: 0; width: 260px; background: transparent; }
.file-card-meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.file-card-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card-size { font-size: 11px; color: var(--text-3); }
.packet-card, .transfer-card { width: 250px; max-width: 100%; border-radius: 6px; overflow: hidden; cursor: pointer; color: #fff; box-shadow: var(--shadow-sm); }
.packet-card { background: linear-gradient(135deg, #f6a13b, #f07a2a); }
.packet-main { display: flex; align-items: center; gap: 12px; padding: 12px; }
.packet-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); display: flex; align-items: center; justify-content: center; flex: none; }
.packet-text { min-width: 0; flex: 1 1 auto; }
.packet-blessing { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.packet-sub { font-size: 11px; opacity: 0.82; margin-top: 2px; }
.packet-foot { height: 22px; background: rgba(0, 0, 0, 0.08); display: flex; align-items: center; padding: 0 10px; font-size: 10px; letter-spacing: 0.4px; opacity: 0.8; }
.transfer-card { background: linear-gradient(135deg, #f7b24b, #ef8f2f); }
.transfer-main { padding: 12px; display: flex; align-items: center; gap: 12px; }
.transfer-amount { font-size: 18px; font-weight: 600; letter-spacing: 0.5px; }
.transfer-note { font-size: 11px; opacity: 0.85; margin-top: 2px; }
.link-card { width: 270px; max-width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 10px; display: flex; gap: 10px; cursor: pointer; box-shadow: var(--shadow-sm); text-align: left; }
.msg-row.out .link-card { background: rgba(255, 255, 255, 0.92); }
.link-card-main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; }
.link-title { font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-desc { font-size: 11px; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-source { font-size: 10px; color: var(--text-3); }
.link-thumb { width: 54px; height: 54px; flex: none; border-radius: 4px; overflow: hidden; }
.link-thumb .photo { width: 100%; height: 100%; border-radius: 4px; }
.link-thumb .photo-emoji { font-size: 22px; }
.link-thumb .photo-label { display: none; }
.location-card { width: 260px; max-width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); text-align: left; }
.location-map { height: 92px; position: relative; }
.location-map .photo { width: 100%; height: 100%; border-radius: 0; }
.location-map .photo-emoji { font-size: 30px; }
.location-info { padding: 8px 10px; }
.location-name { font-size: 13px; }
.location-address { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.sticker-msg { font-size: 78px; line-height: 1; padding: 2px 4px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12)); cursor: default; user-select: none; }
.msg-row.out .sticker-msg { transform: scaleX(-1); }
.msg-row.out .sticker-msg:hover { transform: scaleX(-1) scale(1.04); }
.msg-status { font-size: 10px; color: var(--text-3); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.msg-status .spinner { width: 10px; height: 10px; border-width: 1px; }
.call-card { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 2px 0; }

.composer { flex: none; background: var(--chat-bg); padding: 0 20px 14px; position: relative; z-index: 6; }
.composer-toolbar { height: 34px; display: flex; align-items: center; gap: 4px; }
.toolbar-btn { width: 30px; height: 30px; border-radius: 5px; color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.toolbar-btn:hover { background: var(--hover); color: var(--text); }
.toolbar-btn.active { color: var(--green); background: var(--green-soft); }
.toolbar-sep { width: 1px; height: 16px; background: var(--border-2); margin: 0 4px; }
.composer-box { background: var(--panel); border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); display: flex; flex-direction: column; min-height: 94px; max-height: 210px; }
.composer-input {
  width: 100%; flex: 1 1 auto; min-height: 66px; max-height: 148px; resize: none; border: 0; outline: 0;
  background: transparent; padding: 9px 11px 4px; font-size: 14.5px; line-height: 1.6; color: var(--text);
  overflow-y: auto; font-family: var(--font);
}
.composer-input::placeholder { color: var(--text-3); }
.composer-bottom { display: flex; align-items: center; gap: 8px; padding: 2px 8px 7px 10px; }
.composer-hint { font-size: 11px; color: var(--text-3); flex: 1 1 auto; }
.composer-hint kbd { font-family: var(--math, inherit); border: 1px solid var(--border-2); border-radius: 3px; padding: 0 4px; font-size: 10px; }
.send-btn { height: 28px; padding: 0 15px; border-radius: 4px; background: var(--green); color: #fff; font-size: 12.5px; font-weight: 500; opacity: 0.45; transition: background 0.15s, opacity 0.15s; }
.send-btn.ready { opacity: 1; }
.send-btn:hover { background: var(--green-dark); }
.reply-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 6px 9px; background: var(--hover); border-left: 3px solid var(--green); border-radius: 0 4px 4px 0; font-size: 12px; color: var(--text-2); }
.reply-bar-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .icon-btn { width: 22px; height: 22px; }
.emoji-panel {
  position: absolute; left: 20px; bottom: 100%; margin-bottom: 8px; width: 356px; max-width: calc(100vw - 40px); height: 306px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md); display: flex; flex-direction: column;
  z-index: 20; overflow: hidden; animation: popIn 0.16s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: translateY(5px) scale(0.99); } to { opacity: 1; transform: none; } }
.emoji-tabs { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--border); flex: none; }
.emoji-tab { width: 30px; height: 26px; border-radius: 4px; font-size: 16px; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.emoji-tab:hover { background: var(--hover); }
.emoji-tab.active { background: var(--green-soft); }
.emoji-scroll { flex: 1 1 auto; overflow-y: auto; padding: 8px; }
.emoji-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.emoji-item { width: 32px; height: 32px; font-size: 21px; display: flex; align-items: center; justify-content: center; border-radius: 4px; }
.emoji-item:hover { background: var(--hover); }
.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 8px; }
.sticker-item { aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 42px; background: var(--panel-2); border: 1px solid var(--border); }
.sticker-item:hover { border-color: var(--green); transform: translateY(-1px); }
.emoji-foot { padding: 4px 9px 6px; font-size: 10px; color: var(--text-3); border-top: 1px solid var(--border); display: flex; justify-content: space-between; }

/* ---------------------------------------------------------------- 右侧信息面板 */
.right-pane { min-width: 0; background: var(--panel-2); border-left: 1px solid var(--border); overflow: hidden; visibility: hidden; opacity: 0; transition: opacity 0.2s; }
.right-panel-inner { width: var(--right-w); height: 100%; display: flex; flex-direction: column; }
.panel-header { height: 52px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--border); }
.panel-header h3 { font-size: 14px; font-weight: 600; }
.panel-scroll { flex: 1 1 auto; overflow-y: auto; padding: 16px; }
.panel-profile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 0 14px; }
.panel-avatar { margin-bottom: 10px; }
.panel-name { font-size: 17px; font-weight: 600; }
.panel-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.panel-signature { font-size: 12px; color: var(--text-2); margin-top: 8px; line-height: 1.6; }
.panel-actions { display: flex; gap: 8px; justify-content: center; margin: 14px 0 6px; }
.panel-section { border-top: 1px solid var(--border); padding: 14px 0; }
.panel-section-title { font-size: 12px; color: var(--text-3); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.panel-info-row { display: flex; gap: 8px; font-size: 12px; padding: 5px 0; color: var(--text-2); }
.panel-info-row .label { width: 52px; flex: none; color: var(--text-3); }
.panel-info-row .value { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.member-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; }
.member { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.member-name { font-size: 10px; color: var(--text-2); max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; font-size: 13px; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 11px; background: var(--border-2); flex: none; transition: background 0.18s; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.18s; }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(16px); }
.panel-danger-btn { color: var(--red); font-size: 13px; width: 100%; text-align: center; padding: 9px; border-radius: 6px; }
.panel-danger-btn:hover { background: rgba(250, 81, 81, 0.08); }

/* ---------------------------------------------------------------- 通讯录主区 */
.contact-detail { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 28px 34px 40px; }
.contact-hero { display: flex; align-items: flex-start; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.contact-hero-avatar { flex: none; }
.contact-hero-main { min-width: 0; flex: 1 1 auto; }
.contact-hero-name { font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.contact-hero-meta { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.contact-hero-sign { font-size: 12.5px; color: var(--text-2); margin-top: 8px; line-height: 1.6; }
.contact-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.contact-info-list { padding: 18px 0; border-bottom: 1px solid var(--border); }
.info-row { display: flex; gap: 12px; padding: 7px 0; font-size: 13px; }
.info-row .label { width: 64px; color: var(--text-3); flex: none; }
.info-row .value { color: var(--text); flex: 1 1 auto; min-width: 0; word-break: break-word; }
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-chip { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 3px; background: var(--hover); font-size: 11px; color: var(--text-2); }
.contact-moments { padding-top: 18px; }
.contact-moments h3 { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 10px; }
.contact-moment-grid { display: flex; gap: 8px; }
.contact-moment-thumb { width: 92px; height: 92px; border-radius: 5px; overflow: hidden; cursor: pointer; }
.contact-moment-thumb .photo { width: 100%; height: 100%; border-radius: 5px; }
.contact-moment-thumb .photo-label { display: none; }

/* ---------------------------------------------------------------- 朋友圈 */
.moments-view { flex: 1 1 auto; min-height: 0; overflow-y: auto; background: var(--panel); }
.moments-topbar { position: sticky; top: 0; z-index: 6; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--border); }
.moments-topbar h1 { font-size: 16px; font-weight: 600; }
.moments-topbar .moments-cover-actions { position: static; display: flex; gap: 2px; }
.moments-topbar .icon-btn { background: transparent; color: var(--text-2); }
.moments-topbar .icon-btn:hover { background: var(--hover); color: var(--text); }
.moments-inner { max-width: 760px; margin: 0 auto; padding-bottom: 50px; }
.moments-cover { position: relative; height: 270px; overflow: hidden; }
.moments-cover .photo { position: absolute; inset: 0; border-radius: 0; height: 100%; }
.moments-cover .photo-emoji { font-size: 90px; opacity: 0.9; }
.moments-cover .photo-label { display: none; }
.moments-cover-title { position: absolute; left: 24px; bottom: 20px; z-index: 2; display: flex; align-items: center; gap: 10px; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.moments-cover-title h1 { font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.moments-cover-actions { position: absolute; right: 18px; bottom: 18px; z-index: 2; display: flex; gap: 10px; }
.moments-cover-actions .icon-btn { background: rgba(0, 0, 0, 0.25); color: #fff; backdrop-filter: blur(4px); }
.moments-cover-actions .icon-btn:hover { background: rgba(0, 0, 0, 0.4); }
.moments-me { display: flex; align-items: flex-end; gap: 12px; padding: 0 24px; margin-top: -34px; position: relative; z-index: 3; }
.moments-me-avatar { border: 3px solid var(--panel); border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
.moments-me-info { padding-bottom: 4px; }
.moments-me-name { font-size: 17px; font-weight: 600; color: var(--text); text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4); }
.moments-me-sign { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.moments-feed { margin-top: 18px; }
.moment { display: flex; align-items: flex-start; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.moment:last-child { border-bottom: 0; }
.moment-avatar { flex: none; cursor: pointer; align-self: flex-start; width: 44px; height: 44px; }
.moment-main { flex: 1 1 auto; min-width: 0; }
.moment-author { font-size: 14px; font-weight: 600; color: var(--blue); }
.moment-text { font-size: 14px; line-height: 1.65; margin: 4px 0 8px; white-space: pre-wrap; word-break: break-word; }
.moment-images { display: grid; gap: 4px; margin: 6px 0 8px; max-width: 420px; }
.moment-images.count-1 { grid-template-columns: minmax(0, 1fr); max-width: 250px; }
.moment-images.count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.moment-images.count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.moment-images.count-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 300px; }
.moment-images.count-5, .moment-images.count-6, .moment-images.count-7, .moment-images.count-8, .moment-images.count-9 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.moment-image { aspect-ratio: 1; border-radius: 4px; overflow: hidden; cursor: zoom-in; }
.moment-image .photo { width: 100%; height: 100%; border-radius: 4px; }
.moment-image .photo-emoji { font-size: 34px; }
.moment-image .photo-label { display: none; }
.moment-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-3); }
.moment-location { color: var(--blue); }
.moment-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; opacity: 0; transition: opacity 0.15s; }
.moment:hover .moment-actions { opacity: 1; }
.moment-action { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-2); padding: 3px 6px; border-radius: 4px; }
.moment-action:hover { background: var(--hover); }
.moment-action.on { color: var(--red); }
.moment-social { margin-top: 8px; background: var(--panel-2); border-radius: 4px; padding: 7px 10px; font-size: 12px; line-height: 1.7; }
.moment-likes { color: var(--blue); display: flex; align-items: flex-start; gap: 5px; }
.moment-likes .heart-mini { color: var(--red); flex: none; margin-top: 2px; }
.moment-comments { margin-top: 3px; }
.moment-comment { color: var(--text); }
.moment-comment .comment-author { color: var(--blue); }
.moment-comment-input { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.moment-comment-input input { flex: 1 1 auto; height: 28px; border: 1px solid var(--border); border-radius: 4px; background: var(--panel); padding: 0 8px; outline: 0; font-size: 12px; }
.moment-comment-input input:focus { border-color: var(--green); }
.moment-comment-input .btn { height: 28px; }
.moments-compose-preview { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; }
.compose-thumb { width: 64px; height: 64px; border-radius: 5px; overflow: hidden; position: relative; }
.compose-thumb .photo { width: 100%; height: 100%; border-radius: 5px; }
.compose-thumb .photo-label { display: none; }
.compose-thumb .remove { position: absolute; right: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; display: flex; align-items: center; justify-content: center; }
.compose-add { width: 64px; height: 64px; border: 1px dashed var(--border-2); border-radius: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-3); font-size: 10px; }
.compose-add:hover { border-color: var(--green); color: var(--green); }

/* ---------------------------------------------------------------- 收藏 / 文件 / 小程序 / 设置 */
.simple-view { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 28px 40px; }
.simple-view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.simple-view-head h2 { font-size: 18px; font-weight: 600; }
.simple-view-head .fine { margin-top: 3px; }
.favorites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.favorite-card { display: flex; gap: 11px; text-align: left; padding: 13px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s; }
.favorite-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.fav-icon { width: 38px; height: 38px; border-radius: 8px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; color: var(--green); flex: none; }
.fav-body { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; }
.fav-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-text { font-size: 11.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fav-source { font-size: 10.5px; color: var(--text-3); }
.file-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.file-table th { text-align: left; font-weight: 500; font-size: 11px; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.file-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.file-row { cursor: default; }
.file-row:hover { background: var(--hover); }
.file-row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-row-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-meta { font-size: 11px; color: var(--text-3); }
.file-row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.mini-view { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 28px 40px; }
.mini-section-title { font-size: 13px; color: var(--text-2); font-weight: 500; margin: 18px 0 10px; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.mini-card { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s; }
.mini-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mini-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 25px; color: #fff; }
.mini-name { font-size: 11.5px; color: var(--text-2); text-align: center; }
.settings-view { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px 32px 40px; }
.settings-title { font-size: 20px; font-weight: 600; margin-bottom: 18px; }
.settings-section { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.settings-section-head { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.settings-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: 0; }
.settings-row-main { flex: 1 1 auto; min-width: 0; }
.settings-label { font-size: 13px; }
.settings-desc { font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.settings-row .switch { margin-left: auto; }
.settings-value { font-size: 12px; color: var(--text-3); }
.settings-account { display: flex; align-items: center; gap: 14px; padding: 18px 16px; }
.settings-account-name { font-size: 16px; font-weight: 600; }
.settings-account-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.theme-options { display: flex; gap: 8px; margin-left: auto; }
.theme-option { padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text-2); }
.theme-option.active { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.about-box { padding: 20px 16px; display: flex; align-items: center; gap: 14px; }
.about-logo { width: 52px; height: 52px; }
.about-name { font-size: 16px; font-weight: 600; }
.about-version { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.about-links { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- 搜索 */
.search-layer { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.28); display: flex; justify-content: center; align-items: flex-start; padding-top: 9vh; }
.search-panel { width: 640px; max-width: calc(100vw - 28px); max-height: 74vh; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: popIn 0.18s ease-out; }
.search-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text-3); flex: none; }
.search-input-wrap input { flex: 1 1 auto; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--text); }
.search-close { font-size: 12px; color: var(--text-3); padding: 4px 6px; border-radius: 4px; }
.search-close:hover { background: var(--hover); }
.search-results { flex: 1 1 auto; overflow-y: auto; padding: 6px 8px 12px; }
.search-section-title { font-size: 11px; color: var(--text-3); padding: 10px 10px 4px; font-weight: 500; }
.search-result { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; text-align: left; }
.search-result:hover { background: var(--hover); }
.search-result-main { min-width: 0; flex: 1 1 auto; }
.search-result-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-sub { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result mark, .search-result-title mark, .search-result-sub mark { background: rgba(7, 193, 96, 0.22); color: var(--text); border-radius: 2px; padding: 0 1px; }
.search-empty { padding: 42px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.search-tip { padding: 26px 20px; text-align: center; color: var(--text-3); font-size: 12px; line-height: 1.8; }

/* ---------------------------------------------------------------- 弹层 */
.modal-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.34); display: flex; align-items: center; justify-content: center; padding: 24px; pointer-events: auto; opacity: 0; transition: opacity 0.18s; }
.modal-overlay.show { opacity: 1; }
.modal { width: min(var(--modal-width, 440px), calc(100vw - 32px)); max-height: 86vh; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; transform: translateY(6px) scale(0.99); transition: transform 0.18s; }
.modal-overlay.show .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; border-bottom: 1px solid var(--border); flex: none; }
.modal-title-wrap { min-width: 0; }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-subtitle { font-size: 11.5px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.modal-close { width: 28px; height: 28px; margin-top: -2px; }
.modal-body { padding: 14px 18px; overflow-y: auto; font-size: 13px; line-height: 1.65; min-height: 0; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid var(--border); flex: none; }
.confirm-message { font-size: 13px; line-height: 1.7; color: var(--text-2); }
.context-menu-layer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.context-menu { position: fixed; width: 196px; padding: 5px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md); pointer-events: auto; opacity: 0; transform: translateY(-3px) scale(0.985); transition: opacity 0.12s, transform 0.12s; }
.context-menu.show { opacity: 1; transform: none; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 5px; font-size: 12.5px; text-align: left; color: var(--text); }
.menu-item:hover:not(:disabled) { background: var(--hover); }
.menu-item.danger { color: var(--red); }
.menu-item:disabled { opacity: 0.4; }
.menu-icon { width: 17px; display: flex; align-items: center; justify-content: center; color: var(--text-2); flex: none; }
.menu-item.danger .menu-icon { color: var(--red); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.toast-layer { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 7px; background: rgba(30, 30, 30, 0.9); color: #fff; font-size: 12.5px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.24); opacity: 0; transform: translateY(-8px); transition: opacity 0.2s, transform 0.2s; max-width: min(480px, calc(100vw - 32px)); }
.toast.show { opacity: 1; transform: none; }
.toast-icon { display: flex; flex: none; }
.toast-success .toast-icon { color: #4ade80; }
.toast-error .toast-icon { color: #f87171; }
.toast-warn .toast-icon { color: #fbbf24; }
.toast-text { line-height: 1.45; }
.image-lightbox { position: fixed; inset: 0; z-index: 110; background: rgba(0, 0, 0, 0.82); display: flex; align-items: center; justify-content: center; padding: 34px; }
.image-lightbox .photo { width: min(78vw, 900px); max-height: 80vh; aspect-ratio: auto; border-radius: 8px; }
.image-lightbox .photo img { max-height: 80vh; width: auto; max-width: 78vw; object-fit: contain; }
.image-lightbox .photo-emoji { font-size: 120px; }
.lightbox-close { position: absolute; right: 22px; top: 18px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; display: flex; align-items: center; justify-content: center; }
.lightbox-caption { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, 0.8); font-size: 12px; }
.redpacket-modal { text-align: center; padding: 8px 0 0; }
.redpacket-amount { font-size: 34px; font-weight: 600; color: var(--orange); margin: 8px 0; }
.redpacket-amount small { font-size: 14px; font-weight: 400; margin-right: 2px; }
.redpacket-blessing { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.redpacket-open { width: 74px; height: 74px; border-radius: 50%; background: linear-gradient(135deg, #f6a13b, #ef7a2a); color: #fff; font-size: 15px; font-weight: 600; box-shadow: 0 10px 26px rgba(239, 122, 42, 0.35); margin: 8px auto 4px; display: flex; align-items: center; justify-content: center; }
.redpacket-open:hover { transform: translateY(-1px); }
.redpacket-note { font-size: 10.5px; color: var(--text-3); margin-top: 8px; }
.call-stage { background: #1f2933; border-radius: 10px; padding: 22px; text-align: center; color: #fff; }
.call-avatar { margin: 0 auto 10px; }
.call-name { font-size: 16px; font-weight: 500; }
.call-status { font-size: 12px; color: rgba(255, 255, 255, 0.6); margin-top: 4px; }
.call-actions { display: flex; justify-content: center; gap: 16px; margin-top: 20px; }
.call-action { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; display: flex; align-items: center; justify-content: center; }
.call-action.hangup { background: #e5484d; }
.call-action:hover { filter: brightness(1.12); }
.article-modal .article-cover { height: 130px; border-radius: 7px; overflow: hidden; margin-bottom: 12px; }
.article-modal .article-cover .photo { width: 100%; height: 100%; }
.article-modal h3 { font-size: 18px; line-height: 1.5; margin-bottom: 6px; }
.article-modal .article-source { font-size: 11px; color: var(--text-3); margin-bottom: 12px; }
.article-modal p { font-size: 13px; color: var(--text-2); line-height: 1.8; margin-bottom: 8px; }
.qr-modal { text-align: center; }
.qr-modal .qr-svg { margin: 0 auto 10px; border-radius: 6px; }
.qr-modal .qr-name { font-size: 16px; font-weight: 600; }
.qr-modal .qr-note { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.mini-modal-icon { width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #fff; margin: 0 auto 10px; }
.mini-skeleton { height: 8px; border-radius: 4px; background: var(--hover); margin: 8px 0; }
.mini-skeleton.w60 { width: 60%; }
.mini-skeleton.w80 { width: 80%; }
.settings-form label { display: block; font-size: 12px; color: var(--text-3); margin: 10px 0 4px; }
.settings-form input, .settings-form textarea, .settings-form select { width: 100%; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); padding: 8px 10px; outline: 0; font-size: 13px; }
.settings-form input:focus, .settings-form textarea:focus { border-color: var(--green); }
.settings-form textarea { min-height: 70px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------------------------------------------------------------- 动效 */
@keyframes vanish { to { opacity: 0; transform: scale(0.96); } }
.msg-row.removing { animation: vanish 0.2s ease-in forwards; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.001ms !important; }
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1180px) {
  :root { --rail-w: 60px; --list-w: 282px; --right-w: 280px; }
  .msg-content { max-width: 66%; }
}
@media (max-width: 980px) {
  .main-screen.right-open { grid-template-columns: var(--rail-w) var(--list-w) minmax(0, 1fr) 0; }
  .right-pane { position: fixed; right: 0; top: 0; bottom: 0; z-index: 60; box-shadow: var(--shadow-lg); }
  .right-pane { width: var(--right-w); }
}
@media (max-width: 760px) {
  :root { --rail-w: 54px; --list-w: 100%; --right-w: 300px; }
  .main-screen { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .main-screen.right-open { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .main-screen.wide { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .list-pane { grid-column: 2; }
  .content-pane {
    position: fixed; left: var(--rail-w); right: 0; top: 0; bottom: 0; z-index: 25;
    transform: translateX(102%); transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  }
  .main-screen.chat-open .content-pane, .main-screen.detail-open .content-pane { transform: none; }
  .chat-back { display: inline-flex; }
  .chat-body { padding: 6px 12px 10px; }
  .composer { padding: 0 12px 10px; }
  .emoji-panel { left: 12px; bottom: 100%; }
  .msg-content { max-width: 76%; }
  .msg-row .msg-avatar { width: 32px; height: 32px; }
  .bubble { font-size: 14px; }
  .chat-header { padding: 0 10px; }
  .chat-header .icon-btn { width: 30px; height: 30px; }
  .rail { padding-top: 14px; }
  .rail-avatar-btn { margin-bottom: 10px; }
  .rail-btn { width: 42px; height: 42px; }
  .rail-btn.active::before { left: -6px; }
  .list-header { padding: 0 9px; }
  .contact-detail { padding: 18px 16px 32px; }
  .contact-hero { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
  .contact-hero-name { justify-content: center; }
  .contact-actions { justify-content: center; }
  .contact-info-list .info-row { justify-content: space-between; }
  .moments-cover { height: 190px; }
  .moments-cover-title h1 { font-size: 18px; }
  .moments-cover .photo-emoji { font-size: 60px; }
  .moment { padding: 14px 14px; gap: 9px; }
  .moment-images { max-width: 100%; }
  .moments-me { padding: 0 14px; }
  .simple-view, .mini-view, .settings-view { padding: 16px 14px 30px; }
  .favorites-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px 18px; }
  .search-layer { padding-top: 4vh; }
  .search-panel { max-height: 84vh; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { max-height: 90vh; border-radius: 14px 14px 10px 10px; }
  .file-table .col-sender, .file-table .col-date { display: none; }
}
@media (max-width: 460px) {
  :root { --rail-w: 48px; }
  .rail-btn { width: 40px; height: 40px; }
  .rail-btn svg { width: 22px; height: 22px; }
  .rail-tip { display: none; }
  .chat-header-actions .icon-btn:nth-child(1) { display: none; }
  .composer-hint { display: none; }
  .send-btn { margin-left: auto; }
  .msg-content { max-width: 80%; }
  .emoji-panel { width: calc(100vw - 24px); }

  .emoji-grid { grid-template-columns: repeat(8, 1fr); }
}

/* ---------------------------------------------------------------- 补充：自检/表单/二级弹层用到的类 */
[hidden] { display: none !important; }
button.msg-avatar, button.moment-avatar, button.contact-moment-thumb, button.rail-avatar-btn { border: 0; background: none; padding: 0; }
button.msg-avatar { cursor: pointer; }
button.moment-avatar { cursor: pointer; }
button.search-box { text-align: left; cursor: text; }
.search-trigger span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden-sm { display: inline; }
.contact-row-main { min-width: 0; }
.contact-filter-chip { display: flex; align-items: center; gap: 6px; margin: 6px 14px; padding: 5px 9px; border-radius: 5px; background: var(--green-soft); color: var(--green); font-size: 12px; }
.contact-filter-chip button { color: var(--green); display: flex; align-items: center; }
.favorite-preview { margin: 8px 0 16px; }
.favorite-photo { width: min(420px, 100%); aspect-ratio: 4 / 3; }
.favorite-text { white-space: pre-wrap; font-size: 14px; line-height: 1.8; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 18px; max-width: 640px; }
.favorite-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 11.5px; color: var(--text-3); margin: 6px 0 14px; }
.file-preview { width: min(420px, 100%); min-height: 180px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 8px 0 16px; }
.file-preview .photo { width: 100%; height: 100%; min-height: 220px; border-radius: 0; }
.file-preview img { max-height: 360px; width: auto; max-width: 100%; object-fit: contain; }
.video-preview { flex-direction: column; gap: 10px; background: #111827; color: #fff; font-size: 12px; min-height: 220px; }
.audio-preview { min-height: 160px; padding: 22px; }
.bubble-file { padding: 0; background: transparent; box-shadow: none; }
.bubble-file::before { display: none; }
.shortcut-key { border: 1px solid var(--border-2); border-radius: 4px; padding: 2px 7px; font-size: 11px; color: var(--text-2); background: var(--panel); white-space: nowrap; }
.profile-edit-avatar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.compose-form textarea, .compose-location input, .add-friend-form input, .group-name-row input { width: 100%; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); padding: 8px 10px; outline: 0; font-size: 13px; }
.compose-form textarea { min-height: 90px; resize: vertical; }
.compose-form textarea:focus, .compose-location input:focus, .add-friend-form input:focus, .group-name-row input:focus { border-color: var(--green); }
.compose-preview { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; min-height: 4px; }
.compose-scenes { margin: 10px 0 8px; }
.compose-scene-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; margin-top: 6px; }
.compose-scene { aspect-ratio: 1; border-radius: 5px; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.compose-scene:hover { outline: 2px solid var(--green); }
.compose-add { margin-top: 8px; }
.compose-location { margin-top: 10px; }
.add-friend-form { display: flex; gap: 8px; margin-bottom: 12px; }
.add-friend-form input { flex: 1 1 auto; }
.group-name-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.group-name-row label { font-size: 12px; color: var(--text-3); flex: none; }
.group-pick-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; max-height: 280px; overflow-y: auto; }
.group-pick { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 5px; font-size: 12.5px; cursor: pointer; }
.group-pick:hover { background: var(--hover); }
.group-pick input { accent-color: var(--green); }
.request-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.request-row:last-child { border-bottom: 0; }
.request-main { flex: 1 1 auto; min-width: 0; }
.request-name { font-size: 13.5px; font-weight: 500; }
.request-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.request-msg { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.request-actions { display: flex; flex-direction: column; gap: 4px; flex: none; }
.history-list { max-height: 54vh; overflow-y: auto; }
.history-row { width: 100%; display: flex; align-items: baseline; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--border); text-align: left; }
.history-row:hover { background: var(--hover); }
.history-sender { flex: none; width: 66px; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-text { flex: 1 1 auto; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-time { flex: none; font-size: 10.5px; color: var(--text-3); }
.scanner-box { height: 220px; border-radius: 10px; background: #111827; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: rgba(255, 255, 255, 0.7); font-size: 12px; position: relative; overflow: hidden; }
.scanner-frame { width: 150px; height: 150px; border: 2px solid var(--green); border-radius: 10px; box-shadow: 0 0 24px rgba(7, 193, 96, 0.3); }
.scanner-frame::after { content: ""; display: block; height: 2px; background: var(--green); box-shadow: 0 0 10px var(--green); margin-top: 73px; animation: scan 2.4s ease-in-out infinite; }
.lightbox-photo { width: min(78vw, 900px); max-height: 78vh; aspect-ratio: auto; border-radius: 8px; }
.lightbox-photo img { max-height: 78vh; width: auto; max-width: 78vw; object-fit: contain; }
.lightbox-photo .photo-emoji { font-size: 120px; }
.request-actions .btn { width: 84px; }

@media (max-width: 760px) {
  .hidden-sm { display: none; }
  .group-pick-list { grid-template-columns: 1fr; }
  .compose-scene-grid { grid-template-columns: repeat(5, 1fr); }
  .favorite-text { padding: 12px; }
  .history-sender { width: 50px; }
}

/* ---------------------------------------------------------------- 1:1 补齐：多选 / 合并转发 / 名片 / 文件模式 / 搜索分类 */
.login-extra { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.login-extra .link-btn { font-size: 12px; }
.main-screen.file-only { grid-template-columns: 0 0 minmax(0, 1fr) 0; }
.main-screen.file-only .rail, .main-screen.file-only .list-pane { display: none; }
.main-screen.file-only .right-pane { display: none; }
.main-screen.file-only .content-pane { grid-column: 3; }
.msg-row.selectable { cursor: pointer; }
.msg-row.selectable:hover .bubble { filter: brightness(0.98); }
.msg-row.selected { background: rgba(7, 193, 96, 0.08); }
.msg-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-2); background: var(--panel); color: transparent; display: flex; align-items: center; justify-content: center; flex: none; margin: 10px 2px 0; }
.msg-row.selected .msg-check { background: var(--green); border-color: var(--green); color: #fff; }
.msg-row.out .msg-check { order: -2; }
.multi-composer { padding-top: 8px; }
.multi-bar { height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-sm); }
.multi-count { font-size: 13px; color: var(--text); font-weight: 500; padding-left: 4px; }
.multi-bar .btn { height: 28px; padding: 0 12px; font-size: 12px; }
.forward-card { width: 260px; max-width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 11px 13px; cursor: pointer; box-shadow: var(--shadow-sm); }
.forward-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forward-sub { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.forward-list { max-height: 56vh; overflow-y: auto; }
.forward-row { padding: 8px 2px; border-bottom: 1px solid var(--border); }
.forward-row:last-child { border-bottom: 0; }
.forward-row-name { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.forward-row-text { font-size: 13px; line-height: 1.55; }
.contact-card-msg { width: 250px; max-width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; box-shadow: var(--shadow-sm); }
.contact-card-avatar { flex: none; }
.contact-card-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.contact-card-name { font-size: 13px; }
.contact-card-meta { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 14px; border-bottom: 1px solid var(--border); flex: none; }
.search-tab { padding: 4px 10px; border-radius: 999px; font-size: 12px; color: var(--text-2); }
.search-tab:hover { background: var(--hover); }
.search-tab.active { background: var(--green-soft); color: var(--green); font-weight: 500; }
.call-video { width: 100%; aspect-ratio: 4 / 3; max-height: 300px; border-radius: 10px; background: #111827; object-fit: cover; margin-bottom: 10px; }
.call-modal .call-stage { padding: 14px; }
.moment-private { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--text-3); margin-left: 6px; }
.moment-comment { display: block; width: 100%; text-align: left; padding: 0; color: var(--text); font-size: 12px; line-height: 1.7; }
.moment-comment:hover { color: var(--green); }
.moment-comment .reply-to { color: var(--text-3); }
.cover-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cover-choice { aspect-ratio: 4 / 3; border-radius: 7px; overflow: hidden; border: 2px solid transparent; }
.cover-choice.active { border-color: var(--green); }
.cover-choice .photo { width: 100%; height: 100%; border-radius: 5px; }
.cover-choice .photo-label { display: none; }
.chat-bg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chat-bg-choice { aspect-ratio: 4 / 3; border-radius: 7px; overflow: hidden; border: 2px solid transparent; }
.chat-bg-choice.active { border-color: var(--green); }
.chat-bg-choice .photo { width: 100%; height: 100%; border-radius: 5px; }
.chat-bg-choice .photo-label { display: none; }

.compose-extra { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 10px 0 4px; font-size: 12px; color: var(--text-3); }
.compose-extra label { display: flex; align-items: center; gap: 6px; }
.compose-extra select, .compose-extra input { border: 1px solid var(--border); border-radius: 5px; background: var(--panel); padding: 5px 7px; font-size: 12px; color: var(--text); outline: 0; }
.compose-extra input { width: 130px; }
.compose-extra select:focus, .compose-extra input:focus { border-color: var(--green); }

