/* 聊天系统专用布局样式 */

/* 基础设置 */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 固定顶部导航栏 */
.navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 3.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #ffffff !important;
    border-bottom: 1px solid #e5e5e5;
}

/* 主体内容区域 */
body {
    padding-top: 3.25rem;
}

main {
    height: calc(100vh - 3.25rem);
    overflow: hidden;
}

/* 个人资料页面特殊处理 */
body:not(.chat-room-page) main {
    height: auto;
    min-height: calc(100vh - 3.25rem);
    overflow: visible;
}

/* 确保个人资料页面可以滚动 */
.container {
    max-width: 100%;
    padding: 0 1rem;
}

/* 移动端个人资料页面优化 */
@media screen and (max-width: 768px) {
    body:not(.chat-room-page) {
        overflow-y: auto;
    }
    
    body:not(.chat-room-page) main {
        height: auto;
        min-height: calc(100vh - 3.25rem);
        overflow: visible;
        padding-bottom: 2rem;
    }
    
    .container {
        padding: 1rem 0.5rem;
    }
    
    .columns {
        margin: 0;
    }
    
    .column {
        padding: 0.5rem;
    }
    
    .box {
        margin-bottom: 1rem;
    }
}

/* 聊天容器 */
.chat-container {
    display: flex;
    height: calc(100vh - 3.25rem);
    overflow: hidden;
    background: #f8f9fa;
}

/* 左侧聊天列表 */
.chat-sidebar {
    width: 320px;
    min-width: 280px;
    background: #ffffff;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
    flex-shrink: 0;
}

.chat-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 搜索框样式 */
.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 0.9rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #007bff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-button:hover {
    background: #0056b3;
}

/* 设备信息卡片 */
.device-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
}

.device-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* 聊天列表 */
.chat-rooms-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-room-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.chat-room-item:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

.chat-room-item.active {
    background: #e3f2fd;
    border-right: 4px solid #2196f3;
}

.chat-room-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e5e5;
    flex-shrink: 0;
}

.chat-room-info {
    flex: 1;
    min-width: 0;
    margin-left: 0.75rem;
}

.chat-room-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-room-last-message {
    font-size: 0.85rem;
    color: #7f8c8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-room-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-room-time {
    font-size: 0.75rem;
    color: #95a5a6;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.chat-room-badge {
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* 右侧聊天主区域 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #f8f9fa;
}

/* 聊天头部 - 固定 */
.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e5e5;
    background: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.75rem;
}

.chat-header-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
}

