/* ============================================================
   MZL即时聊天系统 - 全局样式
   蓝金商务风：深蓝 #1a3a5c + 金色 #c9a961
   响应式适配 PC / 手机
   ============================================================ */

/* 重置与基础 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #333; background: #f0f2f5; }
a { color: #1a3a5c; text-decoration: none; }
a:hover { color: #c9a961; }
img { max-width: 100%; vertical-align: middle; }
input, textarea, button { font-family: inherit; font-size: inherit; outline: none; }

/* 颜色变量（CSS自定义属性，兼容降级） */
:root {
    --primary: #1a3a5c;
    --primary-light: #2a5a8c;
    --primary-dark: #0f2840;
    --gold: #c9a961;
    --gold-light: #e0c98f;
    --gold-dark: #a88a45;
    --bg: #f0f2f5;
    --white: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #e0e0e0;
    --success: #52c41a;
    --error: #f5222d;
    --warning: #faad14;
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: all 0.2s ease;
    line-height: 1.5;
    user-select: none;
}
.btn-primary {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 100%);
    color: #c9a961;
    border-color: #c9a961;
}
.btn-primary:hover { background: linear-gradient(135deg, #2a5a8c 0%, #1a3a5c 100%); color: #e0c98f; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline {
    background: transparent;
    color: #1a3a5c;
    border-color: #1a3a5c;
}
.btn-outline:hover { background: #1a3a5c; color: #c9a961; }
.btn-block { display: block; width: 100%; padding: 12px; font-size: 16px; }
.btn-small { padding: 4px 12px; font-size: 12px; }

/* ============================================================
   认证页面（登录/注册）
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a3a5c 0%, #0f2840 50%, #1a3a5c 100%);
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}
/* 页面级背景，避免滚动时露出空白 */
body.auth-page {
    background: linear-gradient(135deg, #1a3a5c 0%, #0f2840 50%, #1a3a5c 100%);
}
.auth-page-lang {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}
.auth-page-lang .lang-selector select {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(201,169,97,0.4);
    padding: 6px 28px 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c9a961' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.auth-page-lang .lang-selector select option {
    background: #1a3a5c;
    color: #fff;
}
/*.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(201,169,97,0.1) 0%, transparent 70%);
    border-radius: 50%;
}*/
.auth-container { width: 100%; max-width: 420px; position: relative; z-index: 1; }
.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 35px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border-top: 4px solid #c9a961;
}
.auth-header { text-align: center; margin-bottom: 30px; }
.auth-logo { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 15px; border: 2px solid #c9a961; }
.auth-header h1 { font-size: 24px; color: #1a3a5c; margin-bottom: 8px; }
.auth-header p { color: #999; font-size: 13px; }
.auth-form .form-group { margin-bottom: 20px; }
.auth-form label { display: block; margin-bottom: 6px; color: #555; font-weight: 500; font-size: 13px; }
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.auth-form input:focus { border-color: #c9a961; box-shadow: 0 0 0 2px rgba(201,169,97,0.15); }
.code-input-group { display: flex; gap: 10px; }
.code-input-group input { flex: 1; }
.code-input-group .btn { white-space: nowrap; padding: 10px 16px; }
.auth-footer { text-align: center; margin-top: 25px; padding-top: 20px; border-top: 1px solid #f0f0f0; color: #999; font-size: 13px; }
.auth-footer a { color: #1a3a5c; font-weight: 500; }

/* 提示框 */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 13px; }
.alert-error { background: #fff2f0; border: 1px solid #ffccc7; color: #f5222d; }
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #52c41a; }

/* ============================================================
   聊天主界面
   ============================================================ */
.chat-header {
    height: 56px;
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
    z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-logo { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #c9a961; }
.header-title { color: #c9a961; font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    background: transparent;
    border: 1px solid rgba(201,169,97,0.3);
    color: #c9a961;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.icon-btn:hover { background: rgba(201,169,97,0.15); border-color: #c9a961; }
.sound-icon.sound-on { color: #c9a961; }
.sound-icon.sound-off { color: #666; opacity: 0.5; }
.user-info { display: flex; align-items: center; gap: 10px; margin-left: 10px; padding-left: 15px; border-left: 1px solid rgba(201,169,97,0.2); }
.user-name { color: #fff; font-size: 14px; }
.logout-link { color: #c9a961; font-size: 13px; }

.chat-container {
    display: flex;
    height: calc(100vh - 56px);
    background: #f0f2f5;
    overflow: hidden;
}

/* 会话列表 */
.conversation-list {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.conv-list-header {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.conv-list-header h3 { font-size: 16px; color: #1a3a5c; }
.conv-list-body { flex: 1; overflow-y: auto; }
.conv-item {
    padding: 14px 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s;
}
.conv-item:hover { background: #f8f9fb; }
.conv-item.active { background: #eef3f8; border-left: 3px solid #c9a961; padding-left: 12px; }
.conv-delete-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    background: #ff4d4f;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: none;
    z-index: 2;
}
.conv-item:hover .conv-delete-btn { display: block; }
.conv-delete-btn:hover { background: #d9363e; }
.conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c, #2a5a8c);
    color: #c9a961;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}
.conv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-size: 14px; color: #333; font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-last-msg { font-size: 12px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { text-align: right; flex-shrink: 0; }
.conv-time { font-size: 11px; color: #bbb; margin-bottom: 4px; }
.conv-unread {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    background: #f5222d;
    color: #fff;
    font-size: 11px;
    border-radius: 9px;
    text-align: center;
}
.loading-tip { text-align: center; color: #999; padding: 30px; font-size: 13px; }
.empty-tip { text-align: center; color: #999; padding: 40px 20px; font-size: 13px; }

/* 聊天区域 */
.chat-area { flex: 1; display: flex; flex-direction: column; background: #f0f2f5; min-width: 0; }
.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}
.welcome-logo { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 20px; border: 3px solid #c9a961; box-shadow: 0 4px 20px rgba(201,169,97,0.3); }
.chat-welcome h2 { color: #1a3a5c; font-size: 24px; margin-bottom: 10px; }
.chat-welcome p { color: #999; margin-bottom: 30px; }
.welcome-actions { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; }

.chat-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-topbar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 20px;
}
.chat-target-info { display: flex; align-items: center; gap: 10px; }
.target-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c, #2a5a8c);
    color: #c9a961;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    overflow: hidden;
}
.target-avatar img { width: 100%; height: 100%; object-fit: cover; }
.target-name { font-size: 15px; font-weight: 600; color: #1a3a5c; }
.target-status { font-size: 12px; color: #999; }

/* 消息列表 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f0f2f5 url('../img/chatbg.jpg') center/cover no-repeat;
    position: relative;
}
.msg-day-tip {
    text-align: center;
    margin: 15px 0;
    color: #999;
    font-size: 12px;
}
.message-item {
    display: flex;
    margin-bottom: 18px;
    align-items: flex-start;
    gap: 10px;
}
.message-item.mine { flex-direction: row-reverse; }
.msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c, #2a5a8c);
    color: #c9a961;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.message-item.mine .msg-avatar { background: linear-gradient(135deg, #c9a961, #e0c98f); color: #1a3a5c; }
.msg-body { max-width: 65%; }
.msg-sender { font-size: 12px; color: #2996bb; margin-bottom: 4px; font-weight: 600; }
.message-item.mine .msg-sender { text-align: right; color: rgba(255,255,255,0.85); }
.msg-bubble {
    display: inline-block;
    max-width: 100%;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    background: #fff;
    border: 1px solid #e8e8e8;
    position: relative;
}
.msg-bubble .msg-content { margin-top: 2px; }
.msg-bubble.msg-image .msg-sender { margin-bottom: 6px; }
.chat-img-preview { cursor: pointer; max-width: 220px; max-height: 220px; border-radius: 6px; }
.msg-bubble.msg-emoji { font-size: 28px; padding: 6px 10px; }
.message-item.mine .msg-body { text-align: right; }
.message-item.mine .msg-bubble {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 100%);
    color: #fff;
    border-color: #1a3a5c;
}
.msg-time { font-size: 11px; color: #888; margin-top: 4px; }
.message-item.mine .msg-time { text-align: right; color: #888; }
.msg-loading-more { text-align: center; padding: 10px; color: #999; font-size: 12px; }

/* 输入区域 */
.chat-input-area {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 12px 20px;
    flex-shrink: 0;
}
.input-tools { margin-bottom: 8px; }
.input-hint { font-size: 12px; color: #bbb; }
.chat-input-area textarea {
    width: 100%;
    min-height: 60px;
    max-height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s;
}
.chat-input-area textarea:focus { border-color: #c9a961; box-shadow: 0 0 0 2px rgba(201,169,97,0.15); }
.input-actions { text-align: right; margin-top: 10px; }

/* ============================================================
   弹窗
   ============================================================ */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-content {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 100%);
}
.modal-header h3 { color: #c9a961; font-size: 17px; }
.modal-close {
    background: transparent;
    border: none;
    color: #c9a961;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-body p { color: #666; margin-bottom: 15px; font-size: 13px; line-height: 1.6; }
.code-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    background: #f8f9fb;
    margin-bottom: 15px;
    resize: vertical;
}
.link-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
    background: #f8f9fb;
}
.embed-preview { margin-top: 20px; padding-top: 20px; border-top: 1px solid #f0f0f0; }
.embed-preview h4 { color: #1a3a5c; margin-bottom: 12px; font-size: 14px; }
.preview-box { padding: 20px; background: #f8f9fb; border-radius: 6px; text-align: center; }
.share-tip { font-size: 12px; color: #999; margin-top: 15px !important; }

/* ============================================================
   后台管理
   ============================================================ */
.admin-body { background: #f0f2f5; min-height: 100vh; }
.admin-header {
    height: 56px;
    background: linear-gradient(135deg, #1a3a5c 0%, #0f2840 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.admin-header-left { display: flex; align-items: center; gap: 12px; }
.admin-logo { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #c9a961; }
.admin-title { color: #c9a961; font-size: 17px; font-weight: 600; }
.admin-header-right { display: flex; align-items: center; gap: 20px; }
.admin-nav-link { color: #fff; font-size: 14px; }
.admin-nav-link:hover { color: #c9a961; }
.admin-user { color: #c9a961; font-size: 14px; }
.admin-logout { color: #fff; font-size: 13px; opacity: 0.8; }
.admin-logout:hover { opacity: 1; color: #c9a961; }

.admin-container { padding: 24px; max-width: 1400px; margin: 0 auto; }

/* 统计卡片 */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #1a3a5c;
}
.stat-card.stat-warning { border-left-color: #f5222d; }
.stat-icon { font-size: 32px; }
.stat-value { font-size: 26px; font-weight: 700; color: #1a3a5c; }
.stat-label { font-size: 13px; color: #999; margin-top: 2px; }

/* 面板 */
.admin-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 24px;
}
.panel-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-header h3 { color: #1a3a5c; font-size: 16px; }
.panel-tip { color: #999; font-size: 12px; }
.panel-body { padding: 0; }
.search-form { display: flex; gap: 10px; }
.search-form input { padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; width: 200px; }

/* 表格 */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
    background: #f8f9fb;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    color: #666;
    font-weight: 600;
    border-bottom: 2px solid #e8e8e8;
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 13px; color: #333; }
.admin-table tr:hover { background: #fafbfc; }
.admin-table tr.has-unread { background: #fff8f0; }
.admin-table tr.has-unread:hover { background: #fff3e6; }
.table-user { display: flex; align-items: center; gap: 8px; }
.table-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c, #2a5a8c);
    color: #c9a961;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}
.table-avatar img { width: 100%; height: 100%; object-fit: cover; }
.last-msg { color: #666; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.badge-red { background: #fff2f0; color: #f5222d; }
.badge-green { background: #f6ffed; color: #52c41a; }
.badge-gray { background: #f5f5f5; color: #999; }

/* 分页 */
.pagination { padding: 16px 24px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 15px; }
.page-link { padding: 6px 14px; border: 1px solid #ddd; border-radius: 4px; color: #1a3a5c; font-size: 13px; }
.page-link:hover { border-color: #c9a961; color: #c9a961; }
.page-info { color: #999; font-size: 13px; }

/* 后台聊天布局 */
.admin-chat-container { display: flex; height: calc(100vh - 56px); }
.admin-chat-sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    padding: 24px;
    flex-shrink: 0;
    overflow-y: auto;
}
.customer-info-card { text-align: center; margin-bottom: 24px; }
.customer-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c, #2a5a8c);
    color: #c9a961;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    margin: 0 auto 15px;
    overflow: hidden;
}
.customer-avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.customer-name { color: #1a3a5c; font-size: 18px; margin-bottom: 6px; }
.customer-email { color: #999; font-size: 13px; }
.customer-detail { border-top: 1px solid #f0f0f0; padding-top: 20px; }
.detail-item { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; }
.detail-label { color: #999; }
.detail-value { color: #333; font-weight: 500; }
.admin-chat-main { flex: 1; display: flex; flex-direction: column; background: #f0f2f5; min-width: 0; }

/* ============================================================
   响应式 - 平板
   ============================================================ */
@media (max-width: 992px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .conversation-list { width: 260px; }
    .admin-chat-sidebar { width: 220px; padding: 16px; }
}

/* ============================================================
   响应式 - 手机
   ============================================================ */
@media (max-width: 768px) {
    .chat-header { padding: 0 12px; }
    .header-title { font-size: 15px; }
    .user-name { display: none; }
    .icon-btn { width: 32px; height: 32px; font-size: 14px; }

    .chat-container { position: relative; }
    .conversation-list {
        position: absolute;
        left: 0; top: 0; bottom: 0;
        width: 85%;
        max-width: 320px;
        z-index: 5;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.15);
    }
    .conversation-list.show { transform: translateX(0); }

    .stats-row { grid-template-columns: 1fr; gap: 12px; }
    .admin-container { padding: 12px; }
    .admin-header { padding: 0 12px; }
    .admin-title { font-size: 14px; }
    .admin-header-right { gap: 10px; }
    .admin-nav-link { font-size: 13px; }

    .admin-chat-container { flex-direction: column; overflow: hidden; }
    .admin-chat-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 12px;
        max-height: 120px;
        flex-shrink: 0;
        overflow-y: auto;
    }
    .admin-chat-main { min-height: 0; overflow: hidden; }
    .customer-avatar-large { width: 48px; height: 48px; font-size: 20px; margin-bottom: 8px; }
    .customer-name { font-size: 15px; }
    .customer-detail { display: none; }

    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 8px; }
    .search-form input { width: 120px; }

    .msg-body { max-width: 90%; }
    .msg-bubble { max-width: 100%; }
    .chat-messages { padding: 12px; }
    .chat-input-area { padding: 10px 12px; flex-shrink: 0; }

    .auth-card { padding: 30px 20px; }
    .modal-content { max-width: 100%; }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ============================================================
   工具栏按钮（表情/图片）
   ============================================================ */
.input-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 6px 4px;
}
.input-tool-btns {
    display: flex;
    gap: 8px;
}
.tool-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}
.tool-btn:hover {
    background: #f0f4f8;
}

/* ============================================================
   表情面板
   ============================================================ */
.emoji-panel {
    position: absolute;
    bottom: 100%;
    left: 12px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    padding: 10px;
    width: 320px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}
.emoji-item {
    font-size: 22px;
    text-align: center;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}
.emoji-item:hover {
    background: #f0f4f8;
}

/* ============================================================
   图片消息
   ============================================================ */
.msg-image {
    padding: 4px;
    background: #fff;
}
.msg-image img {
    max-width: 250px;
    max-height: 250px;
    border-radius: 6px;
    display: block;
    cursor: pointer;
}
.message-item.mine .msg-image {
    background: #d4e8fc;
}

/* ============================================================
   表情消息
   ============================================================ */
.msg-emoji {
    font-size: 48px;
    background: transparent !important;
    padding: 4px !important;
    box-shadow: none !important;
}

/* ============================================================
   撤回消息
   ============================================================ */
.msg-bubble.msg-revoked {
    color: #999 !important;
    font-style: italic;
    background: #f5f5f5 !important;
    border-color: #e0e0e0 !important;
    font-size: 13px;
}
.msg-revoke-btn {
    color: #1a5fb4;
    cursor: pointer;
    font-size: 12px;
    margin-left: 8px;
}
.msg-revoke-btn:hover {
    text-decoration: underline;
}

/* 聊天输入区域相对定位（表情面板定位用） */
.chat-input-area {
    position: relative;
}

/* 官方客服标识 */
.official-badge {
    display: inline-block;
    background: linear-gradient(135deg, #c9a961, #e8d5a3);
    color: #1a3a5c;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: bold;
    vertical-align: middle;
    margin-left: 4px;
}
.badge-gold {
    background: linear-gradient(135deg, #c9a961, #e8d5a3);
    color: #1a3a5c;
}

/* 语言选择器 */
.lang-selector {
    display: inline-block;
    margin-right: 10px;
}
.lang-selector select {
    padding: 5px 10px;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    background: #fff;
    color: #1a3a5c;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}
.lang-selector select:hover {
    border-color: #c9a961;
}
.lang-selector-label {
    display: inline-block;
    margin-right: 6px;
    font-size: 13px;
    color: #1a3a5c;
    vertical-align: middle;
    font-weight: 500;
}

/* 图形验证码 */
.captcha-group {
    display: flex;
    gap: 10px;
    align-items: center;
}
.captcha-img {
    width: 100px;
    height: 38px;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
}

/* ============================================================
   好友系统样式
   ============================================================ */
.conv-tabs {
    display: flex;
    border-bottom: 1px solid #e8ecf1;
    background: #f8f9fb;
}
.conv-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #6b7c93;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}
.conv-tab:hover {
    color: #1a3a5c;
}
.conv-tab.active {
    color: #1a3a5c;
    border-bottom-color: #c9a961;
    font-weight: 600;
}
.friend-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    background: #e74c3c;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    margin-left: 4px;
    text-align: center;
}
.conv-tab-content {
    display: none;
}
.conv-tab-content.active {
    display: block;
}
.friend-search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}
.friend-search-result {
    max-height: 300px;
    overflow-y: auto;
}
.friend-search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f2f5;
    gap: 10px;
}
.friend-search-item:hover {
    background: #f8f9fb;
}
.friend-search-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c, #2c5f8a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}
.friend-search-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.friend-search-info {
    flex: 1;
    min-width: 0;
}
.friend-search-name {
    font-weight: 600;
    color: #1a3a5c;
    font-size: 14px;
}
.friend-search-email {
    font-size: 12px;
    color: #8a9bb0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.friend-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    gap: 10px;
    transition: background 0.2s;
}
.friend-item:hover {
    background: #f0f4f8;
}
.friend-item-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c, #2c5f8a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}
.friend-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.friend-item-info {
    flex: 1;
    min-width: 0;
}
.friend-item-name {
    font-weight: 600;
    color: #1a3a5c;
    font-size: 14px;
}
.friend-item-email {
    font-size: 12px;
    color: #8a9bb0;
}
.friend-requests {
    border-bottom: 1px solid #e8ecf1;
    background: #fff8e7;
}
.friend-requests-title {
    padding: 8px 15px;
    font-size: 12px;
    color: #c9a961;
    font-weight: 600;
    background: #fef5e0;
}
.friend-request-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f0e6d0;
    gap: 10px;
}
.friend-request-actions {
    display: flex;
    gap: 6px;
}
.friend-request-actions .btn {
    padding: 4px 10px;
    font-size: 12px;
}

/* 好友列表项 */
.friend-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c, #2c5f8a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}
.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.friend-info {
    flex: 1;
    min-width: 0;
}
.friend-name {
    font-weight: 600;
    color: #1a3a5c;
    font-size: 14px;
}
.friend-email {
    font-size: 12px;
    color: #8a9bb0;
}

/* 搜索结果 */
.search-user-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f2f5;
    gap: 10px;
}
.search-user-item:hover {
    background: #f8f9fb;
}
.search-user-info {
    flex: 1;
    min-width: 0;
}
.search-user-name {
    font-weight: 600;
    color: #1a3a5c;
    font-size: 14px;
}
.search-user-email {
    font-size: 12px;
    color: #8a9bb0;
}
.search-user-action {
    flex-shrink: 0;
}
.relation-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #e8f0e8;
    color: #2d7a2d;
    border-radius: 4px;
    font-size: 12px;
}
.btn-add-friend {
    padding: 5px 12px;
    background: linear-gradient(135deg, #1a3a5c, #2c5f8a);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.btn-add-friend:hover {
    background: linear-gradient(135deg, #2c5f8a, #1a3a5c);
}
.btn-add-friend:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 好友请求 */
.friend-request-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9a961, #d4b87a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}
.friend-request-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.friend-request-info {
    flex: 1;
    min-width: 0;
}
.friend-request-name {
    font-weight: 600;
    color: #1a3a5c;
    font-size: 13px;
}
.friend-request-email {
    font-size: 11px;
    color: #8a9bb0;
}
.btn-accept {
    padding: 4px 10px;
    background: #2d7a2d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.btn-accept:hover {
    background: #236b23;
}
.btn-reject {
    padding: 4px 10px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.btn-reject:hover {
    background: #a93226;
}

/* 好友系统 */
.conv-tabs {
    display: flex;
    border-bottom: 1px solid #e1e4e8;
    background: #fff;
}
.conv-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #586069;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}
.conv-tab:hover {
    color: #1a3a5c;
}
.conv-tab.active {
    color: #1a3a5c;
    border-bottom-color: #c9a961;
    font-weight: 600;
}
.friend-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    background: #d73a49;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    margin-left: 4px;
    text-align: center;
}
.friend-requests {
    border-bottom: 1px solid #e1e4e8;
    padding: 8px 12px;
    background: #fff8e1;
}
.friend-requests-title {
    font-size: 12px;
    color: #b08800;
    margin-bottom: 8px;
    font-weight: 600;
}
.friend-request-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.friend-request-item:last-child {
    border-bottom: none;
}
.friend-request-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1a3a5c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 10px;
    overflow: hidden;
}
.friend-request-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.friend-request-info {
    flex: 1;
    min-width: 0;
}
.friend-request-name {
    font-size: 13px;
    color: #24292e;
    font-weight: 500;
}
.friend-request-email {
    font-size: 11px;
    color: #959da5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.friend-request-actions {
    display: flex;
    gap: 6px;
}
.friend-request-actions button {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}
.btn-accept {
    background: #28a745;
    color: #fff;
}
.btn-reject {
    background: #d73a49;
    color: #fff;
}
.friend-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f6f8fa;
    transition: background 0.2s;
}
.friend-item:hover {
    background: #f6f8fa;
}
.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a3a5c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 12px;
    overflow: hidden;
    flex-shrink: 0;
}
.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.friend-info {
    flex: 1;
    min-width: 0;
}
.friend-name {
    font-size: 14px;
    color: #24292e;
    font-weight: 500;
}
.friend-email {
    font-size: 12px;
    color: #959da5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.friend-search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.friend-search-box .link-input {
    flex: 1;
}
.friend-search-result {
    max-height: 300px;
    overflow-y: auto;
}
.search-user-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.search-user-item:last-child {
    border-bottom: none;
}
.search-user-info {
    flex: 1;
    min-width: 0;
}
.search-user-name {
    font-size: 14px;
    color: #24292e;
    font-weight: 500;
}
.search-user-email {
    font-size: 12px;
    color: #959da5;
}
.search-user-action {
    flex-shrink: 0;
}
.btn-add-friend {
    padding: 5px 12px;
    font-size: 12px;
    background: #1a3a5c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-add-friend:disabled {
    background: #959da5;
    cursor: not-allowed;
}
.relation-tag {
    font-size: 11px;
    color: #28a745;
    font-weight: 500;
}
.auth-page-lang {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
}
.auth-page-lang select {
    padding: 8px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #fff;
    color: #1a3a5c;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 140px;
}
@media (max-width: 480px) {
    .auth-page-lang {
        top: 10px;
        right: 10px;
    }
    .auth-page-lang select {
        padding: 6px 8px;
        font-size: 12px;
        max-width: 110px;
    }
}

/* ============================================================
   移动端菜单按钮
   ============================================================ */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #c9a961;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 8px;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: inline-block;
    }
    .chat-header {
        padding: 0 10px;
        height: 50px;
    }
    .header-title {
        display: none;
    }
    .header-right {
        gap: 6px;
    }
    .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .user-name {
        display: none;
    }
    .logout-link {
        font-size: 12px;
    }
    /* 聊天页面header的语言选择器 */
    .chat-header .lang-selector {
        font-size: 12px;
        padding: 4px 6px;
    }
    /* 登录/注册/找回密码页面的语言选择器保持右上角样式 */
    .auth-page-lang {
        top: 5px;
        right: 8px;
    }
    .auth-page {
        padding-top: 55px;
    }
    .auth-page-lang .lang-selector select {
        font-size: 11px;
        padding: 4px 22px 4px 8px;
        max-width: 100px;
    }
    .conversation-list {
        position: absolute;
        left: 0; top: 0; bottom: 0;
        width: 85%;
        max-width: 300px;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.15);
        background: #fff;
    }
    .conversation-list.show {
        transform: translateX(0);
    }
    .chat-area {
        width: 100%;
    }
    .chat-container {
        height: calc(100vh - 50px);
        overflow: hidden;
    }
    .chat-main {
        height: 100%;
        overflow: hidden;
    }
    .chat-topbar {
        height: 48px;
        padding: 0 12px;
    }
    .msg-body {
        max-width: 90%;
    }
    .msg-bubble {
        max-width: 100%;
    }
    .chat-messages {
        -webkit-overflow-scrolling: touch;
        padding: 12px;
        padding-bottom: 10px;
    }
    .chat-input-area {
        flex-shrink: 0;
        padding: 8px 12px;
    }
    .chat-input-area textarea {
        min-height: 44px;
        max-height: 100px;
    }
    .emoji-panel {
        width: 280px;
        left: 8px;
    }
    .emoji-grid {
        grid-template-columns: repeat(7, 1fr);
    }
    .msg-image img {
        max-width: 180px;
        max-height: 180px;
    }
    .input-hint {
        display: none;
    }
    .tool-btn {
        font-size: 22px;
        padding: 6px 10px;
    }
    #sendBtn {
        padding: 8px 14px;
        font-size: 15px;
    }
    #messageInput {
        font-size: 15px;
        min-height: 40px;
    }
    .msg-bubble {
        max-width: 100%;
    }
}

/* ============================================================
   后台管理员管理页面样式
   ============================================================ */
.admin-form-inline {
    width: 100%;
}
.form-group-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}
.form-item-inline {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
}
.form-item-inline label {
    font-size: 13px;
    color: #586069;
    margin-bottom: 6px;
    font-weight: 500;
}
.form-input-inline {
    padding: 8px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.form-input-inline:focus {
    border-color: #1a3a5c;
    box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}
.form-item-btn {
    flex: 0 0 auto;
    min-width: auto;
}
.btn-add-admin {
    padding: 8px 24px;
    font-size: 14px;
    white-space: nowrap;
}
.nickname-input {
    transition: border-color 0.2s;
}
.nickname-input:focus {
    border-color: #c9a961;
    box-shadow: 0 0 0 3px rgba(201,169,97,0.15);
    outline: none;
}
.btn-save-nickname {
    margin-left: 6px;
    padding: 5px 12px;
    font-size: 12px;
}

/* 确保Tab按钮在所有环境下样式正确 */
.conversation-list .conv-tabs {
    flex-shrink: 0;
}
.conversation-list .conv-tab {
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}
.conversation-list .conv-tab:focus {
    outline: none;
}

/* ============================================================
   密码相关样式
   ============================================================ */
.code-input-group {
    display: flex;
    gap: 8px;
}
.code-input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.code-input-group input:focus {
    border-color: #1a3a5c;
    box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}
.btn-code {
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 13px;
}
.forgot-link {
    color: #1a3a5c;
    text-decoration: none;
    font-size: 13px;
}
.forgot-link:hover {
    text-decoration: underline;
    color: #c9a961;
}
.modal-body .form-group {
    margin-bottom: 15px;
}
.modal-body .form-group label {
    display: block;
    font-size: 13px;
    color: #586069;
    margin-bottom: 6px;
    font-weight: 500;
}
.modal-body .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}
.modal-body .form-group input:focus {
    border-color: #1a3a5c;
    box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}

/* 后台客户备注输入框 */
.remark-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    font-size: 12px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}
.remark-input:focus {
    border-color: #1a3a5c;
    box-shadow: 0 0 0 2px rgba(26,58,92,0.1);
}

/* ============================================================
   超低分辨率手机（480px以下）优化
   ============================================================ */
@media (max-width: 480px) {
    .chat-header {
        padding: 0 8px;
        height: 48px;
    }
    .header-logo {
        display: none;
    }
    .header-left {
        gap: 6px;
    }
    .header-right {
        gap: 4px;
    }
    .icon-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .user-name {
        display: none;
    }
    .logout-link {
        font-size: 11px;
    }
    .chat-header .lang-selector select {
        font-size: 10px;
        padding: 3px 0px 3px 6px;
    }
    .chat-container {
        height: calc(100vh - 48px);
    }
    .chat-messages {
        padding: 12px;
    }
    .message-item {
        margin-bottom: 12px;
        gap: 6px;
    }
    .msg-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .msg-body {
        max-width: 90%;
    }
    .msg-bubble {
        max-width: 100%;
        font-size: 13px;
        padding: 8px 12px;
    }
    .chat-input-area {
        padding: 6px 8px;
    }
    .chat-input-area textarea {
        min-height: 38px;
        max-height: 80px;
        font-size: 13px;
    }
    #sendBtn {
        padding: 8px 14px;
        font-size: 13px;
    }
    .auth-card {
        padding: 25px 20px;
    }
    .auth-logo {
        width: 48px;
        height: 48px;
    }
    .auth-header h1 {
        font-size: 18px;
    }
}
 
  
/* Anti-screenshot */  
.chat-messages,.chat-main{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none}  
#messageInput,input,textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}  
.watermark-layer{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;z-index:1;overflow:hidden;opacity:0.06}  
.watermark-layer span{position:absolute;white-space:nowrap;font-size:14px;color:#000;transform:rotate(-30deg)}  
.screenshot-warning{position:fixed;top:50%;left:50%;transform:translate(-50%%,-50%%);background:rgba(0,0,0,0.85);color:#fff;padding:20px 40px;border-radius:8px;font-size:16px;z-index:99999;display:none;text-align:center}  
.screenshot-warning.show{display:block;animation:fadeInOut 2s ease-in-out}  
@keyframes fadeInOut{0%%{opacity:0}20%%{opacity:1}80%%{opacity:1}100%%{opacity:0}}

/* ===== 输入栏UI优化 ===== */
.chat-input-area {
    background: #fff;
    border-top: 1px solid #e8e8e8;
    padding: 10px 16px;
    flex-shrink: 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.input-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.input-hint { font-size: 11px; color: #bbb; }
.input-tool-btns { display: flex; gap: 4px; }
.tool-btn {
    width: 32px; height: 32px;
    background: none; border: none;
    font-size: 18px; cursor: pointer;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.tool-btn:hover { background: #f0f2f5; }
.chat-input-area textarea {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-area textarea:focus {
    border-color: #c9a961;
    box-shadow: 0 0 0 3px rgba(201,169,97,0.12);
    outline: none;
}
.input-actions { text-align: right; margin-top: 8px; }
.send-btn {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 100%);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.send-btn:hover { opacity: 0.9; }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 手机端语言切换优化 ===== */
@media (max-width: 768px) {
    .auth-page-lang {
        top: 8px;
        right: 8px;
    }
    .auth-page-lang select {
        padding: 5px 8px;
        font-size: 11px;
        max-width: 90px;
        border-radius: 4px;
    }
    .chat-header .lang-selector {
        max-width: 90px;
    }
    .chat-header .lang-selector select {
        font-size: 10px;
        padding: 3px 0px 3px 5px;
        max-width: 73px;
    }
}

/* ===== 群聊撤回按钮 ===== */
.group-revoke-btn {
    color: #1a3a5c;
    cursor: pointer;
    font-size: 11px;
    margin-left: 8px;
}
.group-revoke-btn:hover { text-decoration: underline; }

/* ===== 群系统消息 ===== */
.group-system-msg {
    text-align: center;
    margin: 12px 0;
    padding: 6px 16px;
    background: rgba(0,0,0,0.06);
    border-radius: 12px;
    font-size: 12px;
    color: #888;
    display: inline-block;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}
.group-msg-sender {
    font-size: 12px;
    color: #576b95;
    margin-bottom: 3px;
    font-weight: 600;
}
.at-all-tag {
    color: #c9a961;
    font-weight: 600;
}
.muted-tip {
    text-align: center;
    padding: 8px;
    background: #fff3cd;
    color: #856404;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* ===== 新版输入框布局 ===== */
.chat-input-area {
    background: #fff !important;
    border-top: 1px solid #e8e8e8 !important;
    padding: 8px 12px !important;
    flex-shrink: 0;
}
.chat-input-area .input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.chat-input-area .input-row textarea {
    flex: 1 1 auto;
    min-height: 36px !important;
    height: 36px !important;
    max-height: 100px;
    padding: 7px 14px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 18px !important;
    resize: none !important;
    font-size: 14px !important;
    line-height: 20px !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: border-color 0.2s !important;
    overflow-y: auto;
}
.chat-input-area .input-row textarea:focus {
    border-color: #c9a961 !important;
    box-shadow: 0 0 0 2px rgba(201,169,97,0.12) !important;
}
.chat-input-area .input-row .tool-btn {
    width: 34px !important;
    height: 34px !important;
    flex-shrink: 0 !important;
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s !important;
    padding: 0 !important;
    line-height: 1 !important;
}
.chat-input-area .input-row .tool-btn:hover {
    background: #f0f2f5 !important;
}
.chat-input-area .input-send-btn {
    background: transparent !important;
    color: #3390ec !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    font-size: 14px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s !important;
    padding: 0 !important;
}
.chat-input-area .input-send-btn:hover { background: #e8f0fe !important; }
.chat-input-area .input-send-btn:active { background: #d2e3fc !important; }
.chat-input-area .input-send-btn:disabled { opacity: 0.5 !important; cursor: not-allowed !important; }
.chat-input-area .input-send-btn svg { display: block; margin-left: 1px; }
.chat-input-area .input-send-btn .send-spinner {
    animation: send-spin 0.8s linear infinite;
    margin-left: 0;
    color: #999 !important;
}
@keyframes send-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 电脑端默认顺序：图片 | 输入框 | 表情 | @ | 发送 */
.chat-input-area .input-img-btn { order: 1; }
.chat-input-area .input-row textarea { order: 2; }
.chat-input-area .input-emoji-btn { order: 3; }

/* ============================================================
   自定义弹窗组件（替代浏览器alert）
   ============================================================ */
.mzl-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 99999;
    max-width: 80%;
    text-align: center;
    word-break: break-word;
    animation: mzl-toast-in 0.2s ease-out;
    pointer-events: none;
}
@keyframes mzl-toast-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.mzl-toast.hide {
    animation: mzl-toast-out 0.2s ease-in forwards;
}
@keyframes mzl-toast-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 确认弹窗 */
.mzl-modal-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mzl-fade-in 0.2s ease-out;
}
@keyframes mzl-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.mzl-modal {
    background: #fff;
    border-radius: 12px;
    width: 300px;
    max-width: 85%;
    overflow: hidden;
    animation: mzl-modal-in 0.25s ease-out;
}
@keyframes mzl-modal-in {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.mzl-modal-title {
    padding: 18px 20px 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1a3a5c;
    text-align: center;
}
.mzl-modal-content {
    padding: 0 20px 20px;
    font-size: 14px;
    color: #666;
    text-align: center;
    line-height: 1.6;
    word-break: break-word;
}
.mzl-modal-btns {
    display: flex;
    border-top: 1px solid #f0f0f0;
}
.mzl-modal-btn {
    flex: 1;
    padding: 14px 0;
    font-size: 15px;
    border: none;
    background: none;
    cursor: pointer;
    transition: background 0.2s;
}
.mzl-modal-btn:active { background: #f5f5f5; }
.mzl-modal-btn.cancel {
    color: #999;
    border-right: 1px solid #f0f0f0;
}
.mzl-modal-btn.confirm {
    color: #1a3a5c;
    font-weight: 600;
}
.mzl-modal-btn.confirm.danger { color: #f56c6c; }

/* 手机端适配 */
@media (max-width: 768px) {
    .mzl-modal { width: 280px; }
    .mzl-toast { padding: 12px 20px; font-size: 13px; }
}
.chat-input-area .input-row #atAllBtn { order: 4; display: none !important; }
.chat-input-area .input-row #atAllBtn.show { display: flex !important; }
.chat-input-area .input-send-btn { order: 5; }

/* 手机端顺序：表情 | 输入框 | 图片 | @ | 发送 */
@media (max-width: 768px) {
    .chat-input-area {
        padding: 5px 6px !important;
    }
    .chat-input-area .input-row {
        gap: 3px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .chat-input-area .input-emoji-btn { order: 1 !important; }
    .chat-input-area .input-row textarea { order: 2 !important; }
    .chat-input-area .input-img-btn { order: 3 !important; }
    .chat-input-area .input-row #atAllBtn { order: 4 !important; }
    .chat-input-area .input-send-btn { order: 5 !important; }
    .chat-input-area .input-row .tool-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 15px !important;
        min-width: 28px !important;
        flex-shrink: 0 !important;
    }
    .chat-input-area .input-send-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        flex-shrink: 0 !important;
        background: transparent !important;
        color: #3390ec !important;
    }
    .chat-input-area .input-send-btn:hover { background: #e8f0fe !important; }
    .chat-input-area .input-send-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    .chat-input-area .input-send-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    .chat-input-area .input-row textarea {
        min-height: 30px !important;
        height: 30px !important;
        max-height: 80px !important;
        padding: 4px 10px !important;
        font-size: 13px !important;
        line-height: 20px !important;
        border-radius: 15px !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
    }
}  

/* 语言切换按钮 - 高优先级 */
div.lang-selector { position: relative; display: inline-block; z-index: 9999; }
div.lang-selector button.lang-btn {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background: rgba(255,255,255,0.15) !important;
    color: #fff !important;
    border: 1px solid rgba(201,169,97,0.4) !important;
    padding: 5px 5px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
    box-shadow: none !important;
    outline: none !important;
}
div.lang-selector button.lang-btn:hover { background: rgba(201,169,97,0.25) !important; }
div.lang-selector div.lang-dropdown {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    background: #fff !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
    min-width: 140px !important;
    z-index: 99999 !important;
    overflow: hidden !important;
}
div.lang-selector:hover div.lang-dropdown { display: block !important; }
div.lang-selector div.lang-dropdown a {
    display: block !important;
    padding: 8px 16px !important;
    color: #333 !important;
    background: #fff !important;
    text-decoration: none !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    border: none !important;
    text-align: left !important;
}
div.lang-selector div.lang-dropdown a:hover { background: #f5f5f5 !important; color: #1a3a5c !important; }
/* 白色背景页面 */
.white-bg div.lang-selector button.lang-btn,
.admin-page div.lang-selector button.lang-btn {
    background: #f5f5f5 !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
}
.white-bg div.lang-selector button.lang-btn:hover,
.admin-page div.lang-selector button.lang-btn:hover { background: #e8e8e8 !important; }
