/* =========================================================
   在线客服系统 · 用户端样式 v6
   9 套主题（经典微信/古风/卡通/科技/商务/水波纹/动态/水彩/简洁）
   每套主题均支持 日间/夜间 模式（html[data-theme][data-mode]）
   ========================================================= */

/* ---------- 主题变量：经典微信（默认·日间） ---------- */
:root {
  --bg: #ededed;            /* 页面底色 */
  --panel: #ffffff;         /* 侧栏/面板 */
  --panel-2: #f7f7f7;       /* 次级面板 */
  --chat-bg: #f5f5f5;       /* 聊天区底色 */
  --card: #ffffff;          /* 卡片 */
  --text: #191919;
  --muted: #9b9b9b;
  --border: #e5e5e5;
  --accent: #07C160;        /* 品牌主色 */
  --accent-2: #0ABF6B;
  --accent-weak: rgba(7, 193, 96, .12);
  --bubble-mine: #95EC69;   /* 我的气泡 */
  --bubble-mine-text: #0f210c;
  --bubble-their: #ffffff;  /* 对方气泡 */
  --bubble-their-text: #191919;
  --chip: #f2f3f5;
  --chip-text: #6b6b6b;
  --danger: #fa5151;
  --dialog-bg: #ffffff;
  --input-bg: #ffffff;
  --toast-bg: rgba(0, 0, 0, .78);
  --mask: rgba(0, 0, 0, .45);
  --shadow: 0 4px 20px rgba(0, 0, 0, .12);
}

/* ---------- 经典微信 · 夜间 ---------- */
html[data-mode="dark"] {
  --bg: #111111;
  --panel: #1e1e1e;
  --panel-2: #191919;
  --chat-bg: #161616;
  --card: #232323;
  --text: #d5d5d5;
  --muted: #7d7d7d;
  --border: #2c2c2c;
  --accent: #2fb463;
  --accent-2: #07C160;
  --accent-weak: rgba(47, 180, 99, .16);
  --bubble-mine: #2e9e57;
  --bubble-mine-text: #eafff1;
  --bubble-their: #2c2c2c;
  --bubble-their-text: #d5d5d5;
  --chip: #2a2a2a;
  --chip-text: #9a9a9a;
  --danger: #ff6b6b;
  --dialog-bg: #242424;
  --input-bg: #2c2c2c;
  --toast-bg: rgba(255, 255, 255, .9);
  --mask: rgba(0, 0, 0, .6);
  --shadow: 0 4px 20px rgba(0, 0, 0, .5);
}

/* ---------- 古风 · 日间 ---------- */
html[data-theme="gufeng"] {
  --bg: #efe4d1; --panel: #f9f2e4; --panel-2: #f3ead8; --chat-bg: #ecdfc8;
  --card: #faf4e8; --text: #4a3b32; --muted: #a08d78; --border: #e2d4bb;
  --accent: #b03a2e; --accent-2: #8c5a3c; --accent-weak: rgba(176, 58, 46, .12);
  --bubble-mine: #c65d3b; --bubble-mine-text: #fdf3ec;
  --bubble-their: #fffdf6; --bubble-their-text: #4a3b32;
  --chip: #eee1c9; --chip-text: #7c6752; --dialog-bg: #f9f2e4; --input-bg: #fffdf6;
}

/* ---------- 古风 · 夜间 ---------- */
html[data-theme="gufeng"][data-mode="dark"] {
  --bg: #1a1410; --panel: #241c15; --panel-2: #201913; --chat-bg: #171009;
  --card: #2a2118; --text: #dcc9b0; --muted: #8a7660; --border: #382c20;
  --accent: #d1683f; --accent-2: #c65d3b; --accent-weak: rgba(209, 104, 63, .16);
  --bubble-mine: #9c4a2d; --bubble-mine-text: #ffeadd;
  --bubble-their: #2b2118; --bubble-their-text: #dcc9b0;
  --chip: #33271c; --chip-text: #b09b7f; --dialog-bg: #241c15; --input-bg: #2b2118;
}

/* ---------- 卡通 · 日间 ---------- */
html[data-theme="katong"] {
  --bg: #ffeef6; --panel: #fff8fc; --panel-2: #fdf0f8; --chat-bg: #ffe6f2;
  --card: #fffafe; --text: #5b3a4e; --muted: #c393ad; --border: #ffd6ea;
  --accent: #ff5ca8; --accent-2: #7ecbff; --accent-weak: rgba(255, 92, 168, .14);
  --bubble-mine: #ff8fc7; --bubble-mine-text: #fff;
  --bubble-their: #ffffff; --bubble-their-text: #5b3a4e;
  --chip: #ffe3f1; --chip-text: #b06e8e; --dialog-bg: #fff8fc; --input-bg: #ffffff;
}

/* ---------- 卡通 · 夜间 ---------- */
html[data-theme="katong"][data-mode="dark"] {
  --bg: #1c1018; --panel: #271823; --panel-2: #22141f; --chat-bg: #190e16;
  --card: #2e1d29; --text: #f0cfe2; --muted: #96687f; --border: #3a2434;
  --accent: #ff77b7; --accent-2: #7ecbff; --accent-weak: rgba(255, 119, 183, .16);
  --bubble-mine: #d9558f; --bubble-mine-text: #ffe9f4;
  --bubble-their: #2e1d29; --bubble-their-text: #f0cfe2;
  --chip: #361f30; --chip-text: #c995b3; --dialog-bg: #271823; --input-bg: #2e1d29;
}

