/* ========================================
   叠石桥万人网 - 主样式表
   ======================================== */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 仅按钮/交互元素防止双击缩放，不影响文本区域的原生长按选择 */
button, input[type="button"], input[type="submit"],
a, [role="button"], .nav-action-mobile, .dropdown-item,
.send-btn, .wx-login-btn, .login-btn, .tab-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* GPU 加速优化 - 用于动画元素 */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* 图片懒加载占位 */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* 平滑滚动 — 仅导航锚点使用，不可继承给消息列表 */
html {
    scroll-behavior: auto;
}

/* 消息区域必须使用即时滚动，防止 scrollTop 赋值触发动画导致跳动 */
.message-area {
    scroll-behavior: auto !important;
}

/* 减少重绘 - 固定定位元素 */
.fixed-element {
    will-change: transform;
    contain: layout style paint;
}

/* 根元素 - 支持安全区域 */
html {
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    /* 移动端优化 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* 防止下拉刷新和橡皮筋效果 */
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
    /* 固定位置防止拖拽 */
    position: fixed;
    width: 100%;
    height: 100%;
    /* 允许原生触摸交互（长按选择复制等） */
    touch-action: auto;
    -webkit-overflow-scrolling: auto;
}

/* 登录页面 */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #2aa992, #34b77c);
    color: white;
    text-align: center;
    padding: 20px;
}

.login-logo {
    font-size: 60px;
    margin-bottom: 20px;
}

.login-title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
}

.login-subtitle {
    font-size: 16px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.wx-login-btn {
    background: white;
    color: #2aa992;
    border: none;
    padding: 16px 32px;
    font-size: 18px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.wx-login-btn:hover {
    transform: translateY(-2px);
}

.quick-login {
    color: white;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

/* ========================================
   主应用容器
   ======================================== */
.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* ========================================
   侧边栏 - 群列表
   ======================================== */
.sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.sidebar-header {
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-search {
    flex-shrink: 0;
    z-index: 10;
    padding: 8px 10px 6px 10px;
    border-bottom: none;
    background: transparent;
    position: relative;
}

.group-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.user-stats-panel {
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-search::after {
    display: none;
}

/* 搜索输入框容器 - 紧凑版 */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: #f5f7f9;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.search-input-wrapper:hover {
    border-color: #d1d5db;
    background: #f0f2f4;
}

.search-input-wrapper:focus-within {
    border-color: #2aa992;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(42, 169, 146, 0.1);
}

.search-icon {
    position: absolute;
    left: 10px;
    font-size: 13px;
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s ease;
}

.search-input-wrapper:focus-within .search-icon {
    color: #2aa992;
}

.sidebar-search input {
    width: 100%;
    padding: 8px 10px 8px 32px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: transparent;
    box-sizing: border-box;
    color: #1f2937;
    font-weight: 400;
}

.sidebar-search input::placeholder {
    color: #9ca3af;
    font-weight: 400;
    font-size: 12px;
}

.sidebar-search input:focus {
    background: transparent;
    box-shadow: none;
}

.sidebar-search input:hover:not(:focus) {
    background: transparent;
}

/* 清除按钮 - 紧凑版 */
.search-clear-btn {
    position: absolute;
    right: 6px;
    width: 20px;
    height: 20px;
    border: none;
    background: #e5e7eb;
    border-radius: 50%;
    color: #6b7280;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    padding: 0;
    line-height: 1;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.search-clear-btn:hover {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.2);
}

.search-clear-btn:active {
    transform: scale(1.05) rotate(90deg);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.15);
}

/* 搜索框有内容时调整右边距 */
.sidebar-search input:not(:placeholder-shown) {
    padding-right: 44px;
}

/* 搜索框有内容时的视觉反馈 - 通过JavaScript动态添加类 */
.search-input-wrapper.has-content {
    border: 2px solid #d1fae5;
    background: linear-gradient(to right, #ffffff, #f0fdf4);
}

/* 侧边栏聊天记录搜索入口按钮 - 与搜索框样式一致 */
.sidebar-search-history {
    padding: 0 10px 8px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.history-search-btn {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f5f7f9;
    cursor: pointer;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.history-search-btn:hover {
    background: #e6fffb;
    border-color: #2aa992;
    color: #2aa992;
}

.history-search-btn:active {
    background: #d1fae5;
    transform: scale(0.98);
}

.sidebar-group {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.15s;
}

.sidebar-group:hover {
    background: #f9f9f9;
}

.sidebar-group-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2aa992, #1a7a65);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(42,169,146,0.25);
}

.sidebar-group-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sidebar-group-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-group-desc {
    font-size: 12px;
    color: #666;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    background: #2aa992;
    color: white;
    position: relative;
}

.sidebar-header h3 {
    color: white;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.3);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    font-size: 15px;
    color: white;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-id {
    font-size: 12px;
    opacity: 0.9;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.test-login-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.test-login-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.test-login-btn:hover {
    background: rgba(255,255,255,0.3);
}

.sidebar-header h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

/* ========================================
   用户数据统计面板
   ======================================== */
.user-stats-panel {
    padding: 12px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.user-stat-card {
    background: white;
    border-radius: 12px;
    padding: 12px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03);
}

.user-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42,169,146,0.15);
    border-color: #2aa992;
}

.user-stat-card:active {
    transform: scale(0.98);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-icon-posts {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon-gold {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* VIP等级卡片 */
.vip-level-card {
    background: linear-gradient(135deg, #2aa992 0%, #1a7a65 100%);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(42,169,146,0.25);
}

.vip-level-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(42,169,146,0.35);
}

.vip-level-card:active {
    transform: scale(0.98);
}

.invite-friends-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255,107,53,0.4);
    background: linear-gradient(135deg, #ff5722, #ff7b3a) !important;
}

.invite-friends-btn:active {
    transform: scale(0.98);
}

.vip-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vip-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.vip-text {
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.vip-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vip-progress-bar {
    width: 60px;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    overflow: hidden;
}

.vip-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffec8b);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.vip-progress-text {
    font-size: 11px;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
}

/* 旧版兼容 - 保留以防其他地方使用 */
.usage-info {
    display: none;
}

.usage-value {
    color: #2aa992;
    font-weight: 600;
}

#groupList {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

#groupList .group-item {
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    margin: 0 8px 4px 8px;
    border-radius: 8px;
    background: transparent;
}

.group-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.group-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.group-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2aa992, #34b77c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.group-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.group-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
    flex-wrap: nowrap;
}

.group-last-msg {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-unread {
    background: #ff6b35;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
    margin-left: 8px;
    flex-shrink: 0;
}

#groupList .group-item:hover {
    background: #f5f5f5;
}

#groupList .group-item.active {
    background: #e8f5f0;
    border-left-color: #2aa992;
}

#groupList .group-item:active {
    background: #e0e0e0;
    transform: scale(0.98);
}

/* 群组图标样式 */
.group-icon-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.group-icon-emoji {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2aa992, #34b77c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

/* 置顶按钮样式 - 文字标签版 */
.group-pin-btn {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border: 1px solid #d1d5db;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    opacity: 0;
    transition: all 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.group-pin-btn:hover {
    opacity: 1;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
    color: #92400e;
    transform: scale(1.05);
}

.group-pin-btn:active {
    transform: scale(0.95);
}

/* 已置顶状态 - 金色标签 */
.group-pin-btn.pinned {
    opacity: 1;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #b45309;
    color: white;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.group-pin-btn.pinned:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #b91c1c;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* 鼠标悬停群组时显示置顶按钮 */
.group-item:hover .group-pin-btn {
    opacity: 0.8;
}

.group-item:hover .group-pin-btn:hover {
    opacity: 1;
}

.group-item:hover .group-pin-btn.pinned,
.group-pin-btn.pinned {
    opacity: 1;
}

/* 置顶群组样式 */
#groupList .group-item.pinned {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, transparent 60%);
    border-left: 3px solid #f59e0b;
    position: relative;
}

#groupList .group-item.pinned::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
}

#groupList .group-item.pinned.active {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, rgba(42, 169, 146, 0.08) 100%);
    border-left-color: #f59e0b;
}

#groupList .group-item.pinned:hover {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 245, 245, 0.5) 100%);
}

.pin-icon {
    font-size: 12px;
    margin-right: 5px;
}

/* 下拉菜单置顶样式 */
/* 现代化群组下拉项 */
.dropdown-item-modern {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    margin: 3px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 10px;
    position: relative;
}
.dropdown-item-modern:hover {
    background: rgba(42, 169, 146, 0.06);
}
.dropdown-item-modern:active {
    background: rgba(42, 169, 146, 0.12);
    transform: scale(0.98);
    transition: transform 0.08s ease-out;
}
.dropdown-item-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f0f4f8, #e8ecf0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    transition: all 0.2s;
}
.dropdown-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dropdown-item-name {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-item-badge {
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
}
.dropdown-item-badge.pinned-badge {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    color: #f57f17;
}
.dropdown-item-check {
    color: #2aa992;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.dropdown-item-active {
    background: linear-gradient(135deg, rgba(42,169,146,0.08), rgba(52,183,124,0.06));
}
.dropdown-item-active .dropdown-item-icon-wrap {
    background: linear-gradient(135deg, #2aa992, #34b77c);
    color: white;
    box-shadow: 0 2px 8px rgba(42,169,146,0.25);
}
.dropdown-item-active .dropdown-item-name {
    color: #2aa992;
    font-weight: 600;
}
.dropdown-item-pinned {
    position: relative;
}
.dropdown-item-pinned::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: linear-gradient(to bottom, #f59e0b, #d97706);
    border-radius: 0 3px 3px 0;
}
.dropdown-item-main .dropdown-item-icon-wrap {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
}

.dropdown-item.pinned {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
    position: relative;
}

.dropdown-item.pinned::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
}

.dropdown-item.pinned:hover {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.18) 0%, rgba(42, 169, 146, 0.08) 100%);
}

