/*
 * 「青瓷 · Celadon」配色基线 v2
 * 相对旧版（深灰导航 #2E2E2E / 灰列表 #E7E7E7）的变化：
 *   浅色标题栏与导航、白色会话列表、淡绿选中态、柔和气泡绿、更大圆角与更轻的描边。
 * 所有颜色走 CSS 变量，[data-theme="dark"] 覆盖一整套深色值，运行时可切换。
 */
:root, [data-theme="light"] {
  /* 对齐主流桌面客户端：中性灰白底 + #15AC70 品牌绿 + 实底绿色选中态 */
  --brand:#15AC70; --brand-strong:#12995F; --brand-soft:#E8F8EE;
  --nav-active:#15AC70;
  --titlebar:#F7F7F7; --titlebar-ink:#8A8A8A; --titlebar-hover:#EDEDED;
  --nav:#F7F7F7; --nav-ink:#8A8A8A; --nav-hover:#EDEDED;
  --list:#FFFFFF; --list-hover:#F5F5F5; --selected:#15AC70; --selected-ink:#FFFFFF; --selected-sub:rgba(255,255,255,.94);
  --chat:#F5F5F5; --panel:#FFFFFF; --subtle:#F7F7F7;
  --field:#F5F5F5; --field-focus:#EDEDED;
  --bubble-other:#FFFFFF; --bubble-me:#9DF29F;
  --ink:#191919; --muted:#8A8A8A; --faint:#B2B2B2;
  --line:#E5E5E5; --line-soft:#F0F0F0;
  --unread:#FA5151; --link:#576B95; --warn:#D98A21;
  --shadow:0 8px 28px rgba(26,52,38,.13);
  --shadow-sm:0 2px 10px rgba(26,52,38,.09);
  /* v3.2.19：所有视图列表栏统一为发现页的 230px，并支持拖动（运行时由 --list-w 覆盖） */
  --nav-w:60px; --list-w:230px; --title-h:32px;
}
[data-theme="dark"] {
  --brand:#3DBE7E; --brand-strong:#2FA36B; --brand-soft:#213A2B;
  --nav-active:#3DBE7E;
  --titlebar:#171C19; --titlebar-ink:#8C9A90; --titlebar-hover:#252D28;
  --nav:#171C19; --nav-ink:#75847A; --nav-hover:#252D28;
  --list:#1F2521; --list-hover:#28302A; --selected:#2A3C30; --selected-ink:#E7EEE9; --selected-sub:#C2D0C5;
  --chat:#161A18; --panel:#232A25; --subtle:#1B211D;
  --field:#2A322C; --field-focus:#313B33;
  --bubble-other:#2C342E; --bubble-me:#2F7049;
  --ink:#E7EEE9; --muted:#8B9A90; --faint:#6E7C72;
  --line:#333C35; --line-soft:#2B332D;
  --unread:#F26363; --link:#8AA6DC; --warn:#E5A64B;
  --shadow:0 8px 28px rgba(0,0,0,.45);
  --shadow-sm:0 2px 10px rgba(0,0,0,.32);
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;overflow:hidden}
body{
  /* v3.3.1：Windows 上 Noto Sans SC 小字号笔画偏细显得发虚，改以微软雅黑优先，
     雅黑自带完整 ClearType hinting，中文渲染明显更实；英文/数字由雅黑西文与系统回退 */
  font-family:"Microsoft YaHei","PingFang SC","Noto Sans SC",system-ui,sans-serif;
  font-size:13px;color:var(--ink);background:var(--panel);
  -webkit-font-smoothing:antialiased;user-select:none;
  text-rendering:optimizeSpeed;
}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit;padding:0}
input,textarea,button{font-family:inherit;outline:none}
/* v3.2.18：按钮点击 / 按 ESC 后不再残留浏览器默认的橙色键盘焦点框 */
button:focus,button:focus-visible{outline:none;box-shadow:none}
.hidden{display:none !important}
svg{display:block;width:100%;height:100%}
/* 细线性图标自带 width/height 属性；回退到属性尺寸，避免没写专门规则的图标被全局 100% 撑满容器
   （收藏页空态五角星、朋友圈位置图钉因此变得巨大）。专门的 .xxx svg 尺寸规则在后面，依然优先生效 */
svg.ln-ico,svg.ep-ico{width:auto;height:auto}

#app{height:100%;display:flex;flex-direction:column;border:1px solid var(--line);background:var(--panel)}

