/* ============================================================
   CC商聊 - 全局样式（设计系统）
   ============================================================ */
:root{
  --brand:#07C160;--brand2:#06AD56;--brand-soft:rgba(7,193,96,.1);
  --bg:#F6F7F9;--card:#fff;--text:#1A1D26;--t2:#6B7280;--t3:#9AA0AC;
  --line:#F0F1F3;--red:#FF4757;--gold:#F5A623;--purple:#6C5CF0;
  --safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px);
  --app-w:440px;--radius:14px;
  --shadow:0 8px 24px rgba(26,32,60,.08);
}
html.dark-theme{
  --bg:#0D0F14;--card:#1A1D26;--text:#F0F2F7;--t2:#A0A7B8;--t3:#687082;--line:#262A36;
  --shadow:0 8px 24px rgba(0,0,0,.4);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{margin:0;height:100%;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",Arial,sans-serif;
  color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased;
  font-size:14px;line-height:1.5;
}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;}
input,textarea{font:inherit;border:0;outline:0;background:none;color:inherit;}
a{color:inherit;text-decoration:none;}
svg{display:block;}
img{max-width:100%;}
::-webkit-scrollbar{width:0;height:0;}

/* ---------- 桌面外框 ---------- */
body.app-body{display:flex;align-items:center;justify-content:center;}
@media (min-width:560px){
  body.app-body{
    background:
      radial-gradient(900px 500px at 15% 10%,rgba(7,193,96,.16),transparent 60%),
      radial-gradient(800px 500px at 90% 90%,rgba(108,92,240,.16),transparent 60%),
      #EEF1F7;
    padding:20px 0;
  }
  html.dark-theme body.app-body{background:#090B0E;}
  .app{
    width:var(--app-w);height:calc(100vh - 40px);max-height:900px;min-height:600px;
    border-radius:26px;overflow:hidden;box-shadow:0 40px 90px rgba(26,32,60,.22),0 0 0 1px rgba(26,32,60,.05);
  }
}

/* ---------- 应用骨架 ---------- */
.app{
  display:flex;flex-direction:column;width:100%;height:100vh;height:100dvh;
  background:var(--bg);position:relative;overflow:hidden;
}
.page{flex:1;display:flex;flex-direction:column;min-height:0;background:var(--bg);}
.page-body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:calc(74px + var(--safe-b));}
.page-body.no-tab{padding-bottom:calc(16px + var(--safe-b));}
.topbar{
  position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;
  padding:calc(var(--safe-t) + 10px) 16px 10px;background:var(--bg);
}
.topbar.solid{background:var(--card);border-bottom:1px solid var(--line);}
.topbar h1{font-size:17px;font-weight:600;margin:0;letter-spacing:.2px;}
.topbar .tb-actions{display:flex;gap:16px;align-items:center;color:var(--t2);}
.topbar .tb-btn{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:9px;}
.topbar .tb-btn:active{background:var(--line);}
.topbar .tb-back{width:34px;height:34px;display:flex;align-items:center;justify-content:center;margin-left:-8px;}
.topbar .tb-title{flex:1;text-align:center;font-size:16px;font-weight:600;}
.topbar .tb-right{min-width:34px;display:flex;justify-content:flex-end;gap:12px;}

/* ---------- 底部导航 ---------- */
.tabbar{
  position:absolute;left:0;right:0;bottom:0;z-index:30;display:flex;
  background:rgba(255,255,255,.96);backdrop-filter:blur(20px);
  border-top:1px solid var(--line);padding:6px 0 calc(4px + var(--safe-b));
}
html.dark-theme .tabbar{background:rgba(26,29,38,.96);}
.tabbar .tab{
  flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;
  font-size:10.5px;color:var(--t3);padding:3px 0;position:relative;
}
.tabbar .tab.active{color:var(--brand);}
.tabbar .tab svg{width:23px;height:23px;}
.tabbar .tab .dot{
  position:absolute;top:0;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;
  background:var(--red);color:#fff;font-size:10px;line-height:16px;text-align:center;border-radius:9px;
  font-weight:600;
}