.dropdown-pin-icon {
    font-size: 10px;
    margin-left: auto;
    opacity: 0.7;
}

.dropdown-group-icon {
    margin-right: 6px;
}

.dropdown-group-name {
    flex: 1;
}

.group-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pin-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}

.pin-btn:hover {
    background: #f0f0f0;
    opacity: 1;
}

.pin-btn.pinned {
    color: #f59e0b;
}

.group-active-indicator {
    color: #2aa992;
    font-size: 12px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.empty-groups {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

.empty-search-result {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* 搜索高亮 */
.search-highlight {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* ========================================
   移动端搜索框优化 - 紧凑版
   ======================================== */
@media (max-width: 768px) {
    .sidebar-search {
        padding: 10px 12px 8px 12px;
        background: #ffffff;
        border-bottom: none;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .sidebar-search::after {
        display: none;
    }
    
    /* 搜索输入框容器 - 移动端紧凑版 */
    .search-input-wrapper {
        background: #f5f7f9;
        border-radius: 10px;
        box-shadow: none;
        border: 1px solid #e5e7eb;
        transition: all 0.2s ease;
        min-height: 40px;
    }
    
    .search-input-wrapper:active {
        background: #ffffff;
        border-color: #2aa992;
    }
    
    .search-input-wrapper:focus-within {
        background: #ffffff;
        border-color: #2aa992;
        box-shadow: 0 0 0 2px rgba(42, 169, 146, 0.1);
        transform: none;
    }
    
    .search-input-wrapper.has-content {
        background: #ffffff;
        border-color: #10b981;
    }
    
    /* 搜索图标 - 移动端 */
    .search-icon {
        left: 12px;
        font-size: 14px;
        color: #6b7280;
        transition: color 0.2s ease;
    }
    
    .search-input-wrapper:focus-within .search-icon {
        color: #2aa992;
        transform: none;
    }
    
    /* 搜索输入框 - 移动端紧凑版 */
    .sidebar-search input {
        padding: 10px 12px 10px 36px;
        font-size: 14px !important;
        border-radius: 10px;
        border: none;
        background: transparent;
        color: #1f2937;
        font-weight: 400;
        -webkit-appearance: none;
        appearance: none;
        min-height: 40px;
        line-height: 1.4;
    }
    
    .sidebar-search input::placeholder {
        color: #9ca3af;
        font-size: 13px;
        font-weight: 400;
    }
    
    .sidebar-search input:focus {
        border: none;
        background: transparent;
        box-shadow: none;
        outline: none;
    }
    
    .sidebar-search input:not(:placeholder-shown) {
        padding-right: 52px;
    }
    
    /* 清除按钮 - 移动端优化（增大触摸目标） */
    .search-clear-btn {
        right: 10px;
        width: 32px !important; /* 增大触摸目标 */
        height: 32px !important;
        min-width: 32px;
        min-height: 32px;
        font-size: 16px;
        background: #e5e7eb;
        color: #6b7280;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        -webkit-tap-highlight-color: rgba(220, 38, 38, 0.2);
        touch-action: manipulation;
    }
    
    .search-clear-btn:active {
        background: #fee2e2;
        color: #dc2626;
        transform: scale(0.95);
        box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
    }
    
    /* 移动端禁用hover效果，改用active */
    .search-clear-btn:hover {
        background: #e5e7eb;
        color: #6b7280;
        transform: none;
    }
    
    /* 移动端搜索历史按钮优化 - 紧凑版 */
    .sidebar-search-history {
        padding: 0 12px 10px 12px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .history-search-btn {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 10px;
        min-height: 40px;
        -webkit-tap-highlight-color: rgba(42, 169, 146, 0.2);
        touch-action: manipulation;
    }
    
    .history-search-btn:active {
        background: #e6fffb;
        border-color: #2aa992;
        color: #2aa992;
        transform: scale(0.98);
    }
    
    /* 移动端群组图标样式 */
    .group-icon-img {
        width: 36px;
        height: 36px;
    }
    
    .group-icon-emoji {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    /* 移动端置顶按钮 */
    .group-pin-btn {
        font-size: 10px;
        padding: 4px 10px;
        opacity: 0.6;
    }
    
    .group-pin-btn.pinned {
        opacity: 1;
    }
    
    .group-pin-btn:hover {
        transform: none;
    }
    
    .group-pin-btn.pinned:hover {
        transform: none;
    }
}

/* 超小屏幕优化（iPhone SE等） */
@media (max-width: 375px) {
    .sidebar-search {
        padding: 14px 12px 10px 12px;
    }
    
    .search-input-wrapper {
        border-radius: 14px;
        min-height: 46px;
    }
    
    .sidebar-search input {
        padding: 12px 14px 12px 44px;
        font-size: 16px !important;
        border-radius: 14px;
        min-height: 46px;
    }
    
    .search-icon {
        left: 14px;
        font-size: 17px;
    }
    
    .search-clear-btn {
        right: 8px;
        width: 30px !important;
        height: 30px !important;
        min-width: 30px;
        min-height: 30px;
        font-size: 15px;
    }
    
    .sidebar-search input:not(:placeholder-shown) {
        padding-right: 48px;
    }
}

/* 移动端触摸设备专用优化 */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    /* 移除所有hover效果，改用active */
    .search-input-wrapper:hover {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        transform: none;
    }
    
    .sidebar-search input:hover:not(:focus) {
        border: none;
        background: transparent;
    }
    
    /* 优化触摸反馈 */
    .search-clear-btn {
        -webkit-tap-highlight-color: rgba(220, 38, 38, 0.3);
        user-select: none;
        -webkit-user-select: none;
    }
    
    .search-input-wrapper {
        -webkit-tap-highlight-color: rgba(42, 169, 146, 0.1);
    }
    
    /* 防止长按选择文本 */
    .sidebar-search input {
        -webkit-user-select: text;
        user-select: text;
        -webkit-touch-callout: default;
    }
}

/* 移动端键盘弹出时的优化 */
@media (max-width: 768px) {
    /* 当输入框获得焦点时，确保搜索框在视口内 */
    .sidebar-search.input-focused {
        padding-bottom: 8px;
    }
    
    /* 优化搜索框在键盘弹出时的表现 */
    .sidebar-search input:focus {
        /* 确保输入框不会被键盘遮挡 */
        scroll-margin-top: 80px;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar-search {
        padding: 12px 14px 8px 14px;
    }
    
    .search-input-wrapper {
        min-height: 44px;
    }
    
    .sidebar-search input {
        padding: 10px 14px 10px 44px;
        min-height: 44px;
    }
}

/* 移动端用户数据面板适配 */
@media (max-width: 768px) {
    .user-stats-panel {
        padding: 10px;
    }
    
    .user-stats-grid {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .user-stat-card {
        padding: 10px 8px;
        gap: 8px;
    }
    
    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        border-radius: 8px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .vip-level-card {
        padding: 10px 12px;
    }
    
    .vip-icon {
        font-size: 18px;
    }
    
    .vip-text {
        font-size: 14px;
    }
    
    .vip-progress-bar {
        width: 50px;
        height: 5px;
    }
    
    .vip-progress-text {
        font-size: 10px;
    }
}

/* ========================================
   主内容区
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

/* ========================================
   顶部导航
   ======================================== */
.top-nav {
    background: white;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
    overflow: visible;
}

.nav-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-action {
    color: #3c3c43;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    font-weight: 500;
    letter-spacing: 0.1px;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
}

.nav-action .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-action:hover {
    color: #2aa992;
    background: rgba(42, 169, 146, 0.06);
}

.nav-action:hover .nav-icon {
    transform: scale(1.08);
}

.nav-action:active {
    transform: scale(0.95);
    background: rgba(42, 169, 146, 0.1);
    transition: transform 0.1s ease-out;
}

/* 下拉菜单通用样式 */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                0 2px 8px rgba(0, 0, 0, 0.04),
                0 0 0 0.5px rgba(0, 0, 0, 0.03);
    min-width: 160px;
    display: none;
    z-index: 2000;
    padding: 5px;
    animation: dropdownAppear 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: top right;
}

@keyframes dropdownAppear {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 桌面侧边栏开关按钮 */
.sidebar-toggle-btn {
    display: flex !important;
    position: fixed !important;
    top: 15px !important;
    left: 15px !important;
    width: 40px !important;
    height: 40px !important;
    background: #2aa992 !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    font-size: 18px !important;
    cursor: pointer !important;
    z-index: 99999 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    transition: all 0.2s !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.sidebar-toggle-btn:hover {
    background: #1a7a65;
    transform: scale(1.05);
}

/* ========================================
   消息区域
   ======================================== */
.message-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 0;
    background: #ededed;
    position: relative;
    font-size: 15px;
    touch-action: auto;
    -webkit-touch-callout: default;
    -webkit-overflow-scrolling: touch;
    -webkit-user-select: text;
    user-select: text;
}

.message {
    margin-bottom: 16px;
    padding: 0 16px;
}

.message-row-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.message.self .message-row-top {
    flex-direction: row-reverse;
}

.message-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.message-body {
    margin-top: 4px;
}

.message.self .message-bubble {
    margin-left: auto;
    margin-right: 0;
}

.message.self .message-avatar {
    margin-left: 0;
    margin-right: 0;
}

.message.other .message-avatar {
    margin-right: 0;
}

.mobile-chat-header {
    display: none;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    z-index: 10;
    margin: 0;
    padding: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.mobile-header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 16px;
    cursor: pointer;
    user-select: none;
}

.mobile-group-status {
    font-size: 11px;
    color: #999;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.mobile-group-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    color: #333;
}

.mobile-group-status {
    margin: 0;
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
    line-height: 1.4;
}

.desktop-chat-header {
    display: block;
    background: #ffffff;
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: none;
    overflow: hidden;
    flex-shrink: 0;
    border-bottom: 1px solid #f0f0f0;
}

.chat-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    color: #333;
}

.chat-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.chat-info:hover {
    background: rgba(0, 0, 0, 0.03);
}

.chat-info:active {
    background: rgba(0, 0, 0, 0.06);
}

.chat-group-icon {
    font-size: 22px;
    background: rgba(42, 169, 146, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-group-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.chat-member-count {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    color: #999;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f5f5f5;
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.chat-action-btn {
    background: rgba(42, 169, 146, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2aa992;
}

.chat-action-btn:hover {
    background: rgba(42, 169, 146, 0.18);
    transform: translateY(-2px);
}

/* 旧版欢迎通知（兼容） */
.welcome-notice {
    background: #e8f7f3;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    color: #2aa992;
    font-size: 14px;
}

/* 欢迎通知栏 - 位于群名下方，不随消息滚动 */
.welcome-notice-bar {
    position: relative;
    z-index: 9;
    background: linear-gradient(135deg, #e8faf5 0%, #d0f5ec 50%, #e8faf5 100%);
    background-size: 200% 100%;
    padding: 7px 18px;
    text-align: center;
    color: #2aa992;
    font-size: 12.5px;
    font-weight: 500;
    border-bottom: 1px solid rgba(42, 169, 146, 0.12);
    box-shadow: 0 1px 6px rgba(42, 169, 146, 0.06);
    line-height: 1.5;
    user-select: none;
    overflow: hidden;
    flex-shrink: 0;
}

/* 通知栏微光动效 */
.welcome-notice-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: noticeShimmer 4s ease infinite;
}

@keyframes noticeShimmer {
    0% { left: -100%; }
    50%, 100% { left: 200%; }
}

/* 移动端：欢迎通知栏微调 */
@media (max-width: 768px) {
    .welcome-notice-bar {
        padding: 6px 14px;
        font-size: 12px;
    }
}

.message-item {
    display: flex;
    margin-bottom: 8px;
    align-items: flex-start;
}

/* 只对增量追加的单条新消息启用入场动画，批量渲染不加动画 */
.message-item.msg-animate-in {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    margin-right: 0;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #2aa992, #34b77c);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    user-select: none;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* 自己的消息头像使用不同底色 */
.message.self .message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 6px;
}

.message.self .message-info {
    text-align: right;
}

.message.self .message-header {
    text-align: right;
    justify-content: flex-end;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.message-sender {
    font-weight: 500;
    color: #999;
    font-size: 12px;
}

.message-name {
    font-weight: 500;
    color: #999;
    font-size: 12px;
}

.message-time {
    font-size: 11px;
    color: #bbb;
}

/* 微信风格消息操作菜单 */
.message-context-menu {
    position: fixed;
    z-index: 10000;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    min-width: 120px;
    overflow: hidden;
    animation: menuPopIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

@keyframes menuPopIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.message-context-menu .menu-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    font-size: 15px;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.message-context-menu .menu-item:last-child {
    border-bottom: none;
}

.message-context-menu .menu-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
}

.message-context-menu .menu-item:active {
    background: #e8eaed;
    transform: scale(0.98);
}

/* @TA 按钮样式 */
.message-context-menu .menu-item.mention {
    color: #1890ff;
}

.message-context-menu .menu-item.mention:hover {
    background: linear-gradient(135deg, #e6f7ff 0%, #bae7ff 100%);
}

.message-context-menu .menu-item.mention .menu-icon {
    color: #1890ff;
    font-weight: 700;
    font-size: 18px;
}

/* 撤回按钮样式 */
.message-context-menu .menu-item.withdraw {
    color: #fa8c16;
}

.message-context-menu .menu-item.withdraw:hover {
    background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
}

/* 禁用状态 */
.message-context-menu .menu-item.disabled {
    color: #bfbfbf;
    cursor: not-allowed;
    opacity: 0.6;
}

.message-context-menu .menu-item.disabled:hover {
    background: transparent;
    transform: none;
}

.message-context-menu .menu-icon {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* 消息长按时的视觉反馈 */
.message {
    transition: transform 0.1s ease, opacity 0.1s ease;
}

.message:active {
    opacity: 0.85;
    transform: scale(0.99);
}

/* 菜单遮罩层（可选，点击关闭） */
.message-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: transparent;
}

/* ========================================
   现代公告样式 - 毛玻璃 + 微渐变 + 精致动效
   ======================================== */

/* 动画关键帧 */
@keyframes annFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes annSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes annItemFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes annShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes annPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes annGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(42, 169, 146, 0.3); }
    50% { box-shadow: 0 0 20px rgba(42, 169, 146, 0.5); }
}

/* 遮罩层 */
.announcement-modal-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 20, 15, 0.5) 100%);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
    animation: annFadeIn 0.25s ease;
}

/* 卡片 */
.announcement-modal-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.12),
        0 8px 32px rgba(42, 169, 146, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: annSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
}

/* 顶部装饰渐变条 */
.announcement-modal-card::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #2aa992, #34b77c, #5ec6b0, #2aa992);
    background-size: 200% 100%;
    animation: annShimmer 3s ease infinite;
}

/* 头部 */
.announcement-modal-header {
    padding: 22px 24px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

/* 头部装饰背景 */
.announcement-modal-header::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(42, 169, 146, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.announcement-header-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.announcement-header-title .icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(135deg, #e8faf5 0%, #d0f5ec 100%);
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(42, 169, 146, 0.15);
    position: relative;
}

/* 图标光晕效果 */
.announcement-header-title .icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(42, 169, 146, 0.2), transparent);
    z-index: -1;
    opacity: 0.6;
}

.announcement-header-title span {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}

.announcement-header-subtitle {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
    font-weight: 400;
}

/* 关闭按钮 */
.announcement-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    flex-shrink: 0;
}

.announcement-modal-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #333;
    transform: rotate(90deg);
}

.announcement-modal-close:active {
    transform: rotate(90deg) scale(0.9);
}

/* 内容区 */
.announcement-modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
}

.announcement-modal-body::-webkit-scrollbar { width: 3px; }
.announcement-modal-body::-webkit-scrollbar-track { background: transparent; }
.announcement-modal-body::-webkit-scrollbar-thumb { background: rgba(42, 169, 146, 0.2); border-radius: 3px; }
.announcement-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(42, 169, 146, 0.4); }

.announcement-list-wrapper {
    padding: 4px 20px 20px;
}

/* 单条公告 */
.announcement-item {
    margin-bottom: 12px;
    padding: 0;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(241, 245, 249, 0.6) 100%);
    border-radius: 16px;
    border: 1px solid rgba(42, 169, 146, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    animation: annItemFadeIn 0.4s ease both;
}

.announcement-item:hover {
    background: linear-gradient(135deg, rgba(232, 250, 245, 0.6) 0%, rgba(240, 253, 249, 0.8) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(42, 169, 146, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
    border-color: rgba(42, 169, 146, 0.15);
}

.announcement-item:last-child { margin-bottom: 0; }

/* 左侧渐变指示条 */
.announcement-item::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 0;
    width: 3px;
    height: calc(100% - 24px);
    background: linear-gradient(180deg, #2aa992, #34b77c);
    border-radius: 0 3px 3px 0;
    transition: height 0.3s ease;
}

.announcement-item:hover::before {
    top: 8px;
    height: calc(100% - 16px);
}

.announcement-item-inner {
    padding: 18px 18px 18px 22px;
}

/* 标签 */
.announcement-item-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: linear-gradient(135deg, #e8faf5 0%, #d0f5ec 100%);
    color: #2aa992;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
    border: none;
    letter-spacing: 0.02em;
}

.announcement-item-tag::before { content: none; }

.announcement-item-tag.urgent {
    background: linear-gradient(135deg, #fef2f2 0%, #fde8e8 100%);
    color: #ef4444;
    animation: annPulse 2s ease infinite;
}

.announcement-item-tag.urgent::before { content: none; }

/* 标题 */
.announcement-item-title {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

/* 内容 */
.announcement-item-content {
    font-size: 15px;
    font-weight: 500;
    color: #334155;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
    letter-spacing: 0.2px;
}

/* 底部 */
.announcement-item-footer {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.announcement-item-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}
.announcement-item-date::before { content: none; }

.announcement-item-views {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #cbd5e1;
    font-size: 11px;
}
.announcement-item-views::before { content: none; }

/* 底部按钮区 */
.announcement-modal-footer {
    padding: 16px 20px 22px;
    text-align: center;
    flex-shrink: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    background: linear-gradient(180deg, transparent 0%, rgba(42, 169, 146, 0.02) 100%);
}

.announcement-confirm-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2aa992 0%, #34b77c 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.announcement-confirm-btn::before { content: none; }
.announcement-confirm-btn:hover::before { left: auto; }

/* 按钮悬停光效 */
.announcement-confirm-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.announcement-confirm-btn:hover::after {
    left: 100%;
}

.announcement-confirm-btn:hover {
    background: linear-gradient(135deg, #239a85 0%, #2daa6e 100%);
    box-shadow: 0 8px 24px rgba(42, 169, 146, 0.3);
    transform: translateY(-1px);
}

.announcement-confirm-btn:active {
    background: linear-gradient(135deg, #1d8a76 0%, #269960 100%);
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 12px rgba(42, 169, 146, 0.2);
}

.announcement-skip-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: transparent;
    color: #94a3b8;
    border: none;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
    border-radius: 8px;
}

.announcement-skip-btn:hover {
    color: #64748b;
    background: rgba(0, 0, 0, 0.03);
}

/* 空状态 */
.announcement-empty {
    text-align: center;
    padding: 50px 24px;
    color: #cbd5e1;
}

.announcement-empty-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.4;
    filter: grayscale(0.3);
}

.announcement-empty-text {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}

.announcement-empty-subtext {
    font-size: 12px;
    color: #cbd5e1;
    margin-top: 6px;
}

/* 移动端 - 底部弹出式 */
@media (max-width: 480px) {
    .announcement-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .announcement-modal-card {
        border-radius: 24px 24px 0 0;
        max-height: 85vh;
        max-width: 100%;
        animation: annSlideUpMobile 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    @keyframes annSlideUpMobile {
        from { opacity: 0; transform: translateY(100%); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* 顶部拖拽指示条 */
    .announcement-modal-card::after {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 2px;
        z-index: 1;
    }

    .announcement-modal-header { padding: 24px 18px 14px; }
    .announcement-header-title .icon { width: 38px; height: 38px; font-size: 18px; border-radius: 12px; }
    .announcement-header-title span { font-size: 16px; }
    .announcement-list-wrapper { padding: 4px 16px 16px; }
    .announcement-item { border-radius: 14px; margin-bottom: 10px; }
    .announcement-item-inner { padding: 16px 16px 16px 20px; }
    .announcement-item-title { font-size: 16px; }
    .announcement-item-content { font-size: 14px; }
    .announcement-item-footer { flex-direction: column; align-items: flex-start; gap: 4px; }
    .announcement-modal-footer {
        padding: 14px 16px 28px;
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }

    .announcement-confirm-btn {
        padding: 16px 24px;
        font-size: 15px;
        border-radius: 14px;
    }
}

/* 平板适配 */
@media (min-width: 481px) and (max-width: 768px) {
    .announcement-modal-card {
        max-width: 440px;
    }

    .announcement-modal-header {
        padding: 26px 24px 18px;
    }
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    .announcement-modal-overlay {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 20, 15, 0.7) 100%);
    }

    .announcement-modal-card {
        background: rgba(30, 41, 59, 0.95);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow:
            0 24px 80px rgba(0, 0, 0, 0.4),
            0 8px 32px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .announcement-modal-header::after {
        background: radial-gradient(circle, rgba(42, 169, 146, 0.1) 0%, transparent 70%);
    }

    .announcement-header-title span {
        color: #f1f5f9;
    }

    .announcement-header-subtitle {
        color: #64748b;
    }

    .announcement-header-title .icon {
        background: linear-gradient(135deg, rgba(42, 169, 146, 0.15) 0%, rgba(52, 183, 124, 0.1) 100%);
    }

    .announcement-modal-close {
        background: rgba(255, 255, 255, 0.06);
        color: #64748b;
    }

    .announcement-modal-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #f1f5f9;
    }

    .announcement-item {
        background: linear-gradient(135deg, rgba(51, 65, 85, 0.5) 0%, rgba(30, 41, 59, 0.8) 100%);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .announcement-item:hover {
        background: linear-gradient(135deg, rgba(51, 65, 85, 0.7) 0%, rgba(42, 169, 146, 0.08) 100%);
        border-color: rgba(42, 169, 146, 0.2);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

    .announcement-item-tag {
        background: linear-gradient(135deg, rgba(42, 169, 146, 0.15) 0%, rgba(42, 169, 146, 0.08) 100%);
    }

    .announcement-item-tag.urgent {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
    }

    .announcement-item-title {
        color: #f1f5f9;
    }

    .announcement-item-content {
        color: #94a3b8;
    }

    .announcement-item-footer {
        border-top-color: rgba(255, 255, 255, 0.05);
        color: #475569;
    }

    .announcement-modal-footer {
        border-top-color: rgba(255, 255, 255, 0.05);
        background: linear-gradient(180deg, transparent 0%, rgba(42, 169, 146, 0.03) 100%);
    }

    .announcement-skip-btn {
        color: #475569;
    }

    .announcement-skip-btn:hover {
        color: #94a3b8;
        background: rgba(255, 255, 255, 0.04);
    }

    .announcement-empty-text { color: #64748b; }
    .announcement-empty-subtext { color: #475569; }
}

/* 响应式自适应优化 */
@media (max-width: 1200px) {
    .sidebar { width: 240px; }
}

@media (max-width: 992px) {
    .sidebar { width: 220px; }
}

@media (max-width: 768px) {
    .sidebar { 
        width: 85% !important; 
        max-width: 320px !important;
    }
    .main-content { margin-left: 0 !important; }
    .top-nav { padding: 8px 12px; }
    .message-bubble { max-width: 85% !important; }
    
    /* 移动端公告适配 */
    .announcement-modal-card {
        max-width: 95%;
        border-radius: 24px;
        margin: 10px;
    }
    .announcement-modal-header { padding: 22px 20px 14px; }
    .announcement-modal-body { padding: 0 20px 20px; }
    .announcement-modal-footer { padding: 14px 20px 22px; }
    .announcement-item-title { font-size: 16px; }
    .announcement-item-content { font-size: 13px; }
    
    /* 移动端消息间距优化 */
    .message { margin-bottom: 10px; }
}

/* 移除所有英文提示，统一使用中文 */
::placeholder {
    color: #bbb !important;
}

/* 统一滚动条样式，高级感 */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 针对移动端隐藏滚动条 */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        display: none;
    }
    body, html {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
}

.message-text {
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    font-size: inherit;
    color: #1a1a1a;
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
    touch-action: auto !important;
}

.message-bubble-row {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 4px;
    flex-wrap: nowrap;
}

.message.self .message-bubble-row {
    justify-content: flex-end;
    flex-direction: row;
}

.message.other .message-bubble-row {
    justify-content: flex-start;
    flex-direction: row;
}

.message-bubble {
    background: white;
    padding: 9px 12px;
    border-radius: 4px;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 80%;
    display: inline-block;
    position: relative;
    overflow: hidden;
    flex-shrink: 1;
    min-width: 0;
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
    touch-action: auto !important;
}

/* 对方消息气泡左侧小三角 */
.message.other .message-bubble::before {
    content: '';
    position: absolute;
    top: 12px;
    left: -6px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid white;
}

/* 消息来源标签行（头像右侧第一行） */
.message-source-line {
    margin-bottom: 1px;
    line-height: 1;
}

.message-tag {
    display: inline-block;
    background: linear-gradient(135deg, #e53935, #d32f2f);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.3px;
}

.message-tag-right {
    margin-left: auto;
    margin-right: 0;
}

/* ====== 消息气泡卡片样式（5种） ====== */

/* 样式2: 渐变卡片 */
.card-style-gradient .message.other .message-bubble {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf5 100%);
    border-radius: 14px 14px 14px 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.card-style-gradient .message.self .message-bubble {
    background: linear-gradient(135deg, #b5f5a0 0%, #7de067 100%);
    border-radius: 14px 14px 3px 14px;
    box-shadow: 0 2px 8px rgba(42,169,146,0.12);
}
.card-style-gradient .message-bubble::before { display: none; }

/* 样式3: 毛玻璃 */
.card-style-glass .message.other .message-bubble {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 16px 16px 16px 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.card-style-glass .message.self .message-bubble {
    background: rgba(149,236,105,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(149,236,105,0.35);
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 4px 16px rgba(42,169,146,0.08);
}
.card-style-glass .message-bubble::before { display: none; }

/* 样式4: 线框简约 */
.card-style-outlined .message.other .message-bubble {
    background: transparent;
    border: 1.5px solid #d9d9d9;
    border-radius: 14px 14px 14px 3px;
    box-shadow: none;
}
.card-style-outlined .message.self .message-bubble {
    background: transparent;
    border: 1.5px solid #52c41a;
    border-radius: 14px 14px 3px 14px;
    box-shadow: none;
}
.card-style-outlined .message-bubble::before { display: none; }

/* 样式5: 阴影立体 */
.card-style-shadow .message.other .message-bubble {
    background: #fff;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
}
.card-style-shadow .message.self .message-bubble {
    background: #95ec69;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 20px rgba(82,196,26,0.18), 0 1px 4px rgba(82,196,26,0.08);
}
.card-style-shadow .message-bubble::before { display: none; }

/* 样式6: 整体包裹卡片 */
.msg-card-wrap {
    background: #fff;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    position: relative;
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
}
.message.self .msg-card-wrap {
    background: linear-gradient(135deg, #c6f7a8 0%, #95ec69 100%);
}
.msg-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 7px;
    margin-bottom: 7px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.message.self .msg-card-head {
    flex-direction: row-reverse;
}
.msg-card-wrap .message-avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px;
    font-size: 13px !important;
    border-radius: 4px !important;
}
.msg-card-wrap .message-avatar img {
    border-radius: 4px !important;
}
.msg-card-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.message.self .msg-card-meta {
    align-items: flex-end;
}
.msg-card-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.message.self .msg-card-name-row {
    flex-direction: row-reverse;
}
.msg-card-wrap .message-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}
.message.self .msg-card-wrap .message-name {
    color: #1a5e00;
}
.msg-card-wrap .message-time {
    font-size: 10px;
    color: #aaa;
}
.message.self .msg-card-wrap .message-time {
    color: rgba(0,80,0,0.45);
}
.msg-card-text {
    line-height: 1.7;
    font-size: 15px;
    color: #1a1a1a;
    word-break: break-word;
    overflow-wrap: break-word;
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
    touch-action: auto !important;
}
.message.self .msg-card-text {
    color: #0d3800;
    text-align: left;
}
.msg-card-text .message-image-container {
    margin-top: 6px;
}

/* VIP标识徽章 */
.vip-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #1a1a2e;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 6px;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
    animation: vipShine 2s ease-in-out infinite;
}

@keyframes vipShine {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.6);
    }
}

/* VIP消息气泡样式 - 与普通用户微妙区分（所有模式生效） */
.message-vip .message-bubble {
    border-left: 2px solid #ffd700 !important;
    background: linear-gradient(135deg, #fffef5 0%, #fff 40%) !important;
}
.message-vip.self .message-bubble {
    border-left: none !important;
    border-right: 2px solid #ffd700 !important;
    background: linear-gradient(135deg, #95ec69 0%, #e8ffd5 100%) !important;
}
.message-vip .msg-card-wrap {
    border-top: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.1), 0 2px 12px rgba(0,0,0,0.06);
}
.message-vip.self .msg-card-wrap {
    border-top: 2px solid rgba(255, 215, 0, 0.4);
}
.message-vip .msg-card-text {
    border-left: 2px solid rgba(255, 215, 0, 0.3);
    padding-left: 8px;
}
.message-vip.self .msg-card-text {
    border-left: none;
    border-right: 2px solid rgba(255, 215, 0, 0.3);
    padding-right: 8px;
    padding-left: 0;
}
.message-vip .message-name {
    color: #b8860b;
}
/* VIP在各种卡片样式下也有金色边 */
.card-style-gradient .message-vip .message-bubble,
.card-style-glass .message-vip .message-bubble,
.card-style-outlined .message-vip .message-bubble,
.card-style-shadow .message-vip .message-bubble {
    border-left: 2px solid #ffd700 !important;
}
.card-style-gradient .message-vip.self .message-bubble,
.card-style-glass .message-vip.self .message-bubble,
.card-style-outlined .message-vip.self .message-bubble,
.card-style-shadow .message-vip.self .message-bubble {
    border-left: none !important;
    border-right: 2px solid #ffd700 !important;
}

/* 管理员标识徽章 */
.admin-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 6px;
    box-shadow: 0 2px 4px rgba(238, 90, 90, 0.3);
    animation: adminGlow 2s ease-in-out infinite;
}

@keyframes adminGlow {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(238, 90, 90, 0.3);
    }
    50% {
        box-shadow: 0 2px 10px rgba(238, 90, 90, 0.6);
    }
}

.message.self .message-bubble {
    background: #95ec69;
    border-radius: 4px;
    text-align: left;
}

/* 自己消息气泡右侧小三角 */
.message.self .message-bubble::before {
    content: '';
    position: absolute;
    top: 12px;
    right: -6px;
    left: auto;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #95ec69;
    border-right: none;
}

.message.other .message-bubble {
    background: white;
    border-radius: 4px;
}

/* ========================================
   输入区域
   ======================================== */
.input-area {
    padding: 15px 20px;
    padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #eee;
    background: white;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    position: sticky;
    bottom: 0;
    z-index: 100;
    /* 防止键盘弹出时被遮挡 */
    flex-shrink: 0;
}

.message-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 22px;
    font-size: 16px; /* 防止iOS缩放 */
    outline: none;
    transition: all 0.2s;
    background: #f8f9fa;
    min-height: 44px; /* 触摸友好 */
    max-height: 120px; /* 最多约5行 */
    /* 禁用iOS默认样式 */
    -webkit-appearance: none;
    appearance: none;
    resize: none;
    overflow-y: auto;
    touch-action: manipulation;
    -webkit-user-select: text;
    user-select: text;
    cursor: text;
    line-height: 1.4;
    font-family: inherit;
    box-sizing: border-box;
}

.message-input:focus {
    border-color: #2aa992;
    background: white;
    box-shadow: 0 0 0 3px rgba(42, 169, 146, 0.1);
}

.message-input::placeholder {
    color: #999;
}

.search-msg-btn {
    background: #f0f2f5;
    color: #555;
    border: none;
    padding: 10px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 18px;
    margin-right: 4px;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-msg-btn:hover {
    background: #e4f5f0;
    color: #2aa992;
}

.private-msg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #40a9ff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    margin-right: 8px;
    transition: background 0.2s;
    position: relative;
    flex-shrink: 0;
}

.private-msg-btn:hover {
    background: #1890ff;
}

.private-msg-btn.has-notification {
    background: #ff4d4f;
    animation: pulse 2s infinite;
}

.private-msg-btn.has-notification:hover {
    background: #ff7875;
}

.private-msg-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d4f;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
    min-width: 16px;
    text-align: center;
    z-index: 100;
}

/* 私信菜单项中的通知徽章 */
.private-msg-notification-menu {
    background: #ff4d4f;
    color: white;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: bold;
    margin-left: auto;
}

/* 图片上传按钮 - 微信风格 */
.image-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #576b95;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.image-upload-btn:hover {
    background: rgba(87, 107, 149, 0.08);
}

.image-upload-btn:active {
    background: rgba(87, 107, 149, 0.15);
    transform: scale(0.95);
}

.image-upload-btn svg {
    transition: transform 0.2s ease;
}

.image-upload-btn:hover svg {
    transform: scale(1.1);
}

.image-upload-btn.has-image {
    background: rgba(7, 193, 96, 0.1);
    color: #07c160;
}

.image-upload-btn.has-image::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #07c160;
    border-radius: 50%;
    border: 2px solid white;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 2px 12px rgba(245, 87, 108, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(245, 87, 108, 0.6);
        transform: scale(1.05);
    }
}

/* 消息中的图片缩略图 */
.message-image-container {
    display: inline-block;
    flex-shrink: 0;
}

.message-image-thumbnail {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    cursor: pointer;
    object-fit: cover;
    display: block;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(42, 169, 146, 0.25);
    background: #f0f0f0;
}

.message-image-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.message-image-container.image-only .message-image-thumbnail {
    width: 100px;
    height: 100px;
}

.message-image-thumbnail:active {
    transform: scale(0.98);
}

/* 图片预览条（输入框上方） */
.image-preview-bar {
    display: none;
    padding: 8px 12px;
    background: #f0f2f5;
    border-top: 1px solid #e8e8e8;
    align-items: center;
    gap: 8px;
}

.image-preview-bar.active {
    display: flex;
}

.image-preview-bar img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.image-preview-bar .remove-btn {
    background: #ff4d4f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    flex-shrink: 0;
}

.image-preview-bar .remove-btn:hover {
    background: #ff7875;
}

/* 消息中的图片缩略图 */
.message-image-thumb {
    max-width: 120px;
    max-height: 120px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 4px;
    display: block;
    object-fit: cover;
    transition: opacity 0.2s;
}

.message-image-thumb:hover {
    opacity: 0.85;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 0;
}

.message-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    min-height: 80px;
}

.message-input:focus {
    outline: none;
    border-color: #2aa992;
}

/* 输入操作按钮 */
.input-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-upload-btn {
    width: 45px;
    height: 45px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.image-upload-btn:hover {
    background: #e9ecef;
    border-color: #2aa992;
    transform: scale(1.05);
}

/* 图片预览区域 */
.image-preview {
    display: none;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.preview-item {
    position: relative;
    display: inline-block;
    max-width: 200px;
}

#previewImg {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.remove-preview-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remove-preview-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.send-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #2aa992, #34b77c);
    color: white;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    align-self: center;
    min-height: 44px; /* 触摸友好 */
    min-width: 70px;
    box-shadow: 0 2px 8px rgba(42, 169, 146, 0.3);
    /* 防止双击缩放 */
    touch-action: manipulation;
}

.send-btn:hover {
    background: linear-gradient(135deg, #239480, #2aa96a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 169, 146, 0.4);
}

.send-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(42, 169, 146, 0.3);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* ========================================
   消息中的图片
   ======================================== */
.message-image-wrapper {
    margin-top: 4px;
    display: inline-block;
}

.message-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    object-fit: contain;
    background: #f5f5f5;
}

.message-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ========================================
   图片放大查看器
   ======================================== */
.image-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.image-viewer.active {
    display: flex;
}

.image-viewer img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: opacity 0.2s;
}

.image-viewer-close:hover {
    opacity: 0.7;
}

.image-viewer-info {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0,0,0,0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

/* ========================================
   全局加载动画
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2aa992;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   骨架屏加载效果
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 群组列表骨架屏 */
.skeleton-group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    margin: 0 8px 4px 8px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-title {
    height: 16px;
    width: 60%;
}

.skeleton-subtitle {
    height: 12px;
    width: 40%;
}

/* 消息骨架屏 */
.skeleton-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    padding: 0 20px;
}

.skeleton-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-message-header {
    height: 14px;
    width: 120px;
}

.skeleton-message-bubble {
    height: 40px;
    width: 70%;
    border-radius: 8px;
}

/* 用户信息骨架屏 */
.skeleton-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
}

.skeleton-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-user-name {
    height: 16px;
    width: 80px;
}

.skeleton-user-id {
    height: 12px;
    width: 120px;
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 轻微#11: 下拉刷新CSS动画 */
.pull-refresh-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(42, 169, 146, 0.1) 0%, transparent 100%);
    transition: height 0.2s ease;
    z-index: 100;
}

.pull-refresh-indicator.active {
    height: 50px;
}

.pull-refresh-indicator .refresh-icon {
    width: 24px;
    height: 24px;
    border: 2px solid #2aa992;
    border-top-color: transparent;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.pull-refresh-indicator.pulling .refresh-icon {
    transform: rotate(180deg);
}

.pull-refresh-indicator.refreshing .refresh-icon {
    animation: spin 0.8s linear infinite;
}

.pull-refresh-indicator .refresh-text {
    margin-left: 8px;
    font-size: 12px;
    color: #2aa992;
}

/* 骨架屏脉冲动画 */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 私信未读徽章 */
.pm-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    background: #ff4d4f;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: badge-bounce 0.3s ease;
}

@keyframes badge-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.pm-conversation-unread {
    background: rgba(42, 169, 146, 0.1);
    border-left: 3px solid #2aa992;
}

.pm-conversation-unread-count {
    background: #ff4d4f;
    color: white;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* 消息搜索面板 */
.message-search-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.message-search-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.message-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.message-search-input:focus {
    border-color: #2aa992;
}

.message-search-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.search-result-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 8px;
    background: #f8f9fa;
}

.search-result-item:hover {
    background: #e8f5f0;
}

.search-result-sender {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.search-result-content {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.search-result-content mark {
    background: #fff3cd;
    color: #856404;
    padding: 1px 3px;
    border-radius: 3px;
}

.search-result-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.search-no-results {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* 图片预览增强 */
.image-viewer-toolbar {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 30px;
}

.viewer-toolbar-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 消息撤回样式 */
.message-recalled {
    opacity: 0.6;
    font-style: italic;
}

.message-recalled .message-bubble {
    background: #f5f5f5 !important;
    color: #999 !important;
}

.message-context-menu {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 6px 0;
    z-index: 10000;
    min-width: 120px;
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: #f5f5f5;
}

.context-menu-item.danger {
    color: #ef4444;
}

.context-menu-item.danger:hover {
    background: #fef2f2;
}

/* 页面加载进度条 */
.page-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #2aa992, #34b77c);
    z-index: 99999;
    transition: width 0.3s ease;
}

/* 消息加载更多提示 */
.load-more-messages {
    text-align: center;
    padding: 15px;
    color: #2aa992;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.load-more-messages:hover {
    background: #e8f5f0;
    border-radius: 8px;
}

.load-more-messages.loading {
    color: #999;
    cursor: default;
}

.load-more-messages.loading::after {
    content: '...';
    animation: dots 1s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 网络状态提示 */
.network-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 15px;
    text-align: center;
    font-size: 13px;
    z-index: 99998;
    transition: transform 0.3s;
}

.network-status-bar.offline {
    background: #ef4444;
    color: white;
}

.network-status-bar.reconnecting {
    background: #f59e0b;
    color: white;
}

.network-status-bar.hidden {
    transform: translateY(-100%);
}

/* 快速滚动到底部按钮 */
.scroll-to-bottom {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid #eee;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
    transition: all 0.2s;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
}

.scroll-to-bottom.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-bottom:hover {
    background: #2aa992;
    color: white;
    border-color: #2aa992;
}

.scroll-to-bottom .unread-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b35;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ========================================
   移动端适配
   ======================================== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        z-index: 2000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .sidebar.active,
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .sidebar-header h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .user-name {
        font-size: 14px;
    }
    
    .user-id {
        font-size: 11px;
    }
    
    /* 移动端搜索样式已在上面单独定义，此处不再重复 */
    
    #groupList {
        padding: 4px 0;
    }
    
    #groupList .group-item {
        padding: 10px 12px;
        margin: 0 6px 3px 6px;
    }
    
    .group-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .group-name {
        font-size: 14px;
    }
    
    .group-last-msg {
        font-size: 12px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1500;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .nav-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* 保持侧边栏按钮可见，避免在移动端被强制隐藏 */
    #toggleSidebarBtn {
        display: flex !important;
    }

    .nav-actions-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0 12px;
        position: relative;
        gap: 6px;
    }
    
    .nav-mobile-left {
        flex: 1;
        min-width: 60px;
    }
    
    .nav-mobile-center {
        flex: 0 0 auto;
        display: flex;
        justify-content: center;
    }
    
    .nav-mobile-center .nav-action-mobile {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        padding: 8px 20px;
        border-radius: 22px;
    }
    
    .nav-mobile-center .nav-action-mobile:active {
        transform: scale(0.92);
        filter: brightness(0.92);
    }
    
    .nav-mobile-right {
        flex: 1;
        min-width: 60px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
    }
    
    .nav-mobile-right .nav-action-mobile {
        flex-shrink: 0;
        cursor: pointer;
        padding: 8px 18px;
        border-radius: 22px;
    }
    
    .nav-mobile-right .nav-action-mobile:active {
        transform: scale(0.92);
        filter: brightness(0.92);
    }
    
    .mobile-group-avatar {
        cursor: pointer;
        background: linear-gradient(135deg, #2aa992, #34c6a8);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        box-shadow: 0 2px 8px rgba(42, 169, 146, 0.3);
        transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
                    box-shadow 0.3s ease;
        width: 34px;
        height: 34px;
        flex-shrink: 0;
        color: white;
    }
    
    .mobile-group-avatar:active {
        transform: scale(0.9);
        box-shadow: 0 1px 4px rgba(42, 169, 146, 0.2);
        transition: transform 0.1s ease-out;
    }

    .nav-title {
        display: none;
    }

    .nav-actions {
        display: none;
    }

    .mobile-chat-header {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .desktop-chat-header {
        display: none !important;
    }

    .message-area {
        padding: 10px;
        padding-top: 5px;
    }

    .sidebar-toggle-btn {
        display: flex !important;
        position: fixed !important;
        top: 12px !important;
        left: 12px !important;
        width: 36px !important;
        height: 36px !important;
        background: #2aa992 !important;
        border: none !important;
        border-radius: 8px !important;
        color: white !important;
        font-size: 16px !important;
        cursor: pointer !important;
        z-index: 99999 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
        transition: all 0.2s !important;
        align-items: center !important;
        justify-content: center !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .sidebar-toggle-btn:hover,
    .sidebar-toggle-btn:active {
        background: #1a7a65;
        transform: scale(1.05);
    }

    .mobile-menu-btn {
        display: none !important;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .mobile-overlay.show {
        display: block;
    }

    .nav-action-mobile {
        color: #fff;
        cursor: pointer;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 18px;
        border-radius: 22px;
        background: linear-gradient(135deg, #2aa992 0%, #34c6a8 100%);
        border: none;
        box-shadow: 0 2px 8px rgba(42, 169, 146, 0.3),
                    0 0.5px 2px rgba(0, 0, 0, 0.06);
        white-space: nowrap;
        font-weight: 600;
        letter-spacing: 0.3px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
        position: relative;
        z-index: 10;
        transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
                    box-shadow 0.25s ease,
                    filter 0.2s ease;
    }

    .nav-action-mobile .nav-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .nav-action-mobile .nav-icon svg {
        display: block;
    }

    /* 移动端下拉菜单 — JS 通过 fixed 定位控制位置，CSS 只负责外观 */
    .dropdown-menu-mobile {
        min-width: 170px;
        max-width: 230px;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(40px) saturate(180%);
        -webkit-backdrop-filter: blur(40px) saturate(180%);
        border: 0.5px solid rgba(0, 0, 0, 0.06);
        border-radius: 14px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12),
                    0 2px 8px rgba(0, 0, 0, 0.04);
        z-index: 3000;
        padding: 5px;
        touch-action: pan-y;
        overscroll-behavior: contain;
        overflow-x: hidden;
    }

    .nav-action-mobile:hover {
        filter: brightness(1.05);
        box-shadow: 0 3px 12px rgba(42, 169, 146, 0.4),
                    0 1px 3px rgba(0, 0, 0, 0.08);
    }
    
    .nav-action-mobile:active {
        transform: scale(0.92);
        filter: brightness(0.95);
        box-shadow: 0 1px 4px rgba(42, 169, 146, 0.2);
        transition: transform 0.1s ease-out, filter 0.08s ease-out;
    }

    /* 移动端输入区域 - 重要优化 */
    .input-area {
        padding: 8px 10px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 1px solid #eee;
        z-index: 100;
    }

    .input-wrapper {
        gap: 8px;
    }

    .message-input {
        min-height: 44px;
        font-size: 16px; /* 防止iOS缩放 */
        padding: 10px 12px;
        border-radius: 22px;
    }

    .image-upload-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    #previewImg {
        max-height: 100px;
    }

    .send-btn {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 22px;
    }
    
    .private-msg-btn {
        padding: 8px 12px;
        font-size: 14px;
        margin-right: 5px;
    }

    /* 移动端消息气泡优化 */
    .message {
        margin-bottom: 14px;
        gap: 8px;
        padding: 0 12px;
    }

    .message-avatar {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        border-radius: 6px;
    }

    .message-bubble {
        padding: 9px 12px;
        max-width: 70%;
    }

    .message-header {
        gap: 4px;
        margin-bottom: 2px;
    }

    .message-sender {
        font-size: 12px;
    }

    .message-time {
        font-size: 10px;
    }
    
    .message-tag {
        font-size: 10px;
        padding: 2px 8px;
        margin-left: 5px;
    }

    /* 移动端消息图片 */
    .message-image {
        max-width: 180px;
        max-height: 180px;
    }

    /* 移动端图片查看器 */
    .image-viewer-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }

    .image-viewer-info {
        bottom: 20px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    /* 移动端模态框优化 */
    .modal-overlay {
        padding: 10px;
    }
    
    .modal {
        max-width: 95vw;
        max-height: 90vh;
        overflow-y: auto;
        padding: 15px;
    }
    
    .modal-header {
        margin-bottom: 12px;
    }
    
    .modal-title {
        font-size: 16px;
    }
    
    /* 移动端登录页 */
    .login-page {
        padding: 15px;
    }
    
    .login-logo {
        font-size: 48px;
    }
    
    .login-title {
        font-size: 26px;
    }
    
    .login-subtitle {
        font-size: 14px;
        margin-bottom: 30px;
    }
    
    .wx-login-btn {
        padding: 14px 28px;
        font-size: 16px;
    }

    /* 移动端私信聊天优化 */
    .pm-message-item {
        max-width: 95%;
    }

    .pm-message-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .pm-message-text {
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 14px;
    }

    .pm-message-item.sent .pm-message-text {
        border-radius: 14px 4px 14px 14px;
    }

    .pm-message-item.received .pm-message-text {
        border-radius: 4px 14px 14px 14px;
    }

    /* 移动端用户中心优化 */
    .user-center-modal {
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 移动端表单优化 */
    input[type="text"],
    input[type="number"],
    input[type="tel"],
    input[type="email"],
    textarea,
    select {
        font-size: 16px !important; /* 防止iOS缩放 */
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }

    /* 触摸友好的按钮 */
    button, .btn, [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* 移动端滚动优化 */
    .message-area {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        scroll-behavior: smooth;
    }

    /* 移动端底部安全区适配 */
    .input-area {
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    /* 移动端群成员列表优化 */
    .group-members-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        padding: 10px;
    }

    .group-member-item {
        padding: 8px;
    }

    .group-member-avatar {
        width: 45px;
        height: 45px;
        font-size: 12px;
    }

    .group-member-name {
        font-size: 11px;
        max-width: 60px;
    }

    /* 移动端通知优化 */
    .notification-toast {
        left: 10px;
        right: 10px;
        max-width: none;
        width: auto;
    }

    /* 移动端加载动画 */
    .loading-overlay {
        backdrop-filter: blur(3px);
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
    }

    /* 移动端下拉刷新提示 */
    .pull-to-refresh {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 15px;
        color: #999;
        font-size: 13px;
    }

    .pull-to-refresh-icon {
        margin-right: 8px;
        transition: transform 0.3s;
    }

    .pull-to-refresh.active .pull-to-refresh-icon {
        transform: rotate(180deg);
    }
}

/* 超小屏幕适配 (< 375px) */
@media (max-width: 375px) {
    .nav-action-mobile {
        padding: 7px 14px;
        font-size: 12px;
        gap: 4px;
    }
    
    .nav-action-mobile .nav-icon {
        width: 16px;
        height: 16px;
    }
    
    .nav-action-mobile .nav-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .sidebar-toggle-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        top: 10px;
        left: 10px;
    }
    
    .message-bubble {
        max-width: 85%;
        padding: 8px 10px;
    }
    
    .input-area {
        padding: 6px 8px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    }
    
    .message-input {
        min-height: 40px;
        padding: 8px 10px;
    }
    
    .send-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* 超小屏群成员网格 */
    .group-members-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .group-member-avatar {
        width: 40px;
        height: 40px;
    }
    
    .group-member-name {
        font-size: 10px;
        max-width: 50px;
    }
    
    /* 超小屏用户卡片 */
    .user-stats-panel {
        padding: 8px;
    }
    
    .user-stat-card {
        padding: 8px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 10px;
    }
}

/* ========================================
   横屏模式适配
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        width: 200px;
        max-width: 200px;
    }
    
    .sidebar .group-list {
        max-height: calc(100vh - 80px);
    }
    
    .chat-header {
        padding: 6px 12px;
        min-height: auto;
    }
    
    .message-area {
        max-height: calc(100vh - 100px);
        height: calc(100vh - 100px);
    }
    
    .input-area,
    .message-input-area {
        padding: 4px 10px;
    }
    
    .message-input {
        min-height: 32px;
        max-height: 60px;
        padding: 6px 10px;
    }
    
    .message {
        padding: 4px 8px;
    }
    
    .message-avatar {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }
    
    .message-bubble {
        padding: 6px 10px;
        max-width: 65%;
    }
    
    .modal {
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .login-page {
        flex-direction: row;
        justify-content: space-around;
        padding: 10px 30px;
        overflow-y: auto;
    }
    
    .login-logo {
        font-size: 40px;
        margin-bottom: 0;
    }
    
    .login-title {
        font-size: 22px;
    }
    
    .user-stats-panel {
        padding: 6px 8px;
    }
    
    .nav-actions {
        gap: 4px;
    }
}

/* ========================================
   触摸设备优化
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* 增大点击区域 */
    .dropdown-item {
        padding: 14px 16px;
        margin: 6px 8px;
    }
    
    .nav-action-mobile {
        padding: 9px 20px;
    }
    
    .nav-action-mobile:hover {
        filter: brightness(1.05);
    }
    
    .nav-action-mobile:active {
        transform: scale(0.92);
        filter: brightness(0.92);
        transition: transform 0.1s ease-out, filter 0.08s ease-out;
    }
    
    .dropdown-item:hover {
        background: rgba(120, 120, 128, 0.04);
        transform: none;
    }
    
    .dropdown-item:active {
        background: rgba(42, 169, 146, 0.1);
        transform: scale(0.97);
        transition: transform 0.08s ease-out;
    }
    
    /* 更好的滚动体验 */
    .message-area,
    .group-list,
    .modal {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }
    
    /* 防止长按选择文本 */
    .nav-action-mobile,
    .dropdown-item,
    .send-btn,
    .wx-login-btn {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    
    /* 移除点击高亮（排除消息文本区域，不干扰原生复制菜单） */
    *:not(.message-text):not(.message-bubble):not(.msg-card-text):not(.message-area) {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ========================================
   iOS安全区域适配
   ======================================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .input-area {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
    
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .modal {
        margin-bottom: env(safe-area-inset-bottom);
    }
}

/* ========================================
   高对比度/深色模式准备
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* 预留深色模式样式 - 可后续启用 */
}

/* ========================================
   模态框
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    cursor: pointer;
    font-size: 24px;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    margin-bottom: 15px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ========================================
   通知消息
   ======================================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    left: auto;
    padding: 12px 20px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    animation: slideInRight 0.3s ease;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 320px;
    word-wrap: break-word;
    backdrop-filter: blur(10px);
}

/* 移动端通知 - 居中显示 */
@media (max-width: 768px) {
    .notification {
        top: auto;
        bottom: 100px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        max-width: calc(100vw - 40px);
        text-align: center;
        padding: 14px 24px;
        animation: slideInUp 0.3s ease;
    }
}

.notification.success {
    background: linear-gradient(135deg, #2aa992, #34b77c);
}

.notification.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.notification.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   个人中心和管理面板样式
   ======================================== */
.profile-info {
    padding: 0;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #2aa992, #34b77c);
    border-radius: 12px;
    margin-bottom: 20px;
    color: white;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    object-fit: cover;
    flex-shrink: 0;
}

.profile-basic {
    flex: 1;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
    color: white;
}

.profile-phone {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
    color: white;
}

.profile-role {
    font-size: 12px;
    opacity: 0.8;
    color: white;
}

.profile-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
    padding: 0 20px 20px;
}

.profile-action-btn {
    padding: 12px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    color: #333;
}

.profile-action-btn:hover {
    background: #f5f5f5;
    border-color: #2aa992;
    color: #2aa992;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(42, 169, 146, 0.2);
}

.profile-action-btn span {
    font-size: 16px;
}

.profile-role {
    font-size: 14px;
    color: #2aa992;
    font-weight: 500;
}

.profile-admin-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-menu-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #f8f9fa;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-menu-btn:hover {
    background: #e9ecef;
}

/* 群组管理样式 */
.group-management {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.group-info {
    flex: 1;
}

.group-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.group-meta {
    font-size: 12px;
    color: #666;
}

.group-actions {
    display: flex;
    gap: 8px;
}

.btn-create, .btn-edit, .btn-delete, .btn-disable, .btn-enable {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-create {
    background: #2aa992;
    color: white;
}

.btn-create:hover {
    background: #238a7d;
}

.btn-edit {
    background: #3b82f6;
    color: white;
}

.btn-edit:hover {
    background: #2563eb;
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

.btn-disable {
    background: #f59e0b;
    color: white;
}

.btn-disable:hover {
    background: #d97706;
}

.btn-enable {
    background: #10b981;
    color: white;
}

.btn-enable:hover {
    background: #059669;
}

.empty {
    text-align: center;
    color: #999;
    padding: 30px;
}

/* 公告管理样式 */
.announcement-management {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.create-announcement {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.create-announcement input,
.create-announcement textarea {
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.create-announcement textarea {
    resize: vertical;
    min-height: 80px;
}

.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.announcement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.announcement-info {
    flex: 1;
}

.announcement-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.announcement-meta {
    font-size: 12px;
    color: #666;
}

.announcement-actions {
    display: flex;
    gap: 8px;
}

/* 公告弹窗样式 */
.announcements-modal {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.announcement-content {
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
}

.announcement-content h4 {
    margin-bottom: 10px;
    color: #856404;
}

.announcement-content p {
    margin-bottom: 10px;
    color: #856404;
    line-height: 1.6;
}

/* ========================================
   群组下拉菜单
   ======================================== */
.group-dropdown-menu,
.dropdown-menu {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    min-width: 200px;
    max-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10000;
    padding: 6px 0;
    border: 1px solid rgba(0,0,0,0.05);
    /* 限制只能上下滑动，禁止左右拖拽 */
    touch-action: pan-y;
    overscroll-behavior: contain;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
}

.dropdown-item {
    padding: 10px 14px;
    margin: 1px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.15s ease;
    border-radius: 10px;
    font-size: 14px;
    color: #1d1d1f;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    font-size: 14px;
    color: #333;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(42, 169, 146, 0.08);
}

.dropdown-item:active {
    background: rgba(42, 169, 146, 0.14);
    transform: scale(0.98);
    transition: transform 0.08s ease-out;
}

.dropdown-item span:first-child {
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.dropdown-item.active {
    background: #2aa992;
    color: white;
    font-weight: 500;
}

.dropdown-item.active:hover {
    background: #239e88;
}

.dropdown-item.empty {
    color: #999;
    text-align: center;
    cursor: default;
    background: transparent;
    border: none;
}

.dropdown-item.empty:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

.group-icon-small {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.group-name-small {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-indicator {
    color: #2aa992;
    font-size: 12px;
}

.announcement-date {
    color: #856404;
    font-size: 12px;
}

.btn-close-announcement {
    padding: 10px 20px;
    background: #2aa992;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    align-self: flex-end;
}

.btn-close-announcement:hover {
    background: #238a7d;
}

/* ========================================
   系统消息（加入群聊提示）
   ======================================== */
.system-message {
    text-align: center;
    margin: 8px 0;
    padding: 5px 0;
}

.system-message span {
    background: rgba(0, 0, 0, 0.06);
    color: #999;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
}

/* 管理员操作通知（撤回等）- 保留醒目样式 */
.system-message.admin-notice {
    text-align: left;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 4px solid #f59e0b;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    color: #92400e;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

.system-message.admin-notice span {
    background: transparent;
    color: inherit;
    padding: 0;
    display: inline;
}

/* 禁言通知样式 */
.system-message.mute-notice {
    text-align: left;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    border-left: 4px solid #ef4444 !important;
    border-radius: 12px !important;
    padding: 16px 18px !important;
    margin: 12px 16px !important;
    color: #991b1b !important;
    font-size: 14px;
    animation: muteNoticeSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

.system-message.mute-notice span {
    background: transparent;
    color: inherit;
    padding: 0;
    display: inline;
}

@keyframes muteNoticeSlide {
    from { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* ========================================
   马甲选择器样式
   ======================================== */
.vest-select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vest-select:hover {
    border-color: #2aa992;
}

.vest-select:focus {
    outline: none;
    border-color: #2aa992;
    box-shadow: 0 0 0 3px rgba(42, 169, 146, 0.1);
}

.vest-select option {
    padding: 10px;
}

/* ========================================
   交易记录样式
   ======================================== */
.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin-bottom: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.transaction-item:hover {
    background: #f9f9f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.transaction-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.transaction-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.transaction-item:hover .transaction-icon {
    transform: scale(1.1);
}

.transaction-item.income .transaction-icon {
    background: #e6f7ff;
    color: #1890ff;
}

.transaction-item.expense .transaction-icon {
    background: #fff1f0;
    color: #ff4d4f;
}

.transaction-info {
    flex: 1;
    min-width: 0;
    margin-left: 12px;
}

.transaction-desc {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-time {
    font-size: 12px;
    color: #999;
}

.transaction-amount {
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.transaction-item:hover .transaction-amount {
    transform: scale(1.05);
}

.transaction-amount.income {
    color: #52c41a;
}

.transaction-amount.expense {
    color: #ff4d4f;
}

/* 交易记录筛选按钮 */
.trans-filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    color: #333;
}

.trans-filter-btn:hover {
    background: #f0f0f0;
    border-color: #2aa992;
}

.trans-filter-btn.active {
    background: #2aa992;
    color: white;
    border-color: #2aa992;
    box-shadow: 0 2px 6px rgba(42, 169, 146, 0.3);
}

/* ========================================
   我的消息样式
   ======================================== */
.my-message-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.my-message-item:hover {
    background: #f9f9f9;
}

.my-message-item:last-child {
    border-bottom: none;
}

.message-group-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.group-name-badge {
    background: #2aa992;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.message-type-badge {
    background: #f0f0f0;
    color: #666;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.message-content-preview {
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #999;
}

.vest-badge {
    background: #fff7e6;
    color: #d46b08;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

/* 提取自 index.html 的内联样式，保持原有视觉与功能不变 */
.quick-login-invite {
    margin-top: 10px;
    color: #1890ff;
    background: #e6f7ff;
    border: 1px solid #d6b4fe;
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-placeholder {
    width: 60px;
}

.nav-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-action-mobile {
    flex-shrink: 0;
}

/* "我的"按钮闪烁动画 - 私信未读提醒 */
@keyframes myButtonBlink {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(42, 169, 146, 0.3);
    }
    50% {
        box-shadow: 0 2px 12px rgba(255, 59, 48, 0.5),
                    0 0 0 3px rgba(255, 59, 48, 0.15);
    }
}

.nav-action-mobile.blink-notification {
    animation: myButtonBlink 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    border-radius: 22px;
}

.nav-action-mobile.blink-notification span,
.nav-action-mobile.blink-notification .nav-icon {
    color: inherit;
}

.mobile-more-groups {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.hidden-by-default {
    display: none;
}

.welcome-notice-margin {
    margin-top: 15px;
}

.private-msg-notification-hidden {
    display: none;
}

.mobile-group-avatar {
    cursor: pointer;
    background: linear-gradient(135deg, #2aa992, #34c6a8);
    border-radius: 12px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 2px 8px rgba(42, 169, 146, 0.3);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.3s ease;
    width: 34px;
    height: 34px;
    position: relative;
    flex-shrink: 0;
    color: white;
}

.mobile-group-avatar .avatar-icon {
    color: white;
    font-size: 17px;
    font-weight: bold;
}

.mobile-group-avatar .avatar-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4d4f;
    color: white;
    border-radius: 10px;
    padding: 2px 5px;
    font-size: 9px;
    font-weight: bold;
    border: 2px solid white;
    min-width: 14px;
    text-align: center;
}

/* =====================================================
   加载更多历史消息按钮
   ===================================================== */
.load-more-messages {
    text-align: center;
    padding: 12px;
    cursor: pointer;
    color: #2aa992;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    user-select: none;
    transition: background-color 0.2s;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 5;
}

.load-more-messages:hover {
    background: #f0faf8;
}

.load-more-messages:active {
    background: #e0f5f0;
}

/* =====================================================
   超小屏幕适配 (320px - iPhone SE 1代等)
   ===================================================== */
@media (max-width: 320px) {
    .chat-header h2 {
        font-size: 14px;
    }
    
    .message-input-area {
        padding: 6px 8px;
    }
    
    .message-input-area input,
    .message-input-area textarea {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .send-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .sidebar {
        width: 260px;
    }
    
    .login-container {
        padding: 15px;
    }
    
    .login-container h2 {
        font-size: 18px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
        padding: 15px;
    }
}

/* =====================================================
   中等手机屏幕 (414px - iPhone Plus/Max系列)
   ===================================================== */
@media (min-width: 376px) and (max-width: 414px) {
    .sidebar {
        width: 300px;
    }
    
    .chat-header h2 {
        font-size: 16px;
    }
}

/* =====================================================
   平板适配 (768px - 1024px)
   ===================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    .chat-area {
        flex: 1;
    }
    
    .message-bubble {
        max-width: 70%;
    }
}

/* =====================================================
   iOS 键盘弹出适配
   ===================================================== */
@media (max-height: 500px) and (max-width: 768px) {
    .chat-header {
        padding: 6px 10px;
    }
    
    .message-input-area {
        padding: 5px 8px;
    }
    
    .sidebar {
        display: none;
    }
}

/* =====================================================
   统一输入框iOS防缩放
   ===================================================== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea {
    font-size: 16px; /* 防止iOS Safari自动缩放 */
}

/* =====================================================
   图片加载失败样式
   ===================================================== */
img.img-error,
img[data-error="true"] {
    display: none;
}

.img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #999;
    font-size: 12px;
    border-radius: 4px;
}

/* =====================================================
   无脚本提示
   ===================================================== */
noscript .noscript-warning {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #666;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
