/* 旺旺 设计系统（配色取意爱马仕式的「主色 + 点缀色」）：
   蓝 = 深蓝 + 柠檬黄（默认） · 紫 = 紫 + 粉 · 白 = 象牙白 + 爱马仕橙。
   --accent 是主色（气泡、选中、链接、按钮），--hl 是点缀色（未读角标、发送键、VIP 标记）。红色只留给危险操作和错误。 */
:root{
  --accent:#12306b; --accent-h:#0b2250; --accent-soft:#e8edf8; --on-accent:#fff;
  --hl:#f7d52d; --on-hl:#12306b;
  --bg:#fff; --side:#f9fafd; --surface:#f1f4fa; --surface-2:#e6ebf4; --chat:#eef2f8;
  --line:rgba(13,27,54,.09); --line-strong:rgba(13,27,54,.16);
  --text:#0d1b36; --sub:#5d6b85; --faint:#94a0b6;
  --bub-me:#12306b; --bub-me-t:#fff; --bub-o:#fff; --bub-o-t:#0d1b36; --bub-shadow:0 1px 1.5px rgba(13,27,54,.08);
  --red:#d6343b; --green:#2f9e5b; --amber:#d9930d;
  --sel:#e8edf8; --hover:rgba(13,27,54,.04);
  --shadow-pop:0 18px 44px -14px rgba(13,27,54,.34),0 0 0 1px rgba(13,27,54,.07);
  --shadow-sm:0 1px 2px rgba(13,27,54,.07);
  --mask:rgba(8,14,30,.5);
  --r-sm:8px; --r:12px; --r-lg:18px;
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","HarmonyOS Sans SC","Noto Sans SC","Microsoft YaHei",system-ui,sans-serif;
  --serif:"Songti SC","Noto Serif SC","Source Han Serif SC","STSong",Georgia,serif;
  color-scheme:only light;
}
/* 紫 + 粉 */
:root[data-accent="purple"]{
  --accent:#5a2d91; --accent-h:#49227a; --accent-soft:#f1eaf9; --hl:#e8458b; --on-hl:#fff;
  --side:#fbf9fd; --surface:#f4eff9; --surface-2:#e9e1f3; --chat:#f4f0f9;
  --line:rgba(40,16,70,.09); --line-strong:rgba(40,16,70,.16);
  --text:#1d1428; --sub:#6b5e80; --faint:#a196b4;
  --bub-me:#5a2d91; --bub-shadow:0 1px 1.5px rgba(40,16,70,.08); --sel:#f1eaf9; --hover:rgba(40,16,70,.04);
  --shadow-pop:0 18px 44px -14px rgba(40,16,70,.36),0 0 0 1px rgba(40,16,70,.07); --mask:rgba(20,8,36,.5);
}
/* 象牙白 + 爱马仕橙 */
:root[data-accent="white"]{
  --accent:#2b2118; --accent-h:#000; --accent-soft:#f3ede5; --hl:#ea6a1a; --on-hl:#fff;
  --bg:#fff; --side:#fcfaf7; --surface:#f6f2ec; --surface-2:#ece6dc; --chat:#f7f4ef;
  --line:rgba(43,33,24,.09); --line-strong:rgba(43,33,24,.17);
  --text:#2a2018; --sub:#7a6c5f; --faint:#aa9d90;
  --bub-me:#2b2118; --bub-shadow:0 1px 1.5px rgba(43,33,24,.08); --sel:#f3ede5; --hover:rgba(43,33,24,.04);
  --shadow-pop:0 18px 44px -14px rgba(43,33,24,.32),0 0 0 1px rgba(43,33,24,.07); --mask:rgba(30,20,10,.48);
}
:root[data-theme="dark"]{
  --accent:#8fb0ff; --accent-h:#aac2ff; --accent-soft:#16254a; --on-accent:#08122b;
  --hl:#ffe14d; --on-hl:#10234c;
  --bg:#0b1220; --side:#0e1628; --surface:#152036; --surface-2:#1e2b46; --chat:#080e1a;
  --line:rgba(255,255,255,.07); --line-strong:rgba(255,255,255,.13);
  --text:#e8ecf5; --sub:#97a3bb; --faint:#62708b;
  --bub-me:#1d4189; --bub-me-t:#fff; --bub-o:#16213a; --bub-o-t:#e8ecf5; --bub-shadow:none;
  --red:#ff6b72; --green:#46c27a; --amber:#f0b54a;
  --sel:#14284f; --hover:rgba(255,255,255,.045);
  --shadow-pop:0 20px 48px -14px rgba(0,0,0,.75),0 0 0 1px rgba(255,255,255,.08);
  --shadow-sm:none; --mask:rgba(0,0,0,.65);
  color-scheme:dark;
}
:root[data-theme="dark"][data-accent="purple"]{
  --accent:#b99bff; --accent-h:#cbb4ff; --accent-soft:#2a1d47; --on-accent:#1a0b2c; --hl:#ff6fae; --on-hl:#2a0b1b;
  --bg:#120d1b; --side:#160f21; --surface:#1e1530; --surface-2:#2a1f40; --chat:#0d0a14;
  --text:#ece6f5; --sub:#a094b8; --faint:#6c6085;
  --bub-me:#5a2d91; --bub-o:#1f1730; --bub-o-t:#ece6f5; --sel:#2a1d47;
}
:root[data-theme="dark"][data-accent="white"]{
  --accent:#f0e6dc; --accent-h:#fff; --accent-soft:#2b231c; --on-accent:#1a120b; --hl:#ff8a3d; --on-hl:#1c0f05;
  --bg:#14110f; --side:#17130f; --surface:#211b16; --surface-2:#2d251e; --chat:#0f0c0a;
  --text:#f1e9e0; --sub:#a89a8c; --faint:#6f6358;
  --bub-me:#4d3d31; --bub-o:#201a15; --bub-o-t:#f1e9e0; --sel:#2b231c;
}
/* ---------- 皮肤 · 纯白简洁 ---------- */
:root[data-skin="clean"][data-skin]{
  --accent:#1c1c1e; --accent-h:#000; --accent-soft:#ebebeb; --on-accent:#fff;
  --hl:#1c1c1e; --on-hl:#fff;
  --bg:#fff; --side:#fff; --surface:#f9f9f9; --surface-2:#f2f2f7; --chat:#f2f2f7;
  --line:rgba(0,0,0,.07); --line-strong:rgba(0,0,0,.12);
  --text:#1c1c1e; --sub:#636366; --faint:#aeaeb2;
  --bub-me:#1c1c1e; --bub-me-t:#fff; --bub-o:#e9e9eb; --bub-o-t:#1c1c1e; --bub-shadow:none;
  --red:#ff3b30; --green:#34c759; --amber:#ff9500;
  --sel:#ebebeb; --hover:rgba(0,0,0,.03);
  --shadow-pop:0 0 0 1px rgba(0,0,0,.08),0 8px 24px rgba(0,0,0,.08); --shadow-sm:none;
  --mask:rgba(0,0,0,.4);
  color-scheme:only light;
}
/* ---------- 皮肤 · 玻璃态 ---------- */
:root[data-skin="glass"][data-skin]{
  background:linear-gradient(150deg,#09080f 0%,#0f0c1e 45%,#0c0a14 100%) fixed;
  --accent:rgba(255,255,255,.92); --accent-h:#fff; --accent-soft:rgba(255,255,255,.12); --on-accent:#2a0a60;
  --hl:#ff9f5e; --on-hl:#fff;
  --bg:rgba(255,255,255,.07); --side:rgba(255,255,255,.10); --surface:rgba(255,255,255,.14);
  --surface-2:rgba(255,255,255,.20); --chat:rgba(0,0,0,.08);
  --line:rgba(255,255,255,.11); --line-strong:rgba(255,255,255,.20);
  --text:rgba(255,255,255,.95); --sub:rgba(255,255,255,.65); --faint:rgba(255,255,255,.40);
  --bub-me:rgba(120,60,220,.55); --bub-me-t:#fff; --bub-o:rgba(255,255,255,.13); --bub-o-t:rgba(255,255,255,.95); --bub-shadow:0 2px 8px rgba(0,0,0,.22);
  --red:#ff6b72; --green:#46c27a; --amber:#f0b54a;
  --sel:rgba(255,255,255,.14); --hover:rgba(255,255,255,.07);
  --shadow-pop:0 8px 40px rgba(0,0,0,.5),0 0 0 1px rgba(255,255,255,.10); --shadow-sm:0 1px 4px rgba(0,0,0,.20);
  --mask:rgba(0,0,20,.65);
  color-scheme:dark;
}
:root[data-skin="glass"][data-skin] body{background:transparent}
:root[data-skin="glass"][data-skin] .side,
:root[data-skin="glass"][data-skin] .chat-head,
:root[data-skin="glass"][data-skin] .composer,
:root[data-skin="glass"][data-skin] .modal-wrap,
:root[data-skin="glass"][data-skin] .drawer,
:root[data-skin="glass"][data-skin] .pop,
:root[data-skin="glass"][data-skin] .sticker-pop,
:root[data-skin="glass"][data-skin] .auth-card,
:root[data-skin="glass"][data-skin] .auth-aside{
  backdrop-filter:blur(24px) saturate(160%);
  -webkit-backdrop-filter:blur(24px) saturate(160%);
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font:14px/1.5 var(--font);background:var(--bg);color:var(--text);overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
button{font:inherit;cursor:pointer;color:inherit;background:none;border:none}
input,textarea,select{font:inherit;color:inherit}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
input:focus-visible,textarea:focus-visible{outline:none}
svg.i{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
time,.time,.tnum{font-variant-numeric:tabular-nums}
::selection{background:var(--accent-soft)}
*{scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}
::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:var(--line-strong);border-radius:8px;border:2px solid transparent;background-clip:content-box}

/* ---------- 登录 ---------- */
.auth{height:100dvh;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);background:var(--bg)}
.auth-aside{background:var(--surface);border-right:1px solid var(--line);padding:56px;display:flex;flex-direction:column;justify-content:space-between}
.auth-aside .mark{display:flex;align-items:center;gap:12px;font-family:var(--serif);font-weight:700;font-size:20px;letter-spacing:.12em}
.auth-aside .mark img{width:36px;height:36px}
.auth-aside h2{font-family:var(--serif);font-size:32px;line-height:1.35;font-weight:700;letter-spacing:.02em;max-width:15em}
.auth-aside ul{list-style:none;margin-top:22px;display:grid;gap:12px;color:var(--sub)}
.auth-aside li{display:flex;gap:10px;align-items:center}
.auth-aside li::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--hl);flex:none}
.auth-aside small{color:var(--faint)}
.auth-main{display:flex;align-items:center;justify-content:center;padding:24px}
.auth-card{width:min(360px,100%)}
.auth-logo{display:none;align-items:center;gap:10px;margin-bottom:26px;font-weight:600;font-size:20px}
.auth-logo img{width:34px;height:34px}
.auth-card h1{font-family:var(--serif);font-size:26px;font-weight:700;letter-spacing:.02em;margin-bottom:4px}
.auth-card .lead{color:var(--sub);margin-bottom:22px}
.auth-tabs{display:flex;gap:22px;border-bottom:1px solid var(--line);margin-bottom:20px}
.auth-tabs button{padding:0 0 10px;color:var(--sub);font-weight:500;position:relative}
.auth-tabs button.on{color:var(--text)}
.auth-tabs button.on::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--accent);border-radius:2px}
.field{margin-bottom:14px}
.field label{display:block;font-size:12.5px;color:var(--sub);margin-bottom:6px;font-weight:500}
.field input,.field textarea,.field select{width:100%;border:1px solid var(--line-strong);background:var(--bg);border-radius:var(--r);padding:11px 13px;outline:none;font-size:15px;transition:border-color .15s,box-shadow .15s}
.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 18px;border-radius:var(--r);font-weight:500;background:var(--accent);color:var(--on-accent);min-height:38px;transition:background .15s,transform .05s}
.btn:hover{background:var(--accent-h)}
.btn:active{transform:translateY(.5px)}
.btn:disabled{opacity:.45;cursor:default}
.btn.ghost{background:var(--surface);color:var(--text)}
.btn.ghost:hover{background:var(--surface-2)}
.btn.danger{background:var(--red);color:#fff}
.btn.sm{padding:5px 12px;min-height:30px;font-size:13px;border-radius:var(--r-sm)}
.btn.block{width:100%;padding:12px;font-size:15px}
.err{color:var(--red);font-size:13px;min-height:20px;margin:-4px 0 8px}
.tip{color:var(--sub);font-size:12.5px}
.uin-reveal{border:1px solid var(--line);background:var(--surface);border-radius:var(--r-lg);padding:20px;text-align:center;margin:6px 0 18px}
.uin-reveal b{display:block;font-family:var(--serif);font-size:36px;font-weight:700;letter-spacing:.08em;margin:6px 0;font-variant-numeric:tabular-nums;color:var(--accent)}

/* ---------- 主布局 ---------- */
.layout{display:flex;height:100dvh;background:var(--bg)}
.side{width:clamp(280px,38vw,350px);flex:none;border-right:1px solid var(--line);display:flex;flex-direction:column;background:var(--side);min-width:0}
.main{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--chat);position:relative}
.side-top{display:flex;align-items:center;gap:8px;padding:12px 12px 8px}
.me-btn{width:36px;height:36px;border-radius:50%;flex:none;padding:0;position:relative}
.me-btn .av{width:36px;height:36px}
.icon-btn{width:36px;height:36px;border-radius:var(--r-sm);display:inline-flex;align-items:center;justify-content:center;color:var(--sub);position:relative;flex:none;transition:background .12s,color .12s}
.icon-btn:hover{background:var(--surface);color:var(--text)}
.icon-btn:disabled{opacity:.4;cursor:default}
.search{flex:1;display:flex;align-items:center;gap:7px;background:var(--surface);border-radius:var(--r);padding:0 11px;height:36px;color:var(--faint);min-width:0;transition:box-shadow .15s,background .15s}
.search:focus-within{background:var(--bg);box-shadow:0 0 0 1.5px var(--accent)}
.search input{flex:1;border:none;background:none;outline:none;min-width:0;font-size:14px;color:var(--text)}
.search input::placeholder{color:var(--faint)}
.search input::-webkit-search-cancel-button{display:none}
.tabs{display:flex;padding:0 6px;border-bottom:1px solid var(--line)}
.tab{flex:1;padding:9px 0 9px;display:flex;align-items:center;justify-content:center;gap:6px;font-size:13.5px;color:var(--sub);position:relative;font-weight:500;transition:color .12s}
.tab svg.i{width:18px;height:18px}
.tab:hover{color:var(--text)}
.tab.on{color:var(--accent)}
.tab.on::after{content:"";position:absolute;left:18%;right:18%;bottom:-1px;height:2px;border-radius:2px;background:var(--accent)}
.badge{min-width:18px;height:18px;border-radius:9px;background:var(--hl);color:var(--on-hl);font-size:11px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;padding:0 5px;font-variant-numeric:tabular-nums;line-height:1}
.tab .badge{position:static;margin-left:0}
.side-body{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:6px 0 10px}
.list-head{display:flex;align-items:center;justify-content:space-between;padding:12px 16px 4px;color:var(--faint);font-size:12px;font-weight:500;letter-spacing:.02em}
.row{display:flex;align-items:center;gap:12px;padding:9px 12px;margin:1px 8px;border-radius:var(--r);cursor:pointer;position:relative;transition:background .1s}
.row:hover{background:var(--hover)}
.row.on{background:var(--sel)}
.row .meta{flex:1;min-width:0}
.row .t1{display:flex;align-items:baseline;gap:6px}
.row .name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:15px}
.row .time{font-size:11.5px;color:var(--faint);flex:none}
.row .t2{display:flex;align-items:center;gap:6px;color:var(--sub);font-size:13px;margin-top:1px;min-height:20px}
.row .snip{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row .snip em{font-style:normal;color:var(--hl);font-weight:600}
.empty{padding:56px 28px;text-align:center;color:var(--sub);font-size:13.5px;line-height:1.7}
.empty .ill{width:56px;height:56px;border-radius:18px;background:var(--surface);color:var(--faint);display:inline-flex;align-items:center;justify-content:center;margin-bottom:14px}
.empty .ill svg.i{width:26px;height:26px;stroke-width:1.4}
.empty b{display:block;font-size:15px;font-weight:600;color:var(--text);margin-bottom:4px}

/* 头像 */
.av{width:46px;height:46px;border-radius:50%;flex:none;position:relative;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-weight:600;font-size:17px;user-select:none;background:var(--surface-2)}
.av svg.idt{width:100%;height:100%;border-radius:50%;display:block}
.av img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block}
.av.sm{width:34px;height:34px;font-size:13px}
.av.xs{width:24px;height:24px;font-size:11px}
.av.lg{width:80px;height:80px;font-size:30px}
.av .dot{position:absolute;right:-1px;bottom:-1px;width:12px;height:12px;border-radius:50%;border:2.5px solid var(--side);background:var(--faint);box-sizing:content-box;margin:-1px -1px 0 0}
.av .dot.online{background:var(--green)}.av .dot.busy{background:var(--red)}
.av.g,.av.g img{border-radius:14px}
.av.g{letter-spacing:.02em}
.av.sm.g,.av.xs.g{border-radius:10px}