/* ---------- 科技 · 日间 ---------- */
html[data-theme="keji"] {
  --bg: #e6eefb; --panel: #f4f8ff; --panel-2: #eaf2fd; --chat-bg: #dde9f8;
  --card: #f8fbff; --text: #14213d; --muted: #7d8db0; --border: #d3e0f2;
  --accent: #0e6fff; --accent-2: #00c6ff; --accent-weak: rgba(14, 111, 255, .12);
  --bubble-mine: #2563eb; --bubble-mine-text: #f2f8ff;
  --bubble-their: #ffffff; --bubble-their-text: #14213d;
  --chip: #e3ecfa; --chip-text: #5a6f96; --dialog-bg: #f4f8ff; --input-bg: #ffffff;
}

/* ---------- 科技 · 夜间（霓虹深蓝） ---------- */
html[data-theme="keji"][data-mode="dark"] {
  --bg: #060d1c; --panel: #0c1729; --panel-2: #0a1222; --chat-bg: #050b17;
  --card: #101d33; --text: #c8dcf5; --muted: #5d7195; --border: #16243d;
  --accent: #00d1ff; --accent-2: #7c5cff; --accent-weak: rgba(0, 209, 255, .14);
  --bubble-mine: #0f4c9e; --bubble-mine-text: #dff4ff;
  --bubble-their: #101d33; --bubble-their-text: #c8dcf5;
  --chip: #12213a; --chip-text: #7fa3cf; --dialog-bg: #0c1729; --input-bg: #101d33;
}

/* ---------- 商务 · 日间 ---------- */
html[data-theme="shangwu"] {
  --bg: #eceff4; --panel: #f8fafc; --panel-2: #f1f4f9; --chat-bg: #e7ebf2;
  --card: #fbfcfe; --text: #1f2d3d; --muted: #8494a8; --border: #dbe2ec;
  --accent: #1f6feb; --accent-2: #3b82f6; --accent-weak: rgba(31, 111, 235, .12);
  --bubble-mine: #1f6feb; --bubble-mine-text: #f0f6ff;
  --bubble-their: #ffffff; --bubble-their-text: #1f2d3d;
  --chip: #e9edf4; --chip-text: #64748b; --dialog-bg: #f8fafc; --input-bg: #ffffff;
}

/* ---------- 商务 · 夜间 ---------- */
html[data-theme="shangwu"][data-mode="dark"] {
  --bg: #10141b; --panel: #1a212b; --panel-2: #161d26; --chat-bg: #0d1219;
  --card: #202836; --text: #d3dce6; --muted: #76879b; --border: #28323f;
  --accent: #4d8dff; --accent-2: #3b82f6; --accent-weak: rgba(77, 141, 255, .16);
  --bubble-mine: #2b5fd9; --bubble-mine-text: #eaf2ff;
  --bubble-their: #202836; --bubble-their-text: #d3dce6;
  --chip: #232d3a; --chip-text: #9fb0c4; --dialog-bg: #1a212b; --input-bg: #202836;
}

/* ---------- 水波纹 · 日间 ---------- */
html[data-theme="shuibo"] {
  --bg: #dff0f9; --panel: #eef9ff; --panel-2: #e6f4fb; --chat-bg: #d6ecf7;
  --card: #f4fbff; --text: #16394d; --muted: #78a3b8; --border: #cbe4f0;
  --accent: #2196d9; --accent-2: #26c6da; --accent-weak: rgba(33, 150, 217, .12);
  --bubble-mine: #3aa9dc; --bubble-mine-text: #f0faff;
  --bubble-their: #ffffff; --bubble-their-text: #16394d;
  --chip: #e2f1f9; --chip-text: #5b8ba3; --dialog-bg: #eef9ff; --input-bg: #ffffff;
}

/* ---------- 水波纹 · 夜间 ---------- */
html[data-theme="shuibo"][data-mode="dark"] {
  --bg: #081820; --panel: #0e2330; --panel-2: #0b1d28; --chat-bg: #06141c;
  --card: #122a3a; --text: #c6e4f2; --muted: #5f8a9e; --border: #1a3648;
  --accent: #35c0e8; --accent-2: #26c6da; --accent-weak: rgba(53, 192, 232, .14);
  --bubble-mine: #1d7ca6; --bubble-mine-text: #e8f9ff;
  --bubble-their: #122a3a; --bubble-their-text: #c6e4f2;
  --chip: #16303f; --chip-text: #86b7cb; --dialog-bg: #0e2330; --input-bg: #122a3a;
}

/* ---------- 动态 · 日间（渐变流动） ---------- */
html[data-theme="dongtai"] {
  --bg: #efeaff; --panel: #f8f5ff; --panel-2: #f2edff; --chat-bg: #eae2fd;
  --card: #fbf9ff; --text: #33265c; --muted: #9d8fc4; --border: #e0d7f5;
  --accent: #7c5cff; --accent-2: #ff7ac8; --accent-weak: rgba(124, 92, 255, .12);
  --bubble-mine: #7c5cff; --bubble-mine-text: #f5f0ff;
  --bubble-their: #ffffff; --bubble-their-text: #33265c;
  --chip: #ece5fb; --chip-text: #7a6aa8; --dialog-bg: #f8f5ff; --input-bg: #ffffff;
}

/* ---------- 动态 · 夜间 ---------- */
html[data-theme="dongtai"][data-mode="dark"] {
  --bg: #130b22; --panel: #1d1333; --panel-2: #180f2b; --chat-bg: #0e0720;
  --card: #241741; --text: #e2d6f7; --muted: #8a7ab0; --border: #2e1e4d;
  --accent: #a585ff; --accent-2: #ff8fd4; --accent-weak: rgba(165, 133, 255, .16);
  --bubble-mine: #6a48e8; --bubble-mine-text: #f4efff;
  --bubble-their: #241741; --bubble-their-text: #e2d6f7;
  --chip: #2a1b48; --chip-text: #b7a6dd; --dialog-bg: #1d1333; --input-bg: #241741;
}

