:root{
  --wx-green:#07c160;
  --wx-green-dark:#06ad56;
  --bg:#f5f5f5;
  --text:#1a1a1a;
  --muted:#9a9a9a;
  --line:#ececec;
  --wx-bubble:#95ec69;
  /* 现代精致化：统一圆角与层次阴影尺度（用柔和阴影取代生硬边框，提升质感） */
  --r-sm:10px; --r-md:14px; --r-lg:18px; --r-xl:22px;
  --sh-1:0 1px 2px rgba(17,24,39,.05);
  --sh-2:0 8px 24px rgba(17,24,39,.08);
  --sh-3:0 20px 60px rgba(17,24,39,.18);
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"PingFang SC","Microsoft YaHei",sans-serif}
body{
  background:var(--bg);color:var(--text);font-size:15px;overflow:hidden;
}
/* 自定义滚动条：细、圆润、半透明，去掉系统默认的「硬」粗条，提升现代感 */
*::-webkit-scrollbar{width:8px;height:8px}
*::-webkit-scrollbar-thumb{background:rgba(0,0,0,.16);border-radius:8px;transition:background .15s}
*::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,.28)}
*::-webkit-scrollbar-track{background:transparent}
.app{position:relative;height:100%;overflow:hidden;display:flex;background:#ededed}

/* ---------- 左侧导航栏 ---------- */
.nav-rail{width:64px;background:#2e2e2e;display:flex;flex-direction:column;align-items:center;padding:16px 0 12px;flex-shrink:0;z-index:2}
.rail-avatar{width:38px;height:38px;border-radius:11px;background:var(--wx-green);color:#fff;display:flex;align-items:center;justify-content:center;font-size:15px;overflow:hidden;cursor:pointer;margin-bottom:16px;flex-shrink:0;box-shadow:0 4px 12px rgba(7,193,96,.28)}
.rail-avatar img{width:100%;height:100%;object-fit:cover}
.rail-btns{display:flex;flex-direction:column;gap:8px;flex:1}
.rail-btn{width:38px;height:38px;border:none;background:transparent;color:#b2b2b2;border-radius:11px;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;transition:background .15s,color .15s}
.rail-btn svg{width:22px;height:22px}
.rail-btn.on{color:#07c160}
.rail-btn:hover{color:#fff}
.rail-bottom{display:flex;flex-direction:column;gap:8px}
.plus-menu{display:none;position:absolute;background:#4c4c4c;border-radius:14px;z-index:100;overflow:hidden;box-shadow:0 10px 30px rgba(0,0,0,.4);transition:opacity .12s,transform .12s}
.plus-menu.show{display:block}
.plus-menu .pi{padding:10px 16px;color:#fff;font-size:14px;cursor:pointer;display:flex;align-items:center;gap:8px;white-space:nowrap}
.plus-menu .pi:hover{background:#555}
.plus-menu .pi svg{width:18px;height:18px}

/* ---------- 会话列表 ---------- */
.sidebar{width:284px;background:#fff;display:flex;flex-direction:column;flex-shrink:0;min-width:0;box-shadow:1px 0 0 #eee,2px 0 18px rgba(17,24,39,.04)}

/* 移动端「PC 端已登录」提示横幅（仿微信，桌面隐藏） */
.pc-banner{display:none;align-items:center;gap:8px;padding:9px 12px;background:#d6ebff;color:#155a8a;font-size:13px;flex-shrink:0;border-bottom:1px solid #bfddf5}
.pc-banner.show{display:flex}
.pc-banner .ico{width:16px;height:16px;flex:0 0 16px}
.pc-banner .dot{width:8px;height:8px;border-radius:50%;background:var(--wx-green);flex:0 0 8px;box-shadow:0 0 0 3px rgba(7,193,96,.18)}
.pc-banner .txt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pc-banner .x{border:none;background:transparent;color:#155a8a;opacity:.55;cursor:pointer;font-size:13px;line-height:1;padding:2px 5px;border-radius:6px;transition:opacity .15s,background .15s}
.pc-banner .x:hover{opacity:1;background:rgba(0,0,0,.06)}
@media (min-width:981px){.pc-banner{display:none !important}}
.search{padding:12px 14px;border-bottom:1px solid #f2f2f2}
.search input{width:100%;height:36px;border:1px solid var(--line);border-radius:10px;padding:0 12px;font-size:14px;outline:none;background:#f5f6f8;transition:border-color .15s,box-shadow .15s,background .15s}
.search input:focus{background:#fff;border-color:var(--wx-green)}
#convList{flex:1;overflow-y:auto;min-height:0}
/* ---------- 会话左滑操作（标为未读 / 不显示 / 删除） ---------- */
/* wrap 负责裁剪与底边框；操作按钮层垫底，卡片左滑露出 */
.conv-wrap{position:relative;overflow:hidden;border-bottom:1px solid #f3f3f3}
.conv-wrap .conv{border-bottom:none;background:#fff;transition:background .15s,transform .2s ease;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.conv-wrap .conv.active{background:#ececec}
.conv-actions{position:absolute;top:0;right:0;bottom:0;display:flex;z-index:0}
.ca-btn{width:68px;border:none;color:#fff;font-size:13px;cursor:pointer;padding:0;font-family:inherit;transition:filter .15s}
.ca-btn:hover{filter:brightness(1.08)}
.ca-btn:active{filter:brightness(.92)}
.ca-unread{background:#3e8eff}
.ca-hide{background:#ffa22b}
.ca-del{background:#fa5151}
/* 「标为未读」小红点（无计数） */
.conv .badge.dot{width:10px;min-width:10px;height:10px;padding:0;border-radius:50%}

.conv{display:flex;align-items:center;gap:12px;padding:13px 16px;cursor:pointer;position:relative;transition:background .15s}
.conv.active{background:#ececec}
.conv:hover{background:#f3f3f3}
.conv .ava{width:48px;height:48px;border-radius:12px;background:#c8c8c8;color:#fff;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;overflow:hidden}
.conv .ava img{width:100%;height:100%;object-fit:cover}
.conv .meta{flex:1;min-width:0}
.conv .meta .top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.conv .meta .name{font-weight:600;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conv .meta .time{font-size:12px;color:#b2b2b2;flex-shrink:0}
.conv .meta .preview{color:var(--muted);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:3px}
.conv .badge{min-width:18px;height:18px;background:#fa5151;border-radius:9px;color:#fff;font-size:12px;display:flex;align-items:center;justify-content:center;padding:0 5px;flex-shrink:0}

/* ---------- 聊天区 ---------- */
.chat{flex:1;min-width:0;display:flex;flex-direction:column;background:#ededed;position:relative}
.chat-empty{flex:1;display:flex;align-items:center;justify-content:center;color:#bbb}
.chat-empty .wm{width:120px;height:120px}
.chat-head{height:58px;background:#f7f7f7;display:flex;align-items:center;padding:0 16px;font-weight:600;font-size:16px;flex-shrink:0;color:#1a1a1a;box-shadow:0 1px 0 #ececec,0 3px 12px rgba(17,24,39,.03)}
.chat-head .back{display:none;margin-right:10px;font-size:20px;cursor:pointer}
.chat-head #chatTitle{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-head .more{display:none;border:none;background:transparent;color:#5b5b5b;width:36px;height:36px;border-radius:10px;cursor:pointer;align-items:center;justify-content:center;padding:0;flex-shrink:0;transition:background .15s,color .15s}
.chat-head .more svg{width:20px;height:20px;display:block}
.chat-head .more:hover{background:#e6e6e6;color:#333}
.chat-head .more:active{background:#dcdcdc}
.chat-head .chat-del:hover{background:#ffeaea;color:#fa5151}
.chat-head .chat-del:active{background:#ffd9d9}
.messages{flex:1;overflow-y:auto;padding:18px 20px;min-height:0;display:flex;flex-direction:column;gap:12px}
.msg{display:flex;gap:10px;align-items:flex-start;max-width:calc(100% - 48px);position:relative}
.msg.self{flex-direction:row-reverse;align-self:flex-end}
.msg .ava{width:40px;height:40px;border-radius:11px;background:#c8c8c8;color:#fff;display:flex;align-items:center;justify-content:center;font-size:15px;flex-shrink:0;overflow:hidden}
.msg .ava img{width:100%;height:100%;object-fit:cover}
.msg .bubble{max-width:min(calc(100vw - 128px),560px);min-width:20px;background:#fff;border-radius:14px;padding:10px 14px;word-break:break-word;font-size:15px;line-height:1.5;box-shadow:var(--sh-1);position:relative}
.msg.self .bubble{background:var(--wx-bubble)}
.bubble img{max-width:180px;max-height:240px;border-radius:12px;cursor:pointer;display:block}
.bubble a{color:#576b95}
.bubble .file{display:flex;align-items:center;gap:10px;background:#fff;padding:4px}
.bubble .file .fi{font-size:28px}
.bubble .file a{font-size:13px;color:#576b95}
.bubble .voice{display:flex;align-items:center;gap:6px;color:#1a1a1a;cursor:pointer;
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.bubble .voice *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.bubble .voice svg{width:21px;height:21px;flex-shrink:0}
.bubble .voice .dur{font-size:15px;font-weight:600}
.msg.self .voice{flex-direction:row-reverse}
.msg.self .voice svg{transform:scaleX(-1)}
/* 正在播放：喇叭图标呼吸一下，明确"这条在响"（同一时刻只会有一条处于该状态） */
.bubble .voice.playing svg{animation:voicePulse .9s ease-in-out infinite}
/* 语音转文字结果：显示在语音气泡正下方，参考微信样式
   白底圆角块（自己的消息也是白底，不是绿色气泡）+ 极淡阴影，和聊天区灰底区分开 */
.voice-text{font-size:14px;line-height:1.55;color:#1a1a1a;background:#fff;
  border-radius:8px;padding:6px 10px;margin-top:5px;
  max-width:260px;word-break:break-word;box-shadow:0 1px 2px rgba(0,0,0,.06)}
.msg.self .voice-text{text-align:right;margin-left:auto}
@keyframes voicePulse{0%,100%{opacity:1}50%{opacity:.35}}
.bubble.emoji{font-size:42px;background:transparent;padding:0;box-shadow:none}
.msg.self{flex-direction:row-reverse;align-self:flex-end}
.msg.self .bubble{background:var(--wx-bubble)}
.msg .sender{font-size:12px;color:#9a9a9a;margin-bottom:3px}

/* 点按消息不出现系统「高亮方块 / 焦点框」（微信点消息没有这个反馈）。
   移动端点任意元素默认会盖一层半透明方块（尤其鸿蒙/安卓 WebView 很明显），
   这里对消息区整块关掉；长按菜单、复制、引用等交互不受影响。 */
#messages,
.messages,
.msg,
.msg .bubble,
.msg .ava,
.bubble .voice,
.bubble .file,
.bubble .media,
.msg .bubble img{-webkit-tap-highlight-color:transparent;tap-highlight-color:transparent}
#messages:focus,.messages:focus,.msg:focus,.msg .bubble:focus,.bubble .voice:focus,.bubble .file:focus{outline:none}

/* 聊天气泡小三角（朝向头像），表情消息保持无尾 */
.msg:not(.self) .bubble:not(.emoji)::before{content:'';position:absolute;top:13px;left:-6px;border-style:solid;border-width:6px 6px 6px 0;border-color:transparent #fff transparent transparent}
.msg.self .bubble:not(.emoji)::before{content:'';position:absolute;top:13px;right:-6px;border-style:solid;border-width:6px 0 6px 6px;border-color:transparent transparent transparent var(--wx-bubble)}

/* 消息译文（原地插入） */
.msg-translated{margin-top:6px;padding-top:4px;border-top:1px solid rgba(0,0,0,.08);font-size:13px;color:#576b95;line-height:1.45}
.msg.self .bubble .msg-translated{border-top-color:rgba(255,255,255,.35);color:#fff}

/* ---------- 输入区 ---------- */
.composer{border-top:1px solid transparent;background:#f7f7f7;flex-shrink:0;display:flex;flex-direction:column;position:relative;box-shadow:0 -1px 0 #ececec,0 -3px 14px rgba(17,24,39,.03)}
.pc-area{padding:6px 12px 10px;display:flex;flex-direction:column;flex:1;min-height:0}
.toolbar{display:flex;align-items:center;gap:2px;margin-bottom:2px;flex-wrap:wrap}
.toolbar .tb{width:30px;height:30px;border:none;background:transparent;border-radius:10px;color:#5b5b5b;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;transition:background .15s,color .15s}
.toolbar .tb svg{width:18px;height:18px;display:block}
.toolbar .tb:hover{background:#e6e6e6;color:#333}
.toolbar .tb:active{background:#dcdcdc}
.toolbar .spacer{flex:1}
.m-bar{display:none;align-items:center;gap:8px;padding:7px 8px}
.c-right{display:flex;align-items:center;gap:1px;flex-shrink:0}
.c-btn{width:44px;height:44px;border:none;background:transparent;color:#1a1a1a;border-radius:50%;display:flex;align-items:center;justify-content:center;padding:0;flex-shrink:0;cursor:pointer}
.c-btn svg{width:33px;height:33px;display:block}
.c-btn:active{background:#e4e7e4}
.c-mid{flex:1;min-width:0;display:flex;align-items:center}
#cMid .input-wrap{min-height:38px}
#cMid #msgInput{flex:none;min-height:38px;height:38px;max-height:140px;padding:8px 44px 8px 10px;line-height:22px;overflow-y:auto}
#cMid .send-btn{width:30px;height:30px;right:4px;bottom:auto;top:50%;transform:translateY(-50%)}
#cMid .send-btn svg{width:19px;height:19px}
.attach-panel{display:none;background:#f7f7f7;border-top:1px solid #f0f0f0;padding:16px 8px 30px}
.attach-panel.show{display:grid;grid-template-columns:repeat(4,1fr);row-gap:20px}
.ap-item{cursor:pointer;text-align:center}
.ap-ico{width:56px;height:56px;margin:0 auto;background:#fff;border-radius:16px;display:flex;align-items:center;justify-content:center;box-shadow:var(--sh-1);transition:background .15s,box-shadow .15s}
.ap-ico svg{width:26px;height:26px;color:#191919}
.ap-item:active .ap-ico{background:#ececec}
.ap-item span{display:block;font-size:12px;color:#7a7a7a;margin-top:8px}
#textRow{display:flex;flex-direction:column;flex:1;min-height:0}
.input-wrap{position:relative;display:flex;flex:1;min-height:70px;background:#fff;border:1px solid #ececec;border-radius:14px;flex-direction:column;transition:border-color .15s,box-shadow .15s}
#msgInput{width:100%;flex:1;min-height:70px;max-height:220px;resize:none;border:none;background:transparent;padding:8px 50px 8px 10px;font-size:15px;outline:none;font-family:inherit;line-height:1.5;box-shadow:none}
#msgInput:focus{box-shadow:none}
/* 聚焦只做中性提示：之前是绿色边框 + 3px 绿色光晕，点一下就在输入框底部闪一片绿，观感很跳 */
.input-wrap:focus-within{border-color:#e2e5e3;box-shadow:0 1px 3px rgba(17,24,39,.04)}
.composer-foot{display:flex;align-items:center;gap:12px;padding-top:4px}
.composer-foot .hint{color:#b2b2b2;font-size:12px}
.send-btn{position:absolute;right:6px;bottom:6px;width:34px;height:34px;min-width:0;border:none;border-radius:50%;background:transparent;color:#8f9693;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;transition:background .15s,color .15s}
.send-btn svg{width:20px;height:20px;display:block}
.send-btn .ico-send{display:none}
/* 有文字时只把图标变成绿色，不给圆形底色（原来实心绿圆很抢眼，像多了一个按钮） */
.send-btn.on{background:transparent;color:var(--wx-green)}
.send-btn.on .ico-mic{display:none}
.send-btn.on .ico-send{display:block}
.send-btn.on:hover{background:#ebeeec;color:var(--wx-green-dark)}
.send-btn.on:active{background:#e0e4e1}
.send-btn.listening{background:var(--wx-green);color:#fff;animation:micpulse 1.3s ease-in-out infinite}
.send-btn.listening .ico-mic{display:block}
.send-btn.listening .ico-send{display:none}
@keyframes micpulse{0%,100%{box-shadow:0 0 0 0 rgba(7,193,96,.35)}50%{box-shadow:0 0 0 7px rgba(7,193,96,0)}}
.rec-btn{display:none;flex:1;height:38px;border:1px solid #e9eceb;border-radius:12px;background:#fff;font-size:15px;color:#1a1a1a;cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;font-family:inherit;justify-content:center;align-items:center;text-align:center;transition:border-color .15s,background .15s}
.rec-btn.recording{background:#d9ded9;border-color:#c9cfc9;color:#333}

/* ---------- 按住说话录音浮层（微信式） ---------- */
.rec-overlay{position:fixed;inset:0;z-index:350;display:none;flex-direction:column;align-items:center;justify-content:center;background:rgba(0,0,0,.45);touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.rec-overlay.show{display:flex}
.rec-overlay *{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.rec-bubble{position:relative;width:170px;height:170px;border-radius:26px;background:#95ec69;display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:0 12px 40px rgba(0,0,0,.25);transition:background .15s,color .15s}
.rec-bubble .mic{width:46px;height:46px;color:#fff;margin-bottom:6px}
.rec-timer{position:absolute;top:12px;left:0;right:0;text-align:center;font-size:13px;color:#fff;opacity:.85}
.rec-wave{display:flex;align-items:flex-end;gap:3px;height:28px;margin-bottom:4px}
.rec-wave .bar{width:5px;min-height:6px;background:#fff;border-radius:3px;animation:recwave 1.1s ease-in-out infinite}
.rec-wave .bar:nth-child(1){animation-delay:0s}
.rec-wave .bar:nth-child(2){animation-delay:.15s}
.rec-wave .bar:nth-child(3){animation-delay:.3s}
.rec-wave .bar:nth-child(4){animation-delay:.45s}
.rec-wave .bar:nth-child(5){animation-delay:.6s}
@keyframes recwave{0%,100%{height:6px}50%{height:26px}}
.rec-bubble-tip{position:absolute;bottom:14px;font-size:13px;color:#fff;opacity:.95}
.rec-tip{position:fixed;bottom:18%;font-size:14px;color:#fff;transition:all .15s}
.rec-zone{position:fixed;bottom:22%;display:flex;flex-direction:column;align-items:center;gap:5px;color:#fff;opacity:.55;transition:opacity .15s,transform .15s}
.rec-zone .ico{width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.22);display:flex;align-items:center;justify-content:center}
.rec-zone .ico svg{width:22px;height:22px}
.rec-zone .ico span{font-size:22px;font-weight:600}
.rec-zone .label{font-size:13px}
.rec-zone.cancel{left:12%}
.rec-zone.text{right:12%}
/* 取消态 */
.rec-overlay.cancel .rec-bubble{background:#fa5151}
.rec-overlay.cancel .rec-tip,
.rec-overlay.cancel .rec-bubble-tip{color:#fff}
.rec-overlay.cancel .rec-zone.cancel{opacity:1;transform:scale(1.1)}
/* 转文字态 */
.rec-overlay.text .rec-zone.text{opacity:1;transform:scale(1.1)}
@media (max-width:980px){
  .rec-bubble{width:150px;height:150px}
  .rec-bubble .mic{width:40px;height:40px}
  .rec-tip{bottom:16%}
  .rec-zone{bottom:18%}
}

/* 表情面板 */
/* 表情面板（微信表情 PNG，分类 tab） */
.emoji-panel{display:none;flex-direction:column;max-height:250px;background:#fff;border-radius:16px;box-shadow:var(--sh-2);margin-bottom:6px;overflow:hidden}
.emoji-panel.show{display:flex}
.ep-grid{flex:1;display:flex;flex-wrap:wrap;align-content:flex-start;gap:2px;overflow-y:auto;padding:8px 8px 4px}
.ep-grid img{width:34px;height:34px;padding:3px;box-sizing:border-box;border-radius:10px;cursor:pointer;flex:0 0 auto}
.ep-grid img:hover{background:#f0f0f0}
.ep-grid img:active{background:#e3e3e3}
.ep-tabs{flex:0 0 auto;display:flex;gap:2px;padding:4px 6px;border-top:1px solid #eee;background:#fafafa;overflow-x:auto}
.ep-tabs button{flex:0 0 auto;border:none;background:transparent;border-radius:10px;padding:5px 10px;font-size:12px;color:#666;cursor:pointer;transition:background .15s,color .15s}
.ep-tabs button.on{background:#e6f7ec;color:#07c160;font-weight:600}
/* 消息正文里的表情（行内，随字号缩放） */
.wx-emoji{width:1.25em;height:1.25em;vertical-align:-0.28em;display:inline-block;margin:0 1px}
.mo-text .wx-emoji{width:1.35em;height:1.35em;vertical-align:-0.32em}
/* 纯表情消息：去掉气泡底色，只留表情（仿微信） */
.msg .bubble.emoji{background:transparent;padding:0;box-shadow:none;min-width:0}
/* 发送/接收都按「原大」显示：与表情面板里的图标同尺寸（34px），不再放大 */
.msg .bubble.emoji .wx-emoji{width:34px;height:34px;vertical-align:middle;margin:0}
/* 收藏 / 详情里的表情尺寸 */
.fav2-ico .wx-emoji{width:32px;height:32px;vertical-align:middle;margin:0}
.fd-emoji{padding:8px 0}
.fd-emoji .wx-emoji{width:96px;height:96px;vertical-align:middle;margin:0 6px 6px 0}

/* 弹层（发起聊天/建群）
   z-index 必须高于全屏子页 .sv(92) 与 .moments(90)，否则从「收藏详情」点转发时，
   弹层会被子页整个盖住 —— 表现为「点了没反应」。 */
.modal-mask{position:fixed;inset:0;background:rgba(0,0,0,.4);display:none;align-items:center;justify-content:center;z-index:110}
.modal-mask.show{display:flex}
.modal{width:360px;max-width:92vw;background:#fff;border-radius:18px;max-height:80vh;display:flex;flex-direction:column;box-shadow:var(--sh-3)}
.modal h3{padding:16px;font-size:16px;border-bottom:1px solid #f0f0f0}
.modal .body{flex:1;overflow-y:auto;padding:8px 16px}
.modal .foot{padding:12px 16px;border-top:1px solid #f0f0f0;display:flex;gap:10px;justify-content:flex-end}
.modal .foot button{border:none;border-radius:12px;padding:8px 18px;font-size:14px;cursor:pointer;transition:background .15s,opacity .15s}
/* 我的收藏列表 */
.fav-item{display:flex;align-items:flex-start;gap:10px;padding:12px 4px;border-bottom:1px solid #f0f0f0}
.fav-item:last-child{border-bottom:none}
.fav-main{flex:1;min-width:0}
.fav-text{font-size:14px;line-height:1.5;word-break:break-word;white-space:pre-wrap;color:#1a1a1a}
.fav-thumb{width:96px;height:96px;object-fit:cover;border-radius:8px;display:block;cursor:pointer}
.fav-meta{font-size:12px;color:#9a9a9a;margin-top:6px}
.fav-del{border:none;background:#fdecec;color:#d64545;border-radius:8px;padding:5px 12px;font-size:12px;cursor:pointer;flex-shrink:0;transition:background .15s}
.fav-del:hover{background:#f9dcdc}
.modal .foot .ok{background:var(--wx-green);color:#fff}
.modal .foot .cancel{background:#eee;color:#333}

/* ===== 全屏子页面（收藏 / 笔记），仿微信收藏 ===== */
body.sv-open{overflow:hidden}
.sv{display:none;position:fixed;inset:0;background:#f7f7f7;z-index:92;overflow-y:auto;-webkit-overflow-scrolling:touch}
.sv.show{display:flex;flex-direction:column}
.sv-head{position:sticky;top:0;z-index:5;height:50px;flex:0 0 50px;display:flex;align-items:center;justify-content:space-between;padding:0 10px;background:#ededed;box-shadow:0 1px 0 #ececec,0 3px 12px rgba(17,24,39,.03)}
.sv-back{border:none;background:none;font-size:26px;line-height:1;color:#333;width:36px;height:36px;padding:0;cursor:pointer}
.sv-title{font-size:16px;font-weight:600;color:#1a1a1a}
.sv-act{border:none;background:none;color:#333;width:36px;height:36px;display:flex;align-items:center;justify-content:center;padding:0;cursor:pointer}
.sv-act svg{width:21px;height:21px}
.sv-text{border:none;background:none;color:var(--wx-green);font-size:15px;font-weight:600;cursor:pointer;padding:0 6px}
/* 搜索 */
.fav-search{padding:8px 12px 4px;background:#ededed}
.fav-search input{width:100%;height:34px;border:none;border-radius:10px;background:#fff;padding:0 12px;font-size:14px;outline:none;box-sizing:border-box}
/* 分类 tab */
.fav-tabs{display:flex;gap:6px;padding:4px 12px 10px;background:#ededed;overflow-x:auto}
.fav-tabs button{flex:0 0 auto;border:none;border-radius:14px;background:#fff;color:#555;font-size:13px;padding:6px 14px;cursor:pointer;white-space:nowrap}
.fav-tabs button.on{background:var(--wx-green);color:#fff;font-weight:600}
/* 列表 */
.fav-list{flex:1;overflow-y:auto;background:#fff;padding:0 14px 30px}
.fav2-item{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid #f0f0f0;cursor:pointer}
.fav2-item:active{background:#fafafa}
.fav2-thumb{width:52px;height:52px;flex:0 0 52px;border-radius:8px;overflow:hidden;background:#eee}
.fav2-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.fav2-ico{width:52px;height:52px;flex:0 0 52px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:20px}
.fav2-main{flex:1;min-width:0}
.fav2-main .t{font-size:15px;color:#1a1a1a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fav2-main .s{font-size:12px;color:#9a9a9a;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fav2-time{font-size:12px;color:#b2b2b2;flex-shrink:0;margin-left:6px}
/* 详情 */
.fd-wrap{flex:1;padding:16px;overflow-y:auto}
.fd-text{font-size:16px;line-height:1.6;color:#1a1a1a;white-space:pre-wrap;word-break:break-word;background:#fff;border-radius:12px;padding:14px;box-shadow:var(--sh-1)}
.fd-emoji{font-size:56px;text-align:center;padding:20px 0}
.fd-media{background:#000;border-radius:12px;overflow:hidden;display:flex;justify-content:center;box-shadow:var(--sh-1)}
.fd-media img{max-width:100%;max-height:60vh;display:block;cursor:zoom-in}
.fd-media video{max-width:100%;max-height:60vh;display:block}
.fd-file{background:#fff;border-radius:12px;padding:16px;word-break:break-all;box-shadow:var(--sh-1)}
.fd-file a{color:var(--wx-green);font-size:15px;text-decoration:none}
.fd-file audio{width:100%}
.fd-meta{margin-top:14px;font-size:12px;color:#9a9a9a;line-height:1.8}
.fd-bar{flex:0 0 auto;display:flex;border-top:1px solid #e6e6e6;background:#fff}
.fd-bar button{flex:1;border:none;background:none;padding:12px 0;font-size:14px;color:#333;display:flex;flex-direction:column;align-items:center;gap:4px;cursor:pointer}
.fd-bar button svg{width:20px;height:20px}
.fd-bar button.danger{color:#e64340}
.fd-bar button:active{background:#f5f5f5}
/* 笔记编辑 */
.note-input{flex:1;width:100%;border:none;outline:none;resize:none;padding:16px;font-size:16px;line-height:1.7;font-family:inherit;background:#fff;box-sizing:border-box}
.note-foot{flex:0 0 auto;padding:10px;background:#fff;border-top:1px solid #e6e6e6}
.note-foot button{width:100%;height:44px;border:none;border-radius:12px;background:#fdecec;color:#e64340;font-size:15px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:6px;transition:background .15s}
.note-foot button svg{width:18px;height:18px}
/* 通知设置 */
.nt-wrap{flex:1;width:100%;padding:14px;box-sizing:border-box}
.nt-group-title{font-size:13px;color:#9a9a9a;padding:6px 4px 8px}
.nt-group{background:#fff;border-radius:10px;overflow:hidden;margin-bottom:10px}
.nt-row{display:flex;align-items:center;gap:12px;padding:13px 14px;border-bottom:1px solid #f2f2f2}
.nt-row:last-child{border-bottom:none}
.nt-main{flex:1;min-width:0}
.nt-label{font-size:15px;color:#1a1a1a}
.nt-hint{font-size:12px;color:#9a9a9a;margin-top:3px}
.nt-switch{flex:0 0 auto;width:50px;height:30px;border:none;border-radius:15px;background:#e2e4e3;position:relative;cursor:pointer;padding:0;transition:background .2s}
.nt-switch::after{content:'';position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:transform .2s}
.nt-switch.on{background:var(--wx-green)}
.nt-switch.on::after{transform:translateX(20px)}
.nt-preview{display:flex;justify-content:center;margin:0 0 20px}
.nt-preview button{border:1px solid #e4e4e4;background:#fff;color:#3a3a3a;border-radius:18px;padding:8px 20px;font-size:14px;cursor:pointer;transition:background .15s,border-color .15s}
.nt-preview button:active{background:#f0f0f0}
.nt-tip{font-size:12px;color:#9a9a9a;line-height:1.7;padding:0 4px}
/* 通知音量档位（小/中/大 分段按钮） */
.nt-volrow{background:#fff;border-radius:10px;margin-bottom:10px;border-bottom:none;padding:11px 14px}
.nt-volbox{flex:0 0 auto;display:flex;gap:2px;background:#f0f2f1;border-radius:9px;padding:3px}
.nt-vol{border:none;background:transparent;color:#5a5a5a;font-size:13px;padding:6px 0;min-width:46px;border-radius:8px;cursor:pointer;font-family:inherit;transition:background .15s,color .15s}
.nt-vol.on{background:#fff;color:var(--wx-green);font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.nt-vol:active{background:#e4e6e5}
/* 桌面端：内容居中成一列，避免宽屏下过散 */
@media (min-width:1000px){
  .sv{background:#ededed}
  .fav-search,.fav-tabs,.fav-list,.fd-wrap,.note-input,.note-foot,.nt-wrap{align-self:center;width:100%;max-width:720px}
  .fav-list,.note-input,.note-foot,.fd-file,.fd-text{background:#fff}
  .fd-bar button{max-width:240px}
}
.pick{display:flex;align-items:center;gap:10px;padding:9px 4px;border-bottom:1px solid #f3f3f3;cursor:pointer}
.pick .ava{width:38px;height:38px;border-radius:10px;background:var(--wx-green);color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px;overflow:hidden;flex:0 0 38px}
.pick .ava img{width:100%;height:100%;object-fit:cover;display:block}
.pick input{width:18px;height:18px}
.modal input.name-in{width:100%;height:38px;border:1px solid var(--line);border-radius:10px;padding:0 12px;margin-bottom:10px;outline:none;transition:border-color .15s}

/* 群管理弹层 */
.gm-top{display:flex;align-items:center;gap:12px;padding:6px 0 2px}
.gm-ava{width:52px;height:52px;border-radius:12px;background:var(--wx-green);color:#fff;display:flex;align-items:center;justify-content:center;font-size:15px;overflow:hidden;flex:0 0 52px}
.gm-ava img{width:100%;height:100%;object-fit:cover}
.gm-ava.editable{cursor:pointer;box-shadow:0 0 0 2px rgba(7,193,96,.3)}
.gm-name{flex:1;margin-bottom:0 !important}
.gm-name[readonly]{background:#f5f5f5;color:#666}
.gm-name-ops{display:none;justify-content:flex-end;margin:8px 0 2px}
.gm-btn{border:none;border-radius:10px;padding:7px 14px;font-size:13px;cursor:pointer;background:#eee;color:#333;transition:background .15s}
.gm-btn.primary{background:var(--wx-green);color:#fff}
.gm-sec-title{font-size:13px;color:#888;margin:14px 0 2px;border-top:1px solid var(--line);padding-top:12px}
.gm-member{display:flex;align-items:center;gap:10px;padding:8px 2px;border-bottom:1px solid #f3f3f3}
.gm-m-ava{width:38px;height:38px;border-radius:10px;background:#c8c8c8;color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px;overflow:hidden;flex:0 0 38px}
.gm-m-ava img{width:100%;height:100%;object-fit:cover}
.gm-m-name{flex:1;min-width:0;font-size:14px;display:flex;align-items:center;flex-wrap:wrap;gap:5px}
.gm-tag{font-size:11px;padding:1px 6px;border-radius:9px;background:#eee;color:#888;flex-shrink:0}
.gm-tag.owner{background:#fff3d6;color:#c48b00}
.gm-tag.admin{background:#e3f2ff;color:#2b7fd4}
.gm-tag.muted{background:#ffe3e3;color:#d64545}
.gm-tag.me{background:#e6f7ee;color:#09934c}
.gm-m-ops{display:flex;gap:6px;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;max-width:60%}
.gm-op{border:none;border-radius:8px;padding:5px 9px;font-size:12px;cursor:pointer;background:#f0f0f0;color:#444;transition:background .15s}
.gm-op:hover{background:#e6e6e6}
.gm-op.danger{background:#fdecec;color:#d64545}
.gm-op.danger:hover{background:#f9dcdc}
.gm-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.gm-actions .gm-op{padding:8px 16px;font-size:13px}
@media (max-width:520px){
  .gm-op{padding:4px 7px;font-size:11px}
  .gm-m-ops{max-width:none}
  .gm-member{flex-wrap:wrap}
}

/* ---------- 移动端：底部导航 + 页面 ---------- */
.mobile-nav{display:none}
.m-page{display:none}
.m-chat-head{display:none}
.m-head{height:52px;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:600;background:#f7f7f7;box-shadow:0 1px 0 #ececec,0 3px 12px rgba(17,24,39,.03);position:sticky;top:0;z-index:2}
.m-body{padding:12px 14px 24px}
.m-empty{color:#b2b2b2;font-size:13px;padding:22px 0;text-align:center}
/* 上翻加载更多历史的顶部提示 / 到底提示 */
.m-older{color:#b2b2b2;font-size:12px;padding:8px 0;text-align:center;flex-shrink:0}
.m-older.end{color:#c9c9c9;padding-bottom:4px}
.m-row{display:flex;align-items:center;gap:12px;padding:11px 4px;border-bottom:1px solid #f0f0f0;cursor:pointer;font-size:15px}
.m-group{display:flex;align-items:center;gap:12px;padding:10px 4px;border-bottom:1px solid #f0f0f0;cursor:pointer}
.m-group .ava{width:44px;height:44px;border-radius:11px;background:#c8c8c8;color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0;overflow:hidden}
.m-group .ava img{width:100%;height:100%;object-fit:cover}
.m-group .meta{flex:1;min-width:0}
.m-group .nm{font-size:15px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m-group .sub{font-size:12px;color:#9a9a9a;margin-top:2px}
.m-group .arrow{color:#bbb;margin-left:auto;font-size:20px}

/* ---------- 我的 ---------- */
.me-avatar{width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.25);color:#fff;display:flex;align-items:center;justify-content:center;font-size:15px;cursor:pointer;overflow:hidden;flex-shrink:0}
.me-avatar-big{width:72px;height:72px;border-radius:50%;background:var(--wx-green);color:#fff;display:flex;align-items:center;justify-content:center;font-size:28px;margin:0 auto;overflow:hidden}
.me-avatar-big img{width:100%;height:100%;object-fit:cover}

/* 好友 / 请求条目 */
.friend-item{display:flex;align-items:center;gap:10px;padding:8px 2px;border-bottom:1px solid #f3f3f3}
.friend-item .ava{width:36px;height:36px;border-radius:50%;background:var(--wx-green);color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px;overflow:hidden}
.friend-item .ava img{width:100%;height:100%;object-fit:cover}
.friend-item .op{margin-left:auto;display:flex;gap:6px}
.friend-item .op button{border:none;border-radius:8px;padding:5px 12px;font-size:13px;cursor:pointer;transition:background .15s,opacity .15s}
.friend-item .op .ok{background:var(--wx-green);color:#fff}
.friend-item .op .no{background:#eee;color:#333}
.section-title{font-size:13px;color:var(--muted);margin:14px 0 4px}

/* 撤回按钮（气泡内常驻的那种已删除，撤回只走长按面板；此处保留空位仅为历史兼容） */
.msg.self .bubble{position:relative}

/* ---------- 朋友圈 ---------- */
.moments{display:none;position:fixed;inset:0;background:#fff;z-index:90;overflow-y:auto}
.moments.show{display:block}
.mo-head{position:sticky;top:0;z-index:5;height:50px;display:flex;align-items:center;justify-content:space-between;padding:0 12px;background:#fff;box-shadow:0 1px 0 #ececec,0 3px 12px rgba(17,24,39,.03)}
.mo-head .mo-title{font-weight:600;font-size:16px}
.mo-back{border:none;background:none;font-size:24px;cursor:pointer;color:#333;width:34px;height:34px;line-height:1;padding:0}
.mo-cam{border:none;background:none;color:#333;width:34px;height:34px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.mo-cam svg{width:21px;height:21px}
.mo-cover{height:170px;background:linear-gradient(135deg,#04502b,#07c160);background-size:cover;background-position:center;position:relative}
.mo-cover .cover-btn{position:absolute;left:12px;bottom:12px;z-index:2;display:flex;align-items:center;gap:4px;border:none;border-radius:16px;background:rgba(0,0,0,.35);color:#fff;font-size:12px;padding:5px 10px;cursor:pointer}
.mo-cover .cover-btn svg{width:14px;height:14px}
.mo-cover .cover-btn:hover{background:rgba(0,0,0,.5)}
.mo-cover.has-bg{cursor:pointer}
.mo-cover.has-bg .cover-btn{display:none}
.mo-cover .me{position:absolute;right:16px;bottom:-26px;text-align:right}

/* 朋友圈封面大图预览 */
.cover-preview{position:fixed;inset:0;background:#000;z-index:200;display:none;align-items:center;justify-content:center}
.cover-preview.show{display:flex}
.cover-preview .cp-back{position:absolute;top:8px;left:8px;width:44px;height:44px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:#fff;font-size:34px;cursor:pointer;z-index:2}
.cover-preview .cp-img{width:100%;height:100%;background-size:contain;background-repeat:no-repeat;background-position:center}
.cover-preview .cp-change{position:absolute;bottom:26px;right:20px;border:none;border-radius:8px;background:#fff;color:#333;padding:8px 16px;font-size:14px;cursor:pointer;box-shadow:var(--sh-1);transition:background .15s}
.cover-preview .cp-change:active{background:#e6e6e6}

/* 视频通话按钮（聊天头部） */
.chat-head .call-btn{display:none;border:none;background:transparent;color:#5b5b5b;width:36px;height:36px;border-radius:10px;cursor:pointer;align-items:center;justify-content:center;padding:0;flex-shrink:0;transition:background .15s,color .15s}
.chat-head .call-btn svg{width:21px;height:21px;display:block}
.chat-head .call-btn:hover{background:#e6e6e6;color:#07c160}

/* 视频通话层 */
.call-layer{position:fixed;inset:0;z-index:400;display:none}
.call-layer.show{display:block}
.call-incoming{position:absolute;inset:0;background:#2b2b2b;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff}
.call-incoming .ci-ava{width:96px;height:96px;border-radius:50%;background:#07c160;display:flex;align-items:center;justify-content:center;font-size:38px;overflow:hidden;margin-bottom:18px}
.call-incoming .ci-ava img{width:100%;height:100%;object-fit:cover}
.call-incoming .ci-name{font-size:20px;font-weight:600}
.call-incoming .ci-tip{margin-top:8px;color:#bbb;font-size:14px}
.call-incoming .ci-ops{position:absolute;bottom:64px;display:flex;gap:64px}
.ci-btn{width:64px;height:64px;border-radius:50%;border:none;color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer}
.ci-btn svg{width:30px;height:30px}
.ci-btn.accept{background:#07c160}
.ci-btn.reject{background:#fa5151;transform:rotate(135deg)}
.call-active{position:absolute;inset:0;background:#000}
.call-active #callRemote{width:100%;height:100%;object-fit:cover;background:#111}
.call-active #callLocal{position:absolute;right:12px;top:12px;width:104px;height:156px;object-fit:cover;border-radius:10px;box-shadow:0 4px 16px rgba(0,0,0,.5);background:#222;z-index:2}
.call-active .call-top{position:absolute;top:14px;left:0;right:0;text-align:center;color:#fff;font-size:15px;font-weight:600;text-shadow:0 1px 4px rgba(0,0,0,.6);z-index:2}
.call-active .call-ops{position:absolute;bottom:36px;left:0;right:0;display:flex;justify-content:center;gap:40px;z-index:2}
.call-op{width:58px;height:58px;border-radius:50%;border:none;background:rgba(255,255,255,.22);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer}
.call-op svg{width:26px;height:26px}
.call-op.danger{background:#fa5151}
.call-op.muted{background:#fff;color:#333}

/* 语音通话模式：用深色面板盖住视频区（远端音频仍由 #callRemote 播放，只是不显示画面） */
.call-voice{position:absolute;inset:0;background:#2b2b2b;display:none;flex-direction:column;align-items:center;justify-content:center;z-index:1}
.call-active.voice .call-voice{display:flex}
.call-active.voice #callLocal{display:none}
.call-active.voice .call-top{display:none}
.call-voice .cv-ava{width:112px;height:112px;border-radius:50%;background:#07c160;display:flex;align-items:center;justify-content:center;font-size:44px;overflow:hidden;margin-bottom:18px}
.call-voice .cv-ava img{width:100%;height:100%;object-fit:cover}
.call-voice .cv-name{font-size:22px;font-weight:600;color:#fff}
.call-voice .cv-tip{margin-top:10px;color:#bbb;font-size:14px;font-variant-numeric:tabular-nums;min-height:20px}

/* 图片查看器（点击放大/再点关闭） */
.img-viewer{position:fixed;inset:0;background:rgba(0,0,0,.94);z-index:300;display:none;align-items:center;justify-content:center}
.img-viewer.show{display:flex}
/* 点图片本身不关闭，只有 ✕ / Esc / 点空白处才关 —— 避免看图时误触把图关掉 */
.img-viewer img{max-width:94vw;max-height:88vh;object-fit:contain;border-radius:8px;cursor:default}
.img-viewer .iv-bar{position:absolute;top:10px;right:12px;display:flex;gap:8px;align-items:center}
.img-viewer .iv-btn{border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.10);color:#fff;
  border-radius:16px;padding:6px 14px;font-size:13px;cursor:pointer;text-decoration:none;line-height:1.4}
.img-viewer .iv-btn:hover{background:rgba(255,255,255,.2)}
.img-viewer .iv-close{width:34px;height:34px;padding:0;border-radius:50%;font-size:16px;
  display:flex;align-items:center;justify-content:center}
.mo-cover .me .nm{color:#fff;font-weight:600;font-size:14px;text-shadow:0 1px 4px rgba(0,0,0,.45);margin-bottom:8px}
.mo-cover .me .me-avatar-big{width:58px;height:58px;font-size:20px;border:2px solid #fff;box-sizing:border-box}
.mo-composer{margin:44px 14px 6px;background:#f7f7f7;border-radius:10px;padding:12px}
.mo-composer textarea{width:100%;min-height:70px;border:none;border-radius:10px;padding:10px;font-size:14px;resize:vertical;outline:none;font-family:inherit;background:#fff;box-sizing:border-box}
.mo-imgs{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.mo-thumb{position:relative;width:64px;height:64px}
.mo-thumb img{width:100%;height:100%;object-fit:cover;border-radius:8px}
.mo-thumb .x{position:absolute;top:-6px;right:-6px;width:18px;height:18px;background:rgba(0,0,0,.6);color:#fff;border-radius:50%;font-size:11px;display:flex;align-items:center;justify-content:center;cursor:pointer}
.mo-tools{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}
.mo-tools button{border:none;border-radius:10px;padding:8px 16px;font-size:13px;cursor:pointer;background:#e8e8e8;color:#333;transition:background .15s}
.mo-tools button.ok{background:var(--wx-green);color:#fff}
.mo-feed{padding:0 14px 50px;max-width:640px;margin:0 auto}
.mo-item{display:flex;gap:10px;padding:14px 0;border-bottom:1px solid #f0f0f0}
.mo-ava{width:40px;height:40px;border-radius:10px;background:#c8c8c8;color:#fff;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:15px;overflow:hidden}
.mo-ava img{width:100%;height:100%;object-fit:cover}
.mo-main{flex:1;min-width:0}
.mo-name{color:#576b95;font-weight:600;font-size:15px}
.mo-text{font-size:15px;line-height:1.5;margin-top:3px;white-space:pre-wrap;word-break:break-word}
.mo-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin-top:6px;max-width:320px}
.mo-grid img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:8px;cursor:pointer;display:block}
.mo-meta{display:flex;justify-content:space-between;align-items:center;margin-top:8px}
.mo-time{color:#b2b2b2;font-size:12px}
.mo-ops a{color:#576b95;font-size:13px;cursor:pointer;font-weight:600;margin-left:10px}
.mo-likes{background:#f7f7f7;border-radius:8px;padding:6px 10px;font-size:13px;color:#576b95;margin-top:8px}
.mo-comment{background:#f7f7f7;padding:6px 10px;font-size:13px;line-height:1.5;word-break:break-word;margin-top:2px;border-radius:8px}
.mo-comment b{color:#576b95;font-weight:600}
.mo-c-input{display:flex;gap:6px;margin-top:8px}
.mo-c-input input{flex:1;height:32px;border:1px solid #ddd;border-radius:8px;padding:0 10px;font-size:13px;outline:none;transition:border-color .15s}
.mo-c-input input:focus{border-color:var(--wx-green)}
.mo-c-input button{border:none;background:var(--wx-green);color:#fff;border-radius:8px;padding:0 12px;font-size:13px;cursor:pointer;transition:background .15s}

/* ---------- 全局 toast 提示 ---------- */
#toastBox{position:fixed;top:18px;left:50%;transform:translateX(-50%);z-index:9999;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}
.toast{background:rgba(0,0,0,.78);color:#fff;font-size:14px;line-height:1.4;padding:9px 18px;border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,.22);max-width:72vw;animation:toastIn .22s ease-out}
.toast.ok{background:rgba(7,193,96,.94)}
.toast.err{background:rgba(230,67,64,.94)}
/* 「有人@你」提醒：红色 + 可点击跳转到该群（#toastBox 是 pointer-events:none，这里要放开） */
.toast.at-notify{pointer-events:auto;cursor:pointer;background:rgba(250,81,81,.96);display:flex;align-items:center;gap:8px;padding:11px 18px;font-size:14px;box-shadow:0 6px 20px rgba(250,81,81,.35)}
.toast.at-notify b{font-weight:600;letter-spacing:.5px}
.toast.at-notify .at-from{max-width:34vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;opacity:.92}
.toast.at-notify:active{background:rgba(226,60,60,.98)}
@keyframes toastIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}

/* ---------- 通讯录添加好友 ---------- */
.add-friend-row{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.add-friend-row input{flex:1;max-width:170px;height:34px;border:1px solid var(--line);border-radius:10px;padding:0 10px;font-size:13px;outline:none;transition:border-color .15s}
.add-friend-row input:focus{border-color:var(--wx-green)}
.add-friend-row .ok{height:34px;border:none;border-radius:10px;background:var(--wx-green);color:#fff;font-size:13px;padding:0 16px;cursor:pointer;flex-shrink:0;transition:background .15s}
.add-friend-row .ok:active{background:var(--wx-green-dark)}

/* ---------- 消息长按/右键菜单 ---------- */
.msg-menu{position:absolute;z-index:80;background:rgba(58,58,58,.96);border-radius:14px;padding:8px 6px;display:grid;grid-template-columns:repeat(5,1fr);gap:4px;box-shadow:var(--sh-2);min-width:260px;max-width:92vw;user-select:none}
.msg-menu::after{content:'';position:absolute;bottom:-6px;left:50%;transform:translateX(-50%);border-width:6px 6px 0;border-style:solid;border-color:rgba(58,58,58,.96) transparent transparent transparent}
.msg-menu.top::after{top:-6px;bottom:auto;border-width:0 6px 6px 6px;border-color:transparent transparent rgba(58,58,58,.96) transparent}
.msg-menu .mi{display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 4px;border-radius:8px;cursor:pointer;color:#fff;font-size:11px;min-width:48px;text-align:center;transition:background .12s}
.msg-menu .mi:hover{background:rgba(255,255,255,.18)}
.msg-menu .mi span.ico{font-size:18px;line-height:1}

/* ===== 群聊 @ 提醒 ===== */
/* 群成员头像可点（弹出 @TA / 发消息） */
.msg .ava.clickable{cursor:pointer;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.msg .ava.clickable:hover{opacity:.85}
.msg-menu.member-menu{grid-template-columns:repeat(2,auto);min-width:0;max-width:none;padding:6px;gap:2px}
.msg-menu.member-menu .mi{flex-direction:row;gap:6px;font-size:13px;min-width:0;padding:7px 10px;white-space:nowrap}
/* 气泡里的 @昵称 高亮 */
.bubble .mention{color:#576b95;font-weight:600}
.msg.self .bubble .mention{color:#115c33}
/* 输入 @ 弹出的成员选择列表 */
.mention-picker{position:fixed;z-index:85;display:none;background:#fff;border-radius:12px;border:1px solid #f0f0f0;box-shadow:var(--sh-2);max-height:220px;overflow-y:auto;padding:4px}
.mention-picker.show{display:block}
.mention-picker .mp-item{display:flex;align-items:center;gap:8px;padding:7px 8px;border-radius:8px;cursor:pointer;font-size:14px;color:#1a1a1a;transition:background .15s}
.mention-picker .mp-item:hover,.mention-picker .mp-item:active{background:#f2f2f2}
.mention-picker .mp-item .ava{width:28px;height:28px;border-radius:8px;background:var(--wx-green);color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;overflow:hidden;flex:0 0 28px}
.mention-picker .mp-item .ava img{width:100%;height:100%;object-fit:cover;display:block}
.mention-picker .mp-item .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mention-picker .mp-item .tag{font-size:11px;color:#07c160;background:#e6f7ec;border-radius:6px;padding:1px 6px}
.mention-picker .mp-empty{padding:12px 16px;text-align:center;color:#b2b2b2;font-size:13px}
/* 会话列表「[有人@我]」 */
.conv .meta .preview .at-me{color:#fa5151;font-weight:600}

/* ---------- 引用 ---------- */
.quote-bar{display:none;align-items:center;gap:8px;padding:6px 10px;background:#f3f3f3;border-bottom:1px solid #e8e8e8;border-radius:10px 10px 0 0;margin:0 0 -1px 0;position:relative;z-index:1}
.quote-bar.show{display:flex}
.quote-bar .q-line{width:3px;align-self:stretch;background:var(--wx-green);border-radius:2px;flex-shrink:0}
.quote-bar .q-info{flex:1;min-width:0}
.quote-bar .q-title{font-size:12px;color:var(--wx-green);font-weight:600}
.quote-bar .q-text{font-size:12px;color:#888;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quote-bar .q-x{width:24px;height:24px;border:none;background:transparent;color:#999;cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center}
.quote-bar .q-x:hover{color:#333}

/* ---------- 多选 ---------- */
.msg.multi .bubble,.msg.multi .ava{pointer-events:none;user-select:none}
.msg-check{display:none;position:absolute;left:-28px;top:50%;transform:translateY(-50%);width:18px;height:18px;accent-color:var(--wx-green);cursor:pointer;z-index:5}
.msg.multi .msg-check{display:block}
.msg.selected .bubble{box-shadow:0 0 0 2px var(--wx-green)}

/* 多选底部操作栏 */
.multi-bar{display:none;position:absolute;left:0;right:0;bottom:0;background:#f7f7f7;box-shadow:0 -1px 0 #ececec,0 -6px 20px rgba(17,24,39,.06);padding:8px 0;align-items:center;justify-content:space-around;z-index:20}
.multi-bar.show{display:flex}
.multi-bar button{border:none;background:transparent;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:12px;color:#5b5b5b;cursor:pointer;padding:4px 12px}
.multi-bar button .ico{font-size:22px;line-height:1}
.multi-bar button.danger{color:#d64545}

/* 转发选择列表 */
#forwardList .pick .ava{flex:0 0 36px}
#forwardList .pick:last-child{border-bottom:none}

/* 消息引用渲染 */
.bubble .quote-ref{display:flex;gap:6px;align-items:flex-start;padding:6px 8px;background:rgba(0,0,0,.04);border-radius:8px;margin-bottom:6px;border-left:3px solid var(--wx-green);font-size:12px;color:#555}
.bubble .quote-ref .q-sender{color:var(--wx-green);font-weight:600;white-space:nowrap}
.bubble .quote-ref .q-body{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bubble.self .quote-ref{background:rgba(255,255,255,.25);border-left-color:#fff}

/* 移动端适配 */
@media (max-width:980px){
  .nav-rail{display:none}
  .sidebar{position:fixed;inset:0;width:100%;background:#fff;z-index:1;display:none}
  .sidebar:not(.hide-m){display:flex}
  #chatPanel{position:fixed;inset:0;background:#ededed;z-index:3;transform:translateX(100%);transition:transform .2s}
  #chatPanel.open{transform:translateX(0)}
  .chat-head .back{display:block}
  .mobile-nav{display:flex;position:fixed;bottom:0;left:0;right:0;height:56px;background:#f7f7f7;box-shadow:0 -1px 0 #ececec,0 -3px 14px rgba(17,24,39,.03);z-index:10;align-items:center;justify-content:space-around}
  .mobile-nav .tab{flex:1;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:none;background:transparent;color:#999;font-size:11px;cursor:pointer}
  .mobile-nav .tab svg{width:22px;height:22px}
  .mobile-nav .tab.on{color:#07c160}
  .m-page.show{display:block;position:fixed;inset:0;bottom:56px;background:#fff;z-index:2;overflow-y:auto}
  .m-chat-head{display:flex}
  .composer .pc-area{display:none}
  .composer .m-bar{display:flex}
  .messages{padding-bottom:70px}
}

/* ==================== 重建补齐（2026-09-21） ====================
   文件损坏重建时丢失的段落，按现有标记补回：
   登录页 auth / PC 面板(通讯录·发现) / 搜索行+加号 / 行条目 /
   移动端聊天头部⊕ / 我的页 / 聊天动态元素 / chat-open */

/* ---------- 登录 / 注册页 ---------- */
.auth-wrap{position:relative;height:100%;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;background:linear-gradient(135deg,#e9f9f0 0%,#f6f8f7 55%,#e6f4ec 100%);padding:24px 16px}
.auth-deco{position:absolute;border-radius:50%;pointer-events:none}
.auth-deco.d1{width:360px;height:360px;background:radial-gradient(circle at 35% 35%,rgba(7,193,96,.16),transparent 68%);top:-120px;left:-110px}
.auth-deco.d2{width:460px;height:460px;background:radial-gradient(circle at 60% 60%,rgba(7,193,96,.13),transparent 68%);bottom:-180px;right:-150px}
.auth-deco.d3{width:190px;height:190px;background:radial-gradient(circle at 50% 50%,rgba(7,193,96,.18),transparent 70%);top:10%;right:10%}
.auth-card{position:relative;z-index:1;width:380px;max-width:94vw;background:#fff;border-radius:16px;box-shadow:0 14px 44px rgba(16,64,40,.13);padding:36px 32px 28px;text-align:center}
.auth-logo{width:64px;height:64px;margin:0 auto 12px;border-radius:16px;background:linear-gradient(135deg,#07c160,#059a4e);color:#fff;font-size:30px;display:flex;align-items:center;justify-content:center;box-shadow:0 6px 16px rgba(7,193,96,.32)}
.auth-card h1{margin:0 0 6px;font-size:22px;letter-spacing:3px;color:#17301f}
.auth-card .sub{font-size:13px;color:#9aa6a1;margin-bottom:14px}
.auth-err{min-height:18px;font-size:13px;color:#e64340;margin-bottom:6px;word-break:break-all}
.field{display:flex;align-items:center;gap:9px;height:46px;padding:0 14px;margin-bottom:12px;border:1px solid #e3e8e5;border-radius:10px;background:#f8faf9;transition:border-color .15s,box-shadow .15s,background .15s}
.field:focus-within{border-color:var(--wx-green);background:#fff;box-shadow:0 0 0 3px rgba(7,193,96,.13)}
.field span{font-size:15px;flex-shrink:0}
.field input{flex:1;min-width:0;border:none;outline:none;background:transparent;font-size:15px;color:var(--text)}
#submitBtn{width:100%;height:46px;margin-top:2px;border:none;border-radius:10px;background:var(--wx-green);color:#fff;font-size:16px;font-weight:600;letter-spacing:6px;cursor:pointer;transition:background .15s}
#submitBtn:hover{background:var(--wx-green-dark)}
#submitBtn:active{filter:brightness(.94)}
.auth-switch{margin-top:16px;font-size:13px;color:#9aa6a1}
.auth-switch a{color:var(--wx-green);font-weight:500;cursor:pointer;margin-left:4px}
.auth-switch a:hover{text-decoration:underline}
.auth-tip{margin-top:8px;font-size:12px;color:#8a9a92}
.auth-foot{position:relative;z-index:1;margin-top:20px;font-size:12px;color:#9fb0a7;letter-spacing:1px}

/* ---------- 左栏面板：通讯录 / 发现（PC） ---------- */
.pane{flex:1;min-height:0;display:flex;flex-direction:column}
.pane-head{flex-shrink:0;height:52px;display:flex;align-items:center;padding:0 16px;font-size:16px;font-weight:600;border-bottom:1px solid #f0f0f0}
.pane-cta-row{flex-shrink:0;padding:10px 12px 6px}
.pane-cta{width:100%;height:38px;display:flex;align-items:center;justify-content:center;gap:6px;border:none;border-radius:12px;background:#e9f8ef;color:var(--wx-green);font-size:14px;cursor:pointer;transition:background .15s}
.pane-cta svg{width:18px;height:18px}
.pane-cta:hover{background:#d9f1e2}
.pane-scroll{flex:1;min-height:0;overflow-y:auto;padding:4px 14px 12px}

/* ---------- 搜索行 + 加号（PC 会话列表头部） ---------- */
.search-row{position:relative;display:flex;align-items:center;gap:8px;padding:8px 10px 8px 12px;border-bottom:1px solid #eee;flex-shrink:0}
.search-row .search{flex:1;min-width:0;padding:0;border-bottom:none}
.pc-plus{flex:0 0 32px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:#5b5b5b;border-radius:10px;cursor:pointer;padding:0;transition:background .15s,color .15s}
.pc-plus svg{width:20px;height:20px}
.pc-plus:hover{background:#ececec}
.search-row .plus-menu{top:44px;right:8px}

/* ---------- 行条目（通讯录 / 发现 / 我的 共用） ---------- */
.m-row .txt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m-row .arrow{color:#c8c8c8;margin-left:auto;font-size:18px;flex-shrink:0}
.m-row.danger .txt{color:#e64340}
.ico.sq{width:30px;height:30px;flex:0 0 30px;border-radius:10px;color:#fff;display:flex;align-items:center;justify-content:center}
.ico.sq svg{width:18px;height:18px}
.m-badge,.nav-badge{min-width:16px;height:16px;border-radius:8px;background:#fa5151;color:#fff;font-size:11px;line-height:16px;text-align:center;padding:0 5px}
.m-badge:empty,.nav-badge:empty{display:none}

/* ---------- 移动端聊天头部（⊕ 按钮） ---------- */
.m-chat-head{position:sticky;top:0;z-index:5;align-items:center;gap:8px;height:52px;padding:0 12px;background:#f7f7f7;box-shadow:0 1px 0 #ececec,0 3px 12px rgba(17,24,39,.03)}
.m-chat-head .t{flex:1;min-width:0;font-size:16px;font-weight:600}
.m-chat-head .plus{position:relative;flex:0 0 34px;width:34px;height:34px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:#1a1a1a;border-radius:10px;cursor:pointer;padding:0;transition:background .15s,color .15s}
.m-chat-head .plus svg{width:22px;height:22px}
.m-chat-head .plus:hover{background:#ececec}
.m-chat-head .plus-menu{top:46px;right:8px}

/* ---------- 移动端「我的」页 ---------- */
.m-profile{display:flex;flex-direction:column;align-items:center;background:#fff;border-radius:14px;padding:24px 0 18px;margin-bottom:12px;box-shadow:var(--sh-1)}
.m-nick{margin-top:10px;font-size:17px;font-weight:600}
.m-user{margin-top:2px;font-size:13px;color:#9a9a9a}
.m-head-btn{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:34px;height:34px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:#333;border-radius:10px;cursor:pointer;padding:0;transition:background .15s,color .15s}
.m-head-btn svg{width:20px;height:20px}
.m-head-btn:hover{background:#ececec}

/* ---------- 聊天动态元素 ---------- */
.sys-msg{text-align:center;font-size:12px;color:#9a9a9a;margin:8px auto;max-width:80%}
/* 通话记录（仿微信）：居中灰色小胶囊。用 width:fit-content + margin:auto 让块级元素按内容宽度居中 */
.sys-msg.call-rec{width:fit-content;max-width:80%;padding:4px 12px;border-radius:12px;background:rgba(0,0,0,.05);color:#8b8b8b}
.time-divider{text-align:center;font-size:12px;color:#9a9a9a;margin:10px 0}
.read-tip{font-size:11px;color:#9a9a9a;text-align:right;margin-top:2px;user-select:none}
.msg:not(.self) .read-tip{text-align:left}

/* ---------- chat-open（移动端打开会话时隐藏列表） ---------- */
@media (max-width:980px){
  body.chat-open .sidebar{display:none}
  .mobile-nav .tab{position:relative}
  .mobile-nav .tab .nav-badge{position:absolute;top:7px;left:calc(50% + 4px)}
}

/* 移动端隐藏 PC 会话列表的发起按钮（移动端只保留顶栏 ⊕）。
   注意：必须放在 .pc-plus 基础规则之后，否则会被其 display:flex 覆盖。 */
@media (max-width:980px){
  .pc-plus{display:none}
}

/* ---------- 图片消息：无气泡框、固定尺寸（放在末尾覆盖 .bubble 与 .msg.self .bubble） ---------- */
.msg .bubble.media{padding:0;background:transparent;box-shadow:none;min-width:0;border-radius:8px}
.msg .bubble.media .msg-img{display:block;width:auto;height:auto;max-width:min(180px,54vw);max-height:min(240px,30vh);border-radius:12px;cursor:pointer}
.msg .bubble.media .revoke-btn{left:auto;right:-52px}

/* ---------- 头像底色：文件助手 / 群聊默认绿底（图标与首字） ---------- */
.conv .ava.self,.conv .ava.g,.m-group .ava.g{background:var(--wx-green)}

/* ---------- 移动端：进入会话隐藏底栏（仿微信），输入框贴底可见 ---------- */
@media (max-width:980px){
  body.chat-open .mobile-nav{display:none}
  .messages{padding-bottom:14px}
}

/* ---------- 移动端：#textRow 由 JS 搬入 #cMid 后的单行输入栏（须放在末尾覆盖基础规则） ---------- */
@media (max-width:980px){
  #cMid #textRow{flex:1;min-width:0;min-height:0}
  #cMid .input-wrap{min-height:38px;height:auto;border-radius:8px;flex:none}
  #cMid .composer-foot{display:none}
  #cMid .quote-bar{margin-bottom:4px}
}