/* 好友分组 */
.fgroup-h{display:flex;align-items:center;gap:6px;padding:10px 18px 6px;cursor:pointer;color:var(--sub);font-size:12.5px;font-weight:500;user-select:none}
.fgroup-h:hover{color:var(--text)}
.fgroup-h .arrow{transition:transform .15s;display:inline-block;width:12px;font-size:15px;line-height:1;color:var(--faint)}
.fgroup-h.open .arrow{transform:rotate(90deg)}
.fgroup-h .cnt{margin-left:auto;font-size:12px;color:var(--faint);font-variant-numeric:tabular-nums}
.sig{font-size:12.5px;color:var(--sub);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row.friend{padding:7px 12px}
.row.friend .av{width:38px;height:38px;font-size:15px}
.row.friend.off .av{opacity:.55}
.newfriend{display:flex;align-items:center;gap:12px;padding:9px 12px;margin:2px 8px 4px;border-radius:var(--r);cursor:pointer}
.newfriend:hover{background:var(--hover)}
.newfriend .ic{width:38px;height:38px;border-radius:12px;background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center}

/* ---------- 聊天区 ---------- */
.chat-head{display:flex;align-items:center;gap:12px;padding:0 14px;background:var(--bg);border-bottom:1px solid var(--line);min-height:58px}
.chat-head .back{display:none}
.chat-head .who{flex:1;min-width:0;line-height:1.3}
.chat-head .who b{font-size:15.5px;font-weight:600;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-head .who>span{font-size:12.5px;color:var(--sub);display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-head .who>span.live{color:var(--accent)}
.notice-bar{background:var(--bg);border-bottom:1px solid var(--line);color:var(--sub);padding:7px 16px;font-size:12.5px;display:flex;gap:8px;align-items:center;cursor:pointer}
.notice-bar svg.i{width:15px;height:15px;color:var(--accent)}
.notice-bar span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.msgs{flex:1;overflow-y:auto;padding:14px 18px 8px;overscroll-behavior:contain}
.msgs .more{text-align:center;padding:8px;color:var(--accent);font-size:12.5px;cursor:pointer}
.tsep{text-align:center;margin:16px 0 10px}
.tsep span{font-size:12px;color:var(--faint);font-variant-numeric:tabular-nums}
.sys{text-align:center;margin:10px 0}
.sys span{font-size:12px;color:var(--faint);display:inline-block;max-width:84%}
.msg{display:flex;gap:8px;margin-top:2px;align-items:flex-end}
.msg.first{margin-top:10px}
.msg.me{flex-direction:row-reverse}
.msg .av-slot{width:34px;flex:none}
.msg.me .av-slot{display:none}
.msg .body{max-width:min(70%,560px);min-width:0;display:flex;flex-direction:column;align-items:flex-start}
.msg.me .body{align-items:flex-end}
.msg .nick{font-size:12px;color:var(--sub);margin:0 2px 3px;font-weight:500}
.bubble{background:var(--bub-o);color:var(--bub-o-t);border-radius:16px 16px 16px 5px;padding:7px 12px 6px;word-break:break-word;white-space:pre-wrap;box-shadow:var(--bub-shadow);position:relative;line-height:1.5;font-size:15px}
.msg.me .bubble{background:var(--bub-me);color:var(--bub-me-t);border-radius:16px 16px 5px 16px}
.msg:not(.first) .bubble{border-top-left-radius:6px}
.msg.me:not(.first) .bubble{border-top-left-radius:16px;border-top-right-radius:6px}
.msg:not(.last) .bubble{border-bottom-left-radius:6px}
.msg.me:not(.last) .bubble{border-bottom-left-radius:16px;border-bottom-right-radius:6px}
.bubble a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.bubble .at{color:var(--accent);font-weight:600}
.msg.me .bubble .at{color:#fff;text-decoration:underline;text-underline-offset:2px}
.bubble .txt{white-space:pre-wrap}
.bubble.media{padding:0;background:transparent;box-shadow:none;overflow:hidden;border-radius:14px;line-height:0}
.bubble.media img,.bubble.media video{max-width:min(320px,100%);max-height:360px;display:block;cursor:zoom-in;background:var(--surface-2);border-radius:14px}
.bubble.media .meta-line{position:absolute;right:6px;bottom:6px;background:rgba(0,0,0,.5);color:#fff;border-radius:9px;padding:1px 7px;line-height:1.5}
.bubble.media .meta-line .read{color:#fff}
.bubble.media .img-caption{margin:0;padding:8px 12px 4px;font-size:13.5px;line-height:1.5;white-space:pre-wrap;word-break:break-word;color:var(--main);background:var(--surface-2);border-radius:0 0 14px 14px}
.bubble.media:has(.img-caption){background:var(--surface-2)}
.bubble.media:has(.img-caption) img{border-radius:14px 14px 0 0}
.bubble.media:has(.img-caption) .meta-line{position:static;float:right;margin:0 12px 6px 0;background:none;color:var(--faint);padding:0}
.msg.me .bubble.media:has(.img-caption){background:var(--accent)}
.msg.me .bubble.media .img-caption{background:transparent;color:#fff}
.bubble.file{display:flex;gap:11px;align-items:center;min-width:220px;cursor:pointer;text-decoration:none;padding:10px 12px}
.bubble.file .fic{width:40px;height:40px;border-radius:11px;background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;flex:none}
.msg.me .bubble.file .fic{background:rgba(255,255,255,.2);color:#fff}
.bubble.file b{display:block;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:210px;font-size:14.5px}
.bubble.file small{opacity:.7;font-size:12px}
.quote{border-left:2.5px solid var(--accent);background:var(--accent-soft);border-radius:4px 8px 8px 4px;padding:3px 9px;margin:1px 0 5px;font-size:12.5px;cursor:pointer;color:var(--sub);line-height:1.45}
.msg.me .quote{border-left-color:rgba(255,255,255,.85);background:rgba(255,255,255,.16);color:rgba(255,255,255,.9)}
.quote b{display:block;font-weight:600;color:var(--accent)}
.msg.me .quote b{color:#fff}
.meta-line{display:inline-flex;gap:5px;align-items:center;font-size:11px;color:var(--faint);float:right;margin:5px 0 -2px 10px;line-height:1.2;font-variant-numeric:tabular-nums;user-select:none}
.msg.me .meta-line{color:rgba(255,255,255,.72)}
.meta-line .read{color:rgba(255,255,255,.95)}
.meta-line .fail{color:#ffd0d2;cursor:pointer;font-weight:500}
.bubble.media .meta-line{float:none;margin:0}
.recalled{text-align:center;margin:10px 0;font-size:12px;color:var(--faint)}
.typing{height:0}
.reply-bar{display:flex;align-items:center;gap:8px;padding:7px 14px 7px 16px;background:var(--bg);border-top:1px solid var(--line);font-size:12.5px;color:var(--sub);position:relative}
.reply-bar::before{content:"";position:absolute;left:12px;top:8px;bottom:8px;width:2.5px;border-radius:2px;background:var(--accent)}
.reply-bar span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:6px}
.reply-bar b{color:var(--accent);font-weight:600}

/* 输入区：附件 / 表情 / 输入框 / 发送 在同一行 */
.composer{background:var(--bg);border-top:1px solid var(--line);padding:10px 12px calc(10px + env(safe-area-inset-bottom));position:relative}
.composer .row-in{display:flex;align-items:flex-end;gap:6px}
.composer .field-wrap{flex:1;min-width:0;background:var(--surface);border-radius:20px;padding:0 14px;display:flex;align-items:center;transition:box-shadow .15s,background .15s}
.composer .field-wrap:focus-within{background:var(--bg);box-shadow:0 0 0 1.5px var(--accent)}
.composer textarea{width:100%;border:none;outline:none;resize:none;background:transparent;max-height:140px;min-height:38px;line-height:1.5;padding:8px 0;font-size:15px}
.composer textarea::placeholder{color:var(--faint)}
.send-btn{width:38px;height:38px;border-radius:50%;background:var(--hl);color:var(--on-hl);display:inline-flex;align-items:center;justify-content:center;flex:none;transition:background .15s,opacity .15s,transform .1s}
.send-btn:hover{filter:brightness(.95)}
.send-btn:disabled{background:var(--surface-2);color:var(--faint);cursor:default}
.composer.has-text #voice-btn{display:none}
.send-btn svg.i{width:18px;height:18px;stroke-width:2}
.composer .muted-note{padding:11px;text-align:center;color:var(--sub);background:var(--surface);border-radius:var(--r);font-size:13px}
.progress{height:2px;margin:-10px -12px 8px;background:transparent}.progress i{display:block;height:100%;background:var(--accent);width:0;transition:width .2s}
.pop{position:absolute;background:var(--bg);border-radius:var(--r-lg);box-shadow:var(--shadow-pop);z-index:30;animation:pin .14s ease}
@keyframes pin{from{opacity:0;transform:translateY(4px) scale(.98)}}
.attach-pop{left:10px;bottom:100%;margin-bottom:8px;padding:6px;min-width:180px}
.attach-pop button{display:flex;align-items:center;gap:12px;width:100%;padding:10px 12px;border-radius:var(--r-sm);font-size:14px;color:var(--text)}
.attach-pop button:hover{background:var(--surface)}
.attach-pop button svg.i{color:var(--accent);width:20px;height:20px}
.emoji-panel{right:10px;bottom:100%;margin-bottom:8px;width:min(360px,calc(100vw - 24px));height:340px;display:flex;flex-direction:column;overflow:hidden}
.ep-tabs{display:flex;border-bottom:1px solid var(--line);flex-shrink:0}
.ep-tab{flex:1;padding:9px;font-size:13px;font-weight:500;color:var(--sub);border-radius:0;transition:color .12s}
.ep-tab.active{color:var(--accent);box-shadow:inset 0 -2px 0 var(--accent)}
.ep-pane{flex:1;overflow-y:auto;display:flex;flex-direction:column}
.ep-pane[hidden]{display:none}
.emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:1px;padding:8px}
.emoji-grid button{font-size:22px;padding:5px 0;border-radius:var(--r-sm);line-height:1.25}
.emoji-grid button:hover{background:var(--surface)}
.at-pop{left:12px;bottom:100%;margin-bottom:8px;min-width:220px;max-height:240px;overflow-y:auto;padding:5px}
.at-pop .row{margin:0;padding:6px 10px}
.at-pop .row .name{font-size:14px}
.placeholder{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--faint);gap:14px;font-size:13.5px}
.placeholder .ill{width:68px;height:68px;border-radius:22px;background:var(--bg);color:var(--faint);display:flex;align-items:center;justify-content:center;box-shadow:var(--shadow-sm)}
.placeholder .ill svg.i{width:30px;height:30px;stroke-width:1.3}
.ctx{position:fixed;z-index:80;background:var(--bg);border-radius:var(--r);box-shadow:var(--shadow-pop);padding:5px;min-width:140px;animation:pin .12s ease}
.ctx button{display:block;width:100%;text-align:left;padding:8px 12px;border-radius:var(--r-sm);font-size:14px}
.ctx button:hover{background:var(--surface)}
.ctx button.danger{color:var(--red)}

/* ---------- 弹窗 / 抽屉 ---------- */
.mask{position:fixed;inset:0;background:var(--mask);z-index:60;display:flex;align-items:center;justify-content:center;padding:16px;animation:fin .15s ease;backdrop-filter:blur(2px)}
@keyframes fin{from{opacity:0}}
.modal{background:var(--bg);border-radius:var(--r-lg);box-shadow:var(--shadow-pop);width:min(420px,100%);max-height:min(86dvh,720px);display:flex;flex-direction:column;overflow:hidden;animation:pin .18s ease}
.modal.wide{width:min(540px,100%)}
.modal-h{display:flex;align-items:center;padding:16px 16px 8px 20px}
.modal-h b{flex:1;font-size:17px;font-weight:600}
.modal-b{padding:6px 20px 18px;overflow-y:auto;flex:1}
.modal-f{display:flex;gap:10px;justify-content:flex-end;padding:12px 20px 16px;border-top:1px solid var(--line)}
.seg{display:flex;background:var(--surface);border-radius:var(--r);padding:3px;margin-bottom:12px}
.seg button{flex:1;padding:7px 0;border-radius:9px;color:var(--sub);font-weight:500;transition:background .12s}
.seg button.on{background:var(--bg);color:var(--text);box-shadow:var(--shadow-sm)}
.drawer-mask{position:fixed;inset:0;background:var(--mask);z-index:60;animation:fin .15s ease}
.drawer{position:fixed;top:0;bottom:0;width:min(330px,88vw);background:var(--bg);z-index:61;box-shadow:var(--shadow-pop);overflow-y:auto;display:flex;flex-direction:column}
.drawer.left{left:0;animation:dl .2s ease}.drawer.right{right:0;width:min(370px,94vw);animation:dr .2s ease}
@keyframes dl{from{transform:translateX(-24px);opacity:0}}@keyframes dr{from{transform:translateX(24px);opacity:0}}
.me-card{padding:26px 20px 16px;display:flex;flex-direction:column;gap:3px;border-bottom:1px solid var(--line)}
.me-card .av{width:64px;height:64px;font-size:24px;margin-bottom:8px}
.me-card b{font-size:18px;font-weight:600}.me-card span{color:var(--sub);font-size:13px}
.me-card .chips{display:flex;gap:6px;margin-top:10px}
.chip{padding:4px 11px;border-radius:14px;background:var(--surface);color:var(--sub);font-size:12.5px;font-weight:500;display:inline-flex;gap:6px;align-items:center}
.chip i{width:7px;height:7px;border-radius:50%;background:var(--faint)}
.chip.on{background:var(--accent-soft);color:var(--accent)}
.chip.on.online i{background:var(--green)}.chip.on.busy i{background:var(--red)}
.menu-item{display:flex;align-items:center;gap:14px;padding:12px 20px;cursor:pointer;width:100%;text-align:left;font-size:14.5px}
.menu-item:hover{background:var(--hover)}
.menu-item .i{color:var(--sub);display:flex}
.menu-item .tog{margin-left:auto}
.switch{width:40px;height:24px;border-radius:12px;background:var(--surface-2);position:relative;transition:background .15s;flex:none}
.switch::after{content:"";position:absolute;left:2px;top:2px;width:20px;height:20px;border-radius:50%;background:#fff;transition:left .15s;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.switch.on{background:var(--accent)}.switch.on::after{left:18px}
.user-card{text-align:center;padding:8px 0 6px}
.user-card .av{margin:4px auto 10px}
.user-card h3{font-size:19px;font-weight:600}
.user-card p{color:var(--sub);margin-top:2px;font-size:13.5px}
.kv{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line);gap:14px;align-items:center}
.kv span:first-child{color:var(--sub);flex:none}
.pick-list{max-height:260px;overflow-y:auto;border:1px solid var(--line);border-radius:var(--r);padding:4px}
.pick-list .row{margin:0;padding:7px 10px}
.pick-list input[type=checkbox]{width:18px;height:18px;accent-color:var(--accent)}
.member{display:flex;align-items:center;gap:12px;padding:8px 0}
.member .nm{flex:1;min-width:0;line-height:1.4}
.tag{font-size:11.5px;padding:1px 8px;border-radius:10px;background:var(--accent-soft);color:var(--accent);font-weight:500;display:inline-block}
.tag.owner{background:rgba(217,147,13,.14);color:var(--amber)}
.tag.bad{background:rgba(229,72,77,.12);color:var(--red)}
.lightbox{position:fixed;inset:0;background:rgba(6,8,12,.92);z-index:90;display:flex;align-items:center;justify-content:center;padding:20px;animation:fin .15s ease}
.lightbox img,.lightbox video{max-width:100%;max-height:100%;border-radius:8px}
#toasts{position:fixed;top:14px;left:50%;transform:translateX(-50%);z-index:100;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;width:max-content;max-width:92vw}
.toast{background:var(--text);color:var(--bg);border-radius:12px;padding:10px 16px;font-size:13.5px;font-weight:500;box-shadow:var(--shadow-pop);animation:pin .18s ease}
.toast.bad{background:var(--red);color:#fff}
.conn-bar{background:var(--amber);color:#fff;text-align:center;font-size:12.5px;padding:5px;font-weight:500}
.drop-hint{position:absolute;inset:8px;border:2px dashed var(--accent);border-radius:var(--r-lg);background:color-mix(in srgb,var(--accent) 8%,transparent);z-index:20;display:flex;align-items:center;justify-content:center;font-size:16px;color:var(--accent);font-weight:500;pointer-events:none}

/* ---------- 语音消息 ---------- */
.bubble.audio{display:flex;align-items:center;gap:10px;padding:8px 14px 8px 10px;min-width:180px;cursor:default;white-space:normal}
.audio-play{width:36px;height:36px;border-radius:50%;background:var(--accent);color:var(--on-accent);display:inline-flex;align-items:center;justify-content:center;flex:none;transition:background .12s}
.audio-play:hover{background:var(--accent-h)}
.audio-play svg.i{width:16px;height:16px;stroke-width:2}
.msg.me .audio-play{background:rgba(255,255,255,.22);color:#fff}
.msg.me .audio-play:hover{background:rgba(255,255,255,.32)}
.audio-wave{flex:1;display:flex;align-items:center;gap:2px;height:24px;min-width:60px}
.audio-wave span{display:inline-block;width:3px;border-radius:2px;background:var(--accent);opacity:.6;flex:none}
.msg.me .audio-wave span{background:#fff}
.audio-dur{font-size:12px;color:var(--sub);flex:none;font-variant-numeric:tabular-nums}
.msg.me .audio-dur{color:rgba(255,255,255,.75)}

/* 录音 UI */
.rec-ui{display:flex;align-items:center;gap:10px;padding:8px 6px}
.rec-dot{width:10px;height:10px;border-radius:50%;background:var(--red);flex:none;animation:rec-pulse 1s ease-in-out infinite}
@keyframes rec-pulse{0%,100%{opacity:1}50%{opacity:.35}}
.rec-time{font-size:14px;font-variant-numeric:tabular-nums;font-weight:500;color:var(--text);min-width:36px}
.rec-wave{flex:1;display:flex;align-items:center;gap:2px;height:28px;overflow:hidden}
.rec-wave span{display:inline-block;width:3px;border-radius:2px;background:var(--accent);flex:none}
.rec-send-btn{width:38px;height:38px;border-radius:50%;background:var(--hl);color:var(--on-hl);display:inline-flex;align-items:center;justify-content:center;flex:none;transition:background .12s}
.rec-send-btn:hover{filter:brightness(.95)}
.rec-send-btn svg.i{width:16px;height:16px;stroke-width:2;fill:currentColor;stroke:none}

/* ---------- 贴图/GIF ---------- */
/* ---------- 相机短视频面板 ---------- */
.cam-panel{position:absolute;bottom:100%;left:0;right:0;background:var(--surface);border-top:1px solid var(--line);display:flex;flex-direction:column;max-height:420px;overflow:hidden}
.cam-preview{width:100%;max-height:340px;object-fit:cover;background:#000;display:block}
.cam-bar{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;gap:10px;background:var(--surface)}
.cam-rec-btn{width:52px;height:52px;border-radius:50%;background:var(--red);border:none;cursor:pointer;position:relative;flex:none;transition:transform .12s}
.cam-rec-btn::after{content:"";position:absolute;inset:50%;transform:translate(-50%,-50%);width:20px;height:20px;border-radius:50%;background:#fff;transition:border-radius .2s,width .2s,height .2s}
.cam-rec-btn.recording::after{width:16px;height:16px;border-radius:3px}
.cam-rec-btn:active{transform:scale(.92)}
.cam-timer{font-size:14px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--red);min-width:3ch;text-align:center}
.cam-cancel,.cam-send{color:var(--sub)}
.cam-send{color:var(--accent)}
.bubble.sticker{background:transparent;padding:4px;box-shadow:none;border-radius:0}
.bubble.sticker .sticker-img{max-width:160px;max-height:160px;border-radius:8px;display:block}
.gif-pane,.local-pane{display:flex;flex-direction:column;flex:1;overflow:hidden}
.gif-search-row{display:flex;gap:6px;padding:8px 10px;flex-shrink:0}
.gif-search-inp{flex:1;height:34px;padding:0 10px;border-radius:8px;border:1px solid var(--line);background:var(--bg);color:var(--text);font-size:13px}
.gif-search-inp:focus{border-color:var(--accent);outline:none}
.gif-grid{flex:1;overflow-y:auto;padding:4px 8px 8px}
.gif-loading{padding:20px;text-align:center;color:var(--sub);font-size:13px}
.sticker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:4px}
.sticker-item{padding:4px;border-radius:8px;aspect-ratio:1;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:background .1s}
.sticker-item:hover{background:var(--line)}
.sticker-item img{max-width:100%;max-height:100%;object-fit:contain;border-radius:6px}
.local-toolbar{display:flex;align-items:center;gap:8px;padding:8px 10px;flex-shrink:0;border-bottom:1px solid var(--line)}
.local-hint{font-size:12px;color:var(--sub)}
.local-grid{flex:1;overflow-y:auto;padding:8px}

/* ---------- mob-back (返回按钮，桌面隐藏) ---------- */
.mob-back{display:none;align-items:center;gap:8px;padding:12px 16px;color:var(--accent);font-weight:500;font-size:14.5px;cursor:pointer;border-bottom:1px solid var(--line)}
.mob-back svg.i{width:18px;height:18px}

/* ---------- 窄屏（手机）：Telegram 风格，无底部页签 ---------- */
@media (max-width:600px){
  .auth{grid-template-columns:1fr}
  .auth-aside{display:none}
  .auth-logo{display:flex}
  .side{width:100%;border-right:none}
  .tabs{display:none}
  .side-body{padding-bottom:calc(10px + env(safe-area-inset-bottom))}
  .main{position:fixed;inset:0;z-index:20;transform:translateX(100%);transition:transform .22s ease}
  .layout[data-pane="chat"] .main{transform:none}
  .chat-head .back{display:inline-flex}
  .icon-btn,.me-btn{width:44px;height:44px}
  .me-btn .av{width:36px;height:36px}
  .msg .body{max-width:85%}
  .composer textarea,.field input,.field textarea,.field select,.search input{font-size:16px}
  .row{padding:12px 14px;min-height:48px}
  .mob-back{display:flex}
  /* 右键菜单 → 底部 action sheet */
  .ctx{left:8px!important;right:8px!important;bottom:calc(12px + env(safe-area-inset-bottom))!important;top:auto!important;border-radius:14px;min-width:auto;animation:ctx-up .18s ease}
  .ctx button{padding:14px 16px;font-size:15px;min-height:48px;text-align:center}
  @keyframes ctx-up{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* 会员标记与动态头像 */
.vip-tag{display:inline-block;font-size:10px;font-weight:700;letter-spacing:.08em;line-height:1;padding:3px 6px;border-radius:6px;background:var(--hl);color:var(--on-hl);vertical-align:2px;margin-left:6px}
.av video.av-vid{width:100%;height:100%;border-radius:inherit;object-fit:cover;display:block;background:var(--surface-2)}
.av.vip::after{content:"";position:absolute;inset:-3px;border-radius:inherit;border:1.5px solid var(--accent);opacity:.55;pointer-events:none}
.acct-sep{height:1px;background:var(--line);margin:4px 20px}
.acct-row{gap:10px}
.acct-info{display:flex;flex-direction:column;gap:1px;flex:1;min-width:0}
.acct-info>span:first-child{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acct-info>.tnum{font-size:11px;color:var(--sub)}
.swatches{display:flex;align-items:center;gap:14px;padding:12px 20px}
.swatches>span{color:var(--sub);font-size:14.5px;flex:1}
.sw{width:28px;height:28px;border-radius:50%;position:relative;box-shadow:inset 0 0 0 1px var(--line-strong)}
.sw.on::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:2px solid var(--text)}
.sw[data-a=blue]{background:linear-gradient(135deg,#12306b 50%,#f7d52d 50%)}.sw[data-a=purple]{background:linear-gradient(135deg,#5a2d91 50%,#e8458b 50%)}.sw[data-a=white]{background:linear-gradient(135deg,#f6f2ec 50%,#ea6a1a 50%)}
.skin-row{gap:8px}
.skin-btn{padding:5px 12px;border-radius:14px;font-size:13px;font-weight:500;color:var(--sub);background:var(--surface);border:1px solid var(--line);transition:color .12s,background .12s,border-color .12s}
.skin-btn.on{color:var(--text);background:var(--accent-soft);border-color:var(--accent)}
.av-edit{display:flex;gap:16px;align-items:center;margin-bottom:6px}
.av-edit .btns{display:flex;flex-direction:column;gap:8px;align-items:flex-start}
.lockbtn[disabled]{opacity:.55}

/* ---------- 通话覆盖层 ---------- */
.call-overlay{position:fixed;inset:0;z-index:900;display:flex;align-items:center;justify-content:center;background:var(--mask);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.call-box{background:var(--surface);border-radius:20px;padding:32px 28px;min-width:240px;display:flex;flex-direction:column;align-items:center;gap:16px;box-shadow:var(--shadow-pop)}
.call-avatar{width:64px;height:64px;border-radius:50%;background:var(--accent-soft);display:flex;align-items:center;justify-content:center}
.call-avatar svg.i{width:28px;height:28px;stroke:var(--accent);stroke-width:2}
.call-avatar.active{animation:call-pulse 1.4s ease-in-out infinite}
@keyframes call-pulse{0%,100%{box-shadow:0 0 0 0 var(--accent-soft)}50%{box-shadow:0 0 0 12px transparent}}
.call-name{font-weight:600;font-size:18px;color:var(--text)}
.call-status{font-size:13px;color:var(--sub)}
.call-timer{font-size:22px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--text);letter-spacing:.05em}
.call-actions{display:flex;gap:20px;align-items:center;margin-top:8px}
.call-btn-end,.call-btn-reject{width:52px;height:52px;border-radius:50%;background:var(--red);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:opacity .12s}
.call-btn-end:hover,.call-btn-reject:hover{opacity:.85}
.call-btn-end svg.i,.call-btn-reject svg.i{stroke:#fff;width:22px;height:22px}
.call-btn-accept{width:52px;height:52px;border-radius:50%;background:var(--green);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:opacity .12s}
.call-btn-accept:hover{opacity:.85}
.call-btn-accept svg.i{stroke:#fff;width:22px;height:22px}
.call-btn-mute{width:46px;height:46px;border-radius:50%;background:var(--surface-2);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .12s}
.call-btn-mute.muted{background:var(--amber)}
.call-btn-mute svg.i{width:20px;height:20px}
.call-btn{background:none;border:none;cursor:pointer;padding:4px;display:inline-flex}

/* ============ Telegram 1:1（2026-11-03，Victor 批） ============ */
/* 设计 tokens：顶栏 #527DA3 · 未读 #4CAF50 · 静音 #B0BEC5 · FAB #55A9E3 · 己方气泡 #EEFFDE · 壁纸 #D9E4EC */
:root{
  --tg:#527DA3; --tg-d:#426B8F; --tg-green:#4CAF50; --tg-mute:#B0BEC5; --tg-fab:#55A9E3;
  --tg-out:#EEFFDE; --tg-in:#fff; --tg-time:#8A9CA8; --tg-check:#5BADE0; --tg-wall:#D9E4EC;
  --accent:#527DA3; --accent-h:#426B8F; --accent-soft:#E4EDF3; --on-accent:#fff;
  --hl:#4CAF50; --on-hl:#fff;
  --bg:#fff; --side:#fff; --surface:#F4F4F5; --surface-2:#EDEDEF; --chat:var(--tg-wall);
  --line:rgba(0,0,0,.08); --line-strong:rgba(0,0,0,.14);
  --text:#212121; --sub:#8A8A8A; --faint:#AAAAAA;
  --bub-me:var(--tg-out); --bub-me-t:#212121; --bub-o:var(--tg-in); --bub-o-t:#212121;
  --bub-shadow:0 1px 1px rgba(0,0,0,.08);
  --sel:#E4EDF3; --hover:rgba(0,0,0,.04);
}
/* ---- 应用栏 ---- */
.tg-appbar{display:flex;align-items:center;gap:4px;background:var(--tg);color:#fff;min-height:56px;padding:4px 8px;flex:none}
.tg-appbar .icon-btn{color:#fff;width:44px;height:44px;border-radius:50%}
.tg-appbar .icon-btn:hover{background:rgba(255,255,255,.12);color:#fff}
.tg-appbar .icon-btn .i{width:24px;height:24px}
.tg-title{flex:1;font-size:20px;font-weight:500;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:8px}
.tg-searchbar{display:flex;align-items:center;gap:4px;background:var(--tg);min-height:56px;padding:4px 8px;flex:none}
.tg-searchbar .icon-btn{color:#fff;width:44px;height:44px;border-radius:50%}
.tg-searchbar .icon-btn:hover{background:rgba(255,255,255,.12)}
.tg-searchbar input{flex:1;background:transparent;border:0;outline:0;color:#fff;font-size:17px;min-width:0}
.tg-searchbar input::placeholder{color:rgba(255,255,255,.6)}
/* ---- 聊天列表行 ---- */
.side-body{background:var(--side)}
.row{display:flex;align-items:center;gap:12px;padding:8px 12px;margin:0;border-radius:0;min-height:76px;cursor:pointer}
.row:hover{background:var(--hover)}
.row.on{background:var(--sel)}
.row .avatar{width:54px;height:54px;flex:none}
.row .rbody{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:4px}
.row .rtop{display:flex;align-items:center;gap:6px}
.row .rname{flex:1;font-size:16px;font-weight:500;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row .rtime{font-size:12px;color:var(--sub);flex:none;font-variant-numeric:tabular-nums}
.row .checks{display:inline-flex;flex:none}
.row .checks .i{width:18px;height:14px}
.row .rbottom{display:flex;align-items:center;gap:6px}
.row .rprev{flex:1;font-size:14px;color:var(--sub);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row .rprev em{font-style:normal;color:var(--hl);font-weight:600}
.row .badge{background:var(--tg-green);color:#fff;font-size:12px;font-weight:500;min-width:22px;height:22px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;padding:0 6px;flex:none}
/* ---- FAB ---- */
.side{position:relative}
.fab{position:absolute;right:16px;bottom:16px;width:56px;height:56px;border-radius:50%;background:var(--tg-fab);color:#fff;border:0;box-shadow:0 4px 12px rgba(0,0,0,.25);display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:5}
.fab .i{width:24px;height:24px}
.fab:active{transform:scale(.94)}
/* ---- 聊天顶栏 ---- */
.chat-head{background:var(--tg);border-bottom:0;min-height:56px;padding:4px 8px;gap:4px}
.chat-head .icon-btn{color:#fff;width:44px;height:44px;border-radius:50%}
.chat-head .icon-btn:hover{background:rgba(255,255,255,.12);color:#fff}
.chat-head .icon-btn .i{width:24px;height:24px}
.chat-head .back{display:inline-flex}
.chat-head .avatar{width:42px;height:42px;flex:none}
.chat-head .who{flex:1;min-width:0;line-height:1.35;cursor:pointer}
.chat-head .who b{font-size:16.5px;font-weight:500;color:#fff;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-head .who>span{font-size:13px;color:rgba(255,255,255,.8);display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-head .who>span.live{color:#fff}
/* ---- 壁纸 ---- */
.msgs{background-color:var(--tg-wall);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='%23B8C9D6' stroke-width='1' opacity='.35'%3E%3Ccircle cx='20' cy='20' r='6'/%3E%3Cpath d='M60 30l8 8M68 30l-8 8'/%3E%3Crect x='90' y='60' width='12' height='12' rx='2'/%3E%3Ccircle cx='40' cy='80' r='4'/%3E%3Cpath d='M80 100q6-6 12 0'/%3E%3C/g%3E%3C/svg%3E");padding:12px 10px 8px}
/* ---- 日期 pill ---- */
.tsep{text-align:center;margin:12px 0 8px}
.tsep span{display:inline-block;background:rgba(0,0,0,.28);color:#fff;font-size:12.5px;padding:4px 12px;border-radius:12px;font-variant-numeric:tabular-nums}
/* ---- 气泡（Telegram 尾巴） ---- */
.bubble{font-size:15.5px;line-height:1.45;padding:7px 10px 6px;box-shadow:var(--bub-shadow)}
.msg.first .bubble{border-radius:3px 14px 14px 14px}
.msg.me.first .bubble{border-radius:14px 3px 14px 14px}
.msg:not(.first) .bubble{border-top-left-radius:8px}
.msg.me:not(.first) .bubble{border-top-left-radius:14px;border-top-right-radius:8px}
.msg:not(.last) .bubble{border-bottom-left-radius:8px}
.msg.me:not(.last) .bubble{border-bottom-left-radius:14px;border-bottom-right-radius:8px}
/* 气泡内时间+✓✓ */
.meta-line{font-size:11px;color:var(--tg-time);display:inline-flex;align-items:center;gap:3px;float:right;margin:8px 0 0 8px;font-variant-numeric:tabular-nums}
.meta-line .read{color:var(--tg-check)}
.meta-line .read.unread{color:var(--tg-time)}
.msg.me .bubble .meta-line{color:var(--tg-time)}
/* 群聊昵称彩色 */
.msg .nick{font-size:13px;font-weight:500;margin:0 2px 2px}
.msg .nick.nc0{color:#EF9A9A}.msg .nick.nc1{color:#F48FB1}.msg .nick.nc2{color:#CE93D8}
.msg .nick.nc3{color:#9FA8DA}.msg .nick.nc4{color:#90CAF9}.msg .nick.nc5{color:#80DEEA}
.msg .nick.nc6{color:#A5D6A7}.msg .nick.nc7{color:#E6EE9C}.msg .nick.nc8{color:#FFCC80}
/* ---- 抽屉 ---- */
.drawer-mask{background:rgba(0,0,0,.5)}
.drawer{background:#fff;width:min(320px,85vw)}
.tg-dhead{background:var(--tg);color:#fff;padding:20px 16px 12px}
.tg-dprofile{display:flex;align-items:center;gap:14px}
.tg-dprofile .avatar{width:64px;height:64px;flex:none}
.tg-dwho{min-width:0}
.tg-dname{font-size:17px;font-weight:500;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tg-dphone{font-size:13.5px;color:rgba(255,255,255,.75);margin-top:2px}
.tg-dstatus{display:flex;gap:8px;margin-top:12px}
.tg-dstatus .chip{background:rgba(255,255,255,.15);color:#fff;border:0;font-size:12px;padding:5px 12px;border-radius:12px;cursor:pointer}
.tg-dstatus .chip.on{background:#fff;color:var(--tg)}
.tg-dstatus .chip i{display:none}
.tg-div{height:8px;background:#F0F0F0;margin:0}
.menu-item.tg-mi{display:flex;align-items:center;gap:20px;padding:0 20px;min-height:48px;font-size:15px;color:var(--text);width:100%;background:none;border:0;cursor:pointer;text-align:left}
.menu-item.tg-mi:hover{background:var(--hover)}
.menu-item.tg-mi .i{width:24px;height:24px;color:#8A8A8A;flex:none}
.menu-item.tg-mi .switch{margin-left:auto}
.tg-settings{background:#FAFAFA;border-top:1px solid var(--line)}
.tg-settings .swatches{padding:10px 20px}
/* ---- 输入栏微调（Telegram 圆角） ---- */
.composer{padding:6px 10px 10px;background:transparent}
.composer .bar{background:#fff;border-radius:24px;box-shadow:0 1px 2px rgba(0,0,0,.1)}
.composer .send-fab{background:var(--tg-fab)}
/* ---- 深色主题（Telegram Dark 近似） ---- */
:root[data-theme="dark"]{
  --tg:#17212B;
  --bg:#0E1621; --side:#17212B; --surface:#1C2733; --surface-2:#242F3D; --chat:#0E1621;
  --line:rgba(255,255,255,.08); --line-strong:rgba(255,255,255,.14);
  --text:#FFFFFF; --sub:#7F91A4; --faint:#5B6B7C;
  --bub-me:#2B5278; --bub-me-t:#fff; --bub-o:#182533; --bub-o-t:#fff; --bub-shadow:none;
  --accent:#6FA8DC; --accent-h:#5B9BD5; --accent-soft:#1C2B3A; --hl:#4CAF50;
  --sel:#1C2B3A; --hover:rgba(255,255,255,.05);
  --tg-wall:#0E1621;
}
:root[data-theme="dark"] .tg-appbar,:root[data-theme="dark"] .tg-searchbar,:root[data-theme="dark"] .chat-head,:root[data-theme="dark"] .tg-dhead{background:#17212B}
:root[data-theme="dark"] .msgs{background-color:#0E1621}
:root[data-theme="dark"] .drawer{background:#17212B}
:root[data-theme="dark"] .menu-item.tg-mi{color:#fff}
:root[data-theme="dark"] .menu-item.tg-mi .i{color:#7F91A4}
:root[data-theme="dark"] .tg-div{background:#0E1621}
:root[data-theme="dark"] .tg-settings{background:#101923}
:root[data-theme="dark"] .row .rname{color:#fff}
:root[data-theme="dark"] .composer .bar{background:#17212B}
/* 列表行 hairline 分割线（Telegram 式左缩进） */
.row .rbody{border-bottom:1px solid rgba(0,0,0,.06)}
.row:last-child .rbody{border-bottom:0}

/* ---- LoveChat 扩展模块样式（红包/转账/钱包/投票/阅后即焚/小游戏/打赏） ---- */
.wallet-hero{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 16px;background:var(--surface-2,#f4f6f9);border-radius:12px;margin-bottom:8px}
.wallet-hero h2{font-size:26px;font-weight:700;margin:4px 0;color:var(--text)}
.wallet-actions{display:flex;gap:8px;flex-wrap:wrap}
.bubble.rp-card,.bubble.tf-card{min-width:220px;max-width:260px;padding:12px 14px;background:linear-gradient(135deg,#e64b3b,#d93829);color:#fff !important;border-radius:12px;cursor:pointer;user-select:none}
.bubble.rp-card.finished,.bubble.rp-card.expired,.bubble.rp-card.refunded,.bubble.tf-card.accepted,.bubble.tf-card.refunded{opacity:.78;filter:saturate(.75)}
.bubble.tf-card{background:linear-gradient(135deg,#f08c24,#df7610)}
.rp-top{display:flex;align-items:center;gap:10px}
.rp-ic{font-size:28px;line-height:1}
.rp-info{display:flex;flex-direction:column;min-width:0}
.rp-info b{font-size:15px;font-weight:600;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rp-info span{font-size:12px;color:rgba(255,255,255,.88);margin-top:2px}
.rp-foot{display:flex;align-items:center;justify-content:space-between;margin-top:10px;padding-top:6px;border-top:1px solid rgba(255,255,255,.2);font-size:11px;color:rgba(255,255,255,.85)}
.bubble.rp-card .meta-line,.bubble.tf-card .meta-line{color:rgba(255,255,255,.85) !important;margin:0}
.bubble.poll-card,.bubble.game-card,.bubble.reward-card{min-width:220px;max-width:280px;padding:12px 14px}
.poll-q{margin-bottom:8px;font-size:14px}
.poll-q small{color:var(--sub);margin-left:4px;font-weight:400}
.poll-opts{display:flex;flex-direction:column;gap:6px}
.poll-opt{position:relative;padding:7px 10px;border:1px solid var(--line-strong,rgba(0,0,0,.12));border-radius:8px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;font-size:13px;overflow:hidden}
.poll-bar{position:absolute;left:0;top:0;bottom:0;background:rgba(79,140,255,.18);pointer-events:none}
.poll-txt,.poll-cnt{position:relative;z-index:1}
.poll-cnt{font-size:12px;color:var(--sub)}
.game-res{font-size:18px;font-weight:600;margin:8px 0 4px}
.fwd-line{font-size:11.5px;color:var(--sub);margin-bottom:4px;font-style:italic}
.burn-pill{display:inline-block;margin-left:6px;padding:1px 6px;border-radius:10px;font-size:11px;background:rgba(229,72,77,.15);color:#e5484d;cursor:pointer}
.bubble.burned{font-style:italic;color:var(--sub)}
.icon-btn.burn-on{color:#ff7a45;position:relative}
.burn-tag{font-size:10px;position:absolute;bottom:2px;right:2px}
.pin-bar{cursor:pointer;display:flex;align-items:center;gap:6px}
.pin-bar span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ad-banner-wrap{padding:6px 10px;border-bottom:1px solid var(--line);display:flex;flex-direction:column;gap:6px;background:var(--surface-2,rgba(0,0,0,.02))}
.ad-banner{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:8px;background:var(--accent-soft,#eaf1ff);color:var(--text);text-decoration:none;font-size:13px}
.ad-banner .ad-tag{font-size:10.5px;padding:1px 5px;border-radius:4px;background:var(--accent,#2f6df6);color:#fff;flex:none}
.ad-banner .ad-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
.row .rprev em.draft-tag{font-style:normal;color:var(--red,#e5484d);font-weight:600}
.archive-folder{background:var(--surface,#f4f4f5);border-bottom:1px solid var(--line)}
.archived-box{background:var(--surface,#f8f9fb);border-bottom:2px solid var(--line-strong)}
.meta-line .read{display:inline-flex;align-items:center;gap:2px}
.meta-line .read i{font-style:normal;font-size:10.5px;margin-left:1px}
.meta-line .edited-tag{font-size:10.5px;opacity:.85;margin-right:2px}
.bubble .txt,.bubble .img-caption{user-select:text;-webkit-user-select:text;cursor:text}
.reply-bar.edit-bar::before{background:var(--amber,#d9930d)}
.reply-bar.edit-bar b{color:var(--amber,#d9930d)}