/* ---- 自绘标题栏 ---- */
.titlebar{height:var(--title-h);flex:0 0 var(--title-h);background:var(--titlebar);display:flex;align-items:center;justify-content:flex-end;-webkit-app-region:drag}
.titlebar-drag{flex:1;height:100%;display:flex;align-items:center;padding-left:14px}
.titlebar-name{font-size:11px;color:var(--titlebar-ink);letter-spacing:.6px;font-weight:500}
.win-btns{display:flex;height:100%;-webkit-app-region:no-drag;padding-right:6px}
/* v3.6.4：窗口按钮整体调小（40x32 → 32x26），图标随 viewBox 等比缩小 */
.win-btn{width:32px;height:26px;margin-top:3px;color:var(--titlebar-ink);-webkit-app-region:no-drag;position:relative;border-radius:6px}
.win-btn svg{width:100%;height:100%}
.win-btn .ic-restore{display:none}
.win-btn.is-max .ic-max{display:none}
.win-btn.is-max .ic-restore{display:block}
.win-btn:hover{background:var(--titlebar-hover)}
.win-btn.is-pinned{color:var(--brand-strong)}
.win-close:hover{background:#E81123}
.win-close:hover svg path,.win-close:hover svg rect{stroke:#FFF}

/* ---- 主体三栏 ---- */
/* v3.3.4：主流 4.0 式主区 —— 面板圆角 + 边距，间隙用分隔底色 */
.body{flex:1;display:flex;min-height:0;padding:6px;background:var(--line,#EDEDED)}
.nav{width:var(--nav-w);flex:0 0 var(--nav-w);background:var(--nav);display:flex;flex-direction:column;align-items:center;padding-top:18px;gap:4px;border-radius:10px 0 0 10px}
.nav-avatar{position:relative;width:36px;height:36px;border-radius:6px;background:#5B8FF9;color:#FFF;display:flex;align-items:center;justify-content:center;font-size:15px;margin-bottom:14px;cursor:pointer;overflow:hidden;background-size:cover;background-position:center}
.nav-avatar img{width:100%;height:100%;object-fit:cover}
.nav-btn{width:100%;height:52px;color:var(--nav-ink);display:flex;align-items:center;justify-content:center;position:relative}
.nav-btn svg{width:22px;height:22px;opacity:.85}
.nav-btn:hover{color:var(--ink);background:var(--nav-hover)}
.nav-btn:hover svg{opacity:1}
.nav-btn.active{color:var(--nav-active)}
.nav-btn.active svg{opacity:1}
.nav-spacer{flex:1}

.list-col{width:var(--list-w);flex:0 0 var(--list-w);background:var(--list);display:flex;flex-direction:column;min-height:0;border-radius:0 10px 10px 0}
/* 可拖动分隔条：4px 命中区，hover 才显形，不占视觉宽度 */
.list-resizer{width:5px;flex:0 0 5px;margin-left:-3px;margin-right:-2px;z-index:6;cursor:col-resize;
  background:transparent;position:relative}
.list-resizer::after{content:'';position:absolute;left:2px;top:0;bottom:0;width:1px;background:transparent;transition:background .15s}
.list-resizer:hover::after{background:var(--brand)}
body.resizing-list,body.resizing-list *{cursor:col-resize!important;user-select:none!important}
body[data-standalone="1"] .list-resizer{display:none}
/* v3.2.18：与右侧 .chat-header 严格同为 48px，并连上同一条底部分隔线 */
.search-row{height:48px;flex:0 0 48px;display:flex;align-items:center;gap:8px;padding:9px 10px;
  border-bottom:1px solid var(--line)}
.search-box{height:28px;flex:1;background:var(--field);border-radius:6px;display:flex;align-items:center;gap:6px;padding:0 8px}
.search-box:focus-within{background:var(--field-focus)}
.search-ico{width:16px;height:16px;flex:0 0 16px}
.search-ico circle,.search-ico path{stroke:var(--muted)}
.search-box input{flex:1;min-width:0;background:transparent;border:none;font-size:12px;color:var(--ink)}
.search-box input::placeholder{color:var(--muted)}
.search-clear{font-size:16px;color:var(--muted);line-height:1;width:16px}
.add-btn{width:28px;height:28px;flex:0 0 28px;background:var(--field);border-radius:6px}
.add-btn:hover{background:var(--field-focus)}
.add-btn svg{width:28px;height:28px}
.add-btn path{stroke:var(--muted)}
.list-panel{flex:1;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable}
.list-panel::-webkit-scrollbar,.msg-area::-webkit-scrollbar,.sp-grid-wrap::-webkit-scrollbar{width:6px}
.list-panel::-webkit-scrollbar-thumb,.msg-area::-webkit-scrollbar-thumb,.sp-grid-wrap::-webkit-scrollbar-thumb{background:var(--line);border-radius:3px}

/* 会话项 */
.conv-item{height:64px;position:relative;display:flex;align-items:center;padding:0 12px;cursor:pointer;background:var(--list)}
/* v3.3.4：会话列表行间分割线（主流，从头像右侧起线，选中行不画线） */
.conv-item::after{content:'';position:absolute;left:58px;right:0;bottom:0;height:1px;background:var(--line-soft,#ECECEC);pointer-events:none}
.conv-item.active::after{display:none}
.conv-item:hover{background:var(--list-hover)}
.conv-item.active{background:var(--selected)}
/* v3.3：选中态浅色化 —— 深色文字配浅色底，不再绿底白字 */
.conv-item.active .conv-name,.conv-item.active .conv-time{color:var(--selected-ink)}
.conv-item.active .conv-prev{color:var(--selected-sub)}
.simple-row.active,.cat-row.active{background:var(--selected)}
.avatar{width:40px;height:40px;flex:0 0 40px;border-radius:5px;display:flex;align-items:center;justify-content:center;color:#FFF;font-size:14px;font-weight:500;overflow:hidden;background-size:cover;background-position:center}
/* v3.6.6：会话列表头像与联系人页头像统一为 34px */
.conv-avatar{position:relative;flex:0 0 34px;width:34px;height:34px}
.conv-avatar .avatar{width:100%;height:100%;flex:0 0 100%}
.conv-avatar .group-avatar{width:100%;height:100%}
.avatar img{width:100%;height:100%;object-fit:cover}
.conv-main{margin-left:10px;min-width:0;flex:1}
/* v3.4.4：主流单行省略 —— 预览/名称铺满可用宽度后再打 …，不再固定 180px 半截截断 */
.conv-name{font-size:14px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:56px}
.conv-prev{font-size:12px;line-height:20px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:12px}
.conv-time{position:absolute;right:12px;top:12px;font-size:11px;color:var(--faint);width:48px;text-align:right}
/* 主流未读角标：#FA5151 实心红圆 + 白色数字，贴在头像右上角；v3.6.10 缩到 16px 更精致 */
.badge{position:absolute;top:-5px;right:-6px;z-index:6;min-width:16px;height:16px;border-radius:8px;background:var(--unread);color:#FFF;font-size:10px;line-height:16px;font-weight:500;display:flex;align-items:center;justify-content:center;padding:0 4px;box-shadow:0 0 0 2px var(--list)}
.badge.muted{background:var(--unread);width:8px;min-width:8px;height:8px;padding:0;top:-2px;right:-2px;border-radius:50%}

/* 通用分组 / 功能行 */
/* v3.5.14 #5：分组头与下方菜单项同底色（--list），不再出现「上面一块灰蓝、下面白」的断层 */
.group-bar{height:26px;background:var(--list);display:flex;align-items:center;padding-left:12px;font-size:12px;color:var(--muted)}
.letter-bar{height:22px;display:flex;align-items:center;padding-left:12px;font-size:11px;color:var(--faint)}
.simple-row{height:48px;display:flex;align-items:center;padding:0 14px;cursor:pointer;background:var(--list)}
.simple-row:hover{background:var(--list-hover)}
.simple-row.active{background:var(--selected)}
.simple-row .avatar{width:34px;height:34px;flex:0 0 34px;font-size:13px}
.simple-row .row-text{margin-left:12px;font-size:14px}
.row-ico{width:24px;height:24px;flex:0 0 24px}
.row-ico svg{width:24px;height:24px}
/* v3.2.20：发现页菜单图标与其他页面统一为 18px 细线性 */
/* v3.6.10：发现页菜单图标与左侧竖排导航图标统一为 22px */
.mom-row .row-ico svg{width:22px;height:22px}
.cat-row{height:44px;display:flex;align-items:center;padding-left:20px;font-size:14px;cursor:pointer;background:var(--list)}
.cat-row:hover{background:var(--list-hover)}
.cat-row.active{background:var(--selected)}
.empty-tip{padding:34px 16px;text-align:center;color:var(--muted);font-size:12px;line-height:1.9}

/* ---- 内容区 ---- */
.content-col{flex:1;min-width:0;background:var(--panel);display:flex;flex-direction:column;position:relative;border-radius:10px;overflow:hidden;margin-left:6px}

/* 聊天：对标主流——头部压矮、与消息区同白底、用线条分隔 */
.chat-header{height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;background:var(--panel);border-bottom:1px solid var(--line)}
.chat-title{font-size:14px;font-weight:400;color:var(--ink)}
/* v3.6.32：聊天窗口头部在线状态点 —— 会话名左侧小圆点，在线绿 / 离线灰 */
.chat-presence-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px;flex:0 0 auto;vertical-align:1px}
.chat-presence-dot.on{background:#15AC70;box-shadow:0 0 0 2.5px rgba(21,172,112,.18)}
.chat-presence-dot.off{background:#B9BDC1}
.chat-title small{font-size:12px;color:var(--muted);font-weight:400;margin-left:8px}
.header-btns{display:flex;gap:18px;align-items:center}
.icon-btn{width:22px;height:22px;color:#7A7A7A;display:flex;align-items:center;justify-content:center}
.icon-btn svg{width:20px;height:20px}
.icon-btn:hover{color:#15AC70}
.divider{height:1px;flex:0 0 1px;background:var(--line)}
.msg-area{flex:1;overflow-y:auto;scrollbar-gutter:stable;padding:16px;display:flex;flex-direction:column;gap:12px;background:var(--panel)}
/* v3.6.49：时间分隔标签上下留出明显间距（用户反馈「太挤」），居中灰字不变 */
.time-tag{text-align:center;font-size:11px;color:var(--faint);line-height:16px;margin:18px 0 12px}
.msg-row{display:flex;align-items:flex-start;gap:10px}
.msg-row.mine{flex-direction:row-reverse}
.msg-row .avatar{width:34px;height:34px;flex:0 0 34px;font-size:13px}
.bubble{position:relative;max-width:420px;background:var(--bubble-other);border-radius:8px;padding:10px 12px;font-size:14px;line-height:22px;white-space:pre-wrap;word-break:break-word;box-shadow:var(--shadow-sm)}
.bubble::before{content:"";position:absolute;top:13px;left:-6px;border-right:6px solid var(--bubble-other);border-top:5px solid transparent;border-bottom:5px solid transparent}
.msg-row.mine .bubble{background:var(--bubble-me)}
.msg-row.mine .bubble::before{left:auto;right:-6px;border-right:none;border-left:6px solid var(--bubble-me)}
.sender-name{font-size:11px;color:var(--faint);margin-bottom:4px}
.sticker-msg{position:relative;width:132px;height:132px;background:transparent;border-radius:4px;overflow:visible;cursor:pointer}
.sticker-msg img{width:132px;height:132px;object-fit:contain;border-radius:4px;display:block}
.sticker-msg.pressing img{filter:brightness(.92) saturate(.9)}
.sticker-hover-plus{position:absolute;top:-8px;right:-8px;width:20px;height:20px;border-radius:10px;background:var(--brand);color:#FFF;font-size:14px;line-height:20px;text-align:center;opacity:0;transition:opacity .15s;box-shadow:var(--shadow-sm)}
.sticker-msg:hover .sticker-hover-plus{opacity:1}
/* 主流文件消息：收发两侧都是白色卡片，文件名 + 大小 + 右侧文件类型图标 */
.file-bubble{width:264px;max-width:264px;min-width:0;display:flex;align-items:center;gap:12px;
  padding:14px 12px;background:var(--panel)!important;border:1px solid var(--line-soft);
  border-radius:8px;box-shadow:none;white-space:normal;cursor:pointer;line-height:1.4}
.file-bubble::before,.msg-row.mine .file-bubble::before{display:none}
.msg-row.mine .file-bubble{background:var(--panel)!important}
.file-info{flex:1;min-width:0}
.file-name{font-size:14px;line-height:20px;color:var(--ink);word-break:break-all;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.file-meta{font-size:11px;color:var(--faint);line-height:18px;margin-top:4px}
.file-type{width:44px;height:52px;flex:0 0 44px;border-radius:6px;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:2px;font-size:9px;font-weight:600;letter-spacing:.3px}
.file-type svg{width:24px;height:24px}
.file-type span{max-width:40px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.link-bubble{min-width:220px;max-width:300px}
.link-title{font-size:14px;line-height:22px;margin-bottom:4px}
.link-desc{font-size:11px;color:var(--muted)}
.msg-status{font-size:11px;color:var(--unread);margin-left:6px}
/* v3.2.19：主流发送失败 —— 气泡左侧红色圆形叹号 + 居中原因提示 */
.msg-fail-line{display:flex;align-items:center;gap:6px}
.msg-fail{width:18px;height:18px;flex:0 0 18px;border-radius:50%;background:var(--unread,#FA5151);
  color:#FFF;font-style:normal;font-size:12px;font-weight:700;line-height:18px;text-align:center;cursor:pointer}
.msg-fail:hover{filter:brightness(.92)}
/* v3.3.7：失败原因独立整行（msg-area 为 flex 列，需显式撑满并去掉两侧气泡留白的影响） */
.send-fail-tip{width:100%;text-align:center;font-size:11px;color:var(--muted);line-height:18px;
  padding:0 24px;margin:-4px 0 0}
/* 群事件系统提示（主流居中灰字，独立成行不带头像） */
.system-msg{text-align:center;font-size:11px;color:var(--faint);padding:6px 24px;line-height:18px}
/* v3.6.27：撤回提示 + 仅自己可见的「重新编辑」 */
.recall-msg{font-size:11.5px}
.recall-reedit{color:#576B95;cursor:pointer;margin-left:4px}
.recall-reedit:hover{text-decoration:underline}
/* v3.5.22：通话记录主流气泡 —— 与普通消息同形态，一行「状态 + 细线性电话图标」，
   点击整条气泡回拨；未接通用叉叉电话线稿+红色字提示 */
.call-bubble{display:inline-flex;align-items:center;gap:7px;padding:9px 12px;cursor:pointer}
.call-status{font-size:13.5px;line-height:19px;color:var(--ink)}
.call-glyph{display:flex;align-items:center;justify-content:center;color:var(--ink);opacity:.85}
.call-bubble.missed .call-status{color:#E34B4B}
.call-bubble.missed .call-glyph{color:#E34B4B;opacity:1}
.msg-row.mine .call-bubble .call-status,.msg-row.mine .call-bubble .call-glyph{color:inherit;opacity:.95}
.msg-row.mine .call-bubble.missed .call-status,.msg-row.mine .call-bubble.missed .call-glyph{color:#7A1F1F}

/* ---- v3.6.10：气泡宽度由文字决定 + 文字/语音/通话三类气泡统一为通话记录高度 ----
   ① .msg-stack 让气泡与引用块各自成行，气泡不再被长引用内容强行撑宽；
   ② 三类气泡统一 38px（原通话记录高度），多行文本仍可自然增高（min-height 而非 height）。 */
.msg-stack{display:flex;flex-direction:column;align-items:flex-start;min-width:0;max-width:100%}
.msg-row.mine .msg-stack{align-items:flex-end}
.bubble.text-bubble,.bubble.voice-bubble,.bubble.call-bubble{
  width:fit-content;min-height:38px;box-sizing:border-box;padding:9px 12px;line-height:20px}
.bubble.text-bubble::before,.bubble.voice-bubble::before,.bubble.call-bubble::before{top:14px}
/* 点击引用块定位到原消息后的呼吸高亮 */
.quote-flash{animation:quoteFlash 1.45s ease-out}
@keyframes quoteFlash{
  0%{box-shadow:0 0 0 0 rgba(21,172,112,.55)}
  38%{box-shadow:0 0 0 8px rgba(21,172,112,0)}
  100%{box-shadow:0 0 0 0 rgba(21,172,112,0)}
}

/* v3.5.22：在线状态呼吸灯 —— 挂在头像右上角（允许溢出头像边框），在线蓝点 / 离线黄点；
   v3.5.23：仅联拓网节点使用（通讯录页不再显示）；v3.5.25：点位缩小（8px/1.5px 白边）；
   v3.5.26：贴近头像（-1px） */
.pres-dot{position:absolute;top:-1px;right:-1px;z-index:3;width:8px;height:8px;border-radius:50%;
  border:1.5px solid #FFF;box-sizing:content-box;pointer-events:none}
.pres-dot.on{background:#3E9BFA;animation:presBreath 2.2s ease-in-out infinite}
.pres-dot.off{background:#F5C542;animation:presBreath 3.4s ease-in-out infinite}
@keyframes presBreath{
  0%,100%{box-shadow:0 0 0 0 rgba(62,155,250,.4);transform:scale(1)}
  50%{box-shadow:0 0 0 3px rgba(62,155,250,0);transform:scale(1.1)}
}
.pres-dot.off{animation-name:presBreathOff}
@keyframes presBreathOff{
  0%,100%{box-shadow:0 0 0 0 rgba(245,197,66,.35);transform:scale(1)}
  50%{box-shadow:0 0 0 3px rgba(245,197,66,0);transform:scale(1.08)}
}
/* v3.5.22：网络头像加载失败时的「色块+首字」兜底层（图片成功加载后盖住底层） */
.avatar{position:relative}
.avatar.has-fallback .av-fb{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  color:#FFF;font-size:14px;font-weight:500}
.avatar.has-fallback img{position:relative;z-index:1}

/* 输入区（主流：消息区浅灰底 + 白色圆角输入卡片，四周留边；高度比例对标主流） */
/* v3.2.18：输入卡片补一圈清晰边框，白底白卡片不再「看不出边界」 */
/* v3.6.22：附件（图片/文件/视频）进来后输入卡片随内容长高而不是把底部按钮顶出去；
   高度自适应 + 上限 230px，超出后附件条内部滚动，消息区始终留得住。
   flex:0 0 auto 让卡片按内容取高，min-height 保底原 118px 视觉不变。 */
.input-area{min-height:118px;max-height:230px;flex:0 0 auto;background:var(--panel);display:flex;flex-direction:column;
  margin:0 12px 12px;border-radius:12px;padding:8px 16px 8px;
  border:1px solid #D8D8D8;box-shadow:0 1px 4px rgba(0,0,0,.05)}
.editor{flex:1;min-height:22px;padding:2px 2px 6px;user-select:text}
.editor textarea{width:100%;height:100%;resize:none;border:none;background:transparent;font-size:14px;line-height:22px;color:var(--ink)}
.input-bottom{height:32px;flex:0 0 32px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.toolbar{display:flex;align-items:center;gap:18px}
.tool-btn{width:22px;height:22px;color:#7A7A7A;position:relative;display:flex;align-items:center;justify-content:center}
.tool-btn:hover{color:#15AC70}
.tool-btn svg{width:20px;height:20px}
.tool-chev{position:absolute;left:15px;bottom:-2px;color:#7A7A7A;display:flex}
.tool-chev svg{width:11px;height:11px}
.input-actions{display:flex;align-items:center;gap:12px;flex:none}
.tool-round{width:24px;height:24px;border-radius:50%;border:1.3px solid #B4B4B4;color:#8A8A8A;
  display:flex;align-items:center;justify-content:center}
.tool-round:hover{border-color:#15AC70;color:#15AC70}
.tool-round svg{width:14px;height:14px}
.send-row{height:32px;flex:0 0 32px;display:flex;align-items:center;justify-content:flex-end;gap:12px}
.send-hint{font-size:11px;color:var(--faint)}
.btn-send{width:72px;height:28px;border-radius:4px;background:#F5F5F5;font-size:12px;color:#A8A8A8}
.btn-send:hover{background:#EBEBEB}
.btn-send.ready{background:#15AC70;color:#FFF}
.btn-send.ready:hover{background:#12995F}

/* 资料卡 / 收藏 */
/* v3.3.2：内容过高时允许纵向滚动（修复底部「发消息」按钮被裁剪），并留出底部间距 */
.profile-wrap{flex:1;min-height:0;display:flex;align-items:flex-start;justify-content:center;
  padding:56px 0 40px;overflow-y:auto;overflow-x:hidden}
.profile{width:420px;display:flex;flex-direction:column;align-items:center;gap:12px}
.profile .avatar{width:80px;height:80px;flex:0 0 80px;border-radius:7px;font-size:28px}
.profile-name{font-size:20px;font-weight:600}
.profile-id{font-size:12px;color:var(--muted)}
.profile-line{width:100%;height:1px;background:var(--line);margin:6px 0}
.profile-info{width:100%;font-size:13px;line-height:24px;color:var(--ink)}
.profile-btns{display:flex;gap:12px;margin-top:8px}
/* 按钮统一：min-width + nowrap，避免「打开所在目录」等长文案把按钮撑变形 */
.btn-green{background:var(--brand);color:#FFF;border-radius:6px;font-size:13px;padding:0 16px;height:34px;min-width:72px;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center}
.btn-green:hover{background:var(--brand-strong)}
.btn-green.small{height:24px;padding:0 12px;font-size:12px;border-radius:5px;min-width:56px}
.btn-outline{background:var(--panel);border:1px solid var(--line);border-radius:6px;font-size:13px;padding:0 16px;height:34px;color:var(--ink);min-width:72px;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center}
.btn-outline:hover{background:var(--list-hover)}
.btn-outline.small{height:28px;padding:0 12px;font-size:12px;min-width:64px}
.btn-outline.full{width:100%}
.btn-green:disabled{background:var(--line);color:var(--muted);cursor:not-allowed}

/* 主流收藏页：左侧写笔记 + 图标分类 + 绿色选中态，右侧卡片列表 */
.fav-left{flex:1;display:flex;flex-direction:column;min-height:0}
.fav-note-btn{height:44px;margin:4px 12px 14px;border:1px solid var(--line-soft);border-radius:8px;
  background:var(--panel);display:flex;align-items:center;justify-content:center;gap:8px;
  font-size:14px;color:var(--ink);cursor:pointer}
.fav-note-btn:hover{background:var(--list-hover)}
.fav-note-btn svg{width:18px;height:18px;color:var(--muted)}
.fav-cats{flex:1;overflow-y:auto;padding:0 8px}
.fav-cat{height:42px;display:flex;align-items:center;gap:12px;padding:0 12px;border-radius:6px;
  font-size:14px;color:var(--ink);cursor:pointer}
.fav-cat:hover{background:var(--list-hover)}
.fav-cat.active{background:var(--brand);color:#FFF}
.fav-cat-ico{width:18px;height:18px;flex:0 0 18px;display:flex;align-items:center;justify-content:center;color:var(--muted)}
/* v3.2.18：图标带 inline 彩色，选中（绿底）时用 !important 统一压成白色 */
.fav-cat.active .fav-cat-ico{color:#FFF !important}
.fav-cat-ico svg{width:18px;height:18px}
.fav-storage{flex:0 0 34px;display:flex;align-items:center;padding:0 20px;font-size:11px;color:var(--faint)}
/* v3.5.6：与聊天页头部完全一致 —— 48px 高 + 14px 常规字重标题，
   使侧栏「+」按钮（search-row 48px）与「全部」标题在同一水平线上对齐 */
.fav-header{height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;background:var(--panel);border-bottom:1px solid var(--line)}
.fav-title{font-size:14px;font-weight:400;color:var(--ink)}
.fav-count{font-size:12px;color:var(--faint)}
.fav-list{flex:1;overflow-y:auto;padding:18px 22px;display:flex;flex-direction:column;gap:10px;background:var(--panel)}
.fav-card{min-height:82px;border-radius:8px;position:relative;display:flex;align-items:flex-start;gap:12px;
  padding:14px 16px;cursor:pointer;background:var(--subtle)}
.fav-card:hover{background:var(--list-hover)}
.fav-thumb{width:44px;height:44px;flex:0 0 44px;border-radius:8px;display:flex;align-items:center;justify-content:center}
.fav-thumb svg{width:26px;height:26px}
.fav-body{flex:1;min-width:0}
.fav-name{font-size:14px;line-height:22px;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fav-excerpt{font-size:12px;line-height:20px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fav-meta{font-size:11px;color:var(--faint);line-height:20px}
.fav-date{flex:none;font-size:11px;color:var(--faint);line-height:22px}
.fav-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:var(--faint);font-size:13px}
.fav-empty svg{width:34px;height:34px;color:var(--line)}
/* v3.5.2：空状态对标主流——去掉大图标与说明文字，只留一行浅灰小字 */
.fav-empty .fav-empty-sub{font-size:11px;color:var(--faint)}
.fav-empty:not(:has(.fav-empty-sub))::before{content:none}
.fav-empty{gap:0}
.fav-editor{border:1px solid var(--line-soft);border-radius:8px;padding:14px;background:var(--panel);display:flex;flex-direction:column;gap:10px}
.fav-editor-head{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--ink)}
.fav-editor-head svg{color:var(--brand)}
.fav-editor textarea{width:100%;min-height:110px;resize:vertical;border:1px solid var(--line-soft);border-radius:6px;
  padding:10px;font-size:13px;line-height:20px;color:var(--ink);background:var(--panel)}
.fav-editor-btns{display:flex;justify-content:flex-end;gap:10px}

/* ---- 浮层通用 ---- */
.floating{position:fixed;z-index:40;background:var(--panel);border:1px solid var(--line-soft);border-radius:10px;box-shadow:var(--shadow)}
.sticker-panel{width:340px;height:380px;display:flex;flex-direction:column;overflow:hidden}
.sp-tabs{height:36px;flex:0 0 36px;display:flex;align-items:center;padding:0 16px;border-bottom:1px solid var(--line-soft);position:relative}
.sp-tab{font-size:13px;color:var(--muted);padding:0 12px;height:36px}
.sp-tab.active{color:var(--ink);font-weight:600}
.sp-tab-underline{position:absolute;bottom:0;left:88px;width:56px;height:2px;background:var(--brand);border-radius:1px;transition:left .2s}
.sp-close{margin-left:auto;font-size:18px;color:var(--muted);width:20px}
.sp-body{flex:1;display:flex;min-height:0}
/* v3.2.20：左侧菜单与内容区拉开对比（灰底菜单 + 白底选中行，主流） */
.sp-cats{width:78px;flex:0 0 78px;background:var(--subtle);border-right:1px solid var(--line-soft);overflow-y:auto}
.sp-cat{height:44px;display:flex;align-items:center;padding-left:12px;font-size:12.5px;color:var(--ink);cursor:pointer}
.sp-cat:hover{background:var(--list-hover)}
.sp-cat.active{background:var(--panel,#fff);color:var(--brand-strong);font-weight:600}
.sp-grid-wrap{flex:1;overflow-y:auto;min-width:0}
.sp-grid{display:grid;grid-template-columns:repeat(3,72px);gap:8px;padding:10px}
.sp-cell{width:72px;height:72px;border-radius:8px;overflow:hidden;position:relative;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:500}
.sp-cell:hover{outline:2px solid var(--brand);outline-offset:-2px}
.sp-cell img{width:100%;height:100%;object-fit:contain}
.sp-cell.add-cell{background:var(--subtle);border:1px dashed var(--line);color:var(--muted);font-size:28px;font-weight:400}
.sp-emoji{width:72px;height:72px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:26px;cursor:pointer}
.sp-emoji:hover{background:var(--list-hover)}
.sp-bottom{height:34px;flex:0 0 34px;border-top:1px solid var(--line-soft);background:var(--subtle);display:flex;align-items:center;padding:0 12px;gap:14px}
.sp-link{font-size:12px;color:var(--brand);font-weight:600}
.sp-manage{color:var(--muted);font-weight:400}
.sp-count{margin-left:auto;font-size:11px;color:var(--faint)}

/* 管理页 */
.manager-panel{width:340px;height:380px;padding:0 16px;display:flex;flex-direction:column}
.mgr-head{height:44px;flex:0 0 44px;display:flex;align-items:center;justify-content:space-between;font-size:15px;font-weight:600;border-bottom:1px solid var(--line-soft)}
.mgr-grid{display:grid;grid-template-columns:repeat(3,96px);gap:10px;padding:12px 0;height:210px;overflow-y:auto;align-content:start}
.mgr-cell{width:96px;height:88px;border-radius:8px;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden}
.mgr-cell img{width:88px;height:88px;object-fit:contain}
.mgr-cell.dragging{opacity:.45}
.mgr-del{position:absolute;top:2px;right:2px;width:16px;height:16px;border-radius:8px;background:var(--unread);color:#FFF;font-size:11px;line-height:16px;text-align:center;z-index:2}
.mgr-form{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}
.mgr-form input{flex:1;height:28px;border:1px solid var(--line);border-radius:6px;background:var(--field);color:var(--ink);padding:0 8px;font-size:12px}
.mgr-hint{font-size:11px;color:var(--faint);line-height:22px;margin:8px 0}

/* 上传弹窗 */
.modal-mask{position:fixed;inset:0;z-index:60;background:rgba(16,30,22,.34);display:flex;align-items:center;justify-content:center}
.upload-dialog{width:420px;height:360px;background:var(--panel);border-radius:12px;box-shadow:var(--shadow);position:relative;display:flex;flex-direction:column}
.ud-head{height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;font-size:15px;font-weight:600;border-bottom:1px solid var(--line-soft)}
.ud-head button{font-size:20px;color:var(--muted)}
.ud-drop{margin:14px 20px 0;height:76px;border:1px dashed var(--line);border-radius:8px;background:var(--subtle);display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:12px;color:var(--muted);cursor:pointer}
.ud-drop.dragover{border-color:var(--brand);background:var(--brand-soft)}
.ud-sub{font-size:11px;color:var(--faint);margin-top:4px}
.ud-format{font-size:11px;color:var(--muted);padding:8px 20px 0}
.ud-rows{flex:1;min-height:0;overflow-y:auto;padding:8px 20px;display:flex;flex-direction:column;gap:4px}
.ud-row{height:44px;background:var(--subtle);border-radius:6px;padding:4px 10px;position:relative;display:flex;flex-direction:column;justify-content:center}
.ud-row-top{display:flex;justify-content:space-between;font-size:12px;line-height:18px}
.ud-state{font-size:11px}
.ud-state.ok{color:var(--brand)} .ud-state.err{color:var(--unread)} .ud-state.wait{color:var(--link)}
.ud-progress-bg{height:4px;background:var(--line);border-radius:2px;margin-top:4px;overflow:hidden}
.ud-progress-fg{height:4px;background:var(--brand);border-radius:2px;width:0;transition:width .35s}
.ud-foot{height:50px;flex:0 0 50px;display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:0 20px;border-top:1px solid var(--line-soft)}
.ud-foot .btn-outline,.ud-foot .btn-green{height:30px;font-size:12px}

/* 设置 / 菜单 / toast */
.settings-panel{width:300px;min-height:300px;padding:0 0 12px}
.set-head{height:52px;display:flex;align-items:center;padding:0 20px;font-size:16px;font-weight:600;border-bottom:1px solid var(--line-soft)}
.set-list{padding:8px 12px;font-size:13px}
.set-item{padding:10px 12px;border-radius:6px;cursor:pointer;display:flex;justify-content:space-between}
.set-item:hover{background:var(--list-hover)}
.set-meta{font-size:11px;color:var(--muted);line-height:20px;padding:6px 12px;word-break:break-all}
.set-danger{color:var(--unread)}
/* v3.2.17：提到设置窗/侧开框之上，避免右键菜单被遮挡或裁剪
 * v3.2.18：菜单宽度/行高/分隔线全面对标主流桌面客户端（160px、32px 行、细线分组） */
.context-menu{position:fixed;z-index:100090;width:160px;background:var(--panel);border-radius:6px;
  box-shadow:0 4px 16px rgba(0,0,0,.14);padding:4px 0;border:1px solid var(--line-soft)}
.ctx-item{height:32px;display:flex;align-items:center;padding:0 16px;font-size:13px;cursor:pointer;
  user-select:none;white-space:nowrap}
.ctx-item:hover{background:var(--list-hover)}
.ctx-item.disabled{color:var(--faint);cursor:not-allowed}
.ctx-item.danger{color:#FA5151}
.ctx-item.danger:hover{background:#FDECEC}
.ctx-sep{height:1px;background:var(--line-soft,#eee);margin:4px 0;border:0}
.press-bar{position:fixed;z-index:72;display:flex;background:var(--panel);border:1px solid var(--line-soft);border-radius:8px;box-shadow:var(--shadow);overflow:hidden}
.press-bar button{height:30px;padding:0 10px;font-size:11px;border-right:1px solid var(--line-soft)}
.press-bar button:last-child{border-right:none}
.press-bar button:hover{background:var(--list-hover)}
.press-ring{position:fixed;z-index:71;width:72px;height:72px;pointer-events:none}
.press-ring .ring-bg{fill:none;stroke:var(--line);stroke-width:4}
.press-ring .ring-fg{fill:none;stroke:var(--brand);stroke-width:4;stroke-linecap:round;stroke-dasharray:188.5;stroke-dashoffset:188.5;transform:rotate(-90deg);transform-origin:36px 36px}
.press-ring.running .ring-fg{animation:ringFill .6s linear forwards}
@keyframes ringFill{to{stroke-dashoffset:0}}
.preview-overlay{position:fixed;inset:0;z-index:80;background:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center}
.preview-overlay img{width:320px;height:320px;object-fit:contain;background:var(--panel);border-radius:10px;padding:12px}
.chat-search{width:300px;padding:12px}
.cs-head{display:flex;justify-content:space-between;font-size:13px;font-weight:600;margin-bottom:8px}
.cs-head button{font-size:16px;color:var(--muted)}
.cs-head+input{width:100%;height:30px;border:1px solid var(--line);border-radius:6px;padding:0 8px;font-size:12px;background:var(--field);color:var(--ink)}
.cs-results{max-height:220px;overflow-y:auto;margin-top:8px}
.cs-result{padding:8px 4px;border-bottom:1px solid var(--line-soft);font-size:12px;line-height:18px;cursor:pointer}
.cs-result:hover{background:var(--list-hover)}
/* v3.5.20 #1：升级轻提示要能压过登录层(99999)、登录态设置(100000~100002)与过场幕布，
   否则登录页看不到「版本xxx升级成功」这条消息提示。 */
.toast{position:fixed;z-index:2147483647;left:50%;bottom:80px;transform:translateX(-50%);background:var(--ink);color:var(--panel);font-size:12px;padding:9px 18px;border-radius:8px;box-shadow:var(--shadow)}
/* v3.5.16 #2：未登录时主窗口只保留标题栏 + 登录小窗，主界面首帧即隐藏（避免闪屏）。
   规则必须在这里而不是登录层的内联 style，否则 buildOverlay 之前会先闪出聊天界面。 */
html.pre-login #app{border-color:transparent;background:transparent}
html.pre-login #app > .body{visibility:hidden}
/* v3.5.18 #1：标题栏与内容区合成同一块平面，整个登录界面看不出「两层」。
   styles-extra.css 有 html:not([data-theme="dark"]) .titlebar 的半透明淡蓝覆盖，
   这里用更高权重压成不透明实色，颜色与登录层 ::before / 幕布完全一致。 */
html.pre-login .titlebar.titlebar,
html.auth-transition .titlebar.titlebar{background:#FFFFFF}
html[data-theme="dark"].pre-login .titlebar.titlebar,
html[data-theme="dark"].auth-transition .titlebar.titlebar{background:#232A25}

/* ------------------------------------------------- v3.5.18 主流登录 / 登出过渡
   只保留一层与窗口内容区完全同色的实色幕布：没有 logo 过场页、没有提示文字、
   没有位移 / 缩放 / 回弹。窗口尺寸变化发生在这层纯色幕布之下，
   用户看到的只有「内容淡出 → 窗口一次性切换 → 内容淡入」一条连续的淡入淡出。 */
html.auth-entering::before,
html.auth-leaving::before{
  content:"";position:fixed;inset:32px 0 0 0;z-index:2147483646;pointer-events:none;
  background:#FFFFFF;transition:opacity .26s ease;
}
html[data-theme="dark"].auth-entering::before,
html[data-theme="dark"].auth-leaving::before{background:#232A25}
html.auth-leaving::before{opacity:0;animation:xfAuthVeilIn .15s ease forwards}
html.auth-entering::before{opacity:0;animation:xfAuthVeilIn .15s ease forwards}
@keyframes xfAuthVeilIn{from{opacity:0}to{opacity:1}}
/* reload 后的新页面首帧：幕布本来就在显示，立即不透明，绝不重播淡入造成二次闪 */
html.auth-entering.auth-resumed::before{opacity:1;animation:none;transition:none}
/* 主界面数据就绪：只做一次幕布淡出，主界面本身不叠加第二层动画 */
html.auth-entering.auth-entered::before{opacity:0;animation:none;transition:opacity .26s ease}
/* 过渡期主界面只淡出，不做 transform，避免窗口尺寸变化时内容被拉扯 */
html.auth-transition #app > .body{transition:opacity .15s ease}
html.auth-leaving #app > .body{opacity:0}
html.auth-entered #app > .body{opacity:1}
@media (prefers-reduced-motion:reduce){
  html.auth-entering::before,html.auth-leaving::before,
  html.auth-entering.auth-entered::before,
  html.auth-transition #app > .body{animation:none;transition:none}
}
