/* ---- 设计系统 Design Token ---- */
:root {
  color-scheme: light;
  /* 品牌（Tiffany 蓝 #0ABAB5） */
  --brand: #0ABAB5;
  --brand-hover: #089C98;
  --brand-soft: rgba(10, 186, 181, 0.10);
  --bubble-mine: #D5F3F1;
  --bubble-mine-text: #0E3B38;
  --bubble-theirs: #ffffff;
  /* 品牌渐变体系 */
  --brand-gradient: linear-gradient(135deg, #26C9C3 0%, #0ABAB5 48%, #07938F 100%);
  --brand-gradient-hover: linear-gradient(135deg, #30D0CA 0%, #0BB8B2 52%, #079995 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(38,201,195,.15), rgba(10,186,181,.07));
  /* 弥散光斑 */
  --auth-glow-1: rgba(38, 201, 195, 0.16);
  --auth-glow-2: rgba(7, 147, 143, 0.11);
  --auth-glow-3: rgba(120, 190, 235, 0.08);
  /* 功能色 */
  --danger: #e64340;
  --danger-hover: #c93633;
  --danger-gradient: linear-gradient(135deg, #f06a66, #e64340);
  --warning: #f0a020;
  --success: #67c23a;
  --success-gradient: linear-gradient(135deg, #7ed36a, #67c23a);
  /* 背景 */
  --bg-page: #f5f6f8;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-hover: #ececec;
  --bg-input: #ffffff;
  --bg-mask: rgba(0,0,0,0.5);
  /* 文字 */
  --text-primary: #1a1a1a;
  --text-secondary: #8a8f98;
  --text-tertiary: #b0b0b0;
  --text-inverse: #ffffff;
  /* 边框/分隔 */
  --border: #e0e0e0;
  --divider: #ededed;
  /* 状态 */
  --online: #0ABAB5;
  --offline: #cccccc;
  --unread: #f43530;
  /* 圆角（四档，更柔和） */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  /* 间距（4 的倍数） */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  /* 阴影（增强悬浮感） */
  --shadow-card: 0 2px 12px rgba(20, 40, 38, 0.06), 0 1px 3px rgba(20,40,38,.04);
  --shadow-float: 0 8px 24px rgba(20, 40, 38, 0.10), 0 2px 6px rgba(20,40,38,.06);
  --shadow-modal: 0 16px 48px rgba(20, 40, 38, 0.18);
  --shadow-brand: 0 6px 16px rgba(10, 186, 181, 0.32);
}

/* 深色主题 */
[data-theme="dark"] {
  color-scheme: dark;
  --brand: #17C4BE;
  --brand-hover: #11B0AB;
  --brand-soft: rgba(23, 196, 190, 0.14);
  --bubble-mine: #0E7C78;
  --bubble-mine-text: #ffffff;
  --bubble-theirs: #262A31;
  /* 深色下渐变降低亮度，避免刺眼 */
  --brand-gradient: linear-gradient(135deg, #1EC9C3 0%, #12B5AF 48%, #0C9A95 100%);
  --brand-gradient-hover: linear-gradient(135deg, #26CFC9 0%, #14BAB4 52%, #0DA09B 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(30,201,195,.18), rgba(18,181,175,.10));
  --auth-glow-1: rgba(30, 201, 195, 0.12);
  --auth-glow-2: rgba(12, 154, 149, 0.09);
  --auth-glow-3: rgba(120, 190, 235, 0.05);
  --danger: #e64340;
  --danger-hover: #f05653;
  --bg-page: #16181C;
  --bg-card: #1E2126;
  --bg-sidebar: #1E2126;
  --bg-hover: #262A31;
  --bg-input: #262A31;
  --bg-mask: rgba(0,0,0,0.7);
  --text-primary: #E6E8EB;
  --text-secondary: #8A8F98;
  --text-tertiary: #5a5f68;
  --text-inverse: #ffffff;
  --border: #2A2D33;
  --divider: #2A2D33;
  --online: #17C4BE;
  --offline: #4a4f58;
  --unread: #f43530;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-float: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-modal: 0 16px 48px rgba(0,0,0,0.6);
  --shadow-brand: 0 6px 16px rgba(18, 181, 175, 0.28);
}

/* 深色主题下登录页适配（背景换深色底，光斑透明度已随 token 下调，气泡 Tiffany 低透明度） */
[data-theme="dark"] .auth-page { background: radial-gradient(ellipse 60% 55% at 12% 8%, var(--auth-glow-1), transparent 60%), radial-gradient(ellipse 55% 50% at 88% 92%, var(--auth-glow-2), transparent 60%), radial-gradient(ellipse 40% 40% at 70% 12%, var(--auth-glow-3), transparent 55%), linear-gradient(160deg, #10171a 0%, #0f1618 45%, #0e1416 100%); }
[data-theme="dark"] .auth-box { background: #1E2126; border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 12px 32px rgba(0,0,0,0.45); }
[data-theme="dark"] .auth-bubble { border-color: rgba(23,196,190,.22); }
[data-theme="dark"] .logo b { color: #17C4BE; }
[data-theme="dark"] .logo span { color: #B8C2C8; }
[data-theme="dark"] .auth-tabs { background: #262A31; }
[data-theme="dark"] .auth-tab.active { background: #1E2126; color: #17C4BE; }
[data-theme="dark"] .auth-box input { background: #262A31; color: var(--text-primary); }
[data-theme="dark"] .auth-box input:focus { background: #1E2126; }
[data-theme="dark"] .input-wrap .input-icon { color: #6A7480; }
[data-theme="dark"] .auth-features { color: #6A7480; }

/* 无障碍：用户偏好减少动效时，停用背景动效 */
@media (prefers-reduced-motion: reduce) {
  .auth-blob, .auth-bubble { animation: none !important; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif; background: var(--bg-page); color: var(--text-primary); }
.hidden { display: none !important; }

/* 连接状态提示条 */
.conn-status { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; padding: 7px 12px; text-align: center; font-size: 13px; color: #fff; background: var(--warning); transition: background .3s; }
.conn-status.connected { background: var(--success); }

/* 登录/注册页 —— 中性近白背景 + 品牌色点缀 */
.auth-page { height: 100%; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; background: radial-gradient(ellipse 60% 55% at 12% 8%, var(--auth-glow-1), transparent 60%), radial-gradient(ellipse 55% 50% at 88% 92%, var(--auth-glow-2), transparent 60%), radial-gradient(ellipse 40% 40% at 70% 12%, var(--auth-glow-3), transparent 55%), linear-gradient(160deg, #FBFCFC 0%, #F7F9F9 45%, #F3F6F6 100%); }

/* 动态背景装饰层（3 光斑 + 5 品牌气泡，收敛动效） */
.auth-bg-decor { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
/* 弥散光斑 */
.auth-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; will-change: transform; }
.auth-blob.b1 { width: 420px; height: 420px; top: -110px; left: -110px; background: radial-gradient(circle at 35% 35%, var(--auth-glow-1), transparent 65%); animation: blobDrift1 13s ease-in-out infinite; }
.auth-blob.b2 { width: 340px; height: 340px; bottom: -90px; right: -80px; background: radial-gradient(circle at 60% 60%, var(--auth-glow-2), transparent 65%); animation: blobDrift2 16s ease-in-out infinite; }
.auth-blob.b3 { width: 260px; height: 260px; top: 20%; right: 14%; background: radial-gradient(circle at 50% 50%, var(--auth-glow-3), transparent 60%); animation: blobDrift3 17s ease-in-out infinite; }
@keyframes blobDrift1 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(55px,-45px) scale(1.10); } 66% { transform: translate(-38px,36px) scale(.95); } }
@keyframes blobDrift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-60px,45px) scale(1.08); } }
@keyframes blobDrift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(38px,52px) scale(1.12); } }

/* 品牌气泡上升流 */
.auth-bubble { position: absolute; bottom: -60px; border: 1.5px solid rgba(10,186,181,.35); border-radius: 14px 14px 14px 3px; pointer-events: none; will-change: transform, opacity; animation: bubbleRise linear infinite; }
@keyframes bubbleRise { 0% { transform: translateY(0) translateX(0); opacity: 0; } 12% { opacity: .8; } 85% { opacity: .5; } 100% { transform: translateY(-108vh) translateX(14px); opacity: 0; } }

/* 登录卡片 */
.auth-box { position: relative; z-index: 1; background: #FFFFFF; padding: 44px 40px 32px; border-radius: var(--radius-xl); box-shadow: 0 12px 32px rgba(20,40,38,0.08); text-align: center; width: 400px; max-width: 92vw; border: 1px solid rgba(20,40,38,0.06); }

/* 字标系统：PP 大 + Chat 小（同字重 800，仅字号对比） */
.logo { display: flex; align-items: baseline; justify-content: center; gap: 2px; margin-bottom: 24px; }
.logo-icon { width: 52px; height: 52px; flex-shrink: 0; border-radius: 14px; margin-right: 10px; align-self: center; }
.logo b { font-size: 56px; font-weight: 700; letter-spacing: -1px; line-height: 1; color: #0ABAB5; }
.logo span { font-size: 32px; font-weight: 600; letter-spacing: -0.5px; line-height: 1; color: #5A6A68; }

/* 胶囊分段 Tab */
.auth-tabs { display: flex; margin-bottom: 20px; padding: 3px; background: #F1F4F5; border-radius: 12px; border: none; }
.auth-tab { flex: 1; padding: 9px; border: none; background: none; font-size: 15px; cursor: pointer; color: var(--text-secondary); border-radius: 9px; transition: background .18s, color .18s, box-shadow .18s; }
.auth-tab.active { color: #0E7C78; font-weight: 600; background: #ffffff; box-shadow: 0 1px 3px rgba(20,40,38,0.08); }

/* 表单 */
.auth-box input { width: 100%; height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-md); font-size: 15px; outline: none; background: #F6F8F9; color: var(--text-primary); transition: border-color .18s, box-shadow .18s, background .18s; }
.auth-box input:focus { border-color: var(--brand); background: #ffffff; box-shadow: 0 0 0 3px rgba(10, 186, 181, 0.15); }
.input-wrap { position: relative; margin-bottom: 12px; }
.input-wrap .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #9AA3AC; pointer-events: none; }
.input-wrap input { padding-left: 42px; }
.auth-box .primary-btn { width: 100%; height: 44px; padding: 0; background: #0ABAB5; color: #fff; border: none; border-radius: var(--radius-md); font-size: 16px; font-weight: 600; letter-spacing: .5px; cursor: pointer; transition: background .15s, transform .15s; }
.auth-box .primary-btn:hover { background: #089C98; transform: translateY(-1px); }
.auth-box .primary-btn:active { transform: translateY(0); }
#login-btn, #register-btn { width: 100%; height: 44px; padding: 0; background: #0ABAB5; color: #fff; border: none; border-radius: var(--radius-md); font-size: 16px; font-weight: 600; letter-spacing: .5px; cursor: pointer; transition: background .15s, transform .15s; }
#login-btn:hover, #register-btn:hover { background: #089C98; transform: translateY(-1px); }
#login-btn:active, #register-btn:active { transform: translateY(0); }
.error-msg { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 6px; text-align: left; }
/* 底部特性条 */
.auth-features { margin-top: 20px; font-size: 11px; color: #A6AFB8; letter-spacing: .3px; }

/* 主界面 */
.main-page { display: flex; height: 100%; }

/* 侧边栏 */
.sidebar { width: 300px; background: var(--bg-sidebar); color: var(--text-primary); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 16px; padding-top: calc(16px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))); border-bottom: 1px solid var(--divider); display: flex; align-items: center; justify-content: space-between; }
.self-info { display: flex; align-items: center; gap: 10px; font-size: 16px; min-width: 0; min-height: 44px; cursor: pointer; }
#self-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { border: none; background: var(--bg-hover); color: var(--text-primary); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; }
.logout-btn .icon { width: 16px; height: 16px; }
.logout-btn:hover { background: var(--border); color: var(--text-primary); }
.header-actions { position: relative; }
.more-btn { border: none; background: none; cursor: pointer; padding: 6px; min-width: 36px; min-height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); flex-shrink: 0; }
.more-btn:hover { background: var(--bg-hover); color: var(--brand); }
.sidebar-menu { position: absolute; top: calc(100% + 4px); right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-modal); padding: 4px; min-width: 140px; z-index: 100; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: none; background: none; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-primary); text-align: left; }
.menu-item:hover { background: var(--bg-hover); }
.menu-item .icon { width: 16px; height: 16px; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: rgba(230, 67, 64, 0.08); }

.sidebar-tabs { display: flex; border-bottom: 1px solid var(--divider); }
.s-tab { flex: 1; padding: 12px; min-height: 44px; border: none; background: none; color: var(--text-secondary); font-size: 15px; cursor: pointer; }
.s-tab.active { color: var(--brand); font-weight: bold; border-bottom: 2px solid var(--brand); }

.panel { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.user-list { list-style: none; overflow-y: auto; flex: 1; }
.user-item { position: relative; overflow: hidden; cursor: pointer; }
.user-item-content { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--bg-card); transition: transform .2s ease, background .15s; width: 100%; }
.user-item:hover .user-item-content { background: var(--bg-hover); }
.user-item.active .user-item-content { background-color: var(--bg-card); background-image: var(--brand-gradient-soft); }
.user-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; border-radius: 2px; background: var(--brand-gradient); z-index: 2; }
.user-item-delete { position: absolute; right: 0; top: 0; bottom: 0; width: 72px; border: none; background: var(--danger); color: #fff; font-size: 14px; cursor: pointer; z-index: 0; }
.user-item.swiped .user-item-content { transform: translateX(-72px); }
.user-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.user-name-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pin-badge { color: var(--brand); display: flex; flex-shrink: 0; }
.pin-badge .icon { width: 12px; height: 12px; }
.user-item.pinned .user-item-content { background-color: var(--bg-sidebar); background-image: var(--brand-gradient-soft); }
.user-preview { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-time { font-size: 11px; color: var(--text-secondary); flex-shrink: 0; }
.user-empty { padding: 20px 16px; color: var(--text-secondary); font-size: 13px; }

/* ---- 通讯录 ---- */
.contacts-box { position: relative; width: 360px; max-width: 92vw; max-height: 80vh; display: flex; flex-direction: column; }
.contacts-list { flex: 1; overflow-y: auto; padding-bottom: 16px; min-height: 200px; }
.contacts-letter { padding: 5px 16px; font-size: 13px; font-weight: 600; color: var(--text-secondary); background: var(--bg-sidebar); position: sticky; top: 0; z-index: 1; }
.contact-item { display: flex; align-items: center; gap: 12px; padding: 9px 16px; cursor: pointer; }
.contact-item:hover { background: var(--bg-hover); }
.contact-name { font-size: 15px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contacts-index { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 0; z-index: 2; }
.contacts-index button { width: 22px; height: 19px; border: none; background: none; color: var(--brand); font-size: 11px; font-weight: 600; cursor: pointer; padding: 0; line-height: 1; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dot.online { background: var(--online); }
.status-dot.offline { background: var(--offline); }

/* 添加好友 */
.search-row { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--divider); }
.search-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-input); color: var(--text-primary); font-size: 14px; outline: none; }
.search-row input:focus { border-color: var(--brand); }
.search-row button { padding: 8px 14px; background: var(--brand); color: var(--text-inverse); border: none; border-radius: 4px; cursor: pointer; font-size: 14px; flex-shrink: 0; }
.search-row button:hover { background: var(--brand-hover); }

.requests-title { padding: 12px 16px 6px; font-size: 13px; color: var(--text-secondary); border-top: 1px solid var(--divider); }
.request-item { display: flex; align-items: center; gap: 8px; padding: 10px 16px; }
.request-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-accept { padding: 5px 12px; background: var(--brand); color: var(--text-inverse); border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }
.btn-accept:hover { background: var(--brand-hover); }
.btn-reject { padding: 5px 12px; background: var(--danger); color: var(--text-inverse); border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }
.btn-reject:hover { background: #c93633; }
.btn-admin { padding: 5px 12px; background: #3a7afe; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; flex-shrink: 0; }
.btn-admin:hover { background: #2563eb; }
.btn-admin.muted { background: #e0e0e0; color: #666; }
.btn-admin.muted:hover { background: #d0d0d0; }
.btn-disabled { padding: 5px 12px; background: var(--bg-hover); color: var(--text-secondary); border: none; border-radius: 4px; font-size: 13px; }

.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #26C9C3, #0ABAB5, #07938F); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; box-shadow: inset 0 -1px 2px rgba(0,0,0,0.08); }
.chat-avatar { width: 32px; height: 32px; font-size: 14px; cursor: pointer; }

/* 统一 SVG 线条图标（Lucide） */
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; display: block; }

/* 聊天区 */
.chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-secondary); }
.empty-icon { width: 64px; height: 64px; margin-bottom: 16px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-gradient-soft); color: var(--brand); box-shadow: 0 0 0 6px rgba(10, 186, 181, 0.06); }
.empty-icon .icon { width: 30px; height: 30px; }

.chat-window { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-header { padding: 14px 16px; padding-top: calc(14px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))); background: var(--bg-page); border-bottom: 1px solid var(--divider); display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; flex-shrink: 0; }
.back-btn { display: none; border: none; background: none; cursor: pointer; color: var(--text-primary); padding: 4px; align-items: center; justify-content: center; }
.chat-status { font-size: 12px; font-weight: normal; }
.chat-status.online { color: var(--brand); }
.chat-status.offline { color: var(--text-secondary); }

.message-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
/* 聊天背景（B3）：仅当前会话 message-list 生效 */
.message-list.bg-mint { background: linear-gradient(160deg, #e0f7f5 0%, #d2f0ec 50%, #c8ece6 100%); }
.message-list.bg-lavender { background: linear-gradient(160deg, #efe9fb 0%, #e6defa 50%, #ddd2f5 100%); }
.message-list.bg-sunset { background: linear-gradient(160deg, #fdece2 0%, #fbe4d3 50%, #f8d9c4 100%); }
.message-list.bg-slate { background: #eef0f3; }
.message-list.bg-night { background: linear-gradient(160deg, #1c2530 0%, #232f3d 50%, #2a3a4a 100%); }
/* 深色主题下背景类适配 */
[data-theme="dark"] .message-list.bg-mint { background: linear-gradient(160deg, #153b38 0%, #123430 50%, #102e2b 100%); }
[data-theme="dark"] .message-list.bg-lavender { background: linear-gradient(160deg, #2a2440 0%, #272039 50%, #241c33 100%); }
[data-theme="dark"] .message-list.bg-sunset { background: linear-gradient(160deg, #3a2a20 0%, #35261c 50%, #302219 100%); }
[data-theme="dark"] .message-list.bg-slate { background: #1e2126; }
[data-theme="dark"] .message-list.bg-night { background: linear-gradient(160deg, #0c1420 0%, #101a28 50%, #142030 100%); }
.msg-row { display: flex; flex-wrap: wrap; }
.msg-row.msg-new { animation: msgIn 0.22s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.msg-row.mine { justify-content: flex-end; }
.msg-row.theirs { justify-content: flex-start; }
.msg-row.pending { opacity: 0.6; }
.msg-row.failed .bubble { border: 1px solid #e64340; }
.msg-row.sent::after { content: '✓'; color: var(--text-tertiary); font-size: 12px; align-self: center; margin-left: 6px; white-space: nowrap; }
.msg-fail-btn { width: 22px; height: 22px; border-radius: 50%; border: none; background: #e64340; color: #fff; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; align-self: center; flex-shrink: 0; line-height: 1; }
.bubble { position: relative; max-width: 60%; padding: 9px 13px; border-radius: 16px; font-size: 15px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.mine .bubble { background: var(--bubble-mine); color: var(--bubble-mine-text); border-bottom-right-radius: 6px; }
.theirs .bubble { background: var(--bubble-theirs); color: var(--text-primary); border-bottom-left-radius: 6px; }
.image-bubble { padding: 4px; }
.image-bubble img { max-width: 240px; border-radius: 6px; display: block; }

/* 文件消息 */
.file-bubble { padding: 12px; min-width: 160px; max-width: 260px; }
.file-icon { font-size: 32px; text-align: center; margin-bottom: 8px; }
.file-name { font-size: 14px; word-break: break-all; margin-bottom: 4px; }
.file-size { font-size: 12px; color: #999; margin-bottom: 8px; }
.file-link { color: #0A6E6A; text-decoration: none; font-size: 13px; font-weight: 500; }
.msg-video { max-width: 260px; max-height: 320px; border-radius: 6px; display: block; }
.msg-img { max-width: 240px; border-radius: 6px; display: block; cursor: zoom-in; }
.image-bubble img { cursor: zoom-in; }

/* 视频放大按钮 */
.media-wrap { position: relative; display: inline-block; }
.media-zoom-btn {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px;
  background: rgba(0,0,0,0.55); color: #fff; border: none; border-radius: 6px;
  font-size: 16px; cursor: pointer; line-height: 1; display: flex;
  align-items: center; justify-content: center; transition: background 0.15s;
}
.media-zoom-btn:hover { background: rgba(0,0,0,0.8); }

/* 媒体查看器（全屏放大） */
.media-viewer { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.media-viewer.hidden { display: none; }
.media-viewer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.85); }
.media-viewer-close {
  position: absolute; top: 16px; right: 16px; width: 44px; height: 44px;
  background: rgba(255,255,255,0.15); color: #fff; border: none; border-radius: 50%;
  cursor: pointer; line-height: 1; z-index: 2;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.media-viewer-close .icon { width: 22px; height: 22px; }
.media-viewer-close:hover { background: rgba(255,255,255,0.3); }
.media-viewer-save {
  position: absolute; top: 16px; right: 72px; width: 44px; height: 44px;
  background: rgba(255,255,255,0.15); color: #fff; border: none; border-radius: 50%;
  cursor: pointer; line-height: 1; z-index: 2;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.media-viewer-save .icon { width: 20px; height: 20px; }
.media-viewer-save:hover { background: rgba(255,255,255,0.3); }
.media-viewer-content { position: relative; z-index: 1; max-width: 92vw; max-height: 92vh; display: flex; align-items: center; justify-content: center; }
.viewer-img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 4px; cursor: zoom-in; user-select: none; -webkit-user-drag: none; -webkit-user-select: none; touch-action: none; will-change: transform; }
.viewer-video { max-width: 92vw; max-height: 92vh; border-radius: 4px; background: #000; }
.viewer-loading {
  position: absolute; width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25); border-top-color: #fff;
  animation: viewer-spin 0.8s linear infinite; z-index: 1;
}
@keyframes viewer-spin { to { transform: rotate(360deg); } }

/* 消息里的链接 */
.msg-link { color: var(--brand); text-decoration: underline; cursor: pointer; word-break: break-all; }
.msg-link:hover { color: var(--brand-hover); }
.mine .bubble .msg-link { color: var(--bubble-mine-text); text-decoration: underline; }

/* 内置浏览器弹窗 */
.browser-modal { position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; background: #fff; }
.browser-modal.hidden { display: none; }
.browser-topbar { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 10px; background: var(--bg-card); border-bottom: 1px solid var(--divider); flex-shrink: 0; }
.browser-urlbox { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.browser-title { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.browser-url { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.browser-btn { border: none; background: none; cursor: pointer; padding: 7px 11px; font-size: 13px; color: var(--text-secondary); border-radius: 6px; white-space: nowrap; flex-shrink: 0; }
.browser-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.browser-icon-btn { font-size: 16px; padding: 7px 9px; line-height: 1; }
.browser-back { font-size: 26px; padding: 0 8px 5px; font-weight: 500; }
.browser-primary { color: var(--brand); font-weight: 600; }
.browser-primary:hover { color: var(--brand-hover); }
.browser-progress { height: 2px; background: transparent; position: relative; flex-shrink: 0; }
.browser-progress-bar { height: 100%; width: 0; background: var(--brand); transition: width 2.5s ease; }
.browser-tip { padding: 8px 14px; font-size: 12px; color: #8a6d3b; background: #fcf8e3; border-bottom: 1px solid #f0e6c8; flex-shrink: 0; }
.browser-tip.hidden { display: none; }
.browser-frame { flex: 1; width: 100%; border: none; background: #fff; }

/* 影视播放器（干净，无片源站广告） */
.vod-player-modal { position: fixed; inset: 0; z-index: 10001; display: flex; flex-direction: column; background: #000; }
.vod-player-modal.hidden { display: none; }
.vod-player-topbar { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 10px; background: #000; flex-shrink: 0; }
.vod-player-topbar .browser-back { color: #fff; }
.vod-player-title { flex: 1; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vod-player-video { flex: 1; width: 100%; min-height: 0; object-fit: contain; background: #000; }
.vod-player-modal.portrait .vod-player-video { max-width: min(100%, calc((100vh - 46px) * 0.5625)); align-self: center; }
.vod-player-loading { position: absolute; top: 46px; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; font-size: 13px; background: #000; z-index: 6; }
.vod-player-loading.hidden { display: none; }
.vod-player-spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--brand); border-radius: 50%; animation: vodspin 0.8s linear infinite; }
@keyframes vodspin { to { transform: rotate(360deg); } }

/* 输入区 */
.input-area { position: relative; border-top: 1px solid var(--divider); background: var(--bg-card); padding: 8px 12px 12px; padding-bottom: calc(12px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); flex-shrink: 0; }
.toolbar { display: flex; gap: 2px; margin-bottom: 4px; }
.toolbar button { border: none; background: none; cursor: pointer; padding: 4px; min-width: 36px; min-height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: color .15s, background .15s; }
.toolbar button:hover { color: var(--brand); background: var(--brand-soft); }
#voice-btn { border: none; background: none; cursor: pointer; padding: 8px; min-width: 40px; min-height: 40px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); flex-shrink: 0; align-self: center; transition: color .15s, background .15s; }
#voice-btn .icon { fill: currentColor; stroke: none; }
#voice-btn.active { color: var(--brand); background: var(--brand-soft); }
#voice-btn.recording { color: var(--danger); background: rgba(230,67,64,.12); }
#voice-hold-btn { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; background: var(--bg-input); color: var(--text-primary); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
#voice-hold-btn.recording { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: bold; }

.emoji-panel { display: flex; flex-wrap: wrap; gap: 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 8px; max-height: 180px; overflow-y: auto; margin-bottom: 8px; }
.emoji-item { font-size: 22px; cursor: pointer; padding: 2px; }
.emoji-item:hover { background: var(--bg-hover); border-radius: 4px; }

.input-row { display: flex; gap: 8px; align-items: flex-end; }
#msg-input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 15px; resize: none; outline: none; font-family: inherit; background: var(--bg-input); color: var(--text-primary); transition: border-color .18s, box-shadow .18s; max-height: 120px; }
#msg-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(10, 186, 181, 0.12); }
#send-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; background: var(--brand); color: #fff; border: none; border-radius: var(--radius-md); cursor: pointer; font-size: 15px; font-weight: 600; flex-shrink: 0; box-shadow: none; transition: transform .15s, background .15s, filter .15s; }
#send-btn .icon { width: 16px; height: 16px; }
#send-btn:hover { background: var(--brand-hover); transform: translateY(-1px); }
#send-btn:active { transform: translateY(0); }

/* 响应式：手机端 */
@media (max-width: 768px) {
  .sidebar { width: 100%; }
  .chat-area { display: none; }
  body.chat-open .sidebar { display: none; }
  body.chat-open .chat-area { display: flex; }
  .back-btn { display: inline-flex; }
  .bubble { max-width: 80%; }
  /* 输入框增大 */
  #msg-input { padding: 10px 12px; min-height: 40px; }
}

/* ---- 群聊 ---- */
.create-group-btn { margin: 12px 16px; padding: 10px; background: var(--brand); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.create-group-btn .icon { width: 18px; height: 18px; }
.create-group-btn:hover { background: var(--brand-hover); }

.group-avatar { background: linear-gradient(135deg, #3a7afe, #2563eb); border-radius: 50%; }
.group-avatar .icon { width: 20px; height: 20px; }
.group-count { font-size: 12px; color: #999; flex-shrink: 0; }

.group-setting-btn { border: none; background: none; cursor: pointer; padding: 6px; border-radius: 4px; margin-left: 0; display: inline-flex; align-items: center; justify-content: center; color: #666; }
.group-setting-btn:hover { background: #e0e0e0; color: var(--brand); }

/* 群消息 */
.system-msg { text-align: center; color: #999; font-size: 12px; padding: 4px 0; }
.retention-notice { align-self: center; text-align: center; color: #8c8c8c; font-size: 12px; line-height: 1.5; padding: 6px 14px; margin: 2px 0; background: #f5f5f5; border-radius: 14px; }
.msg-time { text-align: center; color: #999; font-size: 12px; padding: 10px 0 4px; }
.lock-divider { display: flex; align-items: center; gap: 8px; color: var(--brand); font-size: 12px; padding: 10px 0; margin: 2px 0; }
.lock-divider::before, .lock-divider::after { content: ''; flex: 1; height: 1px; background: #e5e5e5; }
.unread-divider { display: flex; align-items: center; gap: 8px; color: #8c8c8c; font-size: 12px; padding: 10px 0; margin: 2px 0; }
.unread-divider::before, .unread-divider::after { content: ''; flex: 1; height: 1px; background: #e5e5e5; }
.msg-sender { font-size: 12px; color: #999; margin-bottom: 2px; padding-left: 4px; }

/* 群聊消息布局：头像 + 主体（微信式分组） */
.msg-body { display: flex; flex-direction: column; align-items: flex-start; max-width: 62%; min-width: 0; }
.mine .msg-body { align-items: flex-end; }
.msg-row .group-avatar { margin-right: 8px; flex-shrink: 0; }
.msg-row.mine .group-avatar { margin-right: 0; margin-left: 8px; }
.msg-row .msg-avatar { margin-right: 8px; flex-shrink: 0; }
.msg-row.mine .msg-avatar { margin-right: 0; margin-left: 8px; }
.theirs.msg-row.continue .msg-body { margin-left: 44px; }
.msg-body .bubble { max-width: 100%; }

/* 自动锁定遮罩 */
.lock-screen { position: fixed; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; z-index: 20000; }
.lock-box { background: var(--bg-card); border-radius: var(--radius-xl); padding: 40px 32px; width: 340px; max-width: 90vw; text-align: center; box-shadow: var(--shadow-float); }
.lock-icon { font-size: 40px; margin-bottom: 8px; }
.lock-title { font-size: 18px; font-weight: bold; color: var(--text-primary); margin-bottom: 20px; }
.lock-box input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 14px; margin-bottom: 12px; outline: none; background: var(--bg-input); color: var(--text-primary); transition: border-color .18s, box-shadow .18s; }
.lock-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(10, 186, 181, 0.14); }
.lock-box button { width: 100%; }

/* 消息已读状态（单勾=已送达，双勾=已读） */
.msg-read-status { display: block; font-size: 12px; color: var(--text-tertiary); text-align: right; margin-top: 2px; letter-spacing: -2px; }
.msg-read-status.read { color: var(--brand); }

/* 多选删除消息 */
.msg-row.selectable { cursor: pointer; }
.multi-check { align-self: center; flex-shrink: 0; margin: 0 8px; width: 18px; height: 18px; }
.toolbar-btn { border: none; background: none; cursor: pointer; padding: 6px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); }
.toolbar-btn:hover { background: var(--bg-hover); color: var(--brand); }
.chat-header-info { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.chat-header-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.unread-indicator { display: inline-flex; align-items: center; gap: 3px; border: none; background: var(--brand); color: #fff; cursor: pointer; padding: 4px 10px; border-radius: 14px; font-size: 12px; font-weight: 600; }
.unread-indicator:hover { background: var(--brand-hover); }
.unread-indicator .icon { width: 13px; height: 13px; }
.multi-select-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--divider); background: var(--bg-card); font-size: 14px; flex-shrink: 0; }
.multi-select-all { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.multi-select-count { color: var(--text-secondary); flex: 1; }
.danger-btn { background: var(--danger-gradient); color: #fff; border: none; border-radius: var(--radius-md); padding: 8px 16px; cursor: pointer; font-size: 14px; font-weight: 600; box-shadow: 0 4px 12px rgba(230, 67, 64, 0.28); transition: transform .15s, box-shadow .15s; }
.danger-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(230, 67, 64, 0.36); }
.danger-btn:disabled { background: #f0a8a6; box-shadow: none; cursor: not-allowed; transform: none; }
.multi-select-bar button:not(.danger-btn) { background: none; border: none; color: var(--text-primary); cursor: pointer; font-size: 14px; padding: 8px 12px; border-radius: 4px; }
.multi-select-bar button:not(.danger-btn):hover { background: var(--bg-hover); }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: var(--bg-mask); display: flex; align-items: center; justify-content: center; z-index: 10002; }
.modal-box { position: relative; background: var(--bg-card); border-radius: var(--radius-xl); padding: 24px; width: 380px; max-width: 92vw; max-height: 82vh; overflow-y: auto; color: var(--text-primary); box-shadow: var(--shadow-modal); }
.modal-box h3 { margin-bottom: 16px; font-size: 18px; text-align: center; }
.modal-close-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; background: var(--bg-hover); color: var(--text-secondary); border: none; border-radius: 50%; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.modal-close-x .icon { width: 18px; height: 18px; }
.modal-close-x:hover { background: var(--border); color: var(--danger); }
.modal-box input, .modal-box textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 14px; margin-bottom: 12px; outline: none; font-family: inherit; background: var(--bg-input); color: var(--text-primary); transition: border-color .18s, box-shadow .18s; }
.modal-box input:focus, .modal-box textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(10, 186, 181, 0.12); }
.modal-box input.input-error { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(230, 67, 64, 0.12); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-cancel { padding: 8px 16px; min-height: 44px; background: var(--bg-hover); color: var(--text-primary); border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
.modal-confirm { padding: 8px 16px; min-height: 44px; background: var(--brand-gradient); color: #fff; border: none; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-brand); transition: transform .15s, box-shadow .15s, filter .15s; }
.modal-confirm:hover { background: var(--brand-gradient-hover); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(10, 186, 181, 0.40); }
.modal-cancel.danger { background: rgba(230, 67, 64, 0.1); color: var(--danger); }

/* 上传任务条（云盘容量条下方，非悬浮） */
.upload-task-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.upload-task-icon { color: var(--brand); display: flex; flex-shrink: 0; }
.upload-task-main { flex: 1; min-width: 0; }
.upload-task-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.upload-task-name { font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-task-info { font-size: 12px; color: var(--text-secondary); flex-shrink: 0; white-space: nowrap; }
.upload-task-actions { display: flex; gap: 8px; flex-shrink: 0; }
.upload-task-btn { padding: 6px 12px; border: none; border-radius: 6px; background: var(--bg-hover); color: var(--text-primary); font-size: 13px; cursor: pointer; white-space: nowrap; }
.upload-task-btn.danger { background: rgba(230, 67, 64, 0.1); color: var(--danger); }

/* 下载任务条（顶部悬浮，全局可见，不受云盘界面限制） */
.download-task-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10003; /* 高于云盘(10001)/普通弹窗(10002)，低于锁屏(20000) */
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--divider);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}
.download-task-icon { color: var(--brand); display: flex; flex-shrink: 0; }
.download-task-main { flex: 1; min-width: 0; }
.download-task-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.download-task-name { font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.download-task-info { font-size: 12px; color: var(--text-secondary); flex-shrink: 0; white-space: nowrap; }
.download-task-actions { display: flex; gap: 8px; flex-shrink: 0; }
.download-task-btn { padding: 6px 12px; border: none; border-radius: 6px; background: var(--bg-hover); color: var(--text-primary); font-size: 13px; cursor: pointer; white-space: nowrap; }
.download-task-btn.danger { background: rgba(230, 67, 64, 0.1); color: var(--danger); }

.progress-track { width: 100%; height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--brand-gradient); border-radius: 3px; transition: width .15s ease; }

.member-select-title { font-size: 13px; color: var(--text-secondary); margin: 12px 0 8px; }
.member-select-list { list-style: none; max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
.member-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.member-item:hover { background: var(--bg-hover); }
.member-item.selected { background: var(--brand-soft); }
.member-check { color: var(--brand); font-weight: bold; flex-shrink: 0; }

.setting-row { margin-bottom: 12px; }
.setting-note { font-size: 12px; color: var(--text-secondary); margin: -6px 0 12px; line-height: 1.5; padding-left: 2px; }
.device-list { max-height: 320px; overflow-y: auto; }
.device-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.device-icon { font-size: 22px; }
.device-info { flex: 1; }
.device-name { font-size: 14px; color: var(--text-primary); }
.device-time { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.device-kick { padding: 6px 12px; background: var(--danger); color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 13px; }
.device-kick:hover { background: var(--danger-hover); }
.device-empty { text-align: center; color: var(--text-secondary); font-size: 13px; padding: 24px 0; }
.setting-row label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.setting-row.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.setting-row.toggle-row > label:not(.switch) { font-size: 14px; color: var(--text-primary); margin-bottom: 0; }

label.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; margin-bottom: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 24px; transition: 0.2s; }
.switch .slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: var(--brand-gradient); box-shadow: var(--shadow-brand); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* 外观（主题）分段控件 */
.theme-seg { display: flex; background: var(--bg-hover); border-radius: 8px; padding: 3px; gap: 2px; }
.theme-seg-btn { flex: 1; padding: 7px 0; border: none; background: none; border-radius: 6px; font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: background .15s, color .15s; }
.theme-seg-btn.active { background: var(--bg-card); color: var(--text-primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.setting-row.volume-row { display: flex; align-items: center; justify-content: space-between; }
.setting-row.volume-row > label { font-size: 14px; color: #333; margin-bottom: 0; }
.volume-wrap { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 180px; }
.volume-wrap input[type="range"] { flex: 1; accent-color: var(--brand); }
#volume-value { font-size: 13px; color: #666; min-width: 40px; text-align: right; }

.group-add-btn { width: 100%; padding: 10px; background: var(--brand); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; margin: 8px 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.group-add-btn .icon { width: 18px; height: 18px; }
.group-add-btn:hover { background: var(--brand-hover); }
.group-leave-btn { width: 100%; padding: 10px; background: #e64340; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; margin-bottom: 8px; }
.group-leave-btn:hover { background: #c93633; }

/* ---- 头像 ---- */
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* ---- 撤回消息 ---- */
.recall-bubble { color: #999; font-style: italic; background: #f0f0f0; }

/* ---- 消息操作菜单 ---- */
.msg-more { opacity: 0; background: none; border: none; cursor: pointer; color: #999; align-self: center; padding: 4px 6px; min-width: 44px; min-height: 44px; flex-shrink: 0; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.msg-more .icon { width: 18px; height: 18px; }
.msg-row:hover .msg-more { opacity: 1; }
.msg-more:hover { color: var(--text-primary); }
.msg-action-menu { position: fixed; z-index: 2000; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-modal); padding: 4px 0; min-width: 120px; }
.msg-action-menu button { display: block; width: 100%; padding: 10px 16px; min-height: 44px; border: none; background: none; text-align: left; cursor: pointer; font-size: 14px; color: var(--text-primary); }
.msg-action-menu button:hover { background: var(--bg-hover); }
.msg-action-menu button.danger { color: var(--danger); }
@media (hover: none) { .msg-more { display: none; } }

/* ---- 消息「已编辑」标注 ---- */
.edited-tag { margin-left: 6px; font-size: 11px; color: var(--text-tertiary, #999); opacity: 0.8; white-space: nowrap; }

/* ---- 消息反应 ---- */
.reaction-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.reaction-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; font-size: 13px; line-height: 1.4; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.reaction-chip:hover { background: var(--bg-input); }
.reaction-chip.mine { border-color: var(--brand); color: var(--brand); }

/* ---- 反应选择器 ---- */
.react-picker { position: fixed; z-index: 2000; display: flex; gap: 4px; padding: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-modal); }
.react-picker button { width: 40px; height: 40px; font-size: 22px; border: none; background: none; border-radius: 50%; cursor: pointer; transition: transform .1s; }
.react-picker button:hover { transform: scale(1.2); background: var(--bg-hover); }

/* ---- 聊天背景选择器 ---- */
.bg-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bg-option { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 2px solid transparent; border-radius: var(--radius-md); background: none; cursor: pointer; font-size: 13px; color: var(--text-primary); }
.bg-option:hover { background: var(--bg-hover); }
.bg-option.active { border-color: var(--brand); }
.bg-swatch { width: 100%; height: 56px; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }
.bg-swatch.bg-default { background: var(--bg-page); }
.bg-swatch.bg-mint { background: linear-gradient(160deg, #e0f7f5, #c8ece6); }
.bg-swatch.bg-lavender { background: linear-gradient(160deg, #efe9fb, #ddd2f5); }
.bg-swatch.bg-sunset { background: linear-gradient(160deg, #fdece2, #f8d9c4); }
.bg-swatch.bg-slate { background: #eef0f3; }
.bg-swatch.bg-night { background: linear-gradient(160deg, #1c2530, #2a3a4a); }

/* ---- Toast 轻提示 ---- */
.toast-container { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 20px; border-radius: var(--radius-md); color: #fff; font-size: 14px; max-width: 80vw; box-shadow: var(--shadow-modal); word-break: break-all; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: rgba(0,0,0,0.75); }

/* ---- 通用确认弹窗 ---- */
.confirm-text { margin-bottom: 8px; font-size: 15px; color: var(--text-primary); text-align: center; word-break: break-all; }
.modal-danger { background: var(--danger); }
.modal-danger:hover { background: #c93633; }

/* ---- 个人设置 ---- */
.profile-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-ppid { font-size: 14px; color: var(--brand); font-weight: 600; cursor: pointer; user-select: all; word-break: break-all; }
.profile-avatar { width: 60px; height: 60px; border-radius: 50%; font-size: 24px; background: linear-gradient(135deg, var(--brand), var(--brand-hover)); }
.group-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.group-avatar-preview { width: 56px; height: 56px; border-radius: 12px; font-size: 24px; }

/* ---- 好友资料弹窗 ---- */
.friend-profile-box { width: 320px; max-width: 92vw; }
.friend-profile-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px 0 16px; }
.friend-profile-avatar { width: 64px; height: 64px; font-size: 26px; }
.friend-profile-name { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.friend-profile-meta { border-top: 1px solid var(--divider); }
.friend-profile-sign { font-size: 14px; color: var(--text-secondary); word-break: break-all; }

/* ---- 个人中心版块入口 ---- */
.profile-menu { margin: 8px 0 4px; border-top: 1px solid var(--divider); }
.profile-menu-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 2px; min-height: 44px; background: none; border: none; border-bottom: 1px solid var(--divider); cursor: pointer; font-size: 15px; color: var(--text-primary); transition: background .15s; }
.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:hover { background: var(--bg-hover); }
.profile-menu-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-menu-icon .icon { width: 18px; height: 18px; }
.profile-menu-label { flex: 1; text-align: left; }
.profile-menu-arrow { width: 16px; height: 16px; color: var(--text-secondary); flex-shrink: 0; }

/* ---- 我的钱包 ---- */
.wallet-balance-row { display: flex; gap: 10px; margin-bottom: 14px; }
.wallet-balance-card { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px 18px; border-radius: var(--radius-lg); background: var(--bg-hover); color: var(--text-primary); }
.wallet-balance-card.pp { background: var(--brand-gradient); color: #fff; }
.wallet-balance-label { font-size: 13px; opacity: 0.9; }
.wallet-balance-amount { font-size: 28px; font-weight: 700; letter-spacing: .5px; }
.wallet-actions { display: flex; gap: 10px; margin-bottom: 14px; }
.wallet-action-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; min-height: 44px; background: var(--bg-hover); color: var(--text-primary); border: none; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; font-weight: 600; }
.wallet-action-btn:hover { background: var(--border); }
.wallet-action-btn .icon { width: 16px; height: 16px; }
.wallet-deposit { background: var(--bg-hover); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 14px; }
.wallet-deposit-title { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.wallet-deposit-row { display: flex; align-items: center; gap: 8px; }
.wallet-deposit-address { flex: 1; font-size: 13px; font-family: monospace; color: var(--text-primary); word-break: break-all; }
.wallet-copy-btn { padding: 6px 14px; min-height: 36px; background: var(--brand); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; flex-shrink: 0; }
.wallet-copy-btn:hover { background: var(--brand-hover); }
.wallet-deposit-note { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }
.withdraw-note { font-size: 12px; color: var(--text-secondary); margin: 2px 0 10px; }
.wallet-log-entry { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 14px; margin-top: 4px; background: var(--bg-hover); border: none; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; color: var(--text-primary); text-align: left; }
.wallet-log-entry:hover { background: var(--border); }
.wallet-log-entry .icon { width: 16px; height: 16px; color: var(--text-secondary); }
.log-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.log-tab { flex: 1; padding: 9px; background: var(--bg-hover); color: var(--text-secondary); border: none; border-radius: 8px; cursor: pointer; font-size: 14px; }
.log-tab.active { background: var(--brand); color: #fff; font-weight: 600; }
.log-panel { max-height: 400px; overflow-y: auto; }
.wallet-log-title { font-size: 13px; color: var(--text-secondary); margin: 0 0 6px; }
.wallet-log-list { list-style: none; margin: 0; padding: 0; max-height: 400px; overflow-y: auto; }
.wallet-log-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--divider); }
.wallet-log-item:last-child { border-bottom: none; }
.wallet-log-left { min-width: 0; }
.wallet-log-label { font-size: 14px; color: var(--text-primary); }
.wallet-log-time { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.wallet-log-amount { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.wallet-log-amount.in { color: #e6a23c; }
.wallet-log-amount.out { color: var(--brand); }
.wallet-log-empty { text-align: center; font-size: 13px; color: var(--text-secondary); padding: 20px 0; }

/* ---- 转账消息气泡 ---- */
.transfer-bubble { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 150px; background: linear-gradient(135deg, #ffb648, #ff9d2e); color: #fff; border-radius: var(--radius-md); padding: 12px 14px; }
.transfer-icon { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; }
.transfer-amount { font-size: 22px; font-weight: 700; }
.transfer-label { font-size: 12px; opacity: 0.92; word-break: break-all; }

/* ---- 红包消息气泡 ---- */
.redpacket-bubble { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 170px; background: linear-gradient(135deg, #ff6b5e, #e64340); color: #fff; border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer; }
.redpacket-bubble .redpacket-icon { font-size: 26px; }
.redpacket-title { font-size: 15px; font-weight: 600; }
.redpacket-msg { font-size: 12px; opacity: 0.9; word-break: break-all; }
.redpacket-status { font-size: 11px; opacity: 0.85; margin-top: 2px; }

/* ---- 红包结果/详情弹窗 ---- */
.redpacket-result-box { text-align: center; }
.rp-result-sender { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.rp-result-msg { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.rp-result-amount { font-size: 30px; font-weight: 700; color: #e64340; margin: 14px 0 4px; }
.rp-result-title { font-size: 13px; color: var(--text-secondary); text-align: left; margin: 4px 0 8px; }
.rp-grab-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; text-align: left; }
.rp-grab-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px; border-bottom: 1px solid var(--divider); font-size: 14px; color: var(--text-primary); }
.rp-grab-item:last-child { border-bottom: none; }
.rp-grab-amt { color: #e6a23c; font-weight: 600; }
.rp-grab-empty { text-align: center; font-size: 13px; color: var(--text-secondary); padding: 16px 0; }


/* ---- 未读红点 ---- */
.unread-badge { min-width: 18px; height: 18px; background: #f43530; color: #fff; border-radius: 9px; font-size: 11px; display: flex; align-items: center; justify-content: center; padding: 0 5px; flex-shrink: 0; line-height: 1; }

/* ---- tab 红点 ---- */
.sidebar-tabs .s-tab { position: relative; }
.tab-badge { position: absolute; top: 6px; right: 8px; min-width: 16px; height: 16px; background: #f43530; color: #fff; border-radius: 8px; font-size: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px; line-height: 1; }

/* ---- @ 功能 ---- */
.mention-badge { min-width: 18px; height: 18px; background: #f43530; color: #fff; border-radius: 9px; font-size: 13px; display: flex; align-items: center; justify-content: center; padding: 0 5px; flex-shrink: 0; line-height: 1; font-weight: bold; }
.mention-picker { position: absolute; bottom: 100%; left: 12px; right: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); max-height: 200px; overflow-y: auto; z-index: 30; margin-bottom: 6px; }
.mention-picker ul { list-style: none; margin: 0; padding: 4px 0; }
.burn-picker-title { font-size: 12px; color: #999; padding: 8px 12px 4px; }
#burn-list li { padding: 8px 12px; cursor: pointer; font-size: 14px; }
#burn-list li:hover { background: #f0f0f0; }
/* ---- 阅后即焚（E2EE）视觉 ---- */
.burn-bubble { position: relative; }
.burn-masked {
  cursor: pointer;
  border: 1px solid rgba(230, 67, 64, 0.35);
  background: linear-gradient(135deg, rgba(230,67,64,0.08), rgba(230,67,64,0.03));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 10px 14px;
  transition: background .2s, border-color .2s, transform .1s;
}
.burn-masked:hover { border-color: rgba(230,67,64,0.6); background: linear-gradient(135deg, rgba(230,67,64,0.14), rgba(230,67,64,0.05)); }
.burn-masked:active { transform: scale(0.98); }
.burn-mask-inner { display: flex; align-items: center; gap: 8px; }
.burn-flame { font-size: 16px; line-height: 1; animation: burnFlicker 1.2s ease-in-out infinite; }
.burn-hint { font-size: 13px; color: #c0392b; letter-spacing: .3px; }
@keyframes burnFlicker {
  0%, 100% { transform: scale(1) rotate(-2deg); opacity: 1; }
  25% { transform: scale(1.15) rotate(2deg); opacity: .9; }
  50% { transform: scale(1.05) rotate(-1deg); opacity: 1; }
  75% { transform: scale(1.2) rotate(3deg); opacity: .85; }
}
/* 倒计时 UI：气泡内火焰 + 剩余秒数 */
.burn-countdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  font-size: 12px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  animation: burnPulse .5s ease-in-out;
}
@keyframes burnPulse { 0% { opacity: .3; transform: scale(1.3); } 100% { opacity: 1; transform: scale(1); } }
/* 销毁消散动效 */
.burn-vanish {
  animation: burnVanish .45s ease forwards;
}
@keyframes burnVanish {
  0% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  30% { opacity: .8; transform: translateY(-4px) scale(1.02); filter: blur(1px); }
  100% { opacity: 0; transform: translateY(-14px) scale(0.6); filter: blur(6px); }
}
.mention-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.mention-item:hover { background: #f0f0f0; }
.mention-highlight { background: #fff5e6; border-left: 3px solid #f43530; }
.mention-all { border-bottom: 1px solid #eee; margin-bottom: 4px; }
.mention-all .user-name { color: var(--brand); font-weight: bold; }

/* ---- image source sheet (Android app) ---- */
.image-source-sheet { position: fixed; inset: 0; z-index: 100; }
.image-source-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.image-source-panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg-card); border-radius: 12px 12px 0 0; box-shadow: 0 -4px 16px rgba(0,0,0,0.15); padding: 8px 0 16px; }
.image-source-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px; border-bottom: 1px solid #f0f0f0; margin-bottom: 4px; }
.image-source-header span { font-size: 14px; color: #999; }
.image-source-panel button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 20px; background: none; border: none; font-size: 16px; color: var(--text-primary); cursor: pointer; text-align: left; }
.image-source-panel button:active { background: #f0f0f0; }
.image-source-panel button .icon { width: 22px; height: 22px; stroke: var(--brand, var(--brand)); }
.image-source-panel button.cancel { justify-content: center; border-top: 6px solid #f5f5f5; color: #999; }
.image-source-panel button.cancel .icon { display: none; }

/* ---- voice bubble ---- */
.voice-bubble { display: flex; align-items: center; gap: 8px; min-width: 90px; }
.voice-play-btn { width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--brand); color: #fff; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.voice-play-btn.playing { background: var(--brand-hover); }
.voice-duration { font-size: 14px; }

/* ---- 引用回复 ---- */
.quote-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f5f5f5; border-top: 1px solid #eee; font-size: 13px; color: #666; }
.quote-bar-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-bar-close { background: none; border: none; cursor: pointer; color: #999; padding: 2px; display: flex; align-items: center; }
.quote-bar-close .icon { width: 16px; height: 16px; }
.quote-block { display: block; max-width: 100%; background: rgba(0,0,0,0.05); border-left: 3px solid var(--brand); border-radius: 4px; padding: 4px 8px; margin-bottom: 6px; text-align: left; }
.mine .quote-block { background: rgba(255,255,255,0.5); }
.quote-name { font-size: 12px; color: var(--brand); margin-bottom: 1px; }
.quote-text { font-size: 13px; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-clickable { cursor: pointer; }
.quote-clickable:hover { filter: brightness(0.92); }
.flash-highlight { animation: flash-bg 1.5s ease; }
@keyframes flash-bg {
  0% { background: rgba(7, 193, 96, 0.35); }
  100% { background: transparent; }
}

/* ---- 转发 ---- */
.forward-tag { font-size: 12px; color: var(--brand); margin-bottom: 4px; }
.forward-section-title { font-size: 12px; color: #999; margin: 12px 0 4px; padding-left: 4px; }
.forward-list { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow-y: auto; }
.forward-item { display: flex; align-items: center; gap: 10px; padding: 10px 8px; cursor: pointer; border-radius: 6px; }
.forward-item:hover { background: #f0f0f0; }
.forward-avatar { width: 36px; height: 36px; border-radius: 6px; background: linear-gradient(135deg, var(--brand), var(--brand-hover)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.forward-avatar.group { border-radius: 50%; background: linear-gradient(135deg, #4a90d9, #3570b0); }
.forward-name { font-size: 15px; color: #333; }

/* ===== 频道（影视 · 苹果CMS V10 片源）===== */
.channel-panel { display: flex; flex-direction: column; height: 100%; background: var(--bg-page); overflow: hidden; }
.channel-panel.hidden { display: none; }
.channel-header { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg-card); flex-shrink: 0; }
.channel-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.channel-search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.channel-search input { flex: 1; height: 36px; padding: 0 14px; border: none; border-radius: 18px; font-size: 14px; outline: none; background: var(--bg-hover); color: var(--text-primary); }
.channel-search button { height: 36px; padding: 0 16px; border: none; border-radius: 18px; background: var(--brand); color: #fff; font-size: 13px; cursor: pointer; flex-shrink: 0; }
.channel-search button:hover { background: var(--brand-hover); }
.channel-tabs { display: flex; gap: 0; padding: 0 8px; background: var(--bg-card); border-bottom: 1px solid var(--divider); flex-shrink: 0; }
.channel-tab { flex: 1; padding: 12px 0; font-size: 14px; text-align: center; color: var(--text-secondary); background: none; border: none; cursor: pointer; position: relative; }
.channel-tab.active { color: var(--brand); font-weight: 600; }
.channel-tab.active::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; width: 22px; height: 3px; background: var(--brand); border-radius: 2px; }
.channel-sec { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.channel-sec.hidden { display: none; }

/* 命理排盘 */
.mingli-form { padding: 12px 16px; background: var(--bg-card); border-bottom: 1px solid var(--divider); display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.mingli-form-row { display: flex; align-items: center; gap: 10px; }
.mingli-form-row label { width: 64px; font-size: 13px; color: var(--text-secondary); flex-shrink: 0; }
.mingli-form-row input, .mingli-form-row select { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; background: var(--bg-input); color: var(--text-primary); }
.mingli-result { flex: 1; overflow-y: auto; padding: 12px; }
.mingli-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(104px, auto); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.mingli-cell { background: var(--bg-card); padding: 6px 5px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mingli-cell.is-body { background: #F0FAF9; }
.mingli-center { grid-column: span 2; grid-row: span 2; background: var(--bg-sidebar); justify-content: center; gap: 9px; padding: 10px 16px; }
.mingli-center-row { display: flex; flex-direction: column; gap: 1px; }
.mingli-center-key { font-size: 11px; color: var(--text-secondary); }
.mingli-center-val { font-size: 12px; color: var(--text-primary); font-weight: 500; word-break: break-all; }
.mingli-palace-name { font-size: 12px; font-weight: 600; color: var(--brand); }
.mingli-gz { font-size: 12px; color: var(--text-primary); font-weight: 600; }
.mingli-stars { display: flex; flex-wrap: wrap; gap: 3px; }
.mingli-star { font-size: 11px; line-height: 1.25; }
.mingli-star.major { color: var(--text-primary); font-weight: 600; }
.mingli-star.major[data-b="庙"] { color: #d0342c; }
.mingli-star.major[data-b="旺"] { color: #e67e22; }
.mingli-star.major[data-b="得"] { color: #3a7afe; }
.mingli-star.major[data-b="利"] { color: #0abab5; }
.mingli-star.major[data-b="平"] { color: #8a9499; }
.mingli-star.major[data-b="不"] { color: #aab2b6; }
.mingli-star.major[data-b="陷"] { color: #6b7478; }
.mingli-star.minor { color: var(--text-secondary); }
.mingli-mutagen { font-size: 10px; font-weight: 700; margin-left: 1px; }
.mingli-mutagen.m-禄 { color: #0abab5; }
.mingli-mutagen.m-权 { color: #7b61ff; }
.mingli-mutagen.m-科 { color: #3a7afe; }
.mingli-mutagen.m-忌 { color: #d0342c; }
.mingli-shensha { display: flex; flex-wrap: wrap; gap: 4px; font-size: 10px; line-height: 1.2; }
.ss-changsheng { color: #c0392b; }
.ss-boshi { color: #3a7afe; }
.ss-jiangqian { color: #0abab5; }
.ss-suiqian { color: #e67e22; }
.mingli-ages { font-size: 10px; color: var(--text-tertiary); margin-top: auto; line-height: 1.3; }
.mingli-interp { margin-top: 14px; }
.mingli-interp-btn { width: 100%; margin-bottom: 10px; }
.mingli-interp-body { display: flex; flex-direction: column; gap: 10px; }
.mingli-interp-loading { text-align: center; color: var(--text-secondary); font-size: 13px; padding: 16px 0; }
.mingli-interp-seg { font-size: 13px; line-height: 1.7; color: var(--text-primary); white-space: pre-wrap; }
.mingli-interp-seg.heading { font-weight: 700; color: var(--brand); font-size: 14px; margin-top: 4px; }
.channel-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 16px; }
.ph-icon { width: 48px; height: 48px; color: var(--brand); opacity: 0.4; }
.ph-title { font-size: 15px; color: var(--text-secondary); font-weight: 500; }
.ph-desc { font-size: 13px; color: var(--text-tertiary); }
.channel-cats { display: flex; gap: 8px; padding: 10px 16px 4px; flex-wrap: nowrap; overflow-x: auto; background: var(--bg-card); flex-shrink: 0; scrollbar-width: none; }
.channel-cats::-webkit-scrollbar { display: none; }
.vod-cat { padding: 6px 15px; border-radius: 17px; font-size: 13px; font-weight: 500; color: var(--text-secondary); background: var(--bg-hover); border: none; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: background .15s ease, color .15s ease; }
.vod-cat:hover { color: var(--text-primary); }
.vod-cat.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.channel-subcats { display: flex; gap: 6px; padding: 6px 16px 0; flex-wrap: nowrap; overflow-x: auto; background: var(--bg-card); flex-shrink: 0; scrollbar-width: none; }
.channel-subcats::-webkit-scrollbar { display: none; }
.channel-subcats.hidden { display: none; }
.vod-subcat { padding: 4px 12px; border-radius: 13px; font-size: 12px; color: var(--text-secondary); background: var(--bg-hover); border: none; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: background .15s ease, color .15s ease; }
.vod-subcat:hover { color: var(--text-primary); }
.vod-subcat.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.channel-filters { display: flex; gap: 8px; padding: 8px 16px 10px; background: var(--bg-card); flex-shrink: 0; }
.vod-select { height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 15px; background: var(--bg-input); color: var(--text-primary); font-size: 13px; outline: none; cursor: pointer; }
.channel-body { flex: 1; overflow-y: auto; padding: 12px 16px 16px; }
.vod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 14px; }
.drama-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.sort-label { font-size: 12px; color: var(--text-tertiary); align-self: center; flex-shrink: 0; }
.drama-sortbar, .vod-sortbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px 0; flex-wrap: wrap; flex-shrink: 0; }
.vod-card { cursor: pointer; }
.vod-cover { position: relative; aspect-ratio: 3/4; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-hover); }
.vod-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vod-tag { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.62); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vod-hot { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.62); color: #ffb800; font-size: 11px; padding: 1px 6px; border-radius: 4px; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vod-name { font-size: 13px; margin-top: 6px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vod-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.vod-loading, .vod-empty { text-align: center; color: var(--text-tertiary); padding: 48px 0; font-size: 14px; }

/* 影视详情弹窗 */
.vod-detail-box { width: 460px; max-width: 92vw; max-height: 86vh; overflow-y: auto; }
.vod-detail-content { padding: 4px 20px 20px; }
.vod-detail-head { display: flex; gap: 16px; }
.vod-detail-cover { width: 120px; height: 168px; object-fit: cover; border-radius: var(--radius-md); flex-shrink: 0; background: var(--bg-hover); }
.vod-detail-info { flex: 1; min-width: 0; }
.vod-detail-title { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.vod-detail-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }
.vod-detail-actor { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }
.vod-detail-intro { font-size: 13px; color: var(--text-secondary); margin-top: 12px; line-height: 1.7; max-height: 120px; overflow-y: auto; }
.vod-detail-sub { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-top: 16px; }
.vod-play-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vod-play-btn { padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); font-size: 13px; cursor: pointer; }
.vod-play-btn:hover { border-color: var(--brand); color: var(--brand); }
.vod-play-more { display: block; margin-top: 10px; padding: 6px 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--brand); font-size: 13px; cursor: pointer; }
.vod-play-more:hover { border-color: var(--brand); }
.vod-detail-empty { color: var(--text-tertiary); font-size: 13px; margin-top: 10px; }

/* ---- 云网盘 ---- */
.drive-entry-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 16px; border: none; border-top: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 14px; cursor: pointer; }
.drive-entry-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.drive-entry-btn .icon { width: 18px; height: 18px; }
.drive-modal { position: fixed; inset: 0; z-index: 10001; display: flex; flex-direction: column; background: var(--bg-page); }
.drive-modal.hidden { display: none; }
.drive-topbar { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 10px; background: var(--bg-card); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drive-title { flex: 1; font-size: 16px; font-weight: 600; color: var(--text-primary); }
.drive-upload-btn { padding: 6px 14px; border: none; border-radius: var(--radius-sm); background: var(--brand); color: #fff; font-size: 13px; cursor: pointer; }
.drive-quota { padding: 8px 16px; background: var(--bg-card); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drive-quota-text { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.drive-quota-track { height: 6px; border-radius: 3px; background: var(--bg-hover); overflow: hidden; }
.drive-quota-fill { height: 100%; background: var(--brand); transition: width .3s; }
.drive-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.drive-list { display: flex; flex-direction: column; }
.drive-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; }
.drive-item:hover { background: var(--bg-hover); }
.drive-item-icon { width: 44px; height: 44px; border-radius: 8px; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; font-size: 22px; overflow: hidden; flex-shrink: 0; }
.drive-item-icon img { width: 100%; height: 100%; object-fit: cover; }
.drive-item-info { flex: 1; min-width: 0; }
.drive-item-name { font-size: 14px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drive-item-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.drive-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.drive-item-btn { padding: 5px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); font-size: 12px; cursor: pointer; }
.drive-item-btn:hover { border-color: var(--brand); color: var(--brand); }
.drive-item-btn.danger:hover { border-color: #e5484d; color: #e5484d; }
.drive-empty { padding: 60px 20px; text-align: center; color: var(--text-tertiary); font-size: 14px; }
.drive-loading { padding: 40px 20px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.group-drive-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); font-size: 14px; cursor: pointer; }
.group-drive-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ---- 私密空间（保险箱）---- */
.drive-vault-btn { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-secondary); font-size: 13px; cursor: pointer; }
.drive-vault-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.vault-view { padding: 20px 16px; }
.vault-auth { max-width: 360px; margin: 0 auto; padding: 24px 16px; }
.vault-auth-title { font-size: 16px; font-weight: 600; color: var(--text-primary); text-align: center; margin-bottom: 8px; }
.vault-auth-warn { font-size: 12px; color: #e5484d; text-align: center; margin-bottom: 16px; line-height: 1.5; }
.vault-auth input { width: 100%; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); font-size: 14px; box-sizing: border-box; }
.vault-auth .modal-confirm { width: 100%; margin-top: 4px; }
.vault-toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.vault-toolbar .vod-select { flex: 1; }

/* ---- 版本更新 ---- */
.avatar.has-update { position: relative; }
.avatar.has-update::after { content: ''; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; background: #e5484d; border-radius: 50%; border: 2px solid var(--bg-card); }
.version-label { font-size: 13px; color: var(--text-secondary); }
/* 更新红点（设置入口） */
.update-dot { display: inline-block; width: 8px; height: 8px; background: #e5484d; border-radius: 50%; flex-shrink: 0; }
.profile-menu-item .update-dot { margin-right: 2px; }
/* 更新按钮红点（设置-版本行，右上角，与头像红点同款） */
#update-version-btn.has-update { position: relative; }
#update-version-btn.has-update::after { content: ''; position: absolute; top: -5px; right: -5px; width: 10px; height: 10px; background: #e5484d; border-radius: 50%; border: 2px solid var(--bg-card); }
.update-ver { text-align: center; font-size: 18px; font-weight: 600; color: var(--brand); margin: 8px 0; }
.update-changelog { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; white-space: pre-wrap; }

/* ---- 影视：观看历史 / 我的收藏 ---- */
.vod-mine-bar { display: flex; gap: 8px; padding: 10px 16px 0; flex-wrap: wrap; flex-shrink: 0; }
.vod-mine-btn { padding: 6px 14px; border-radius: 16px; font-size: 13px; color: var(--text-secondary); background: var(--bg-hover); border: none; cursor: pointer; }
.vod-mine-btn.active { background: var(--brand); color: #fff; }
.vod-mine-btn.danger { color: #e5484d; background: transparent; }
.vod-fav-btn { flex-shrink: 0; align-self: flex-start; padding: 6px 14px; border-radius: 16px; font-size: 13px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; }
.vod-fav-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.vod-card { position: relative; }
.vod-card-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; display: none; align-items: center; justify-content: center; }
.vod-card:hover .vod-card-del { display: flex; }
@media (hover: none) { .vod-card-del { display: flex; } }

/* ---- 我的足迹（观看历史 + 收藏）---- */
.trace-tabs { display: flex; gap: 8px; padding: 10px 16px 4px; flex-wrap: wrap; flex-shrink: 0; }
.trace-tab { padding: 6px 16px; border-radius: 16px; font-size: 13px; color: var(--text-secondary); background: var(--bg-hover); border: none; cursor: pointer; }
.trace-tab.active { background: var(--brand); color: #fff; }
