* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: #fafafa;
    height: 100vh;
    overflow: hidden;
    /* 防止移动端双击缩放 */
    touch-action: manipulation;
    /* 优化移动端滚动 */
    -webkit-overflow-scrolling: touch;
    /* 安全区域适配（iPhone X等） */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================
   统一“返回”按钮样式（前端）
   以 business_services.php 为标准
   ========================= */
.cw-back-btn {
    padding: 10px 18px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #212121;
    color: #ffffff;
    border: 2px solid #212121;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
}
.cw-back-btn:hover {
    background: #424242;
    border-color: #424242;
    color: #ffffff;
}

.chat-container {
    display: flex;
    height: 100vh;
    position: relative;
}

/* 侧边栏 */
.sidebar {
    width: 300px;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .contact-item:hover {
        background: transparent;
    }
    
    .contact-item:active {
        background: #e4e6eb;
    }
    
    button:active, .tool-btn:active {
        opacity: 0.7;
    }
}

/* 移动端侧边栏 */
@media (max-width: 768px) {
    body {
        overflow: hidden;
        /* 安全区域适配 */
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .chat-container {
        position: relative;
        height: 100vh;
        height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        width: 85%;
        max-width: 320px;
        transform: translateX(-100%);
        box-shadow: 2px 0 20px rgba(0,0,0,0.2);
        z-index: 200;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        /* 原生滑动效果 */
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    /* 侧边栏遮罩层 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 150;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.show {
        display: block;
        animation: fadeIn 0.3s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .chat-area {
        width: 100%;
    }
    
    .menu-toggle {
        display: inline-block !important;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        padding: 8px 12px;
        color: #1877f2;
        margin-right: 10px;
        border-radius: 50%;
        transition: background 0.2s;
        -webkit-tap-highlight-color: transparent;
    }
    
    .menu-toggle:active {
        background: rgba(24, 119, 242, 0.1);
    }
    
    .back-btn {
        display: inline-block !important;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        padding: 8px 12px;
        color: #1877f2;
        margin-right: 10px;
        border-radius: 50%;
        transition: background 0.2s;
        -webkit-tap-highlight-color: transparent;
    }
    
    .back-btn:active {
        background: rgba(24, 119, 242, 0.1);
    }
    
    /* 原生风格导航栏 */
    .chat-header {
        padding: 12px 15px;
        padding-top: calc(12px + env(safe-area-inset-top));
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
        box-shadow: 0 1px 0 rgba(0,0,0,0.08);
        display: flex;
        align-items: center;
        min-height: 44px;
        /* 原生导航栏效果 */
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .chat-header h3 {
        font-size: 17px;
        font-weight: 600;
        margin: 0;
        flex: 1;
        text-align: center;
    }
    
    .messages-container {
        padding: 12px 10px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
        /* 原生滚动效果 */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* 消息气泡优化 - 更像微信/Telegram */
    .message-content {
        max-width: 75%;
        padding: 9px 13px;
        border-radius: 18px;
        font-size: 16px;
        line-height: 1.4;
        word-wrap: break-word;
        word-break: break-word;
        /* 原生触摸反馈 */
        -webkit-tap-highlight-color: transparent;
    }
    
    .message.own .message-content {
        background: #95ec69;
        color: #000;
        border-bottom-right-radius: 4px;
        /* 更柔和的阴影 */
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
    
    .message.other .message-content {
        background: #fff;
        color: #000;
        border-bottom-left-radius: 4px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    }
    
    /* 输入区域优化 - 原生风格 */
    .input-area {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 0.5px solid rgba(0,0,0,0.1);
        padding: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 100;
        box-shadow: 0 -1px 0 rgba(0,0,0,0.05);
        /* 原生输入框效果 */
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .input-box {
        gap: 8px;
        align-items: flex-end;
    }
    
    .input-box textarea {
        padding: 10px 14px;
        font-size: 16px;
        max-height: 120px;
        border-radius: 20px;
        border: 1px solid #e4e6eb;
        background: #f0f2f5;
        /* 原生输入框样式 */
        -webkit-appearance: none;
        appearance: none;
        resize: none;
        line-height: 1.4;
    }
    
    .input-box textarea:focus {
        background: #fff;
        border-color: #1877f2;
        outline: none;
    }
    
    #send-btn {
        padding: 10px 20px;
        font-size: 15px;
        white-space: nowrap;
        border-radius: 20px;
        font-weight: 500;
        /* 原生按钮效果 */
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s;
    }
    
    #send-btn:active {
        transform: scale(0.95);
    }
    
    .sidebar-header {
        padding: 15px;
        padding-top: calc(15px + env(safe-area-inset-top));
    }
    
    .sidebar-header h2 {
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    /* 联系人列表优化 - 原生风格 */
    .contact-item {
        padding: 12px 15px;
        transition: background 0.15s;
        -webkit-tap-highlight-color: transparent;
        /* 原生列表项效果 */
        border-bottom: 0.5px solid rgba(0,0,0,0.05);
    }
    
    .contact-item:active {
        background: #f0f2f5;
    }
    
    .contact-avatar {
        width: 50px;
        height: 50px;
        font-size: 20px;
        /* 更圆润的头像 */
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        overflow: hidden;
    }
    
    .contact-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .contact-name {
        font-size: 16px;
        font-weight: 500;
    }
    
    .contact-status {
        font-size: 14px;
        margin-top: 2px;
    }
    
    .unread-badge {
        top: 10px;
        right: 15px;
        font-size: 12px;
        padding: 2px 6px;
        min-width: 18px;
        height: 18px;
        line-height: 18px;
        border-radius: 9px;
        font-weight: 600;
    }
    
    .tool-btn {
        font-size: 24px;
        padding: 8px;
        border-radius: 50%;
        transition: background 0.2s;
        -webkit-tap-highlight-color: transparent;
    }
    
    .tool-btn:active {
        background: rgba(0,0,0,0.05);
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 12px;
        /* 原生模态框效果 */
        -webkit-overflow-scrolling: touch;
    }
    
    .friend-requests-notification {
        padding: 12px;
        max-height: 150px;
    }
    
    .friend-request-item {
        padding: 10px;
        border-radius: 8px;
    }
    
    .accept-btn, .reject-btn {
        padding: 8px 16px;
        font-size: 14px;
        border-radius: 6px;
        font-weight: 500;
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s;
    }
    
    .accept-btn:active, .reject-btn:active {
        transform: scale(0.95);
    }
    
    /* 移动端优化：移除消息气泡小三角（在小屏幕上可能显示不佳） */
    .message.own .message-content::after,
    .message.other .message-content::after {
        display: none;
    }
    
    /* 移动端优化：调整消息间距 */
    .message {
        margin-bottom: 8px;
        animation: messageSlideIn 0.3s ease;
    }
    
    @keyframes messageSlideIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* 移动端优化：调整聊天窗口高度 */
    .chat-window {
        height: 100vh;
        height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        display: flex;
        flex-direction: column;
    }
    
    /* 优化搜索框 */
    .search-box input {
        font-size: 15px;
        padding: 10px 15px;
        border-radius: 20px;
        background: #f0f2f5;
        border: none;
    }
    
    .search-box input:focus {
        background: #fff;
        box-shadow: 0 0 0 1px #1877f2;
    }
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e4e6eb;
}

.sidebar-header h2 {
    margin-bottom: 10px;
    color: #1877f2;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.user-info > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vip-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.vip-badge.vip {
    background: #ffd700;
    color: #333;
}

.vip-badge.admin {
    background: #1877f2;
    color: white;
}

.vip-warning {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.vip-warning.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.vip-warning.expired {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.admin-link {
    color: #1877f2;
    text-decoration: none;
    font-size: 14px;
}

.logout-btn {
    color: #1877f2;
    text-decoration: none;
    font-size: 14px;
}

.search-box {
    padding: 15px;
    border-bottom: 1px solid #e4e6eb;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e4e6eb;
    border-radius: 20px;
    outline: none;
}

/* 好友请求通知 */
.friend-requests-notification {
    padding: 15px;
    background: #fff3cd;
    border-bottom: 1px solid #ffeaa7;
    max-height: 200px;
    overflow-y: auto;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 10px;
    color: #856404;
}

.notification-count {
    background: #e41e3f;
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
}

.friend-requests-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.friend-request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
}

.friend-request-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.friend-request-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1877f2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    overflow: hidden;
}

.friend-request-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-request-name {
    font-weight: 500;
    color: #333;
}

.friend-request-actions {
    display: flex;
    gap: 8px;
}

.accept-btn, .reject-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.accept-btn {
    background: #42b72a;
    color: white;
}

.accept-btn:hover {
    background: #36a420;
}

.reject-btn {
    background: #e4e6eb;
    color: #333;
}

.reject-btn:hover {
    background: #d4d6db;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #e4e6eb;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    border-bottom-color: #1877f2;
    color: #1877f2;
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

.list-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e4e6eb;
}

.list-header h3 {
    font-size: 16px;
}

.add-btn {
    padding: 5px 10px;
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.contact-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    padding: 15px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.contact-item:hover {
    background: #f0f2f5;
}

.contact-item:active {
    background: #e4e6eb;
}

.contact-item.active {
    background: #e7f3ff;
}

.unread-badge {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #e41e3f;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    line-height: 16px;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1877f2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    overflow: hidden;
}

.contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-avatar.admin-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #1877f2;
    color: white;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.contact-status {
    font-size: 12px;
    color: #65676b;
}

.online {
    color: #42b72a;
}

/* 聊天区域 */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.chat-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #65676b;
}

.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e4e6eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.chat-header h3 {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.back-btn, .menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    color: #1877f2;
    margin-right: 10px;
}

.chat-actions button {
    padding: 5px 10px;
    background: transparent;
    border: 1px solid #e4e6eb;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #ededed;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(0,0,0,.03) 20px, rgba(0,0,0,.03) 21px),
        repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(0,0,0,.03) 20px, rgba(0,0,0,.03) 21px);
    background-size: 100% 100%;
    /* 原生滚动优化 */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    position: relative;
}

.message {
    margin-bottom: 12px;
    display: flex;
    flex-direction: row;
    position: relative;
    align-items: flex-start;
    gap: 12px;
    padding: 0 15px;
}

.message.own {
    flex-direction: row;
    justify-content: flex-start;
}

.message.other {
    flex-direction: row;
    justify-content: flex-start;
}

/* 消息头像容器 - 统一限制所有头像大小（强制统一） */
.message-avatar {
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
    min-height: 25px !important;
    max-width: 25px !important;
    max-height: 25px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    background: var(--color-gray-200, #e0e0e0);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

.message-avatar img {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 确保所有消息头像（包括自己和对方的）都使用相同尺寸 - 强制限制（最高优先级） */
.message.own .message-avatar,
.message.other .message-avatar {
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
    min-height: 25px !important;
    max-width: 25px !important;
    max-height: 25px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    display: flex !important;
    border-radius: 50% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.message.own .message-avatar img,
.message.other .message-avatar img {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    box-sizing: border-box !important;
    border-radius: 50% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 所有消息都显示头像（参考微信风格） */
.message .message-avatar {
    display: flex !important;
}

/* 消息内容包装器 */
.message-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.message.own .message-content-wrapper {
    align-items: flex-end;
}

.message.other .message-content-wrapper {
    align-items: flex-start;
}

/* 消息发送者名称 */
.message-sender-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-gray-900, #212121);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 消息时间（右侧） */
.message-time {
    font-size: 12px;
    font-weight: 400;
    color: var(--color-gray-500, #9e9e9e);
    margin-top: 4px;
    text-align: right;
    flex-shrink: 0;
    margin-left: 10px;
    align-self: flex-start;
    padding-top: 2px;
}

/* 消息气泡样式 - 参考微信 */
.message-content {
    max-width: 100%;
    padding: 9px 12px;
    border-radius: 12px;
    word-wrap: break-word;
    word-break: break-word;
    position: relative;
    line-height: 1.5;
}

/* 自己的消息 - 绿色气泡（微信风格） */
.message.own .message-content {
    background: #95ec69;
    color: #000;
    border-top-right-radius: 4px;
}

/* 对方的消息 - 白色气泡 */
.message.other .message-content {
    background: #fff;
    color: #000;
    border-top-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 消息气泡小三角（微信风格，可选） */
.message.own .message-content::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 10px;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-left-color: #95ec69;
    border-right: none;
}

.message.other .message-content::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 10px;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-right-color: #fff;
    border-left: none;
}

.message-status {
    font-size: 12px;
    color: #65676b;
    margin-left: 5px;
    display: inline-block;
}

.message-status.sent {
    color: #65676b;
}

.message-status.read {
    color: #1877f2;
}

.message-info {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 移动端消息信息样式 */
@media (max-width: 768px) {
    .message-info {
        font-size: 10px;
        padding: 0 5px;
    }
    
    .message {
        padding: 0 12px;
        gap: 10px;
    }
    
    /* 移动端头像统一为25px */
    .message-avatar {
        width: 25px !important;
        height: 25px !important;
        min-width: 25px !important;
        min-height: 25px !important;
        max-width: 25px !important;
        max-height: 25px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .message-avatar img {
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        box-sizing: border-box !important;
        border-radius: 50% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* 确保所有消息头像（包括自己和对方的）在移动端都使用相同尺寸（最高优先级） */
    .message.own .message-avatar,
    .message.other .message-avatar {
        width: 25px !important;
        height: 25px !important;
        min-width: 25px !important;
        min-height: 25px !important;
        max-width: 25px !important;
        max-height: 25px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
        display: flex !important;
        border-radius: 50% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .message.own .message-avatar img,
    .message.other .message-avatar img {
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        box-sizing: border-box !important;
        border-radius: 50% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .message-sender-name {
        font-size: 13px;
    }
    
    .message-time {
        font-size: 11px;
        margin-left: 8px;
    }
    
    .message-content {
        max-width: 100%;
        font-size: 14px;
    }
}

.message-image {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s;
}

.message-image:active {
    opacity: 0.8;
}

.message-voice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
}

.voice-play-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #1877f2;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.voice-play-btn:active {
    background: #1557b0;
}

/* 录音浮层样式（类似微信） */
#voice-recording-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(4px);
}

#voice-recording-overlay > div {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    color: white;
    min-width: 200px;
}

#voice-mic-icon {
    font-size: 80px;
    margin-bottom: 20px;
    transition: transform 0.2s;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

#voice-status-text {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 500;
}

#voice-timer {
    font-size: 14px;
    color: #ccc;
}

.input-area {
    border-top: 1px solid #e4e6eb;
    padding: 15px;
    background: #fff;
}

.input-toolbar {
    margin-bottom: 10px;
}

.tool-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    margin-right: 10px;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.tool-btn:active {
    background: #f0f2f5;
}

.input-box {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-box textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    min-height: 40px;
    max-height: 40px;
    overflow-y: hidden;
}

.input-box textarea:focus {
    max-height: 120px;
    overflow-y: auto;
}

.input-box textarea:focus {
    border-color: #1877f2;
}

#send-btn {
    padding: 10px 20px;
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

#send-btn:hover {
    background: #166fe5;
}

#send-btn:active {
    background: #1557b0;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #65676b;
}

.modal-content h3 {
    margin-bottom: 20px;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #e4e6eb;
    border-radius: 4px;
    outline: none;
}

.modal-content button {
    width: 100%;
    padding: 10px;
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#search-results {
    margin-top: 15px;
}

.search-result-item {
    padding: 10px;
    border: 1px solid #e4e6eb;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item button {
    padding: 5px 15px;
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}