/* ---------- 水彩 · 日间 ---------- */
html[data-theme="shuicai"] {
  --bg: #fbeee4; --panel: #fdf6ee; --panel-2: #faeee2; --chat-bg: #f7e7da;
  --card: #fef9f3; --text: #5c4436; --muted: #b39480; --border: #f0dcc9;
  --accent: #d97757; --accent-2: #7fb8a4; --accent-weak: rgba(217, 119, 87, .12);
  --bubble-mine: #e8968a; --bubble-mine-text: #fff8f5;
  --bubble-their: #ffffff; --bubble-their-text: #5c4436;
  --chip: #f6e4d6; --chip-text: #96735d; --dialog-bg: #fdf6ee; --input-bg: #ffffff;
}

/* ---------- 水彩 · 夜间 ---------- */
html[data-theme="shuicai"][data-mode="dark"] {
  --bg: #1d1512; --panel: #281d19; --panel-2: #231915; --chat-bg: #181110;
  --card: #2f231d; --text: #ecd8c9; --muted: #9c7f6d; --border: #3b2c24;
  --accent: #e8927c; --accent-2: #7fb8a4; --accent-weak: rgba(232, 146, 124, .14);
  --bubble-mine: #b5675a; --bubble-mine-text: #ffefe9;
  --bubble-their: #2f231d; --bubble-their-text: #ecd8c9;
  --chip: #362821; --chip-text: #c9a68f; --dialog-bg: #281d19; --input-bg: #2f231d;
}

/* ---------- 简洁 · 日间 ---------- */
html[data-theme="jianjie"] {
  --bg: #f5f5f5; --panel: #fafafa; --panel-2: #f0f0f0; --chat-bg: #f2f2f2;
  --card: #ffffff; --text: #2b2b2b; --muted: #9e9e9e; --border: #e8e8e8;
  --accent: #555555; --accent-2: #8a8a8a; --accent-weak: rgba(85, 85, 85, .1);
  --bubble-mine: #9aa0a6; --bubble-mine-text: #ffffff;
  --bubble-their: #ffffff; --bubble-their-text: #2b2b2b;
  --chip: #ececec; --chip-text: #777; --dialog-bg: #fafafa; --input-bg: #ffffff;
}

/* ---------- 简洁 · 夜间 ---------- */
html[data-theme="jianjie"][data-mode="dark"] {
  --bg: #141414; --panel: #1d1d1d; --panel-2: #181818; --chat-bg: #101010;
  --card: #242424; --text: #d9d9d9; --muted: #7c7c7c; --border: #282828;
  --accent: #a8a8a8; --accent-2: #8a8a8a; --accent-weak: rgba(168, 168, 168, .12);
  --bubble-mine: #5a5f66; --bubble-mine-text: #f0f0f0;
  --bubble-their: #242424; --bubble-their-text: #d9d9d9;
  --chip: #262626; --chip-text: #9d9d9d; --dialog-bg: #1d1d1d; --input-bg: #242424;
}

/* =========================================================
   基础
   ========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; height: 100dvh; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}

.hidden { display: none !important; }

button { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit; font-size: 15px; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 9px 12px; outline: none; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
a { color: var(--accent); text-decoration: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* 日夜切换按钮图标：日间显示月亮、夜间显示太阳 */
#btn-theme-mode .ic-sun { display: none; }
html[data-mode="dark"] #btn-theme-mode .ic-sun { display: block; }
html[data-mode="dark"] #btn-theme-mode .ic-moon { display: none; }

/* 动态主题：聊天区渐变流动 */
html[data-theme="dongtai"] .chat {
  background-image: linear-gradient(120deg, var(--chat-bg), var(--accent-weak), var(--chat-bg));
  background-size: 300% 300%;
  animation: dongtaiShift 14s linear infinite;
}
@keyframes dongtaiShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* 水波纹主题：聊天区涟漪底纹 */
html[data-theme="shuibo"] .chat {
  background-image: repeating-radial-gradient(circle at 20% 30%, transparent 0, transparent 38px, var(--accent-weak) 39px, transparent 41px),
    repeating-radial-gradient(circle at 85% 75%, transparent 0, transparent 46px, var(--accent-weak) 47px, transparent 49px);
}

/* =========================================================
   登录 / 注册
   ========================================================= */
#auth-page {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.auth-wrap { width: 100%; max-width: 920px; display: flex; align-items: center; justify-content: center; gap: 56px; flex-wrap: wrap; }
.auth-brand { color: #fff; text-align: center; max-width: 320px; }
.auth-brand h1 { font-size: 28px; margin: 14px 0 8px; letter-spacing: 2px; }
.auth-brand p { font-size: 14px; opacity: .85; }
.auth-card {
  background: var(--dialog-bg); color: var(--text);
  border-radius: 14px; padding: 32px 28px; width: 100%; max-width: 380px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .22);
}
.auth-card h2 { font-size: 20px; margin-bottom: 20px; text-align: center; }
.form-row { margin-bottom: 14px; }
.auth-card .btn-primary { width: 100%; margin-top: 4px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-switch a { font-weight: 600; }
.link-btn { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; padding: 0; }
.auth-tip { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }
.admin-link { font-weight: 600; }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; min-width: 0; }
.btn-code {
  flex-shrink: 0; width: 108px; border-radius: 6px; font-size: 13px;
  background: var(--accent-weak); color: var(--accent); font-weight: 600;
}
.btn-code:disabled { color: var(--muted); background: var(--chip); cursor: not-allowed; }

