/* ==================== 全局变量 ==================== */
: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; }

.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: 15px;
    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; }

/* 实名切换 */
.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; 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: 14px;
    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: 1; font-size: 15px; }
.settings-value { font-size: 14px; color: var(--text-tertiary); }
.chevron { 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; gap: 4px; }

/* 消息列表 */
.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;
}

/* 系统消息 */
.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; }

.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: 15px;
    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; }
.edit-avatar-section .avatar-options { justify-content: center; margin-top: 12px; }

/* 添加好友 */
.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; }

/* 二维码 */
.qr-display {
    width: 200px; height: 200px;
    margin: 20px auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}
.qr-placeholder { text-align: center; }
.qr-pattern {
    width: 140px; height: 140px;
    background:
        linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%),
        linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%),
        #fff;
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    border-radius: 4px;
    margin: 0 auto 8px;
}
.qr-scan-hint { text-align: center; font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }

/* 单选列表 */
.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;
}
.call-controls { display: flex; gap: 24px; }
.call-btn {
    width: 60px; height: 60px;
    border: none;
    border-radius: var(--radius-round);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
}
.call-btn:hover { background: rgba(255,255,255,0.25); }
.call-btn.muted { background: rgba(255,255,255,0.05); opacity: 0.5; }
.call-btn.hangup { background: var(--danger); }
.call-btn.hangup:hover { background: #d32f2f; }
.call-btn.accept { background: var(--success, #07C160); }
.call-btn.accept:hover { background: #06ad56; }

/* WebRTC 视频画面 */
#callRemoteVideo {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    background: #000;
}
#callSelfVideo {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.call-incoming-actions {
    display: flex;
    gap: 24px;
    margin-top: 10px;
}
.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: 13px; font-family: inherit; resize: vertical; min-height: 72px; margin-bottom: 8px;
    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;
}

/* ---- 工号标签 ---- */
.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; align-items: center; gap: 10px; cursor: pointer;
    min-width: 200px; padding: 10px 12px;
}
.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; }

/* ---- 实时位置共享面板 ---- */
.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); }
@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); }
.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 条；安卓挖孔屏与横屏同理 */
@supports (padding: env(safe-area-inset-top)) {
    #app {
        padding-top: var(--safe-top);
        padding-bottom: var(--safe-bottom);
        padding-left: var(--safe-left);
        padding-right: var(--safe-right);
    }
}

/* 禁止整页橡皮筋回弹（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-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); }
