/* ==================== 全局变量 ==================== */
:root {
    --primary: #0096e6;
    --primary-dark: #0077b6;
    --primary-light: #e3f2fd;
    --primary-bg: #f0f8ff;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-tertiary: #999;
    --bg-app: #f5f5f5;
    --bg-panel: #fff;
    --bg-chat: #f0f2f5;
    --bg-hover: #f0f0f0;
    --border-color: #e0e0e0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-round: 50%;
    --sidebar-width: 60px;
    --list-width: 320px;
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-app);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

#app { height: 100vh; position: relative; }

/* ==================== 屏幕切换 ==================== */
.screen { display: none; height: 100vh; }
.screen.active { display: flex; }

/* ==================== 认证界面 ==================== */
#authScreen {
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0096e6 0%, #00bcd4 100%);
}

.auth-container {
    width: 400px;
    max-width: 90vw;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
}

.auth-header { text-align: center; margin-bottom: 30px; }
.auth-logo { margin-bottom: 12px; }
.auth-header h1 { font-size: 26px; color: var(--text-primary); }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 6px; }
.home-win-download {
    display: inline-block; margin-top: 12px; padding: 8px 16px;
    border: 1.5px solid var(--primary, #0072e6); border-radius: 20px;
    background: var(--primary-bg, rgba(0,114,230,.08)); color: var(--primary, #0072e6);
    font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
    transition: background .18s, color .18s;
}
.home-win-download:hover, .home-win-download:active {
    background: var(--primary, #0072e6); color: #fff;
}

.auth-panel { display: none; }
.auth-panel.active { display: block; animation: fadeIn 0.3s ease; }

.form-group { margin-bottom: 16px; }
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px; /* iOS：<16px 聚焦时自动放大整页 */
    transition: border-color var(--transition);
    background: #fafafa;
    outline: none;
}
.form-input:focus { border-color: var(--primary); background: #fff; }

.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    letter-spacing: 2px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
    width: 100%;
    padding: 10px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-secondary:hover { background: var(--primary); color: #fff; }

.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-secondary); }
.auth-switch a { color: var(--primary); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* v4.4.2：密码可见切换 */
.pwd-row { position: relative; }
.pwd-row .form-input { padding-right: 46px; }
.pwd-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border: none; background: transparent;
    font-size: 17px; color: var(--text-tertiary, #9aa4b2); cursor: pointer;
    display: flex; align-items: center; justify-content: center; border-radius: 8px;
    user-select: none; -webkit-user-select: none;
}
.pwd-eye:active { background: var(--bg-secondary, #f2f4f7); }
/* v4.4.2：登录/注册页「下载客户端」描边按钮，提升权重 */
.download-entrance {
    display: block; width: 100%; margin-top: 12px; padding: 12px;
    border: 1.5px solid var(--primary, #0072e6); border-radius: 10px;
    background: transparent; color: var(--primary, #0072e6);
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background .18s, color .18s;
}
.download-entrance:hover, .download-entrance:active {
    background: var(--primary, #0072e6); color: #fff;
}

/* 实名切换 */
.realname-toggle {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--primary-bg);
    border-radius: var(--radius);
    border: 1px solid var(--primary-light);
}
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.toggle-label { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.toggle-hint { font-size: 12px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }

/* 开关 */
.switch {
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
}
.switch.active { background: var(--primary); }
.switch-knob {
    width: 20px; height: 20px;
    background: #fff;
    border-radius: var(--radius-round);
    position: absolute;
    top: 2px; left: 2px;
    transition: left var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch.active .switch-knob { left: 22px; }

/* 头像选择 */
.avatar-picker { display: flex; align-items: center; gap: 12px; }
.avatar-label { font-size: 14px; color: var(--text-secondary); white-space: nowrap; }
.avatar-options { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-option {
    width: 40px; height: 40px;
    border-radius: var(--radius-round);
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color var(--transition);
    flex-shrink: 0;
}
.avatar-option.active { border-color: var(--primary); }
.avatar-option[data-avatar="1"] { background: linear-gradient(135deg, #ff6b6b, #ee5a24); }
.avatar-option[data-avatar="2"] { background: linear-gradient(135deg, #4834d4, #686de0); }
.avatar-option[data-avatar="3"] { background: linear-gradient(135deg, #22a6b3, #7ed6df); }
.avatar-option[data-avatar="4"] { background: linear-gradient(135deg, #6ab04c, #badc58); }
.avatar-option[data-avatar="5"] { background: linear-gradient(135deg, #e056fd, #fd79a8); }
.avatar-option[data-avatar="6"] { background: linear-gradient(135deg, #f0932b, #ffbe76); }

/* ==================== 主界面布局 ==================== */
#mainScreen { flex-direction: row; }

.sidebar {
    width: var(--sidebar-width);
    background: #2c2c2c;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    flex-shrink: 0;
}
.sidebar-header { margin-bottom: 20px; cursor: pointer; }
.sidebar-avatar {
    width: 40px; height: 40px;
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
}
.sidebar-name {
    color: #aaa;
    font-size: 11px;
    text-align: center;
    margin-top: 4px;
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; width: 100%; }
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    cursor: pointer;
    color: #aaa;
    transition: color var(--transition);
    position: relative;
    font-size: 11px;
}
.nav-item:hover { color: #fff; }
.nav-item.active { color: var(--primary); }
.nav-icon { font-size: 22px; margin-bottom: 2px; }
.nav-badge {
    position: absolute;
    top: 6px; right: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}
.sidebar-footer { width: 100%; }

/* ==================== 列表面板 ==================== */
.list-panel {
    width: var(--list-width);
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.list-view { display: none; flex-direction: column; height: 100%; }
.list-view.active { display: flex; }

.list-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}
.list-header h2 { font-size: 18px; font-weight: 600; }
.icon-btn {
    width: 36px; height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 22px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--primary); }

.search-box { padding: 8px 16px; }
.search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: none;
    border-radius: var(--radius);
    background: var(--bg-app) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
    font-size: 16px; /* iOS：避免聚焦放大 */
    outline: none;
}
.search-box input:focus { background-color: #fff; box-shadow: 0 0 0 1px var(--primary); }

.list-items { flex: 1; overflow-y: auto; }

/* 聊天列表项 */
.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    gap: 12px;
    transition: background var(--transition);
    position: relative;
}
.chat-item:hover { background: var(--bg-hover); }
.chat-item.active { background: var(--primary-bg); }
.chat-item-avatar {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    position: relative;
}
.chat-item-avatar.group { background: linear-gradient(135deg, #667eea, #764ba2); }
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-top { display: flex; justify-content: space-between; align-items: center; }
.chat-item-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-time { font-size: 12px; color: var(--text-tertiary); flex-shrink: 0; margin-left: 8px; }
.chat-item-msg { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-item-badge {
    position: absolute;
    top: 10px; right: 12px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}
.chat-item.unread .chat-item-name { font-weight: 600; }
.chat-item.unread .chat-item-msg { color: var(--text-primary); }

/* ==================== 通讯录 ==================== */
.contacts-section { padding: 0 0 4px; }
.contact-quick { padding: 4px 0; }
.contact-quick-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    gap: 12px;
    transition: background var(--transition);
}
.contact-quick-item:hover { background: var(--bg-hover); }
.contact-quick-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.quick-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* 联系人列表 */
.contact-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    gap: 12px;
    transition: background var(--transition);
}
.contact-item:hover { background: var(--bg-hover); }
.contact-item-avatar {
    width: 40px; height: 40px;
    border-radius: var(--radius-round);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}
.contact-item-info { flex: 1; min-width: 0; }
.contact-item-name { font-size: 15px; font-weight: 500; }
.contact-item-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.contact-letter { padding: 4px 16px; font-size: 12px; color: var(--text-tertiary); background: var(--bg-app); font-weight: 600; }

.non-real-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
    margin-left: 4px;
}
.real-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
    margin-left: 4px;
}

/* ==================== 设置 ==================== */
.settings-list { overflow-y: auto; height: 100%; }
.settings-section { margin-bottom: 8px; }
.settings-section-title { padding: 12px 20px 4px; font-size: 12px; color: var(--text-tertiary); font-weight: 600; }

.settings-profile {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    gap: 12px;
    transition: background var(--transition);
}
.settings-profile:hover { background: var(--bg-hover); }
.settings-avatar {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 600;
}
.settings-profile-info { flex: 1; }
.settings-profile-name { font-size: 17px; font-weight: 600; }
.settings-profile-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.settings-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    gap: 8px;
    transition: background var(--transition);
    background: #fff;
    border-bottom: 1px solid var(--bg-app);
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--bg-hover); }
.settings-item > span:first-child { flex: 0 0 auto; min-width: 96px; white-space: nowrap; font-size: 15px; }
.settings-value { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevron { flex: 0 0 auto; color: var(--text-tertiary); font-size: 20px; }
.settings-item.toggle-row { justify-content: space-between; }

/* ==================== 内容区域 ==================== */
.content-area { flex: 1; display: flex; flex-direction: column; background: var(--bg-panel); min-width: 0; }

.empty-state {
    display: none;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}
.empty-state.active { display: flex; }
.empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; }

/* ==================== 聊天窗口 ==================== */
.chat-window { display: none; flex: 1; flex-direction: column; height: 100%; }
.chat-window.active { display: flex; }

.chat-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name { font-size: 17px; font-weight: 600; }
.chat-header-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.chat-header-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

/* 消息列表 */
.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: var(--bg-chat);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 时间分隔符 */
.msg-time-sep {
    text-align: center;
    margin: 12px 0;
}
.msg-time-sep span {
    font-size: 12px;
    color: var(--text-tertiary);
    background: rgba(0,0,0,0.05);
    padding: 2px 10px;
    border-radius: 4px;
}
/* v3.6.0：跨天日期分隔线 */
.msg-day-sep {
    text-align: center;
    margin: 16px 0 10px;
}
.msg-day-sep span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.08);
    padding: 3px 12px;
    border-radius: 12px;
}
.chat-header-sub.typing {
    color: var(--primary);
}

/* 系统消息 */
.msg-system {
    text-align: center;
    margin: 8px 0;
}
.msg-system span {
    font-size: 12px;
    color: var(--text-tertiary);
    background: rgba(0,0,0,0.05);
    padding: 4px 12px;
    border-radius: 4px;
}

/* 消息气泡 */
.msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 75%;
}
.msg-row.sent { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
    width: 36px; height: 36px;
    border-radius: var(--radius-round);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}
.msg-content { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 100%; }
.msg-sender-name { font-size: 12px; color: var(--text-tertiary); padding: 0 4px; }
.msg-row.sent .msg-sender-name { display: none; }

.msg-bubble {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
    max-width: 100%;
}
.msg-row.received .msg-bubble {
    background: #fff;
    border-top-left-radius: 2px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}
.msg-row.sent .msg-bubble {
    background: #95ec69;
    border-top-right-radius: 2px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}

.msg-meta { display: flex; align-items: center; gap: 4px; padding: 0 4px; }
.msg-meta-time { font-size: 11px; color: var(--text-tertiary); }
.msg-read-status { font-size: 11px; color: var(--text-tertiary); }
.msg-read-status.read { color: var(--primary); }
.msg-unread-dot { font-size: 11px; color: var(--text-tertiary); }

/* 消息类型 */
.msg-bubble.voice-msg { display: flex; align-items: center; gap: 8px; min-width: 120px; cursor: pointer; }
.voice-bar { display: flex; align-items: center; gap: 2px; height: 20px; }
.voice-bar span { display: block; width: 3px; background: currentColor; border-radius: 2px; opacity: 0.7; }
.voice-duration { font-size: 13px; white-space: nowrap; }

.msg-bubble.image-msg { padding: 0; background: transparent !important; box-shadow: none !important; }
.msg-bubble.image-msg img { max-width: 200px; border-radius: var(--radius); display: block; }

.msg-bubble.sticker-msg { padding: 0; background: transparent !important; box-shadow: none !important; font-size: 64px; }

/* #8/#6：通话记录消息——单行紧凑，点击整块回拨 */
.msg-bubble.call-msg { display: flex; flex-direction: row; align-items: center; gap: 6px; max-width: 100%; white-space: nowrap; }
.call-msg-ico { font-size: 18px; flex: 0 0 auto; }
.call-msg-text { font-size: 14px; line-height: 1.3; white-space: nowrap; }
.call-redial-ico { font-size: 15px; flex: 0 0 auto; opacity: .75; }
.msg-bubble.call-msg-redial { cursor: pointer; }
.msg-bubble.call-msg-redial:active { opacity: .7; }

.msg-bubble.quote-msg { border-left: 3px solid var(--primary); }
.msg-quote { padding: 6px 10px; background: rgba(0,0,0,0.06); border-radius: 4px; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
.msg-quote-name { font-weight: 600; margin-bottom: 2px; }

.msg-recalled { font-size: 13px; color: var(--text-tertiary); font-style: italic; padding: 4px 0; }
.msg-edited-tag { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* 消息已读/未读标记 */
.msg-row.sent .msg-meta { justify-content: flex-end; }
.msg-status-unread { color: var(--text-tertiary); }
.msg-status-read { color: var(--primary); }

/* 消息操作悬浮 */
.msg-row .msg-actions { display: none; position: absolute; right: -36px; top: 0; }
.msg-row:hover .msg-actions { display: flex; }
.msg-action-btn {
    width: 28px; height: 28px;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== 输入区域 ==================== */
.input-area {
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 8px 16px;
}
.input-toolbar { display: flex; gap: 4px; margin-bottom: 8px; }
.toolbar-btn {
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    flex-shrink: 0;
}
.toolbar-btn:hover { background: var(--bg-hover); }
.input-row { display: flex; align-items: flex-end; gap: 8px; }
#messageInput {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 16px; /* iOS：字号 <16px 聚焦时浏览器会自动放大页面，导致布局错乱 */

    resize: none;
    outline: none;
    max-height: 120px;
    min-height: 38px;
    line-height: 1.5;
    background: var(--bg-app);
    transition: border-color var(--transition);
}
#messageInput:focus { border-color: var(--primary); background: #fff; }
#sendBtn {
    width: 38px; height: 38px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    flex-shrink: 0;
}
#sendBtn:hover { background: var(--primary-dark); }
#sendBtn:disabled { background: #ccc; cursor: not-allowed; }

.voice-mode-btn.active { background: var(--primary-light); color: var(--primary); }
.voice-record-bar {
    flex: 1;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-app);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition);
}
.voice-record-bar.recording { background: var(--danger); color: #fff; border-color: var(--danger); }
.voice-record-bar.recording-cancel { background: var(--text-tertiary); color: #fff; }
.voice-record-prompt { font-size: 14px; color: var(--text-secondary); }

/* ==================== 表情面板 ==================== */
.emoji-panel {
    position: absolute;
    bottom: 70px;
    left: 0;
    width: 100%;
    max-width: 500px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow-md);
    z-index: 100;
    height: 280px;
    display: flex;
    flex-direction: column;
}
.emoji-tabs { display: flex; border-bottom: 1px solid var(--border-color); }
.emoji-tab {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: color var(--transition);
    border-bottom: 2px solid transparent;
}
.emoji-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.emoji-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    padding: 8px;
    gap: 4px;
}
.emoji-item {
    font-size: 24px;
    text-align: center;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
    transition: background var(--transition);
}
.emoji-item:hover { background: var(--bg-hover); }

/* ==================== 模态框 ==================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}
.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 420px;
    max-width: 90vw;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-tertiary);
    line-height: 1;
    padding: 0;
}
.modal-close:hover { color: var(--text-primary); }
.modal-edit, .modal-save {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 15px;
    cursor: pointer;
}
.modal-edit:hover, .modal-save:hover { text-decoration: underline; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

/* 个人资料模态 */
.profile-modal { width: 380px; }
.profile-detail { text-align: center; margin-bottom: 24px; }
.profile-avatar-large {
    width: 80px; height: 80px;
    border-radius: var(--radius-round);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    font-weight: 600;
}
.profile-detail-name { font-size: 20px; font-weight: 600; }
.profile-realname-tag { margin-top: 6px; }
.profile-info-list { border-top: 1px solid var(--border-color); }
.profile-info-item {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--bg-app);
    font-size: 15px;
}
.profile-info-item .label { color: var(--text-secondary); }
.profile-info-item .value { font-weight: 500; }

/* 编辑头像 */
.edit-avatar-section { text-align: center; margin-bottom: 20px; }
.edit-avatar-section .profile-avatar-large { cursor: pointer; background-size: cover; background-position: center; }
.edit-avatar-section .avatar-options { justify-content: center; margin-top: 12px; }
/* v4.4.5（第27项）：自定义头像上传控件 */
.avatar-custom-row { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.avatar-upload-btn, .avatar-reset-btn {
    padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
    border: 1px solid var(--primary); background: var(--primary); color: #fff;
}
.avatar-reset-btn { background: transparent; color: var(--text-secondary); border-color: #ddd; }
.avatar-upload-btn:active { opacity: .85; }
.avatar-hint { font-size: 12px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }

/* 添加好友 */
.add-friend-tabs { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 16px; }
.af-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
}
.af-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.af-panel { display: none; }
.af-panel.active { display: block; animation: fadeIn 0.2s; }
.af-hint { font-size: 13px; color: var(--text-tertiary); margin-bottom: 12px; }

.search-results, .contact-match-list, .recommend-list, .forward-list, .group-member-list { display: flex; flex-direction: column; gap: 8px; }

.user-search-item, .forward-item, .group-member-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius);
    cursor: pointer;
    gap: 12px;
    transition: background var(--transition);
}
.user-search-item:hover, .forward-item:hover, .group-member-item:hover { background: var(--bg-hover); }
.user-search-avatar, .forward-avatar, .group-member-avatar {
    width: 40px; height: 40px;
    border-radius: var(--radius-round);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}
.user-search-info, .forward-info, .group-member-info { flex: 1; min-width: 0; }
.user-search-name, .forward-name, .group-member-name { font-size: 15px; font-weight: 500; }
.user-search-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.add-friend-btn {
    padding: 6px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
}
.add-friend-btn:hover { background: var(--primary-dark); }
.add-friend-btn.added { background: var(--success); }
.add-friend-btn.disabled { background: #ccc; cursor: default; }

/* ===== 二维码（v3.5.0 真实扫码加好友） ===== */
.qr-display {
    width: 200px; height: 200px;
    margin: 16px auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 8px;
    box-sizing: border-box;
}
.qr-display canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.qr-scan-hint { text-align: center; font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.6; }
.qr-card { text-align: center; }
.qr-card-name { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.qr-card-actions { display: flex; gap: 10px; justify-content: center; margin: 4px 0 8px; }
.qr-card-actions button { flex: 1; max-width: 160px; font-size: 13px; }
.qr-refresh-mini { background: none; border: none; color: var(--primary); font-size: 13px; cursor: pointer; padding: 4px 8px; }
.qr-expire-note { font-size: 11.5px; color: var(--text-secondary); margin-top: 4px; }
.qr-error { font-size: 13px; color: #c0392b; line-height: 1.7; padding: 12px; }

/* 我的个人资料里的二维码入口 */
.profile-qr-entry { margin: 14px 0 4px; }
.profile-qr-btn {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border: 1px solid var(--border-color);
    border-radius: var(--radius); background: #fff; cursor: pointer; text-align: left;
}
.profile-qr-icon { font-size: 22px; color: var(--primary); width: 28px; text-align: center; }
.profile-qr-text { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; flex-direction: column; gap: 2px; }
.profile-qr-text small { font-size: 11.5px; font-weight: 400; color: var(--text-secondary); }
.profile-qr-arrow { font-size: 22px; color: #bbb; }

/* 「我的二维码」大图弹窗 */
.qr-modal { max-width: 380px; }
.qr-modal-body { text-align: center; }
.qr-owner { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 14px; }
.qr-owner-avatar { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 16px; }
.qr-owner-meta { text-align: left; }
.qr-owner-name { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.qr-owner-tip { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.qr-display-big { width: 240px; height: 240px; }
.qr-big-hint { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; margin: 8px 0 14px; }
.qr-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.qr-modal-actions button { flex: 1 1 45%; min-width: 130px; font-size: 13px; }

/* 扫描二维码弹窗 */
.scan-modal { max-width: 420px; }
.scan-modal-body { text-align: center; }
.scan-viewport {
    position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 320px;
    background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 12px;
}
.scan-viewport video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame {
    position: absolute; inset: 14%; border: 2px solid rgba(141, 203, 99, .95);
    border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28); pointer-events: none;
}
.scan-frame::before, .scan-frame::after { content: ''; position: absolute; width: 24px; height: 24px; border: 3px solid #8DCB63; }
.scan-frame::before { top: -3px; left: -3px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
.scan-frame::after { bottom: -3px; right: -3px; border-left: none; border-top: none; border-radius: 0 0 6px 0; }
.scan-status { font-size: 13px; color: var(--text-primary); min-height: 38px; line-height: 1.5; margin: 0 0 10px; }
.scan-tip { font-size: 11.5px; color: var(--text-secondary); line-height: 1.6; margin-top: 10px; }
.scan-modal-body .btn-primary { width: 100%; }

/* 相机拍照弹窗（问题45） */
.camera-modal { max-width: 420px; }
.camera-viewport {
    position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 62vh;
    background: #000; overflow: hidden;
}
.camera-viewport video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-status {
    position: absolute; left: 0; right: 0; bottom: 10px; text-align: center;
    color: #fff; font-size: 12.5px; line-height: 1.5; padding: 4px 14px;
    text-shadow: 0 1px 4px rgba(0,0,0,.9); pointer-events: none;
}
.camera-toolbar {
    display: flex; align-items: center; justify-content: space-around;
    padding: 18px 20px 8px;
}
.camera-side-btn {
    background: none; border: none; color: var(--text-primary);
    font-size: 15px; cursor: pointer; padding: 10px 14px; border-radius: 8px;
}
.camera-side-btn:active { background: var(--bg-hover); }
.camera-shutter {
    width: 68px; height: 68px; border-radius: 50%; cursor: pointer;
    background: #fff; border: 4px solid var(--primary, #8DCB63);
    box-shadow: 0 2px 10px rgba(0,0,0,.2); position: relative; flex: 0 0 auto;
}
.camera-shutter::after {
    content: ''; position: absolute; inset: 5px; border-radius: 50%;
    border: 2px solid rgba(0,0,0,.08);
}
.camera-shutter:active { transform: scale(.94); }
.camera-shutter:disabled { opacity: .5; cursor: default; }
.camera-tip {
    font-size: 11.5px; color: var(--text-secondary);
    text-align: center; line-height: 1.6; margin: 0; padding: 0 20px 18px;
}

/* 扫码结果 / 确认加好友卡片 */
.invite-user-card {
    display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
    padding: 16px; border: 1px solid var(--border-color); border-radius: var(--radius); background: #fafcf8;
}
.invite-avatar { width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 18px; }
.invite-meta { flex: 1; min-width: 150px; text-align: left; }
.invite-name { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.invite-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; }
.invite-sign { font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; font-style: italic; }
.invite-note { width: 100%; text-align: center; font-size: 13px; color: var(--primary); margin: 8px 0 0; }
.invite-actions { display: flex; gap: 10px; margin-top: 16px; }
.invite-actions button { flex: 1; }

/* 单选列表 */
.radio-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.radio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.radio-item:hover { border-color: var(--primary); }
.radio-item input { display: none; }
.radio-custom {
    width: 20px; height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-round);
    flex-shrink: 0;
    position: relative;
    transition: border-color var(--transition);
}
.radio-item input:checked + .radio-custom { border-color: var(--primary); }
.radio-item input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 10px; height: 10px;
    background: var(--primary);
    border-radius: var(--radius-round);
}
.radio-text { display: flex; flex-direction: column; }
.radio-title { font-size: 15px; font-weight: 500; }
.radio-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

.modal-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; }

/* 好友请求 */
.friend-request-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-app);
    gap: 12px;
}
.friend-request-avatar {
    width: 40px; height: 40px;
    border-radius: var(--radius-round);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}
.friend-request-info { flex: 1; min-width: 0; }
.friend-request-name { font-size: 15px; font-weight: 500; }
.friend-request-msg { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }
.fr-actions { display: flex; gap: 8px; }
.fr-btn {
    padding: 5px 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
}
.fr-btn.accept { background: var(--primary); color: #fff; }
.fr-btn.accept:hover { background: var(--primary-dark); }
.fr-btn.reject { background: var(--bg-hover); color: var(--text-secondary); }
.fr-btn.done { color: var(--text-tertiary); cursor: default; }

/* 群成员选择 */
.group-member-item.selected { background: var(--primary-bg); }
.group-member-check {
    width: 20px; height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-round);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.group-member-item.selected .group-member-check { background: var(--primary); border-color: var(--primary); }
.group-member-item.selected .group-member-check::after { content: '\2713'; color: #fff; font-size: 12px; }

/* ==================== 通话界面 ==================== */
.call-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.call-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; height: 100%;
    gap: 40px;
}
.call-remote-view {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.call-avatar-large {
    width: 120px; height: 120px;
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 48px;
    font-weight: 600;
    box-shadow: 0 0 60px rgba(0,150,230,0.3);
    animation: pulse 2s infinite;
}
.call-remote-name { color: #fff; font-size: 24px; font-weight: 600; }
.call-status { color: rgba(255,255,255,0.6); font-size: 16px; }
.call-timer { color: rgba(255,255,255,0.4); font-size: 14px; }
.call-self-view {
    position: absolute;
    bottom: 120px; right: 30px;
    width: 150px; height: 200px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    border: 1px solid rgba(255,255,255,0.2);
    overflow: hidden;
    touch-action: none;          /* 允许多指/拖动处理，避免页面滚动抢手势 */
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.call-self-view.dragging { cursor: grabbing; opacity: 0.9; border-color: rgba(255,255,255,0.55); }
.call-self-view video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.call-self-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.call-self-flip {
    position: absolute;
    right: 6px; bottom: 6px;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff; cursor: pointer;
    z-index: 4;                  /* 高于 video，确保可点 */
    pointer-events: auto;
    transition: background 0.15s;
}
.call-self-flip:active { background: rgba(0,0,0,0.8); }
/* #89/#90：通话界面按钮（图13/图14样式） */
.call-controls { display: flex; gap: 32px; }
.call-incoming-actions {
    display: none;
    gap: 48px;
    margin-top: 10px;
}
.call-action-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.call-btn-label {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.call-btn {
    width: 64px; height: 64px;
    border: none;
    border-radius: var(--radius-round);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
}
.call-btn:active { transform: scale(0.92); }
/* #89：麦克风按钮——白圆深色图标 */
.call-btn.call-btn-mic {
    background: #fff;
    color: #333;
}
.call-btn.call-btn-mic svg { stroke: #333; }
.call-btn.call-btn-mic:active { background: #f0f0f0; }
.call-btn.call-btn-mic.muted { background: rgba(255,255,255,0.2); }
.call-btn.call-btn-mic.muted svg { stroke: #fff; }
/* 摄像头按钮 */
.call-btn.call-btn-camera {
    background: rgba(255,255,255,0.2);
}
.call-btn.call-btn-camera.off { background: rgba(255,255,255,0.1); opacity: 0.6; }
/* #89：扬声器按钮——深灰圆 */
.call-btn.call-btn-speaker {
    background: rgba(255,255,255,0.15);
}
.call-btn.call-btn-speaker:active { background: rgba(255,255,255,0.25); }
#callAudioBtn.earpiece { background: rgba(255,255,255,0.32); box-shadow: 0 0 0 2px rgba(255,255,255,0.5) inset; }
/* #89/#90：挂断/取消按钮——红圆 */
.call-btn.call-btn-hangup {
    background: var(--danger, #ff3b30);
}
.call-btn.call-btn-hangup:hover { background: #d32f2f; }
.call-btn.call-btn-hangup:active { background: #b71c1c; }
/* #90：接听按钮——绿圆 */
.call-btn.call-btn-accept {
    background: var(--success, #07C160);
}
.call-btn.call-btn-accept:hover { background: #06ad56; }
.call-btn.call-btn-accept:active { background: #058f4a; }
/* #90：拒绝按钮——红圆 */
.call-btn.call-btn-reject {
    background: var(--danger, #ff3b30);
}
.call-btn.call-btn-reject:hover { background: #d32f2f; }
.call-btn.call-btn-reject:active { background: #b71c1c; }

/* WebRTC 视频画面（只出画面，声音由独立 audio 元素输出） */
#callRemoteVideo {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    background: #000;
}
/* v3.9（第39项）：视频通话时远端画面铺满整屏。
   原来 #callRemoteVideo 的 100% 是相对 .call-remote-view——那个盒子没有设置尺寸，
   宽度只由 120px 头像撑开，于是 iPhone 上视频被压成「小得离谱」的一小块。
   这里用 fixed 脱离内容盒子，按视口铺满；文字/小窗/按钮浮在画面之上。 */
.call-overlay.video-mode #callRemoteVideo {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    object-fit: cover;
    z-index: 1;
}
.call-overlay.video-mode .call-remote-view { z-index: 2; pointer-events: none; }
.call-overlay.video-mode .call-remote-name,
.call-overlay.video-mode .call-status,
.call-overlay.video-mode .call-timer {
    text-shadow: 0 1px 8px rgba(0,0,0,.85);
    background: rgba(0,0,0,.22);
    padding: 3px 12px;
    border-radius: 12px;
}
.call-overlay.video-mode .call-self-view { z-index: 3; }
/* 通话视频模式层级 */
.call-overlay.video-mode .call-controls,
.call-overlay.video-mode .call-incoming-actions { z-index: 3; }
/* 远端音频：绝不能用 display:none —— iOS Safari 会停掉隐藏 media 元素的播放。
   用 1px + 极低透明度让它留在渲染树里，同时不占版面。 */
#callRemoteAudio,
.call-audio-host,
.call-audio-host audio {
    position: absolute;
    left: 0; top: 0;
    width: 1px; height: 1px;
    opacity: 0.01;
    pointer-events: none;
    z-index: -1;
}
.call-audio-host { overflow: hidden; }
#callSelfVideo {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
/* 来电模式切换：隐藏通话中按钮，显示接听/拒绝 */
.call-overlay.incoming .call-controls { display: none; }
.call-overlay.incoming .call-incoming-actions { display: flex; }

/* ==================== 上下文菜单 ==================== */
.context-menu {
    position: fixed;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 4px 0;
    z-index: 1500;
    min-width: 120px;
}
.ctx-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background var(--transition);
}
.ctx-item:hover { background: var(--primary-bg); color: var(--primary); }
.ctx-item.danger:hover { background: #ffebee; color: var(--danger); }

/* ==================== Toast ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.toast {
    padding: 10px 24px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    border-radius: var(--radius);
    font-size: 14px;
    animation: toastIn 0.3s ease;
    backdrop-filter: blur(10px);
}
.toast.success { background: rgba(76,175,80,0.9); }
.toast.error { background: rgba(244,67,54,0.9); }

/* ==================== 动画 ==================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 60px rgba(0,150,230,0.3); } 50% { transform: scale(1.03); box-shadow: 0 0 80px rgba(0,150,230,0.5); } }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* 语音消息波形动画 */
.voice-msg.playing .voice-bar span { animation: voiceWave 0.5s infinite alternate; }
@keyframes voiceWave { from { height: 4px; } to { height: 16px; } }
.voice-bar span:nth-child(1) { height: 8px; animation-delay: 0s; }
.voice-bar span:nth-child(2) { height: 14px; animation-delay: 0.1s; }
.voice-bar span:nth-child(3) { height: 10px; animation-delay: 0.2s; }
.voice-bar span:nth-child(4) { height: 16px; animation-delay: 0.15s; }
.voice-bar span:nth-child(5) { height: 6px; animation-delay: 0.25s; }
.voice-bar span:nth-child(6) { height: 12px; animation-delay: 0.05s; }
.voice-bar span:nth-child(7) { height: 8px; animation-delay: 0.3s; }

/* 输入指示 */
.typing-indicator { font-size: 12px; color: var(--text-tertiary); padding: 0 4px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots span { width: 6px; height: 6px; background: var(--text-tertiary); border-radius: 50%; animation: typingDot 1.4s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

/* ==================== v2.1 安全与新增功能样式 ==================== */

/* ---- 伪装界面（办公助手） ---- */
.decoy-container {
    width: 100%; max-width: 560px; margin: auto;
    background: #fff; border-radius: 16px; padding: 28px 24px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.08);
    display: flex; flex-direction: column; gap: 16px;
    max-height: 90vh; overflow-y: auto;
}
.decoy-header { text-align: center; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.decoy-logo {
    width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 14px;
    background: linear-gradient(135deg, #4a90d9, #357abd);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff;
}
.decoy-header h1 { font-size: 20px; color: var(--text-primary); margin-bottom: 4px; }
.decoy-sub { font-size: 12px; color: var(--text-tertiary); }
.decoy-tabs { display: flex; gap: 8px; }
.decoy-tab {
    flex: 1; text-align: center; padding: 10px 0; border-radius: 8px;
    font-size: 14px; color: var(--text-secondary); background: #f5f6f8; cursor: pointer;
    transition: all 0.2s;
}
.decoy-tab.active { background: var(--primary); color: #fff; }
.decoy-body { min-height: 240px; }
.decoy-panel { display: none; }
.decoy-panel.active { display: block; animation: fadeIn 0.2s; }
.decoy-notice {
    padding: 14px; background: #f8f9fb; border-radius: 10px; margin-bottom: 10px;
    border-left: 3px solid #4a90d9;
}
.decoy-notice h4 { font-size: 14px; color: var(--text-primary); margin-bottom: 6px; }
.decoy-notice p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; }
.decoy-notice-time { font-size: 11px; color: var(--text-tertiary); }
.decoy-memo-input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 16px; font-family: inherit; resize: vertical; min-height: 72px; margin-bottom: 8px; /* iOS：避免聚焦放大 */
    box-sizing: border-box;
}
.decoy-memo-item {
    padding: 10px 12px; background: #f8f9fb; border-radius: 8px; margin-bottom: 8px;
    font-size: 13px; color: var(--text-primary); line-height: 1.5;
}
.decoy-memo-item span { display: block; font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
.decoy-logout { margin-top: 4px; }

/* ---- 禁言提示条 ---- */
.mute-banner {
    background: #fff3e0; color: #e65100; border-bottom: 1px solid #ffcc80;
    padding: 8px 16px; font-size: 13px; line-height: 1.5; text-align: center;
}

/* v4.5.3 第71b项：全局网络状态提示条 */
.network-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 7px 14px; font-size: 12.5px; font-weight: 500;
    background: #3a3a3c; color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transform: translateY(-100%); transition: transform .28s ease;
}
.network-banner.show { transform: translateY(0); }
.network-banner-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #ffb74d;
    box-shadow: 0 0 0 0 rgba(255,183,77,.7); animation: netPulse 1.6s infinite;
}
@keyframes netPulse {
    0% { box-shadow: 0 0 0 0 rgba(255,183,77,.7); }
    70% { box-shadow: 0 0 0 7px rgba(255,183,77,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,183,77,0); }
}

/* ---- 工号标签 ---- */
.emp-no-tag {
    margin-left: auto; padding: 3px 10px; background: #e8f1fb; color: #357abd;
    border-radius: 6px; font-size: 12px; white-space: nowrap;
}
.group-member-item { align-items: center; }
#groupManageMemberList .group-member-item { padding: 8px 4px; }

/* ---- 反馈列表 ---- */
.feedback-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; max-height: 260px; overflow-y: auto; }
.feedback-item {
    padding: 12px; background: #f8f9fb; border-radius: 10px;
    border: 1px solid var(--border);
}
.feedback-item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.feedback-cat { font-size: 12px; color: var(--primary); font-weight: 600; }
.feedback-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.feedback-status.pending { background: #fff3e0; color: #e65100; }
.feedback-status.done { background: #e8f5e9; color: #2e7d32; }
.feedback-item-content { font-size: 13px; color: var(--text-primary); line-height: 1.6; word-break: break-all; }
.feedback-reply {
    margin-top: 8px; padding: 8px 10px; background: #eef7ee; border-radius: 6px;
    font-size: 12px; color: #2e7d32; line-height: 1.6;
}
.feedback-reply span { font-weight: 600; }
.feedback-item-time { font-size: 11px; color: var(--text-tertiary); margin-top: 6px; }

/* ---- 备用服务器列表 ---- */
.backup-server-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.backup-server-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px; background: #f8f9fb; border-radius: 8px;
    border: 1px solid var(--border);
}
.backup-server-url { font-size: 13px; color: var(--text-primary); word-break: break-all; }

/* ---- 创建群聊：工号模式开关 ---- */
.toggle-row { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.toggle-label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-primary); }
.toggle-icon { font-size: 16px; }

/* ---- 位置消息卡片 ---- */
.loc-msg {
    display: flex; flex-direction: column; align-items: stretch; gap: 0; cursor: pointer;
    width: 240px; max-width: 100%; padding: 8px;
}
.loc-msg .loc-body { display: flex; flex-direction: column; gap: 4px; }
/* v4.8：地图静态预览缩略图（顶部整行） */
.loc-preview { position: relative; width: 100%; height: 100px; border-radius: 6px; overflow: hidden; background: #e8eef2; margin: 0 0 6px; }
.loc-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.loc-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-60%); font-size: 30px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.loc-icon { font-size: 26px; line-height: 1; }
.loc-body { flex: 1; min-width: 0; }
.loc-addr { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.loc-coord { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.loc-view { font-size: 11px; color: #1e6fff; white-space: nowrap; }
body.theme-dark .loc-preview { background: #2c2c2c; }

/* ---- 实时位置共享面板 ---- */
.share-loc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.share-loc-item {
    padding: 12px 14px; background: #f8f9fb; border: 1px solid var(--border);
    border-radius: 10px; position: relative;
}
.share-loc-item.stale { opacity: 0.65; }
.share-loc-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.share-loc-stale { font-size: 11px; color: #c87d1f; font-weight: 400; margin-left: 6px; }
.share-loc-coord { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-family: monospace; }
.share-loc-time { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.share-loc-view {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    border: none; background: #eef4ff; color: #1e6fff; font-size: 12px;
    padding: 6px 12px; border-radius: 6px; cursor: pointer;
}
.share-loc-empty { text-align: center; color: var(--text-tertiary); font-size: 13px; padding: 24px 0; }

/* ==================== 媒体消息（图片/语音/文件） ==================== */
.msg-bubble.image-msg { padding: 0; background: transparent; overflow: hidden; max-width: 260px; }
.msg-bubble.image-msg img {
    display: block; max-width: 100%; max-height: 320px;
    border-radius: 14px; cursor: zoom-in; object-fit: cover;
}
.media-placeholder { font-size: 13px; color: var(--text-tertiary); }

.msg-bubble.file-msg {
    display: flex; align-items: center; gap: 10px;
    min-width: 180px; cursor: pointer;
}
.msg-bubble.file-msg:hover { filter: brightness(0.97); }
.file-icon { font-size: 26px; line-height: 1; }
.file-info { flex: 1; min-width: 0; }
.file-name {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-size { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.file-dl { font-size: 16px; color: #1e6fff; }

/* 图片大图预览遮罩 */
.img-preview-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.15s ease;
}
.img-preview-overlay img {
    max-width: 94vw; max-height: 90vh; object-fit: contain;
    border-radius: 6px; box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.img-preview-close {
    position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px; border: none; border-radius: 50%;
    background: rgba(255,255,255,0.15); color: #fff;
    font-size: 18px; cursor: pointer;
}
.img-preview-close:hover { background: rgba(255,255,255,0.28); }
/* v4.5.3 第71c项：查看原图按钮 */
.img-preview-original {
    position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
    padding: 8px 18px; border: 1px solid rgba(255,255,255,.4); border-radius: 20px;
    background: rgba(0,0,0,.45); color: #fff; font-size: 13px; cursor: pointer;
    backdrop-filter: blur(4px);
}
.img-preview-original:hover { background: rgba(255,255,255,.2); }
.img-preview-original:disabled { opacity: .6; cursor: default; }
.img-preview-open-original {
    position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 12px; text-decoration: underline; opacity: .85;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ==================== 群视频通话网格 ==================== */
.call-group-grid {
    position: absolute; inset: 0; z-index: 2;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px; padding: 56px 12px 96px; align-content: start;
    overflow-y: auto;
}
.group-video-tile {
    position: relative; aspect-ratio: 4 / 3;
    background: #1a2330; border-radius: 12px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
}
.group-video-tile video {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.group-video-name {
    position: absolute; left: 8px; bottom: 8px;
    max-width: calc(100% - 16px);
    padding: 3px 10px; border-radius: 12px;
    background: rgba(0,0,0,0.55); color: #fff;
    font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    pointer-events: none;
}

/* 群视频网格存在时保证控制按钮可点（覆盖网格层级） */
.call-controls, .call-incoming-actions { position: relative; z-index: 3; }

/* ==================== v3.0 扩展功能 UI ==================== */
.feat-modal { max-width: 560px; width: 92vw; }
.feat-modal .modal-body { max-height: 72vh; overflow-y: auto; }
.feat-hint { font-size: 12px; color: var(--text-tertiary, #8a94a6); line-height: 1.6; margin: 6px 0 12px; }
.feat-section-title, .feat-group-section .feat-section-title {
    font-size: 12px; font-weight: 700; color: var(--text-tertiary, #8a94a6);
    margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--border-color, #e8ecf3);
}
.feat-group-section { margin-top: 14px; }
.feat-results { margin-top: 10px; }
.feat-result {
    padding: 10px 12px; margin-bottom: 8px; border-radius: 10px;
    background: var(--bg-secondary, #f5f7fb); cursor: pointer;
    border: 1px solid transparent; transition: border-color .15s;
}
.feat-result:hover { border-color: var(--primary-color, #4a7cff); }
.feat-result-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-tertiary, #8a94a6); }
.feat-result-head b { color: var(--text-primary, #222); font-size: 13px; }
.feat-result-body { font-size: 13px; color: var(--text-primary, #222); margin-top: 6px; word-break: break-all; }
.feat-actions { display: flex; gap: 8px; margin-top: 8px; }
.feat-btn {
    padding: 6px 14px; border: 1px solid var(--border-color, #dce3ef); border-radius: 8px;
    background: var(--bg-primary, #fff); color: var(--text-primary, #222);
    font-size: 12px; cursor: pointer; white-space: nowrap;
}
.feat-btn:hover { border-color: var(--primary-color, #4a7cff); }
.feat-btn.danger { color: #e53e3e; border-color: #f3c6c6; }
.feat-del { color: #e53e3e; margin-left: 8px; }
.feat-tabs { display: flex; gap: 6px; }
.feat-tab {
    padding: 6px 14px; border-radius: 18px; border: 1px solid var(--border-color, #dce3ef);
    background: transparent; font-size: 12px; cursor: pointer; color: var(--text-secondary, #555);
}
.feat-tab.active { background: var(--primary-color, #4a7cff); color: #fff; border-color: transparent; }
.feat-field { display: block; font-size: 13px; color: var(--text-secondary, #555); margin: 10px 0; }
.feat-field .form-input { margin-top: 6px; width: 100%; }
.feat-field textarea.form-input { resize: vertical; }
.feat-switch-row {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 12px 0; border-bottom: 1px solid var(--border-color, #eef1f6); cursor: pointer;
}
.feat-switch-row span { display: flex; flex-direction: column; font-size: 13px; color: var(--text-primary, #222); }
.feat-switch-row small { font-size: 11px; color: var(--text-tertiary, #8a94a6); margin-top: 3px; font-weight: 400; }
.feat-switch-row input { width: 18px; height: 18px; accent-color: var(--primary-color, #4a7cff); }
.feat-choice-list { display: flex; gap: 8px; flex-wrap: wrap; }
.feat-choice {
    padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border-color, #dce3ef);
    background: var(--bg-primary, #fff); cursor: pointer; font-size: 12px; color: var(--text-primary, #222);
}
.feat-choice:hover { border-color: var(--primary-color, #4a7cff); }
.feat-target-list { max-height: 240px; overflow-y: auto; margin-top: 8px; }
.feat-target {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-primary, #222);
}
.feat-target:hover { background: var(--bg-secondary, #f5f7fb); }
.feat-device {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px; background: var(--bg-secondary, #f5f7fb); margin-bottom: 8px;
    font-size: 13px; color: var(--text-primary, #222);
}
.feat-captcha-box { display: none; }
.feat-captcha-box svg { border-radius: 6px; display: block; }
.feat-download-link {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 13px; text-decoration: underline; background: rgba(0,0,0,.5);
    padding: 6px 14px; border-radius: 16px;
}

/* 会话列表标记 */
.feat-chat-tags { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.feat-tag { font-size: 10px; padding: 1px 6px; border-radius: 8px; line-height: 1.5; }
.feat-tag.pin { background: #fff3d6; color: #b7791f; }
.feat-tag.mute { background: #e8ecf3; color: #718096; }
.feat-tag.mention { background: #ffe3e3; color: #c53030; font-weight: 600; }
.chat-item.feat-pinned { background: var(--bg-hover, #f3f6fc); }
.feat-popup {
    position: fixed; z-index: 9000; min-width: 170px; padding: 6px;
    background: var(--bg-primary, #fff); border: 1px solid var(--border-color, #e3e8f0);
    border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.14);
}
.feat-popup-item { padding: 8px 12px; font-size: 13px; border-radius: 6px; cursor: pointer; color: var(--text-primary, #222); }
.feat-popup-item:hover { background: var(--bg-secondary, #f2f5fa); }

/* 消息装饰 */
.feat-receipt { font-size: 10px; color: var(--text-tertiary, #9aa4b5); margin: 2px 46px 0 0; display: block; text-align: right; }
.msg-row.sent .feat-receipt { margin-right: 8px; }
.feat-receipt.delivered { color: #718096; }
.feat-receipt.read { color: var(--primary-color, #4a7cff); }
/* v4.5.3 第71a项：待发送/发送中状态 */
.feat-receipt.pending { color: #e08a1e; }
.feat-receipt.pending::before { content: '◷ '; }
.feat-mention { color: #2b6cb0; font-weight: 600; }
.feat-mention.me { background: #fff2b8; border-radius: 3px; padding: 0 2px; color: #b7791f; }
.feat-ephemeral { display: block; font-size: 10px; color: #e53e3e; text-align: right; margin: 2px 8px 0 0; }
.feat-transcript {
    font-size: 12px; color: var(--text-secondary, #555); background: var(--bg-secondary, #f3f6fb);
    border-radius: 8px; padding: 6px 10px; margin: 4px 46px 0; max-width: 320px; line-height: 1.5;
}
.feat-mini-btn {
    display: block; margin: 3px 46px 0 auto; border: none; background: transparent;
    color: var(--primary-color, #4a7cff); font-size: 11px; cursor: pointer;
}
.feat-select-box { width: 16px; height: 16px; accent-color: var(--primary-color, #4a7cff); margin: 0 8px; }
.feat-multi-bar {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: var(--bg-secondary, #f3f6fb); border-top: 1px solid var(--border-color, #e8ecf3);
    font-size: 12px; color: var(--text-secondary, #555);
}
.feat-multi-bar span { flex: 1; }
.feat-flash { animation: featFlash 1.6s ease; }
@keyframes featFlash { 0%,100% { background: transparent; } 30% { background: #fff2b8; } }
.ctx-sep { height: 1px; background: var(--border-color, #eef1f6); margin: 4px 0; }

/* @ 成员选择器 */
.feat-mention-picker {
    position: absolute; bottom: 100%; left: 12px; z-index: 100; min-width: 180px;
    background: var(--bg-primary, #fff); border: 1px solid var(--border-color, #e3e8f0);
    border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; max-height: 220px; overflow-y: auto;
}
.feat-mention-opt { padding: 7px 10px; font-size: 13px; border-radius: 6px; cursor: pointer; color: var(--text-primary, #222); }
.feat-mention-opt:hover { background: var(--bg-secondary, #f2f5fa); }
.input-area { position: relative; }

/* ==================== v3.1 触达层与三端适配 ==================== */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* 动态视口高度：iOS 地址栏收缩/展开时不再出现底部被裁切；
   --app-height 仅在软键盘弹出时由 push.js 的 visualViewport 监听写入 */
@supports (height: 100dvh) {
    body, #app { height: 100dvh; }
    #app { height: var(--app-height, 100dvh); }
    .screen { height: 100%; }
}

/* iOS 刘海 / 灵动岛 / 底部 Home 条：v3.2.5 起改由各页面组件自行处理。
   旧版在 #app 上统一加四边 padding，与 .chat-header / .sidebar / .input-area
   里的 env() 重复计算；叠加 .screen.active 用 100dvh 定高，内容会溢出约 80px，
   真机表现为顶部标题被裁掉、底部 Tab 多出一条空白带。
   桌面/仿真里 env(safe-area-inset-*) 恒为 0，所以这类 BUG 测不出来。 */

/* 禁止整页橡皮筋回弹（iOS 上滑会把聊天列表整块拽动） */
html, body { overscroll-behavior: none; }
.message-list, .chat-list, .list-view, .modal-body { overscroll-behavior: contain; }
input, textarea { font-size: 16px; } /* iOS 聚焦时字号 <16px 会自动放大页面 */

/* 通知引导条 */
.push-banner {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom));
    z-index: 9500; display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: 12px;
    background: var(--bg-primary, #fff); color: var(--text-primary, #222);
    border: 1px solid var(--border-color, #e3e8f0);
    box-shadow: 0 6px 24px rgba(0,0,0,.14); font-size: 13px;
}
.push-banner-text { flex: 1; line-height: 1.5; }
.push-banner-btn {
    flex: none; padding: 7px 14px; border: none; border-radius: 8px;
    background: var(--primary-color, #4a7cff); color: #fff; font-size: 12px; cursor: pointer;
}
.push-banner-close {
    flex: none; width: 24px; height: 24px; border: none; background: transparent;
    color: var(--text-tertiary, #999); font-size: 18px; cursor: pointer;
}

/* 通知设置面板 */
.push-overlay {
    position: fixed; inset: 0; z-index: 9600; display: flex;
    align-items: center; justify-content: center; background: rgba(0,0,0,.45);
}
.push-panel {
    width: min(440px, 92vw); max-height: 84vh; display: flex; flex-direction: column;
    background: var(--bg-primary, #fff); border-radius: 14px; overflow: hidden;
}
.push-panel-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border-color, #eef1f6);
}
.push-panel-head h3 { font-size: 15px; font-weight: 600; color: var(--text-primary, #222); }
.push-panel-head button {
    border: none; background: transparent; font-size: 20px; cursor: pointer;
    color: var(--text-tertiary, #999);
}
.push-panel-body { padding: 6px 20px 16px; overflow-y: auto; }
.push-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--border-color, #eef1f6);
    font-size: 13px; color: var(--text-primary, #222); cursor: pointer;
}
.push-row span { display: flex; flex-direction: column; }
.push-row small { font-size: 11px; color: var(--text-tertiary, #8a94a6); margin-top: 3px; }
.push-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary-color, #4a7cff); }
.push-row input[type="time"] {
    border: 1px solid var(--border-color, #dce3ef); border-radius: 6px;
    padding: 4px 6px; font-size: 12px; color: var(--text-primary, #222);
    background: var(--bg-primary, #fff);
}
.push-row input[type="text"] {
    width: 100%; margin-top: 6px; border: 1px solid var(--border-color, #dce3ef);
    border-radius: 6px; padding: 8px 10px; font-size: 12px;
    color: var(--text-primary, #222); background: var(--bg-primary, #fff);
}
.push-fallback { margin-top: 10px; padding: 8px 12px; border: 1px dashed var(--border-color, #dce3ef); border-radius: 8px; }
.push-fallback .push-row { padding: 10px 0; }
.push-hint {
    font-size: 11px; line-height: 1.6; color: var(--text-tertiary, #8a94a6);
    margin-top: 14px; padding: 10px; border-radius: 8px; background: var(--bg-secondary, #f5f7fb);
}
.push-panel-foot { padding: 12px 20px calc(16px + var(--safe-bottom)); text-align: right; border-top: 1px solid var(--border-color, #eef1f6); }

/* v4.5.9 第15项：深色模式下「消息与来电通知」面板文字对比度兜底。
   之前面板用 var(--bg-primary) 等未定义变量回退成白底 + 浅色文字，导致一片糊。 */
body.theme-dark .push-panel { background: #242424; color: #e6e6e6; }
body.theme-dark .push-panel .push-row,
body.theme-dark .push-panel .push-panel-head h3 { color: #e6e6e6; }
body.theme-dark .push-panel .push-row small,
body.theme-dark .push-panel .push-hint { color: #a8a8a8; }
body.theme-dark .push-panel input[type="time"],
body.theme-dark .push-panel input[type="text"] { background: #2c2c2c; color: #e6e6e6; border-color: #3a3a3a; }
body.theme-dark .push-panel .push-fallback { border-color: #3a3a3a; }
body.theme-dark .push-panel .push-panel-head button { color: #c8c8c8; }

/* v4.5.5：自助推送通道「详细教程」折叠区 */
.fb-field { position: relative; }
.fb-guide-btn {
    align-self: flex-start; margin: 6px 0 0; border: none; background: transparent;
    color: var(--primary-color, #4a7cff); font-size: 11px; padding: 2px 0; cursor: pointer;
}
.fb-guide {
    width: 100%; box-sizing: border-box; margin-top: 8px; padding: 10px 12px 8px;
    background: var(--bg-secondary, #f5f7fb); border: 1px solid var(--border-color, #e6ebf2);
    border-radius: 8px; cursor: default;
}
.fb-guide-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.fb-guide-top b { font-size: 12px; color: var(--text-primary, #222); }
.fb-free { font-size: 10px; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.fb-free.yes { color: #1a9d4b; background: #e6f7ed; }
.fb-free.no { color: #b26a00; background: #fff2dd; }
.fb-guide-steps { margin: 0 0 6px; padding-left: 18px; }
.fb-guide-steps li { font-size: 11.5px; line-height: 1.7; color: var(--text-secondary, #555); margin-bottom: 4px; }
.fb-guide-steps li code { background: #eef1f6; padding: 1px 4px; border-radius: 4px; font-size: 11px; word-break: break-all; }
.fb-guide-link { font-size: 11px; color: var(--text-tertiary, #8a94a6); word-break: break-all; margin-bottom: 4px; }
.fb-guide-link a { color: var(--primary-color, #4a7cff); text-decoration: none; }
.fb-guide-note { font-size: 11px; line-height: 1.6; color: #b26a00; background: #fff8ea; border-radius: 6px; padding: 6px 8px; }

/* ==================== v3.2 注册（短信验证 / 个人 · 企业） ==================== */
.auth-container { max-height: 92vh; overflow-y: auto; }
.auth-container::-webkit-scrollbar { width: 4px; }
.auth-container::-webkit-scrollbar-thumb { background: #d6dde8; border-radius: 4px; }

.reg-tabs {
    display: flex; gap: 6px; background: #f1f5fb; border-radius: 10px;
    padding: 4px; margin-bottom: 18px;
}
.reg-tab {
    flex: 1; text-align: center; padding: 9px 0; font-size: 14px; color: #6b7688;
    border-radius: 8px; cursor: pointer; transition: all .2s ease; font-weight: 500;
}
.reg-tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(0, 60, 120, .12); }
.reg-pane { display: none; }
.reg-pane.active { display: block; animation: fadeIn .25s ease; }

.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row .form-input { flex: 1; margin: 0; }
.btn-code {
    flex: 0 0 auto; min-width: 104px; padding: 0 12px; border: 1px solid var(--primary);
    background: #fff; color: var(--primary); border-radius: var(--radius); font-size: 13px;
    cursor: pointer; transition: all .2s ease; white-space: nowrap;
}
.btn-code:hover:not(:disabled) { background: var(--primary); color: #fff; }
.btn-code:disabled { border-color: #cfd8e3; color: #9aa6b6; cursor: not-allowed; background: #f6f8fb; }

.brand-company {
    display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 20px;
    background: var(--primary-light); color: var(--primary-dark); font-size: 12.5px; font-weight: 600;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-company {
    margin-top: 4px; padding: 2px 5px; border-radius: 6px; background: rgba(255, 255, 255, .22);
    color: #fff; font-size: 9px; line-height: 1.2; max-width: 52px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
}

/* 企业审核状态页 */
#companyPendingScreen {
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0096e6 0%, #00bcd4 100%);
}
.pending-container {
    width: 420px; max-width: 92vw; background: #fff; border-radius: var(--radius-lg);
    padding: 34px 30px; box-shadow: var(--shadow-lg); text-align: center;
    max-height: 92vh; overflow-y: auto;
}
.pending-logo { margin-bottom: 10px; }
.pending-container h1 { font-size: 20px; color: var(--text-primary); }
.pending-sub { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.pending-card {
    text-align: left; background: #f7fafd; border-radius: 12px; padding: 14px 16px; margin: 18px 0;
}
.pending-row {
    display: flex; justify-content: space-between; gap: 12px; font-size: 13px;
    padding: 8px 0; border-bottom: 1px dashed #e4ebf5; color: var(--text-secondary);
}
.pending-row:last-child { border-bottom: none; }
.pending-row b { color: var(--text-primary); font-weight: 600; max-width: 62%; text-align: right; word-break: break-all; }
.pending-badge { color: #d98200 !important; }
.pending-badge.ok { color: var(--success) !important; }
.pending-badge.bad { color: var(--danger) !important; }
.pending-reason {
    margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #fff2f0;
    color: #d4380d; font-size: 12.5px; line-height: 1.6;
}
.pending-tip { font-size: 12px; color: var(--text-tertiary); line-height: 1.6; margin-top: 10px; }

/* 企业信息卡 */
.company-brand-card {
    display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px;
    background: linear-gradient(135deg, #e8f5ff 0%, #f4fbff 100%); margin-bottom: 16px;
}
.company-brand-logo {
    width: 52px; height: 52px; border-radius: 14px; flex: 0 0 auto;
    background: linear-gradient(135deg, #00a8ff, #0072e6); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 20px; letter-spacing: -.5px;
}
.company-brand-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.company-brand-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* 成员列表 */
.member-list { display: flex; flex-direction: column; gap: 8px; }
.member-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border: 1px solid var(--border-color); border-radius: 10px;
}
.member-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: 600;
}
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 14px; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.member-phone { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.member-tag {
    font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--primary-light);
    color: var(--primary-dark); font-weight: 500;
}
.member-tag.off { background: #fdecec; color: #d4380d; }
.member-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.member-btn {
    font-size: 12px; padding: 4px 9px; border-radius: 6px; border: 1px solid #d8e0ec;
    background: #fff; color: #4a5568; cursor: pointer;
}
.member-btn:hover { border-color: var(--primary); color: var(--primary); }
.member-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.member-created {
    margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #f0f9f0;
    color: #256b28; font-size: 12.5px; line-height: 1.7; word-break: break-all;
}


/* ==================== v3.2.4 移动端适配（iPhone / Android / PWA） ==================== */
/* 关键：iOS 上只要有一处内容溢出，浏览器在点击输入框 / 切换导航时就会把整页
   scrollIntoView 顶偏，表现为「左边被裁、标题栏消失、底部 Tab 只剩一半」。
   因此根容器一律锁死视口，滚动只交给内部列表。 */
.mobile-back-btn { display: none; }
/* 荣耀 / HarmonyOS 兜底：部分机型 PWA 独立窗口或浏览器下 (pointer: coarse)
   与 max-width 判定不稳定，媒体查询不命中会让返回按钮彻底消失。
   改为只要聊天窗口进入移动端全屏态（JS 已加 class），就强制显示返回。 */
#mainScreen.mobile-chat-open .mobile-back-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: auto;
    min-width: 52px;
    height: 44px;
    padding: 0 6px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.mobile-back-btn .back-label { font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; }
.mobile-back-btn .back-badge { position: absolute; top: 4px; right: 0; }

@media (max-width: 768px), (max-width: 1024px) and (pointer: coarse) {
    html, body {
        height: 100vh;       /* 旧版 WebKit 兜底 */
        height: 100dvh;      /* 地址栏伸缩时取动态视口高度 */
        overflow: hidden;
        overscroll-behavior: none;
    }
    #app {
        height: 100vh;
        height: 100dvh;
        height: var(--app-height, 100dvh); /* 软键盘弹出时跟随 visualViewport */
        overflow: hidden;
    }
    .screen.active {
        /* 关键：用 100% 跟随 #app 的内容盒，绝不能写 100dvh —— 父级一旦有
           safe-area padding，子元素定死视口高度就会溢出并把整页往上顶。 */
        height: 100%;
        overflow: hidden;
        overflow: clip; /* clip 不允许程序化滚动，彻底杜绝整页偏移 */
    }

    #mainScreen {
        flex-direction: column;
        position: relative;
        /* 顶部状态栏 / 刘海由系统绘制（black-translucent 时内容延伸到其下方），
           这里统一让出；品牌色填充该区域，保证状态栏白字可读。 */
        padding-top: env(safe-area-inset-top, 0px);
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        background: var(--primary);
        overflow: hidden;
        overflow: clip;
    }

    /* 侧边导航 → 底部 Tab 栏 */
    .sidebar {
        order: 3;
        margin-top: auto;            /* 贴到主界面最下方 */
        width: 100%;
        max-width: 100vw;
        height: auto;
        min-height: calc(56px + env(safe-area-inset-bottom, 0px));
        flex: 0 0 auto;
        flex-direction: row;
        align-items: stretch;
        padding: 0;
        padding-bottom: 0;           /* 安全区改由 tab 项自身承担，避免栏下方出现纯空白 */
        border-top: 1px solid var(--border-color);
        border-right: none;
        box-shadow: 0 -2px 10px rgba(0,0,0,.04);
    }
    .sidebar-header,
    .sidebar-footer .nav-label,
    .sidebar-company { display: none; }
    .sidebar-header { margin: 0; }
    .sidebar-nav { flex: 1; flex-direction: row; align-items: stretch; justify-content: stretch; gap: 0; min-width: 0; }
    .sidebar .nav-item {
        flex: 1; min-width: 0; gap: 2px;
        justify-content: center;
        padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
    }
    .sidebar .nav-label { font-size: 10px; }
    .sidebar-footer { flex: 0 0 auto; width: auto; display: flex; align-items: stretch; }
    .sidebar-footer .nav-item { flex: 0 0 auto; padding: 6px 14px; }

    /* 列表面板：min-height:0 是关键，否则长列表会把 flex 父容器撑高 */
    .list-panel {
        order: 1;
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        width: 100% !important;
        max-width: 100vw;
        min-width: 0;
        overflow: hidden;
        border-right: none;
    }
    .list-view { min-height: 0; height: 100%; overflow: hidden; }
    .list-header { height: 52px; padding: 0 14px; flex-shrink: 0; }
    .search-box { flex-shrink: 0; }
    .list-items, .settings-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* 聊天窗口：未打开时完全不渲染。
       旧版用 translateX(100%) 把窗口停在屏外，iOS 会把这段位移算进滚动区域，
       点击输入框 / 导航时整页横向滚动 100+px，版面错乱且返回按钮被裁掉。 */
    .content-area {
        order: 2;
        display: none;
        position: absolute;
        top: env(safe-area-inset-top, 0px);   /* 与列表内容区齐平 */
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 60;
        width: 100%;
        /* 不要写 height:100% —— 同时指定 top/bottom 与 height 时 height 优先，
           bottom:0 会被忽略，聊天层底部会多伸出 safe-area-top 那么一截，输入框被裁。 */
        max-width: 100vw;
        flex-direction: column;
        background: var(--bg-panel);
    }
    .content-area.mobile-open {
        display: flex;
        animation: luckySlideIn .2s ease-out;
    }
    @keyframes luckySlideIn {
        from { transform: translateX(24px); opacity: .6; }
        to { transform: none; opacity: 1; }
    }
    /* 聊天全屏时隐藏底部 Tab，输入框才能真正贴底 */
    #mainScreen.mobile-chat-open .sidebar { display: none; }

    .content-area .chat-window { flex: 1; min-height: 0; height: auto; }
    .content-area .message-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* 聊天头部返回按钮：44px 触控热区，避开刘海 */
    .mobile-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px; height: 44px;
        margin-right: 4px;
        border: none;
        background: transparent;
        font-size: 22px;
        color: var(--text-primary);
        cursor: pointer;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }
    .chat-header {
        height: 52px;
        padding: 0 8px;
        flex-shrink: 0;
        background: #fff;
    }
    .chat-header-actions { gap: 12px; }

    /* 输入区避开 iPhone 底部 Home 条 */
    .input-area {
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
        flex-shrink: 0;
    }
    #sendBtn { width: 44px; height: 44px; flex-shrink: 0; }
    #messageInput { font-size: 16px; }

    .modal {
        width: min(94vw, 460px) !important;
        max-width: 100vw;
        max-height: 86vh;
        max-height: 86dvh;
    }
    .modal-body { max-height: 70vh; max-height: 70dvh; overflow-y: auto; }

    /* ===== v3.2.6 通话界面移动端适配 =====
       iPhone 刘海 / Home 条：原通话遮罩是裸的 fixed 满屏层，接听与挂断按钮
       会落到 Home 条下面、横屏还会被挤出视口，导致「点不到、无法接听」。 */
    .call-overlay {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        padding: calc(env(safe-area-inset-top, 0px) + 16px)
                 calc(env(safe-area-inset-right, 0px) + 16px)
                 calc(env(safe-area-inset-bottom, 0px) + 16px)
                 calc(env(safe-area-inset-left, 0px) + 16px);
    }
    .call-container { gap: 18px; width: 100%; height: 100%; }
    .call-remote-view { gap: 10px; flex: 0 1 auto; }
    .call-avatar-large { width: 92px; height: 92px; font-size: 34px; }
    .call-remote-name { font-size: 20px; }
    .call-status { font-size: 14px; }
    .call-controls, .call-incoming-actions { flex: 0 0 auto; margin-top: 4px; }
    .call-btn { width: 62px; height: 62px; font-size: 26px; flex: 0 0 auto; }
    .call-self-view {
        width: 92px; height: 124px;
        right: 12px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
    }
    .call-group-grid { padding: calc(env(safe-area-inset-top, 0px) + 48px) 12px calc(env(safe-area-inset-bottom, 0px) + 104px); }
}

/* 横屏（含 iPhone 刘海横屏）：高度不足时收紧纵向排布，保证控制按钮始终可见 */
@media (max-height: 480px) and (orientation: landscape) {
    .call-container { gap: 10px; }
    .call-remote-view { gap: 6px; }
    .call-avatar-large { width: 60px; height: 60px; font-size: 24px; box-shadow: none; }
    .call-remote-name { font-size: 16px; }
    .call-status { font-size: 12px; }
    .call-timer { font-size: 12px; }
    .call-controls, .call-incoming-actions { margin-top: 0; gap: 20px; }
    .call-btn { width: 52px; height: 52px; font-size: 22px; }
    .call-self-view { width: 72px; height: 96px; right: 10px; bottom: 10px; }
}


/* 触控设备：去掉 hover 依赖与点击高亮闪烁 */
@media (hover: none) {
    * { -webkit-tap-highlight-color: transparent; }
    .toolbar-btn:hover, .btn-primary:hover, #sendBtn:hover { filter: none; }
}

/* 移动端：禁用双击缩放（影响快速点击发送），保留捏合缩放可访问性 */
@media (hover: none) {
    html { touch-action: manipulation; }
}

/* ==================== v3.2.4 iPhone 安装 / 通知引导 ==================== */
.push-ios-guide {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(0,0,0,.55);
}
.push-ios-guide-card {
    width: min(94vw, 420px); max-height: 86vh; max-height: 86dvh;
    display: flex; flex-direction: column;
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.push-ios-guide-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px; border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.push-ios-guide-head h3 { font-size: 16px; font-weight: 600; }
.push-ios-guide-close {
    border: none; background: transparent; font-size: 26px; line-height: 1;
    color: #888; cursor: pointer; padding: 0 4px;
}
.push-ios-guide-body {
    padding: 14px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.push-ios-note { font-size: 12.5px; color: #666; line-height: 1.7; margin-bottom: 10px; }
.push-ios-warn {
    background: #fff3f2; color: #c0392b; padding: 10px 12px;
    border-radius: 8px; font-size: 13px; line-height: 1.6; margin-bottom: 10px;
}
.push-ios-steps { margin: 0 0 12px 18px; padding: 0; }
.push-ios-steps li { font-size: 13.5px; line-height: 1.8; margin-bottom: 8px; color: #333; }
.push-ios-guide-foot {
    display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-color);
}
.push-ios-guide-foot button {
    padding: 9px 18px; border-radius: 8px; cursor: pointer; font-size: 14px;
}


/* ==================== v3.3.0 新增组件 ==================== */
/* 应用图标：去掉 H 字形，直接把 Lucky 放进图标 */
.lucky-mark {
    display: flex; align-items: center; justify-content: center;
    width: 68px; height: 68px; border-radius: 20px;
    background: linear-gradient(135deg, #00a8ff 0%, #0072e6 100%);
    box-shadow: 0 8px 22px rgba(0, 114, 230, .28);
    color: #fff; font-weight: 800; letter-spacing: -.5px;
    font-size: 17px; line-height: 1; user-select: none;
}
.lucky-mark span { transform: translateY(1px); }
.lucky-mark-sm { width: 58px; height: 58px; border-radius: 17px; font-size: 15px; }
.lucky-word { font-size: 13px; font-weight: 800; letter-spacing: -.5px; }
.auth-forgot { margin-top: 10px !important; }
/* v4.6.0 第23项：忘记密码入口从灰色小字提升为醒目入口，第一屏就能找到 */
.auth-forgot a {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--primary);
    border-radius: 999px;
    background: transparent;
}
.auth-forgot a:active { opacity: .7; }

/* 设置页：退出登录 */
.settings-logout-btn {
    width: 100%; padding: 13px; border: none; border-radius: 10px;
    background: #fff1f0; color: #d93025; font-size: 15px; font-weight: 600;
    cursor: pointer;
}
.settings-logout-btn:active { background: #ffd9d6; }

/* 个人资料底部三个操作 */
.profile-actions {
    display: flex; gap: 8px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-color); background: #fff;
}
.profile-action-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 4px; border: 1px solid var(--border-color); border-radius: 10px;
    background: #f7f9fc; color: var(--primary); font-size: 12px; cursor: pointer;
}
.profile-action-btn span { font-size: 20px; line-height: 1.2; }
.profile-action-btn:active { background: #e6f4ff; }

/* 消息自动销毁标记 */
.msg-burn-tag { color: #e8890c; font-size: 11px; margin-left: 6px; white-space: nowrap; }
.burn-note { margin-top: 12px; font-size: 12px; line-height: 1.6; color: var(--text-tertiary); }
.loc-msg-nomap { opacity: .8; }

/* 顶部按钮触控热区，间距放宽后仍好点 */
.chat-header-actions .icon-btn { width: 38px; height: 38px; flex: 0 0 38px; font-size: 18px; }

@media (max-width: 768px), (max-width: 1024px) and (pointer: coarse) {
    .chat-header-actions .icon-btn { width: 36px; height: 36px; flex-basis: 36px; font-size: 17px; }
    .profile-modal { max-height: 88dvh; }
}


/* ===== v3.4.0 消息分页 / 实时位置共享提示 ===== */
.msg-load-more { text-align: center; padding: 10px 0 6px; }
.msg-load-more button {
    border: 1px solid #d8e6cf; background: #f6fbf1; color: #4a7a3a;
    font-size: 12px; padding: 6px 14px; border-radius: 14px; cursor: pointer;
}
.msg-load-more button:active { background: #e8f4dd; }
.msg-system.msg-live-share {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 8px;
}
.msg-live-view {
    border: 1px solid #8DCB63; background: #fff; color: #3c7a35;
    font-size: 12px; padding: 4px 10px; border-radius: 12px; cursor: pointer;
}
.msg-live-view:active { background: #eef8e4; }
.live-share-banner {
    display: none; align-items: center; gap: 10px; padding: 9px 14px;
    background: #eef8e4; color: #33662f; font-size: 13px; cursor: pointer;
    border-bottom: 1px solid #d7eac9;
}
.lsb-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #4caf50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, .18); flex-shrink: 0;
}