/* v7：记住我复选框 */
.remember-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
  font-size: 13px; color: var(--muted); cursor: pointer; user-select: none;
}
.remember-row input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* =========================================================
   应用布局（桌面双栏 / 手机单栏）
   ========================================================= */
#chat-page { height: 100vh; height: 100dvh; }
.app-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.layout { flex: 1; min-height: 0; display: flex; position: relative; overflow: hidden; }

.side {
  width: 320px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--border); min-width: 0; position: relative;
}
.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--chat-bg); }
.tabbar { display: none; }

/* ---------- 侧栏头部 ---------- */
.side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.me { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.me-info { min-width: 0; flex: 1; overflow: hidden; }
.me-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-acc { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--muted); position: relative;
}
.icon-btn:hover { background: var(--chip); color: var(--accent); }
.icon-btn.playing { color: var(--accent); }
.bell-dot {
  position: absolute; top: 5px; right: 5px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger); border: 1.5px solid var(--panel);
}
/* v30：微信式「+」号气泡菜单 */
.plus-dot {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger); border: 1.5px solid var(--panel);
}
.plus-menu {
  position: absolute; top: 60px; right: 12px; z-index: 60;
  background: #4c4c4c; border-radius: 8px; padding: 6px 0;
  box-shadow: 0 6px 24px rgba(0,0,0,.3); display: none; min-width: 150px;
}
.plus-menu.open { display: block; }
.plus-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 16px; color: #fff; font-size: 14px; position: relative;
}
.plus-menu-item:hover { background: rgba(255,255,255,.12); }
.plus-menu-item svg { color: #fff; flex-shrink: 0; }
.plus-menu-dot {
  margin-left: auto; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); display: inline-block;
}
/* v30：好友 Tab 数字角标 */
.tab-badge {
  position: absolute; top: 2px; right: 50%; transform: translateX(16px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 10px; line-height: 16px;
  text-align: center; font-weight: 600; border: 1.5px solid var(--bg);
}
/* v30：好友列表「好友申请」入口 */
.fr-entry {
  display: flex; gap: 12px; padding: 12px 16px; cursor: pointer; align-items: center;
  border-bottom: 1px solid var(--border); background: var(--panel);
}
.fr-entry:hover { background: var(--panel-2); }
.fr-entry-ico {
  width: 40px; height: 40px; border-radius: 8px; background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.fr-entry-main { flex: 1; min-width: 0; }
.fr-entry-name { font-size: 15px; font-weight: 500; }
.fr-entry-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fr-entry-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; line-height: 18px;
  text-align: center; font-weight: 600; flex-shrink: 0;
}

/* ---------- 未读汇总条 ---------- */
.unread-total-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 7px 14px; background: var(--accent-weak); font-size: 13px; color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.unread-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; line-height: 18px;
  display: inline-block; text-align: center; font-weight: 600;
}

/* ---------- 侧栏 Tab ---------- */
.side-tab { display: none; flex: 1; min-height: 0; flex-direction: column; }
.side-tab.active { display: flex; }
.friends-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-size: 15px; font-weight: 600;
}