.chat-header-status {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* 聊天消息区域 - 可滚动 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 消息气泡 */
.message-bubble {
    max-width: 70%;
    margin-bottom: 1rem;
    word-wrap: break-word;
    animation: fadeInUp 0.3s ease;
    display: flex;
    flex-direction: column;
    clear: both;
}

.message-bubble.own {
    margin-left: auto;
    margin-right: 0;
    align-items: flex-end;
}

.message-bubble.other {
    margin-left: 0;
    margin-right: auto;
    align-items: flex-start;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    word-break: break-word;
    max-width: 100%;
}

.message-bubble.own .message-content {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.message-bubble.other .message-content {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    color: #2c3e50;
    border-bottom-left-radius: 6px;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    padding: 0 0.5rem;
}

.message-bubble.own .message-time {
    text-align: right;
}

.message-bubble.other .message-time {
    text-align: left;
}

/* 消息输入区域 - 固定在底部 */
.chat-input {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e5e5;
    background: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
}

.chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.chat-input-field {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    resize: none;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.chat-input-field:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.chat-input-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-input-button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #007bff;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-button:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.chat-input-button.secondary {
    background: #6c757d;
}

.chat-input-button.secondary:hover {
    background: #545b62;
}

/* 欢迎页面 */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.chat-welcome-icon {
    font-size: 4rem;
    color: #007bff;
    margin-bottom: 1rem;
}

.chat-welcome-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.chat-welcome-subtitle {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* 移动端欢迎页面优化 */
@media screen and (max-width: 768px) {
    .chat-welcome {
        padding: 1rem;
        height: auto;
        min-height: 200px;
    }
    
    .chat-welcome-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }
    
    .chat-welcome-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .chat-welcome-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        height: 30vh;
        min-height: 200px;
        max-height: 250px;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        display: flex !important; /* 确保在移动端显示 */
        flex-direction: column;
    }
    
    .chat-main {
        height: 70vh;
        min-height: calc(100vh - 250px - 3.25rem);
        display: flex !important; /* 确保在移动端显示 */
        flex-direction: column;
    }
    
    /* 移动端首页隐藏欢迎页面 */
    .chat-index .chat-welcome {
        display: none !important;
    }
    
    /* 移动端聊天页面隐藏设备信息卡片 */
    .device-info-card {
        display: none !important;
    }
    
    /* 移动端聊天页面隐藏搜索框 */
    .search-container {
        display: none !important;
    }
    
    /* 移动端聊天列表优化 */
    .chat-sidebar-header {
        padding: 0.5rem;
        display: none; /* 完全隐藏头部区域 */
    }
    
    .chat-sidebar-content {
        padding-top: 0;
        flex: 1;
        overflow-y: auto;
    }
    
    .chat-rooms-list {
        padding: 0;
        height: 100%;
    }
    
    .chat-room-item {
        padding: 0.75rem;
        border-bottom: 1px solid #f0f0f0;
        display: flex !important; /* 确保聊天室项目显示 */
    }
    
    .chat-room-avatar {
        width: 40px;
        height: 40px;
    }
    
    .chat-room-name {
        font-size: 0.9rem;
    }
    
    .chat-room-last-message {
        font-size: 0.8rem;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .chat-input-container {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .chat-input-field {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 移动端聊天页面优化 */
    .chat-header {
        padding: 0.75rem 1rem;
        flex-shrink: 0;
    }
    
    .chat-header-name {
        font-size: 1rem;
    }
    
    .chat-messages {
        padding: 0.75rem;
        flex: 1;
        overflow-y: auto;
    }
    
    .chat-input {
        padding: 0.75rem 1rem;
        flex-shrink: 0;
    }
}

@media screen and (max-width: 480px) {
    /* 只在聊天页面隐藏顶部导航栏 */
    body.chat-room-page .navbar {
        display: none !important;
    }
    
    /* 只在聊天页面重置body padding */
    body.chat-room-page {
        padding-top: 0 !important;
    }
    
    /* 只在聊天页面重置main高度 */
    body.chat-room-page main {
        height: 100vh !important;
    }
    
    /* 手机端隐藏聊天列表，只显示聊天窗口 */
    .chat-sidebar {
        display: none !important;
    }
    
    .chat-main {
        height: calc(100vh - 3.25rem);
        width: 100%;
        display: flex !important;
        flex-direction: column;
    }
    
    /* 只在聊天页面调整聊天主区域高度 */
    body.chat-room-page .chat-main {
        height: 100vh;
    }
    
    /* 手机端聊天头部增强，集成导航功能 */
    .chat-header {
        padding: 1rem 0.75rem;
        flex-shrink: 0;
        background: #ffffff;
        border-bottom: 1px solid #e5e5e5;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        position: relative;
    }
    
    .chat-header-info {
        display: flex;
        align-items: center;
        flex: 1;
    }
    
    .chat-header-actions {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }
    
    /* 只在聊天页面添加返回按钮 */
    body.chat-room-page .chat-header::before {
        content: "←";
        position: absolute;
        left: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.5rem;
        color: #007bff;
        cursor: pointer;
        z-index: 10;
    }
    
    /* 只在聊天页面调整头部信息位置，为返回按钮留空间 */
    body.chat-room-page .chat-header-info {
        margin-left: 2rem;
    }
    
    /* 移动端首页完全隐藏欢迎页面和设备信息 */
    .chat-index .chat-welcome {
        display: none !important;
    }
    
    .device-info-card {
        display: none !important;
    }
    
    .search-container {
        display: none !important;
    }
    
    .chat-sidebar-header {
        display: none !important;
    }
    
    /* 确保聊天列表内容区域显示 */
    .chat-sidebar-content {
        flex: 1;
        overflow-y: auto;
        display: flex !important;
        flex-direction: column;
    }
    
    .chat-rooms-list {
        flex: 1;
        display: block !important;
    }
    
    /* 移动端聊天室列表优化 */
    .chat-room-item {
        padding: 0.5rem;
        display: flex !important; /* 确保聊天室项目显示 */
        align-items: center;
    }
    
    .chat-room-avatar {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    
    .chat-room-info {
        flex: 1;
        min-width: 0;
        margin-left: 0.5rem;
    }
    
    .chat-room-name {
        font-size: 0.85rem;
    }
    
    .chat-room-last-message {
        font-size: 0.75rem;
    }
    
    .chat-room-meta {
        flex-shrink: 0;
    }
    
    .chat-room-time {
        font-size: 0.7rem;
    }
    
    .message-bubble {
        max-width: 90%;
        margin-bottom: 0.75rem;
    }
    
    .message-content {
        padding: 0.5rem 0.75rem;
    }
    
    .chat-header {
        padding: 0.5rem 0.75rem;
        flex-shrink: 0;
    }
    
    .chat-header-name {
        font-size: 0.9rem;
    }
    
    .chat-header-status {
        font-size: 0.75rem;
    }
    
    .chat-input {
        padding: 0.5rem 0.75rem;
        flex-shrink: 0;
    }
    
    .chat-input-field {
        min-height: 36px;
        padding: 0.5rem 0.75rem;
        font-size: 16px;
    }
    
    .chat-input-button {
        width: 36px;
        height: 36px;
    }
    
    .chat-messages {
        padding: 0.5rem;
        flex: 1;
        overflow-y: auto;
    }
}

/* 移动端首页专用样式 */
@media screen and (max-width: 480px) {
    /* 移动端专用容器 */
    .mobile-chat-container {
        padding: 1rem;
        height: calc(100vh - 3.25rem);
        overflow-y: auto;
    }
    
    .mobile-chat-content {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-new-chat-btn {
        flex-shrink: 0;
        margin-bottom: 1rem;
    }
    
    .mobile-chat-list {
        flex: 1;
        overflow-y: auto;
        margin-bottom: 1rem;
    }
    
    .mobile-chat-item {
        padding: 0.75rem;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        background: #f8f9fa;
        cursor: pointer;
        transition: background-color 0.2s;
        border: 1px solid #e9ecef;
    }
    
    .mobile-chat-item:hover {
        background: #e9ecef;
    }
    
    .mobile-online-users {
        flex-shrink: 0;
        max-height: 200px;
        overflow-y: auto;
        border-top: 1px solid #e9ecef;
        padding-top: 1rem;
    }
    
    .online-user-item {
        padding: 0.5rem;
        border-radius: 6px;
        background: #f0f8ff;
        cursor: pointer;
        transition: background-color 0.2s;
        margin-bottom: 0.5rem;
    }
    
    .online-user-item:hover {
        background: #e6f3ff;
    }
    
    .mobile-welcome-container {
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 2rem;
    }
    
    .mobile-welcome-container .icon-container {
        margin-bottom: 2rem;
    }
    
    .mobile-welcome-container .title {
        margin-bottom: 1rem;
    }
    
    .mobile-welcome-container .subtitle {
        margin-bottom: 2rem;
    }
}

/* 美化的聊天列表和用户列表样式 */

/* 桌面端聊天列表美化 */
.chat-room-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: none;
    margin: 0.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.chat-room-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.chat-room-item:hover::before {
    left: 100%;
}

.chat-room-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    background: rgba(255, 255, 255, 1);
    border-color: rgba(102, 126, 234, 0.3);
    text-decoration: none;
    color: inherit;
}

.chat-room-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    border-color: transparent;
}

.chat-room-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.chat-room-item:hover .chat-room-avatar {
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.chat-room-item.active .chat-room-avatar {
    border-color: rgba(255,255,255,0.9);
    box-shadow: 0 6px 20px rgba(255,255,255,0.3);
}

.chat-room-info {
    flex: 1;
    min-width: 0;
    margin-left: 1rem;
}

.chat-room-name {
    font-weight: 700;
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.chat-room-item.active .chat-room-name {
    color: white;
}

.chat-room-last-message {
    font-size: 0.85rem;
    color: #718096;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    opacity: 0.8;
}

.chat-room-item.active .chat-room-last-message {
    color: rgba(255,255,255,0.9);
    opacity: 0.9;
}

.chat-room-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-room-time {
    font-size: 0.75rem;
    color: #a0aec0;
    white-space: nowrap;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.chat-room-item.active .chat-room-time {
    color: rgba(255,255,255,0.8);
}

.chat-room-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border-radius: 12px;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.chat-room-item.active .chat-room-badge {
    background: linear-gradient(135deg, #ffd93d 0%, #ff6b6b 100%);
    color: #2d3748;
    box-shadow: 0 4px 12px rgba(255, 217, 61, 0.4);
}

/* 聊天侧边栏美化 */
.chat-sidebar {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-sidebar-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.search-input {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.search-input:focus {
    background: rgba(255, 255, 255, 1);
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.search-button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: scale(1.05);
}

/* 用户列表模态框美化 */
.user-item {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.user-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.user-item:hover::before {
    left: 100%;
}

.user-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    background: rgba(255, 255, 255, 1);
    border-color: rgba(102, 126, 234, 0.3);
}

.user-item .media {
    align-items: center;
}

.user-item .image img {
    border: 3px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.user-item:hover .image img {
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.user-item .media-content {
    overflow: hidden;
}

.user-item .media-content .content p {
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.user-item .media-content .content p:last-child {
    margin-bottom: 0;
    font-weight: 500;
    opacity: 0.8;
}

.user-item .tag {
    font-weight: 600;
    border-radius: 12px;
    padding: 0.3rem 0.6rem;
}

.user-item .tag.is-success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(64, 192, 87, 0.3);
}

.user-item .tag.is-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.user-item .button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.user-item .button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 模态框美化 */
.modal-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.modal-card-head {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    padding: 1.5rem;
}

.modal-card-title {
    color: white;
    font-weight: 700;
}

.modal-card-body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 1.5rem;
}

/* 滚动条美化 */
.chat-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.chat-sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.chat-sidebar-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
}

.chat-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* 移动端美化样式 */
@media screen and (max-width: 480px) {
    /* 移动端专用容器美化 */
    .mobile-chat-container {
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        padding: 1rem;
    }
    
    .mobile-new-chat-btn {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        color: white;
        padding: 1rem 1.5rem;
        border-radius: 16px;
        font-weight: 600;
        font-size: 1rem;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
        transition: all 0.3s ease;
    }
    
    .mobile-new-chat-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
    }
    
    .mobile-section-title {
        font-size: 1.2rem;
        font-weight: 700;
        color: #2d3748;
        margin-bottom: 1rem;
        padding: 0.75rem 1rem;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.08);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        position: relative;
    }
    
    .mobile-section-title::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 0 4px 4px 0;
    }
    
    .mobile-chat-item, .online-user-item {
        padding: 1rem;
        border-radius: 16px;
        margin-bottom: 0.75rem;
        background: rgba(255, 255, 255, 0.95);
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        backdrop-filter: blur(10px);
        position: relative;
        overflow: hidden;
    }
    
    .mobile-chat-item::before, .online-user-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
        transition: left 0.5s ease;
    }
    
    .mobile-chat-item:hover::before, .online-user-item:hover::before {
        left: 100%;
    }
    
    .mobile-chat-item:hover, .online-user-item:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 8px 30px rgba(0,0,0,0.15);
        background: rgba(255, 255, 255, 1);
        border-color: rgba(102, 126, 234, 0.3);
    }
    
    .mobile-welcome-container {
        background: rgba(255, 255, 255, 0.9);
        border-radius: 20px;
        box-shadow: 0 8px 30px rgba(0,0,0,0.1);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        padding: 4rem 1.5rem;
    }
    
    .mobile-welcome-container .icon-container i {
        color: #667eea;
        animation: float 3s ease-in-out infinite;
    }
    
    @keyframes float {
        0%, 100% { transform: translateY(0px); }
        50% { transform: translateY(-10px); }
    }
    
    .mobile-welcome-container .title {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        font-weight: 700;
    }
}