/* ---------- 卡片 / 列表 / 单元 ---------- */
.card{background:var(--card);border-radius:var(--radius);padding:16px;margin:10px 12px;}
.card.flush{padding:0;overflow:hidden;}
.group-title{font-size:12.5px;color:var(--t3);padding:16px 18px 6px;}
.cell-group{background:var(--card);border-radius:var(--radius);margin:10px 12px;overflow:hidden;}
.cell{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid var(--line);cursor:pointer;position:relative;}
.cell:last-child{border-bottom:0;}
.cell:active{background:var(--line);}
.cell .c-icon{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;flex:0 0 auto;background:var(--brand-soft);color:var(--brand);}
.cell .c-title{flex:1;min-width:0;font-size:14.5px;}
.cell .c-desc{font-size:12px;color:var(--t3);margin-top:2px;}
.cell .c-value{color:var(--t3);font-size:13px;display:flex;align-items:center;gap:6px;}
.cell .arrow{color:#C9CED8;font-size:18px;line-height:1;}
html.dark-theme .cell .arrow{color:#3A4256;}
.cell.danger .c-title{color:var(--red);}

/* ---------- 头像 ---------- */
.avatar{width:48px;height:48px;border-radius:10px;object-fit:cover;background:#E8EBF0;flex:0 0 auto;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:600;overflow:hidden;}
.avatar img{width:100%;height:100%;object-fit:cover;display:block;}
.avatar.sm{width:36px;height:36px;border-radius:8px;font-size:14px;}
.avatar.lg{width:72px;height:72px;border-radius:14px;font-size:26px;}
.avatar.xl{width:88px;height:88px;border-radius:18px;font-size:32px;}
.avatar.round{border-radius:50%;}
.avatar.round.sm,.avatar.round.lg,.avatar.round.xl{border-radius:50%;}

/* ---------- 会话列表 ---------- */
.conv-list{background:var(--card);}
.conv-item{display:flex;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);position:relative;cursor:pointer;}
.conv-item:active{background:var(--line);}
.conv-item .avatar{width:46px;height:46px;border-radius:10px;}
.conv-main{flex:1;min-width:0;}
.conv-top{display:flex;justify-content:space-between;align-items:center;gap:8px;}
.conv-name{font-size:15.5px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.conv-time{font-size:11px;color:var(--t3);flex:0 0 auto;}
.conv-bottom{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:3px;}
.conv-msg{font-size:12.5px;color:var(--t3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.conv-badge{min-width:18px;height:18px;padding:0 5px;background:var(--red);color:#fff;font-size:11px;line-height:18px;text-align:center;border-radius:9px;font-weight:600;flex:0 0 auto;}
.conv-badge.mute{background:#C9CED8;}
.conv-badge.dot-only{min-width:9px;width:9px;height:9px;padding:0;border-radius:50%;}
.conv-item .pinned-tag{position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--brand);opacity:0;}
.conv-item.pinned .pinned-tag{opacity:1;}

/* ---------- 聊天 ---------- */
.chat-page{display:flex;flex-direction:column;height:100%;background:var(--bg);}
.chat-head{
  display:flex;align-items:center;gap:10px;padding:calc(var(--safe-t) + 8px) 12px 8px;
  background:var(--card);border-bottom:1px solid var(--line);z-index:20;position:relative;
}
.chat-head .tb-back{width:34px;height:34px;display:flex;align-items:center;justify-content:center;color:var(--text);}
.chat-head .ch-title{flex:1;min-width:0;text-align:center;}
.chat-head .ch-name{font-size:16px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.chat-head .ch-sub{font-size:11px;color:var(--t3);margin-top:1px;}
.chat-head .ch-action{width:34px;height:34px;display:flex;align-items:center;justify-content:center;color:var(--t2);}
.pinned-bar{
  display:flex;align-items:center;gap:8px;margin:0 10px;padding:8px 12px;border-radius:12px;
  background:linear-gradient(135deg,#FFF7E6,#FFF1D6);color:#8A5A00;font-size:12.5px;
  box-shadow:0 2px 10px rgba(245,166,35,.12);flex:0 0 auto;cursor:pointer;
}
.pinned-bar.hidden{display:none;}
.pinned-bar .pb-ico{flex:0 0 auto;display:flex;color:#D48806;}
.pinned-bar .pb-txt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pinned-bar .pb-txt b{font-weight:600;}
.pinned-bar .pb-close{flex:0 0 auto;width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#B08900;background:rgba(212,136,6,.12);}
.chat-body{flex:1;overflow-y:auto;padding:12px 12px 6px;display:flex;flex-direction:column;gap:2px;}
.msg-row{display:flex;gap:8px;padding:3px 0;align-items:flex-start;}
.msg-row.me{flex-direction:row-reverse;}
.msg-row .avatar{width:38px;height:38px;border-radius:8px;font-size:14px;margin-top:2px;}
.msg-content{max-width:calc(100% - 96px);min-width:0;}
.msg-name{font-size:11px;color:var(--t3);margin:0 0 2px 3px;}
.msg-row.me .msg-name{text-align:right;margin-right:3px;}
.bubble{
  position:relative;background:var(--card);border-radius:10px;padding:9px 12px;
  font-size:15px;line-height:1.45;word-break:break-word;white-space:pre-wrap;
  box-shadow:0 1px 2px rgba(0,0,0,.04);display:inline-block;max-width:100%;
}
.msg-row.me .bubble{background:var(--brand);color:#fff;}
html.dark-theme .bubble{background:#252A38;}
html.dark-theme .msg-row.me .bubble{background:var(--brand2);}
.bubble.media{padding:4px;background:transparent;box-shadow:none;}
.bubble.media img,.bubble.media video{display:block;max-width:220px;max-height:280px;border-radius:10px;object-fit:cover;}
.bubble.voice{display:flex;align-items:center;gap:8px;min-width:80px;cursor:pointer;}
.bubble.voice .v-wave{font-size:12px;color:var(--t3);}
.msg-row.me .bubble.voice .v-wave{color:rgba(255,255,255,.85);}
.bubble.card{width:min(72vw,290px);padding:10px 12px;background:var(--card);color:var(--text);}
html.dark-theme .bubble.card{background:#252A38;color:var(--text);}
.card-title{font-size:14px;font-weight:600;margin-bottom:6px;}
.card-sub{font-size:12px;color:var(--t3);line-height:1.6;}
.card-row{display:flex;align-items:center;gap:10px;}
.card-foot{border-top:1px solid var(--line);margin-top:8px;padding-top:6px;font-size:11px;color:var(--t3);}
.redpacket{background:linear-gradient(135deg,#FA9D3B,#F5642E);color:#fff;border-radius:10px;padding:12px 14px;width:230px;cursor:pointer;}
.redpacket .rp-title{font-size:14px;font-weight:600;display:flex;align-items:center;gap:6px;}
.redpacket .rp-sub{font-size:11.5px;opacity:.9;margin-top:4px;}
.redpacket.opened{background:#F5B98B;}
.transfer{background:linear-gradient(135deg,#FFB84D,#FF8A00);color:#fff;border-radius:10px;padding:12px 14px;width:230px;cursor:pointer;}
.bubble .muted{opacity:.8;font-size:12px;}
.time-divider{text-align:center;font-size:11px;color:var(--t3);padding:10px 0 6px;}
.system-msg{text-align:center;font-size:11.5px;color:var(--t3);padding:6px 28px;line-height:1.6;}
.msg-status{font-size:10px;color:var(--t3);align-self:flex-end;margin-top:2px;}

/* ---------- 输入区 ---------- */
.composer{
  background:var(--card);border-top:1px solid var(--line);
  padding:7px 8px calc(7px + var(--safe-b));display:flex;flex-direction:column;gap:6px;z-index:25;
}
.composer-row{display:flex;align-items:flex-end;gap:7px;}
.composer .ico-btn{width:34px;height:34px;display:flex;align-items:center;justify-content:center;color:var(--t2);border-radius:8px;flex:0 0 auto;}
.composer .ico-btn:active{background:var(--line);}
.composer input[type=text],.composer textarea{
  flex:1;min-height:36px;max-height:110px;background:var(--bg);border-radius:9px;padding:8px 12px;font-size:15px;resize:none;line-height:1.4;
}
.composer .send-btn{
  height:36px;padding:0 15px;border-radius:9px;background:var(--brand);color:#fff;font-weight:600;font-size:14px;flex:0 0 auto;
}
.composer .send-btn:disabled{opacity:.5;}
.composer .hold-btn{
  flex:1;height:36px;border-radius:9px;background:var(--bg);color:var(--text);font-size:14.5px;font-weight:500;
}
.composer .hold-btn.recording{background:rgba(255,71,87,.12);color:var(--red);}
.plus-panel{display:none;grid-template-columns:repeat(4,1fr);gap:14px;padding:12px 6px 6px;}
.plus-panel.show{display:grid;}
.plus-item{display:flex;flex-direction:column;align-items:center;gap:6px;font-size:11px;color:var(--t2);}
.plus-item .pi{width:54px;height:54px;border-radius:12px;background:var(--bg);display:flex;align-items:center;justify-content:center;color:var(--t2);}
.plus-item:active .pi{background:var(--line);}

/* ---------- 表情 ---------- */
.emoji-panel{display:none;background:var(--card);border-top:1px solid var(--line);max-height:240px;overflow-y:auto;padding:8px;}
.emoji-panel.show{display:block;}
.emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:4px;}
.emoji-cell{height:38px;display:flex;align-items:center;justify-content:center;font-size:22px;border-radius:8px;cursor:pointer;}
.emoji-cell:active{background:var(--line);}
.emoji-tabs{display:flex;gap:6px;padding:4px 2px 8px;}
.emoji-tabs button{font-size:12px;padding:5px 10px;border-radius:7px;background:var(--bg);color:var(--t2);}
.emoji-tabs button.active{background:var(--brand);color:#fff;}

/* ---------- 底部弹层 / 弹窗 ---------- */
.mask{position:fixed;inset:0;background:rgba(16,20,30,.5);backdrop-filter:blur(2px);z-index:800;opacity:0;pointer-events:none;transition:.2s;}
.mask.show{opacity:1;pointer-events:auto;}
.sheet{
  position:fixed;left:50%;bottom:0;transform:translate(-50%,100%);width:100%;max-width:var(--app-w);
  background:var(--card);border-radius:18px 18px 0 0;z-index:801;transition:transform .25s cubic-bezier(.2,.8,.3,1);
  padding-bottom:calc(8px + var(--safe-b));max-height:82vh;overflow-y:auto;
}
.sheet.show{transform:translate(-50%,0);}
.sheet-hd{display:flex;align-items:center;justify-content:space-between;padding:16px 16px 8px;}
.sheet-hd h3{font-size:15.5px;margin:0;}
.sheet-hd .close{width:28px;height:28px;border-radius:50%;background:var(--bg);display:flex;align-items:center;justify-content:center;color:var(--t2);}
.sheet-body{padding:4px 16px 12px;}
.sheet-item{display:flex;align-items:center;gap:12px;padding:13px 4px;border-bottom:1px solid var(--line);font-size:14.5px;cursor:pointer;}
.sheet-item:last-child{border-bottom:0;}
.sheet-item.danger{color:var(--red);}
.dialog{
  position:fixed;left:50%;top:50%;transform:translate(-50%,-46%) scale(.96);width:86%;max-width:330px;
  background:var(--card);border-radius:16px;z-index:802;opacity:0;pointer-events:none;transition:.18s;
  padding:20px 18px 14px;text-align:center;
}
.dialog.show{opacity:1;pointer-events:auto;transform:translate(-50%,-50%) scale(1);}
.dialog h3{font-size:16px;margin:0 0 8px;}
.dialog p{font-size:13px;color:var(--t2);margin:0 0 14px;line-height:1.6;}
.dialog .dlg-actions{display:flex;gap:10px;}
.dialog .dlg-actions button{flex:1;height:42px;border-radius:10px;font-size:14.5px;font-weight:600;}
.dialog .dlg-actions .ghost{background:var(--bg);color:var(--t2);}
.dialog .dlg-actions .primary{background:var(--brand);color:#fff;}
.dialog .dlg-actions .danger{background:var(--red);color:#fff;}
.dialog input,.dialog textarea{width:100%;background:var(--bg);border-radius:10px;padding:11px 12px;font-size:14px;margin-bottom:12px;}

/* ---------- 表单 ---------- */
.field-row{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line);}
.field-row:last-child{border-bottom:0;}
.field-row label{width:86px;color:var(--t2);font-size:13.5px;flex:0 0 auto;}
.field-row input,.field-row textarea{flex:1;font-size:14.5px;text-align:right;}
.field-row textarea{text-align:left;min-height:60px;}
.field{display:flex;align-items:center;gap:12px;background:var(--bg);border-radius:var(--radius);padding:0 15px;height:50px;margin-bottom:12px;}
.field input{flex:1;font-size:15px;}
.btn{display:flex;align-items:center;justify-content:center;width:100%;height:48px;border-radius:12px;background:var(--brand);color:#fff;font-size:15.5px;font-weight:600;letter-spacing:1px;}
.btn:disabled{opacity:.55;}
.btn.ghost{background:var(--bg);color:var(--t2);}
.btn.small{height:34px;width:auto;padding:0 14px;font-size:13px;letter-spacing:0;border-radius:8px;}
.btn.danger{background:var(--red);}
.btn.outline{background:transparent;border:1px solid var(--brand);color:var(--brand);}

/* ---------- 徽章 / 标签 ---------- */
.badge{display:inline-flex;align-items:center;padding:1px 6px;border-radius:5px;font-size:10px;background:var(--brand-soft);color:var(--brand);font-weight:600;}
.badge.gold{background:rgba(245,166,35,.14);color:var(--gold);}
.badge.svip{background:linear-gradient(135deg,#7C3AED,#F59E0B);color:#fff;box-shadow:0 2px 8px rgba(124,58,237,.28);}

/* ---------- 名称 + 标识行：昵称可截断，标识不裁切 ---------- */
.name-row{display:flex;align-items:center;flex-wrap:wrap;row-gap:2px;min-width:0;}
.name-row .name-txt{
  min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:0 1 auto;
}
.name-row .name-tags{display:flex;align-items:center;flex:0 0 auto;max-width:100%;flex-wrap:wrap;row-gap:2px;}

/* ---------- 靓号号码胶囊（靓 + 号码） ---------- */
.num-pretty{
  display:inline-flex;align-items:center;gap:5px;height:23px;padding-right:9px;border-radius:12px;
  background:linear-gradient(90deg,#FF86A4,#FF3D63);box-shadow:0 3px 12px rgba(255,61,99,.32);
  vertical-align:middle;line-height:1;flex:0 0 auto;white-space:nowrap;box-sizing:border-box;
}
.num-pretty i{
  font-style:normal;font-size:11px;font-weight:700;color:#FF3D63;background:#fff;border-radius:9px;
  padding:3px 6px;margin-left:2px;letter-spacing:.5px;line-height:1;
}
.num-pretty b{font-size:14px;font-weight:800;color:#fff;letter-spacing:.6px;font-variant-numeric:tabular-nums;}

/* ---------- 会话列表里的身份标识（靓号 / 会员 / 官方） ----------
   三者盒子模型完全一致，保证在同一基线上对齐 */
.tag-pretty,.tag-vip,.tag-official{
  display:inline-flex;align-items:center;justify-content:center;
  height:18px;line-height:1;padding:0 6px;border-radius:5px;margin-left:5px;
  font-size:10px;font-weight:700;letter-spacing:.2px;
  vertical-align:middle;white-space:nowrap;box-sizing:border-box;
  flex:0 0 auto;
}
.tag-pretty{
  color:#FFF6DE;
  background:linear-gradient(135deg,#8B5A18,#C08A34);
  box-shadow:inset 0 0 0 1px rgba(255,214,140,.55);
}
.tag-vip.gold{color:#8A5A00;background:linear-gradient(135deg,#FFE7A8,#FFC94D);}
.tag-vip.svip{color:#3A2A00;background:linear-gradient(135deg,#FFE9A8,#FFC24B 60%,#C9A0FF);}
.tag-official{color:#fff;background:linear-gradient(135deg,#4E8CFF,#2F6BFF);}
.badge.svip::before{content:"";width:4px;height:4px;border-radius:50%;background:#fff;margin-right:3px;opacity:.9;}
.badge.purple{background:rgba(108,92,240,.14);color:var(--purple);}
.badge.red{background:rgba(255,71,87,.12);color:var(--red);}
.badge.gray{background:var(--line);color:var(--t3);}
.pill{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:20px;font-size:11.5px;background:var(--bg);color:var(--t2);}
.tag-online{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--brand);}

/* ---------- 空态 / 加载 ---------- */
.empty{text-align:center;color:var(--t3);font-size:13px;padding:56px 20px;line-height:1.8;}
.empty .ico{font-size:34px;margin-bottom:10px;opacity:.7;}
.loading{text-align:center;color:var(--t3);font-size:12.5px;padding:16px;}
.spin{display:inline-block;width:16px;height:16px;border:2px solid rgba(7,193,96,.25);border-top-color:var(--brand);border-radius:50%;animation:sp .7s linear infinite;vertical-align:-3px;}
@keyframes sp{to{transform:rotate(360deg);}}

/* ---------- Toast ---------- */
.toast{
  position:fixed;left:50%;bottom:96px;transform:translate(-50%,12px);z-index:9999;
  background:rgba(24,28,36,.92);color:#fff;font-size:13px;padding:10px 18px;border-radius:11px;
  opacity:0;visibility:hidden;transition:.22s;max-width:82vw;text-align:center;line-height:1.5;
  box-shadow:0 12px 30px rgba(0,0,0,.25);pointer-events:none;
}
.toast.show{opacity:1;visibility:visible;transform:translate(-50%,0);}

/* ---------- 个人主页 ---------- */
.profile-head{display:flex;align-items:center;gap:14px;padding:18px 16px;background:var(--card);}
.profile-head .ph-name{font-size:19px;font-weight:600;}
.profile-head .ph-sub{font-size:12.5px;color:var(--t3);margin-top:4px;}
.profile-stats{display:flex;gap:10px;padding:12px 16px;background:var(--card);border-top:1px solid var(--line);}
.profile-stats .stat{flex:1;text-align:center;}
.profile-stats .stat b{display:block;font-size:16px;}
.profile-stats .stat span{font-size:11px;color:var(--t3);}

/* ---------- 朋友圈 ---------- */
.moment{display:flex;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line);background:var(--card);}
.moment .avatar{width:42px;height:42px;border-radius:8px;}
.moment-body{flex:1;min-width:0;}
.moment-name{font-size:14px;font-weight:600;color:#576B95;}
html.dark-theme .moment-name{color:#7AA2FF;}
.moment-text{font-size:14.5px;line-height:1.55;margin-top:4px;white-space:pre-wrap;word-break:break-word;}
.moment-imgs{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin-top:8px;}
.moment-imgs img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:5px;display:block;}
.moment-imgs.single{grid-template-columns:1fr;max-width:72%;}
/* 单图按原始比例显示，长图不再被裁切 */
.moment-imgs.single{display:block;}
.moment-imgs.single img{
  width:auto !important;height:auto !important;max-width:100%;max-height:380px;
  aspect-ratio:auto !important;object-fit:contain !important;
  border-radius:6px;display:block;background:var(--bg);
}
.moment-foot{display:flex;justify-content:space-between;align-items:center;margin-top:8px;font-size:11.5px;color:var(--t3);}
.moment-actions{display:flex;gap:8px;}
.moment-actions button{padding:4px 10px;border-radius:6px;background:var(--bg);font-size:11.5px;color:var(--t2);}
.moment-likes{background:var(--bg);border-radius:6px;padding:7px 10px;margin-top:8px;font-size:12.5px;line-height:1.6;}
.moment-comments{margin-top:6px;}
.moment-comment{font-size:13px;line-height:1.6;padding:2px 0;}
.moment-comment b{color:#576B95;font-weight:500;}
html.dark-theme .moment-comment b{color:#7AA2FF;}

/* ---------- 钱包 ---------- */
.wallet-hero{
  margin:12px;border-radius:18px;padding:20px;color:#fff;
  background:linear-gradient(135deg,#07C160,#06AD56 60%,#059669);
  box-shadow:0 14px 30px rgba(7,193,96,.28);
}
.wallet-hero .wh-label{font-size:12.5px;opacity:.85;}
.wallet-hero .wh-coin{font-size:34px;font-weight:700;margin:6px 0 2px;letter-spacing:.5px;}
.wallet-hero .wh-sub{font-size:11.5px;opacity:.85;}
.wallet-actions{display:flex;gap:8px;margin-top:16px;}
.wallet-actions button{flex:1;height:40px;border-radius:10px;background:rgba(255,255,255,.18);color:#fff;font-size:13.5px;font-weight:500;}
.wallet-actions button:active{background:rgba(255,255,255,.28);}
.wallet-stats{display:flex;gap:10px;margin:0 12px;}
.wallet-stats .ws{flex:1;background:var(--card);border-radius:12px;padding:12px;text-align:center;}
.wallet-stats .ws b{display:block;font-size:16px;}
.wallet-stats .ws span{font-size:11px;color:var(--t3);}
.log-item{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--line);}
.log-item .li-info b{font-size:14px;}
.log-item .li-info span{display:block;font-size:11px;color:var(--t3);margin-top:2px;}
.log-item .li-amount{font-size:15px;font-weight:600;}
.log-item .li-amount.in{color:var(--brand);}
.log-item .li-amount.out{color:var(--text);}
.tabs{display:flex;gap:6px;padding:10px 12px;}
.tabs button{flex:1;height:34px;border-radius:9px;background:var(--card);color:var(--t2);font-size:13px;}
.tabs button.active{background:var(--brand);color:#fff;font-weight:600;}

/* ---------- 直播 ---------- */
.live-stage{position:relative;background:#000;flex:1;overflow:hidden;display:flex;align-items:center;justify-content:center;}
.live-stage video{width:100%;height:100%;object-fit:cover;}
.live-bar{position:absolute;left:0;right:0;top:0;padding:calc(var(--safe-t) + 10px) 14px 10px;display:flex;justify-content:space-between;color:#fff;background:linear-gradient(rgba(0,0,0,.45),transparent);}
.live-danmaku{position:absolute;left:0;right:0;bottom:70px;max-height:38%;overflow-y:auto;padding:0 12px;display:flex;flex-direction:column;gap:4px;}
.dm{background:rgba(0,0,0,.35);color:#fff;font-size:12.5px;padding:4px 9px;border-radius:20px;align-self:flex-start;max-width:90%;}
.dm b{color:#8BE9C0;font-weight:500;}
.live-ctrl{position:absolute;left:0;right:0;bottom:0;padding:10px 12px calc(10px + var(--safe-b));display:flex;gap:8px;background:linear-gradient(transparent,rgba(0,0,0,.5));}
.live-ctrl input{flex:1;height:40px;border-radius:20px;background:rgba(255,255,255,.16);color:#fff;padding:0 14px;font-size:13.5px;}
.live-ctrl input::placeholder{color:rgba(255,255,255,.6);}
.live-ctrl button{height:40px;padding:0 16px;border-radius:20px;background:var(--brand);color:#fff;font-size:13.5px;}
.live-ctrl button.end{background:var(--red);}

/* ---------- 通话 ---------- */
.call-page{position:fixed;inset:0;background:linear-gradient(160deg,#0E1220,#1A2238);z-index:1000;display:flex;flex-direction:column;color:#fff;}
.call-video-wrap{flex:1;position:relative;overflow:hidden;}
.call-video-wrap video{width:100%;height:100%;object-fit:cover;background:#000;}
.call-video-wrap video.remote{position:absolute;inset:0;}
.call-video-wrap video.local{position:absolute;right:14px;top:calc(var(--safe-t) + 70px);width:96px;height:136px;border-radius:12px;object-fit:cover;box-shadow:0 6px 20px rgba(0,0,0,.4);z-index:2;background:#222;}
.call-info{position:absolute;left:0;right:0;top:calc(var(--safe-t) + 34px);text-align:center;z-index:2;}
.call-info .ci-name{font-size:20px;font-weight:600;}
.call-info .ci-status{font-size:12.5px;opacity:.7;margin-top:6px;}
.call-actions{display:flex;justify-content:center;gap:22px;padding:26px 0 calc(34px + var(--safe-b));position:relative;z-index:3;}
.call-actions button{width:62px;height:62px;border-radius:50%;background:rgba(255,255,255,.14);display:flex;align-items:center;justify-content:center;color:#fff;}
.call-actions button.hang{background:var(--red);}
.call-actions button.accept{background:var(--brand);}
.call-actions button.off{background:rgba(255,255,255,.34);}

/* ---------- 用户选择器 ---------- */
.picker-list{max-height:52vh;overflow-y:auto;}
.picker-item{display:flex;align-items:center;gap:10px;padding:10px 4px;border-bottom:1px solid var(--line);cursor:pointer;}
.picker-item .check{width:20px;height:20px;border-radius:50%;border:1.5px solid #C9CED8;flex:0 0 auto;display:flex;align-items:center;justify-content:center;color:#fff;}
.picker-item.selected .check{background:var(--brand);border-color:var(--brand);}

/* ---------- 工具 ---------- */
.row-between{display:flex;align-items:center;justify-content:space-between;}
.gap8{display:flex;gap:8px;}
.mt8{margin-top:8px;}.mt12{margin-top:12px;}.mt16{margin-top:16px;}.mt24{margin-top:24px;}
.t2{color:var(--t2);}.t3{color:var(--t3);}.small{font-size:12px;}.center{text-align:center;}
.hidden{display:none !important;}
.flex1{flex:1;}
.danger-text{color:var(--red);}
.green-text{color:var(--brand);}
.nowrap{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* 置顶跳转定位高亮 */
.msg-flash{animation:msgFlash 1.6s ease-out;}
@keyframes msgFlash{0%{background:rgba(245,166,35,.35);}100%{background:transparent;}}

/* 多条置顶：折叠面板 */
.pin-list{
  margin:0 10px 6px;background:#fff;border-radius:12px;box-shadow:0 6px 20px rgba(26,32,60,.1);
  overflow:hidden;flex:0 0 auto;max-height:220px;overflow-y:auto;
}
.pin-list.hidden{display:none;}
.pin-list .pl-head{
  display:flex;align-items:center;justify-content:space-between;
  font-size:11.5px;color:var(--t3);padding:9px 12px;border-bottom:1px solid var(--line);
  position:sticky;top:0;background:#fff;z-index:1;
}
.pin-list .pl-close{font-size:11.5px;color:var(--brand);font-weight:600;}
.pin-list .pl-item{display:flex;align-items:center;gap:9px;padding:10px 12px;border-bottom:1px solid #F5F7FA;cursor:pointer;}
.pin-list .pl-item:last-child{border-bottom:0;}
.pin-list .pl-item:active{background:#FAFCFE;}
.pin-list .pl-idx{
  flex:0 0 auto;width:18px;height:18px;border-radius:50%;background:rgba(245,166,35,.15);
  color:#B45309;font-size:10.5px;font-weight:700;display:flex;align-items:center;justify-content:center;
}
.pin-list .pl-main{flex:1;min-width:0;}
.pin-list .pl-txt{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pin-list .pl-sub{font-size:10.5px;color:var(--t3);margin-top:2px;}
.pin-list .pl-del{
  flex:0 0 auto;width:22px;height:22px;border-radius:50%;background:var(--bg);color:var(--t3);
  font-size:11px;display:flex;align-items:center;justify-content:center;
}

/* 待发送图片预览条（图文消息） */
.staged-imgs{
  display:flex;gap:8px;padding:8px 12px 4px;overflow-x:auto;flex:0 0 auto;
  background:var(--card);border-top:1px solid var(--line);
}
.staged-imgs.hidden{display:none;}
.staged-imgs .si{position:relative;flex:0 0 auto;width:60px;height:60px;border-radius:10px;overflow:hidden;background:var(--bg);}
.staged-imgs .si img{width:100%;height:100%;object-fit:cover;display:block;}
.staged-imgs .si .del{
  position:absolute;right:0;top:0;width:18px;height:18px;border-radius:0 10px 0 10px;
  background:rgba(0,0,0,.55);color:#fff;font-size:11px;display:flex;align-items:center;justify-content:center;
}
.staged-imgs .si.up{display:flex;align-items:center;justify-content:center;color:var(--t3);font-size:11px;}

/* 图文消息气泡：文字在上，图片在下 */
.bubble.rich{
  padding:8px 10px;display:flex;flex-direction:column;gap:6px;max-width:min(76vw,300px);
  background:var(--card) !important;color:var(--text) !important;
}
.bubble.rich::after{display:none !important;}
.bubble.rich .rich-text{font-size:14.5px;line-height:1.55;word-break:break-word;white-space:pre-wrap;}
.bubble.rich .rich-imgs{display:grid;gap:4px;}
.bubble.rich .rich-imgs.n1{grid-template-columns:1fr;}
.bubble.rich .rich-imgs.n2{grid-template-columns:1fr 1fr;}
.bubble.rich .rich-imgs.n3{grid-template-columns:repeat(3,1fr);}
.bubble.rich .rich-imgs img{
  width:100%;height:100%;object-fit:cover;border-radius:6px;display:block;cursor:zoom-in;
}
.bubble.rich .rich-imgs.n1 img{max-height:260px;object-fit:contain;background:rgba(0,0,0,.04);}
.bubble.rich .rich-imgs.n2 img,.bubble.rich .rich-imgs.n3 img{aspect-ratio:1;}

/* 朋友圈未读：纯红点（不显示数量） */
.d-dot.dot-dotonly{
  min-width:9px;width:9px;height:9px;padding:0;border-radius:50%;
  font-size:0;line-height:0;box-shadow:0 0 0 2px var(--card);
}