/* ---------- 会话 / 好友列表 ---------- */
.conv-list { flex: 1; overflow-y: auto; min-height: 0; }
.conv-item {
  display: flex; gap: 12px; padding: 12px 16px; cursor: pointer;
  align-items: center; border-bottom: 1px solid var(--border);
}
.conv-item:hover, .conv-item.active { background: var(--panel-2); }
.conv-avatar-wrap { position: relative; flex-shrink: 0; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: #fff; font-weight: 600; user-select: none; flex-shrink: 0;
}
.online-dot {
  position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px;
  background: #22c55e; border-radius: 50%; border: 2px solid var(--panel);
}
.kefu-badge {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 10px; line-height: 1;
  padding: 3px 6px; border-radius: 3px; white-space: nowrap;
}
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.conv-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kefu-tag {
  background: var(--accent); color: #fff; font-size: 12px; padding: 2px 8px;
  border-radius: 4px; font-weight: 500;
}
.conv-time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.conv-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.conv-msg { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-badge { flex-shrink: 0; }
.friend-item { display: flex; gap: 12px; padding: 12px 16px; cursor: pointer; align-items: center; }
.friend-item:hover { background: var(--panel-2); }
.friend-main { min-width: 0; flex: 1; }
.friend-name { font-size: 15px; font-weight: 500; }
.friend-acc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chat-empty-small { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 16px; }

/* ---------- v28：群聊 / 好友申请 / 群成员 ---------- */
.friends-head-act { display: flex; gap: 6px; }
.group-avatar { background: #4a90d9; }
.group-badge {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  background: #4a90d9; color: #fff; font-size: 10px; line-height: 1;
  padding: 3px 6px; border-radius: 3px; white-space: nowrap;
}
.group-count { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.msg-sender { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.add-remark-row { margin-top: 12px; }
.add-remark-row input { width: 100%; }
.group-name-input { width: 100%; margin-bottom: 12px; }
.group-members-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.group-members { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.group-cand {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 8px; cursor: pointer;
}
.group-cand:hover { background: var(--chip); }
.group-cand input { flex-shrink: 0; }
.group-cand-name { flex: 1; min-width: 0; font-size: 14px; }
.fr-list { max-height: 360px; overflow-y: auto; }
.fr-section { margin-bottom: 16px; }
.fr-section-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.fr-item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.fr-item-main { flex: 1; min-width: 0; }
.fr-item-name { font-weight: 600; font-size: 14px; }
.fr-item-msg { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fr-item-act { display: flex; gap: 6px; flex-shrink: 0; }
.fr-pending { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.gi-list { max-height: 360px; overflow-y: auto; }
.gi-item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.gi-name { flex: 1; min-width: 0; font-size: 14px; }
.gi-owner { background: var(--accent); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 3px; margin-left: 6px; }

/* ---------- 底部 Tabbar（手机端） ---------- */
@media (max-width: 768px) {
  .side { width: 100%; }
  .chat {
    position: absolute; inset: 0; z-index: 30; width: 100%;
    transform: translateX(100%); transition: transform .24s ease;
    box-shadow: -4px 0 24px rgba(0, 0, 0, .18);
  }
  body.mobile-chat-open .chat { transform: translateX(0); }
  .tabbar {
    display: flex; height: 54px; box-sizing: content-box;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--panel); border-top: 1px solid var(--border);
  }
  body.mobile-chat-open .tabbar { display: none; }
  .tab-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; font-size: 11px; color: var(--muted); position: relative;
  }
  .tab-item.active { color: var(--accent); }
  .tab-dot {
    position: absolute; top: 6px; right: 50%; margin-right: -22px;
    width: 9px; height: 9px; border-radius: 50%; background: var(--danger);
  }
  .auth-brand { max-width: 100%; }
  .auth-wrap { gap: 20px; }
}

/* =========================================================
   聊天区
   ========================================================= */
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 15px; }

.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.back-btn {
  display: none; width: 34px; height: 34px; border-radius: 8px;
  align-items: center; justify-content: center; color: var(--text);
}
.chat-title-wrap { flex: 1; min-width: 0; }
.chat-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { font-size: 12px; color: var(--muted); }
.chat-sub.on { color: #22c55e; }
.head-icon-btn { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.head-icon-btn:hover { background: var(--chip); color: var(--danger); }

@media (max-width: 768px) {
  .back-btn { display: inline-flex; }
}

/* ---------- 消息列表 ---------- */
.msg-list { flex: 1; overflow-y: auto; min-height: 0; padding: 16px 14px 8px; }
.msg-time { text-align: center; font-size: 12px; color: var(--muted); margin: 12px 0; }
.msg-row { display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-start; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.their { justify-content: flex-start; }
.msg-stack { max-width: min(560px, 74%); min-width: 0; display: flex; flex-direction: column; }
.msg-row.mine .msg-stack { align-items: flex-end; }
.msg-row.their .msg-stack { align-items: flex-start; }
.msg-bubble {
  padding: 9px 13px; border-radius: 10px; font-size: 15px; word-break: break-word;
  white-space: pre-wrap; position: relative;
}
.msg-row.their .msg-bubble { background: var(--bubble-their); color: var(--bubble-their-text); border-top-left-radius: 2px; }
.msg-row.mine .msg-bubble { background: var(--bubble-mine); color: var(--bubble-mine-text); border-top-right-radius: 2px; }
.msg-meta { display: flex; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 4px; padding: 0 2px; }
.read-flag.unread { color: var(--danger); }
.edit-flag { color: var(--muted); }
.msg-recall-tip {
  width: 100%; text-align: center; font-size: 12px; color: var(--muted);
  background: var(--chip); border-radius: 6px; padding: 4px 10px; margin: 4px auto;
}

/* 引用条（消息内） */
.msg-quote {
  max-width: 100%; padding: 6px 10px; border-radius: 6px 6px 0 0;
  background: var(--chip); border-left: 3px solid var(--accent);
  font-size: 12px; color: var(--muted); margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-quote b { color: var(--accent); margin-right: 6px; font-weight: 600; }
.msg-quote + .msg-bubble { border-top-left-radius: 0; }
.msg-quote-media { cursor: pointer; }
.msg-quote-media:hover { opacity: .8; }

/* 媒体消息 */
.msg-image, .msg-video { position: relative; cursor: pointer; max-width: 240px; border-radius: 10px; overflow: hidden; }
.msg-image img { display: block; max-width: 240px; max-height: 300px; border-radius: 10px; }
.msg-video video { display: block; max-width: 240px; max-height: 300px; border-radius: 10px; background: #000; }
.video-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.msg-file {
  display: flex; gap: 10px; align-items: center; cursor: pointer;
  background: var(--bubble-their); color: var(--bubble-their-text);
  border-radius: 10px; padding: 12px 14px; max-width: 260px;
}
.msg-row.mine .msg-file { background: var(--bubble-mine); color: var(--bubble-mine-text); }
.msg-file-name { font-size: 14px; font-weight: 500; word-break: break-all; }
.msg-file-act { font-size: 12px; opacity: .65; margin-top: 2px; }

/* 转账 / 红包气泡 */
.msg-money {
  width: 220px; border-radius: 10px; overflow: hidden; color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12); cursor: pointer;
}
.msg-money.transfer { background: linear-gradient(135deg, #f7a35c, #fa9d3b); }
.msg-money.redpacket { background: linear-gradient(135deg, #f5504e, #e83836); }
.money-top { display: flex; justify-content: space-between; padding: 12px 14px 4px; font-size: 15px; font-weight: 600; }
.money-bottom { padding: 0 14px 12px; font-size: 12px; opacity: .85; }

/* ---------- 输入区 ---------- */
.chat-input-bar { background: var(--panel); border-top: 1px solid var(--border); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.quote-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  background: var(--chip); border-radius: 8px; padding: 7px 10px;
}
.quote-text {
  flex: 1; min-width: 0; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quote-cancel { color: var(--muted); font-size: 13px; padding: 2px 6px; flex-shrink: 0; }
.tool-row { display: flex; gap: 2px; margin-bottom: 6px; }
.tool-btn { width: 38px; height: 38px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.tool-btn:hover { background: var(--chip); color: var(--accent); }
.input-row { display: flex; gap: 10px; align-items: flex-end; }
#msg-input {
  flex: 1; min-width: 0; resize: none; max-height: 110px;
  border-radius: 10px; padding: 10px 12px; line-height: 1.4;
}
.btn-send {
  flex-shrink: 0; padding: 10px 20px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600;
}
.btn-send:active { opacity: .85; }

/* ---------- 表情面板 ---------- */
#emoji-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--panel); border-top: 1px solid var(--border);
  transform: translateY(100%); transition: transform .2s ease;
  max-height: 260px; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom);
}
#emoji-panel.open { transform: translateY(0); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); padding: 10px; }
.emoji-item { font-size: 26px; padding: 8px 0; border-radius: 8px; }
.emoji-item:active { background: var(--chip); }

/* =========================================================
   弹窗通用
   ========================================================= */
.mask {
  position: fixed; inset: 0; background: var(--mask); z-index: 70;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.mask.show { opacity: 1; pointer-events: auto; }
.dialog {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.96);
  z-index: 71; background: var(--dialog-bg); color: var(--text);
  border-radius: 14px; padding: 24px 22px 18px; width: 92%; max-width: 420px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: all .18s ease; max-height: 86vh; overflow-y: auto;
}
.dialog.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.dialog h3 { font-size: 17px; margin-bottom: 16px; text-align: center; }
.btn-primary {
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600;
  border-radius: 8px; padding: 11px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary:active { opacity: .85; }
.btn-primary.sm { font-size: 14px; padding: 9px 16px; }
.btn-primary.danger { background: var(--danger); }
.btn-ghost {
  width: 100%; margin-top: 14px; padding: 10px; border-radius: 8px;
  background: var(--chip); color: var(--chip-text); font-size: 14px; font-weight: 500;
}
.btn-mini {
  padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
  background: var(--chip); color: var(--chip-text);
}
.btn-mini.primary { background: var(--accent); color: #fff; }
.btn-mini:disabled { opacity: .6; cursor: not-allowed; }
.money-btns { display: flex; gap: 10px; margin-top: 16px; }
.money-btns .btn-primary, .money-btns .btn-ghost { flex: 1; margin-top: 0; }

/* ---------- v31：通用确认弹窗 ---------- */
.confirm-dialog { max-width: 360px; }
.confirm-message { font-size: 14px; color: var(--muted); line-height: 1.6; text-align: center; margin-bottom: 4px; word-break: break-all; }

/* ---------- 添加好友 ---------- */
.add-tip { text-align: center; font-size: 13px; color: var(--muted); padding: 22px 0; }
.add-tip.err { color: var(--danger); }
.add-user { display: flex; align-items: center; gap: 12px; padding: 14px 4px; }
.add-user-info { flex: 1; min-width: 0; }
.add-user-name { font-weight: 600; }
.add-user-acc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- 红包 / 转账 / 支付 ---------- */
.money-dialog { text-align: center; }
.money-icon { font-size: 44px; margin: 6px 0 14px; }
.money-label { display: block; font-size: 13px; color: var(--muted); text-align: left; margin-bottom: 8px; }
#money-amount { font-size: 24px; text-align: center; font-weight: 600; }
#money-remark { margin-top: 10px; }
.pay-dialog { text-align: center; }
.pay-amount { font-size: 26px; font-weight: 700; margin: 8px 0 14px; }
#pay-qr { background: #fff; padding: 10px; border-radius: 10px; border: 1px solid var(--border); }
#pay-status { margin: 12px 0 4px; font-size: 14px; color: var(--muted); }
#pay-status.paid { color: var(--accent); font-weight: 600; }
.pay-out-no { font-size: 11px; color: var(--muted); word-break: break-all; }

/* =========================================================
   v6：长按消息菜单
   ========================================================= */
.msg-menu {
  position: fixed; z-index: 90; min-width: 132px; background: var(--dialog-bg);
  border-radius: 10px; box-shadow: var(--shadow); padding: 4px;
  opacity: 0; pointer-events: none; transform: scale(.9); transform-origin: top center;
  transition: opacity .12s ease, transform .12s ease;
}
.msg-menu.show { opacity: 1; pointer-events: auto; transform: scale(1); }
.msg-menu button {
  display: block; width: 100%; text-align: left; padding: 11px 16px;
  font-size: 14px; color: var(--text); border-radius: 7px;
}
.msg-menu button:active { background: var(--chip); }

/* ---------- 编辑消息弹窗 ---------- */
#edit-dialog textarea { resize: vertical; min-height: 90px; }

/* =========================================================
   v6：公告弹窗 / 公告列表
   ========================================================= */
.ann-dialog { text-align: center; }
.ann-flag {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 11px; padding: 3px 10px; border-radius: 10px; margin-bottom: 10px;
}
.ann-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; word-break: break-word; }
.ann-content {
  font-size: 14px; text-align: left; white-space: pre-wrap; word-break: break-word;
  line-height: 1.8; max-height: 44vh; overflow-y: auto; padding: 0 2px;
  background: var(--chip); border-radius: 8px; padding: 12px;
}
.ann-btns { display: flex; gap: 10px; margin-top: 16px; }
.ann-btns .btn-primary { flex: 1.4; }
.ann-btns .btn-ghost { flex: 1; margin-top: 0; }
.ann-close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--muted); background: var(--chip);
}
.ann-dialog.force .ann-close { display: none; }

.bell-list { max-height: 56vh; overflow-y: auto; }
.bell-item { padding: 12px 2px; border-bottom: 1px solid var(--border); }
.bell-item:last-child { border-bottom: none; }
.bell-item.unread .bell-title::after {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); margin-left: 6px; vertical-align: middle;
}
.bell-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bell-badge {
  flex-shrink: 0; font-size: 11px; padding: 2px 7px; border-radius: 4px;
  background: var(--accent-weak); color: var(--accent); font-weight: 600;
}
.bell-badge.force { background: rgba(250, 81, 81, .14); color: var(--danger); }
.bell-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell-time { flex-shrink: 0; font-size: 11px; color: var(--muted); }
.bell-body { font-size: 13px; color: var(--muted); line-height: 1.7; word-break: break-word; }

/* =========================================================
   v6：我的（按钮式子页）
   ========================================================= */
.profile-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.profile-hero {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 16px 18px; background: var(--panel-2);
}
.pt-name { font-size: 17px; font-weight: 600; margin-top: 8px; }
.pt-acc { font-size: 12px; color: var(--muted); }
.plist { margin: 10px 12px; border-radius: 12px; overflow: hidden; background: var(--card); border: 1px solid var(--border); }
.plist-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; font-size: 15px; color: var(--text);
  border-bottom: 1px solid var(--border); text-align: left;
}
.plist-item:last-child { border-bottom: none; }
.plist-item svg { color: var(--accent); flex-shrink: 0; }
.plist-item span { flex: 1; min-width: 0; }
.pp-arrow { color: var(--muted); font-size: 18px; flex-shrink: 0; }
.plist-item:active { background: var(--chip); }
.btn-logout-big {
  display: block; width: calc(100% - 24px); margin: 14px auto; padding: 13px;
  border-radius: 12px; background: var(--card); border: 1px solid var(--border);
  color: var(--danger); font-size: 15px; font-weight: 600;
}
.btn-logout-big:active { background: var(--chip); }

/* 子面板 */
.pp-back {
  display: flex; align-items: center; gap: 4px; padding: 14px 16px;
  font-size: 15px; font-weight: 600; color: var(--accent); width: 100%;
}
.pp-title { font-size: 16px; font-weight: 700; padding: 4px 16px 12px; }
.profile-block {
  margin: 0 12px 12px; padding: 16px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border);
}
.profile-block h4 { font-size: 14px; margin-bottom: 12px; }
.profile-block .btn-primary { margin-top: 6px; }
.money-label { font-size: 13px; color: var(--muted); }
.pp-desc { font-size: 12px; color: var(--muted); line-height: 1.7; margin-bottom: 12px; }
.profile-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 9px 0; font-size: 14px; border-bottom: 1px dashed var(--border);
}
.profile-row:last-child { border-bottom: none; }
.profile-row span { color: var(--muted); flex-shrink: 0; }
.profile-row b { font-weight: 500; word-break: break-all; text-align: right; min-width: 0; }

/* ---------- 收藏列表 ---------- */
.fav-list { padding: 4px 12px 20px; }
.fav-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; user-select: none; -webkit-user-select: none;
}
.fav-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.fav-from { font-size: 13px; font-weight: 600; color: var(--accent); }
.fav-time { font-size: 11px; color: var(--muted); }
.fav-item .msg-image, .fav-item .msg-video { max-width: 200px; }
.fav-item .msg-image img, .fav-item .msg-video video { max-width: 200px; max-height: 220px; }
.fav-item .msg-bubble {
  background: var(--bubble-their); color: var(--bubble-their-text);
  border-radius: 10px; padding: 9px 13px; font-size: 14px; white-space: pre-wrap; word-break: break-word;
}
.fav-item .msg-money { cursor: default; }
.fav-hint { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0; }

/* ---------- 主题切换面板 ---------- */
.mode-row { display: flex; gap: 10px; }
.mode-btn {
  flex: 1; padding: 12px; border-radius: 10px; background: var(--chip);
  color: var(--chip-text); font-size: 14px; font-weight: 500; border: 2px solid transparent;
}
.mode-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-item {
  display: flex; flex-direction: column; gap: 7px; align-items: center;
  padding: 10px 6px; border-radius: 10px; border: 2px solid transparent;
  font-size: 12px; color: var(--text); background: var(--panel-2);
}
.theme-item.active { border-color: var(--accent); }
.th-preview {
  width: 100%; height: 44px; border-radius: 8px; display: block;
  border: 1px solid var(--border);
}
.th-default { background: linear-gradient(135deg, #ededed 50%, #95EC69 50%); }
.th-gufeng { background: linear-gradient(135deg, #f9f2e4 50%, #c65d3b 50%); }
.th-katong { background: linear-gradient(135deg, #ffd9e8 50%, #7ecbff 50%); }
.th-keji { background: linear-gradient(135deg, #0c1729 50%, #00d1ff 50%); }
.th-shangwu { background: linear-gradient(135deg, #e9edf4 50%, #1f6feb 50%); }
.th-shuibo { background: linear-gradient(135deg, #d4f1f9 50%, #3aa9dc 50%); }
.th-dongtai { background: linear-gradient(120deg, #7c5cff, #ff7ac8, #00c6ff, #7c5cff); background-size: 300% 300%; animation: dongtaiShift 8s linear infinite; }
.th-shuicai { background: linear-gradient(135deg, #fef6ec 35%, #f2b9ac 65%, #7fb8a4); }
.th-jianjie { background: linear-gradient(135deg, #f5f5f5 50%, #9aa0a6 50%); }

/* =========================================================
   预览灯箱（v6：媒体加边框 + 下载按钮）
   ========================================================= */
#lightbox {
  position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, .88);
  display: none; flex-direction: column;
}
#lightbox.show { display: flex; }
.lb-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; color: #fff;
}
.lb-title { font-size: 15px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-acts { display: flex; gap: 8px; flex-shrink: 0; }
.lb-btn {
  color: #fff; font-size: 14px; background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px; padding: 7px 14px;
}
.lb-btn:active { background: rgba(255, 255, 255, .28); }
.lb-body {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 0 18px calc(18px + env(safe-area-inset-bottom)); overflow: auto;
}
/* v6 核心：预览内容加白色边框 */
.lb-body img, .lb-body video {
  max-width: calc(100vw - 72px); max-height: calc(100vh - 150px);
  border: 8px solid #ffffff; border-radius: 8px;
  box-shadow: 0 10px 46px rgba(0, 0, 0, .55); background: #000;
}
.lb-file { text-align: center; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lb-file svg { color: #cfd8dc; }
.lb-file-name { font-size: 15px; word-break: break-all; max-width: 80vw; }

/* =========================================================
   Toast
   ========================================================= */
.kefu-toast {
  position: fixed; left: 50%; bottom: 14%; transform: translateX(-50%) translateY(8px);
  background: var(--toast-bg); color: var(--panel); font-size: 13px; line-height: 1.5;
  padding: 10px 16px; border-radius: 8px; z-index: 120; max-width: 78vw;
  opacity: 0; transition: all .22s ease; pointer-events: none; white-space: pre-line;
}
html[data-mode="dark"] .kefu-toast { color: #111; }
.kefu-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.kefu-toast-err { background: rgba(220, 53, 69, .94); color: #fff; }

/* =========================================================
   v9：点击消息操作条 / 灯箱操作按钮 / 手机端媒体缩略图 90×90
   ========================================================= */
.msg-row { position: relative; }
.msg-act-bar { position: absolute; top: -40px; z-index: 40; display: flex; gap: 2px; background: rgba(31,31,31,.94); border-radius: 10px; padding: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.28); }
.msg-act-bar.below { top: auto; bottom: -40px; }
.msg-row.mine .msg-act-bar { right: 44px; }
.msg-row.their .msg-act-bar { left: 44px; }
.msg-act-bar button { border: 0; background: transparent; color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.msg-act-bar button:hover { background: rgba(255,255,255,.16); }
.lb-btn.lb-danger { color: #ff7b7b; }
.lb-head .lb-acts { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
/* v9：文件预览弹窗补边框（此前缺少边框） */
.lb-file { border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 22px 26px; background: rgba(0,0,0,.28); }
@media (max-width: 768px) {
  .msg-image, .msg-video { max-width: 90px; }
  .msg-image img { width: 90px; height: 90px; object-fit: cover; display: block; }
  .msg-video video { width: 90px; height: 90px; object-fit: cover; display: block; }
  .msg-act-bar { top: auto; bottom: -42px; }
  .msg-act-bar.below { top: -42px; bottom: auto; }
  .lb-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* =========================================================
   v10：我的页余额卡 / 付款方式按钮 / 充值弹窗
   ========================================================= */
.balance-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: linear-gradient(135deg, #ffb24d, #f5504e); color: #fff; border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; box-shadow: 0 4px 14px rgba(245,80,78,.25); }
.balance-card .bal-label { display: block; font-size: 12px; opacity: .92; margin-bottom: 4px; }
.balance-card .bal-num { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.balance-card button { border: 0; background: rgba(255,255,255,.22); color: #fff; border-radius: 999px; padding: 8px 18px; font-size: 14px; cursor: pointer; flex-shrink: 0; }
.balance-card button:hover { background: rgba(255,255,255,.32); }
.money-channels { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.pay-method { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 92px; border: 1.5px solid var(--border); background: transparent; border-radius: 10px; padding: 9px 10px; cursor: pointer; font-size: 12px; color: var(--text); }
.pay-method.on { border-color: var(--accent); background: var(--accent-weak); }
.pay-method em { font-style: normal; color: var(--muted); font-size: 11px; }
.pay-method .pm-ico { width: 30px; height: 30px; border-radius: 8px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; font-style: normal; }
.pm-ico.pm-bal { background: #ffb84d; }
.pm-ico.pm-ali { background: #1677ff; }
.pm-ico.pm-wx { background: #07c160; }
.pm-none { font-size: 12px; color: var(--muted); padding: 6px 0; }
.recharge-balance { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* v25：账单查看 */
.bills-tabs { display: flex; gap: 8px; padding: 0 16px 12px; }
.bills-tab { flex: 1; border: 1.5px solid var(--border); background: transparent; color: var(--muted); border-radius: 999px; padding: 8px 0; font-size: 13px; cursor: pointer; }
.bills-tab.active { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.bills-list { padding: 0 12px 8px; }
.bills-loading, .bills-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0; }
.bill-item { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.bill-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.bill-type { font-size: 13px; font-weight: 600; color: var(--text); }
.bill-type.recharge { color: #1677ff; }
.bill-type.transfer { color: #07c160; }
.bill-type.redpacket { color: #f5504e; }
.bill-status { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.bill-status.paid { background: rgba(7,193,96,.12); color: #07c160; }
.bill-status.pending { background: rgba(255,180,77,.15); color: #e08a00; }
.bill-status.expired { background: var(--chip); color: var(--muted); }
.bill-amount { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.bill-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.bill-no { font-size: 11px; color: var(--muted); margin-top: 4px; word-break: break-all; }
.bill-del { margin-top: 8px; padding: 4px 12px; font-size: 12px; background: var(--danger); color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.bill-del:active { opacity: .85; }
.avatar-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.avatar-preview { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; }
.avatar-upload-tip { font-size: 12px; color: var(--muted); margin-top: 10px; }
.bills-pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px 20px; }
.bills-pager .pg-btn { border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.bills-pager .pg-info { font-size: 12px; color: var(--muted); }

/* v14：扫码弹窗「唤起支付宝支付」按钮 */
.pay-wake-btn {
  width: 100%;
  margin-top: 12px;
  background: #1677ff;
  color: #fff;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.pay-wake-btn:hover { background: #0e5fd8; }
.pay-wake-btn:active { background: #0b54c2; }

