﻿/* 自托管字体 */
@font-face {
    font-family: "Long Cang";
    src: url('/fonts/long-cang/long-cang-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ZCOOL KuaiLe";
    src: url('/fonts/zcool-kuaile/zcool-kuaile-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ZCOOL XiaoWei";
    src: url('/fonts/zcool-xiaowei/zcool-xiaowei-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ZCOOL QingKe HuangYou";
    src: url('/fonts/zcool-qingke-huangyou/zcool-qingke-huangyou-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Ma Shan Zheng";
    src: url('/fonts/ma-shan-zheng/ma-shan-zheng-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}


@font-face {
    font-family: "Zhi Mang Xing";
    src: url('/fonts/zhi-mang-xing/zhi-mang-xing-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "WDXL Lubrifont SC";
    src: url('/fonts/wdxl-lubrifont-sc/wdxl-lubrifont-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Noto Sans SC";
    src: url('/fonts/noto-sans-sc/NotoSansSC-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Noto Serif SC";
    src: url('/fonts/noto-serif-sc/NotoSerifSC-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
/* 交流中心 - 简约大方样式 */


/* ========== 基础布局 ========== */
/* 容器样式由 style.css 统一管理，这里不再重复定义 */


/* ========== 用户信息卡片 ========== */
.jl-header-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.jl-header-actions {
    position: absolute;
    top: 15px;
    right: 15px;
}

.jl-header-actions .btn {
    margin-left: 8px;
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid #d0d7de;
    color: #656d76;
}

.jl-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 5px;
}

.jl-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #e8e8e8;
    object-fit: cover;
}

.jl-user-name {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    color: #333;
}

.jl-connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #666;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4757;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background: #2ed573;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}


/* ========== 标签栏 ========== */
.jl-nav-tabs {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 15px;
    gap: 16px;
}

/* 用户信息样式 */
.jl-user-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.jl-user-avatar-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e8e8e8;
    object-fit: cover;
}

.jl-user-details-compact {
    min-width: 0;
}

.jl-user-name-small {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1890ff;
    display: block;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
}

.jl-user-name-small:hover {
    color: #0056b3;
    text-decoration: underline;
}

.jl-connection-status-small {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.status-indicator-small {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff4757;
    animation: pulse 2s infinite;
}

.status-indicator-small.connected {
    background: #2ed573;
}

.status-text-small {
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
}

/* 标签按钮容器 */
.jl-nav-buttons {
    display: flex;
    flex: 1;
}

.jl-nav-tabs .jl-nav-btn {
    display: flex;
}

.jl-nav-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 8px;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #666;
    border-right: 1px solid #e8e8e8;
}

.jl-nav-btn:last-child {
    border-right: none;
}

.jl-nav-btn:hover {
    background: #f8f9fa;
}

.jl-nav-btn.active {
    background: #1890ff;
    color: white;
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.jl-nav-btn .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4757;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}


/* ========== 标签内容 ========== */
.jl-tab-content {
    display: none;
}

.jl-tab-content.active {
    display: block;
}


/* ========== 区块样式 ========== */
.jl-section {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
}

.jl-section-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
}

.jl-section-header h5 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}


/* ========== 空状态 ========== */
.jl-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #a4b0be;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.jl-empty-state p {
    margin: 0 0 5px 0;
    font-weight: 500;
}


/* ========== 消息样式 ========== */
.jl-message-list, .jl-requests-list, .jl-friends-list {
    max-height: 400px;
    overflow-y: auto;
}

/* 消息项容器 */
.jl-message-item, .jl-request-item, .jl-friend-item {
    position: relative;
    background: white;
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.jl-message-item:hover, .jl-request-item:hover, .jl-friend-item:hover {
    background: #f8f9fa;
}

/* 更多按钮样式 */
.jl-more-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 18px;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.jl-message-item:hover .jl-more-btn,
.jl-request-item:hover .jl-more-btn,
.jl-friend-item:hover .jl-more-btn {
    opacity: 1;
    pointer-events: auto;
}

.jl-more-btn:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-50%) scale(1.1);
}

.jl-more-btn:active {
    background: #dee2e6;
    transform: translateY(-50%) scale(0.95);
}

/* 移动端始终显示更多按钮 */
@media (max-width: 768px) {
    .jl-more-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

/* 更多操作菜单样式 */
.jl-more-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white !important; /* 改为白色背景 */
    border: 2px solid #000 !important; /* 调试用黑色边框 */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999 !important; /* 提高层级 */
    min-width: 120px !important;
    min-height: 80px !important; /* 确保有足够高度 */
    opacity: 1 !important; /* 强制显示，调试用 */
    transform: translateY(0) !important; /* 强制显示，调试用 */
    transition: all 0.2s ease;
    pointer-events: auto !important; /* 强制启用点击 */
    overflow: visible !important; /* 确保内容可见 */
}

.jl-more-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.jl-more-menu-item {
    padding: 12px 16px !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 14px !important;
    min-height: 40px !important; /* 确保有最小高度 */
    background: white !important; /* 菜单项背景为白色 */
    color: #333 !important; /* 文字颜色 */
}

.jl-more-menu-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.jl-more-menu-item:hover {
    background: #f8f9fa;
}

.jl-more-menu-item.mark-unread {
    color: #007bff;
}

.jl-more-menu-item.delete {
    color: #dc3545;
}

.jl-more-menu-item:first-child {
    border-radius: 8px 8px 0 0;
}

.jl-message-item:last-child, .jl-request-item:last-child, .jl-friend-item:last-child {
    border-bottom: none;
}

.jl-item-avatar {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

/* 头像包装与在线状态点 */
.jl-avatar-wrap {
    position: relative;
    display: inline-block;
}

.jl-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #adb5bd; /* 默认离线 */
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
}

/* 头像上的状态点使用绝对定位 */
.jl-item-avatar-wrap .jl-status-dot,
.jl-avatar-wrap .jl-status-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    margin-left: 0;
}
.jl-status-dot.online { background: #2ed573; }
.jl-status-dot.offline { background: #adb5bd; }

.jl-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.jl-item-name {
    font-weight: 400;
    color: #333;
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
}

.jl-item-desc {
    color: #999;
    font-size: 13px;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.jl-item-time {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

.jl-item-badge {
    background: #ff4757;
    color: white;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 8px;
    flex-shrink: 0;
    min-width: 16px;
    text-align: center;
    align-self: flex-start;
    margin-top: 2px;
}


/* ========== 加载状态 ========== */
.jl-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 9999;
}


/* ========== 响应式设计 ========== */

/* 桌面版优化 */
@media (min-width: 768px) {
    .jl-header-card {
        padding: 20px;
    }
    
    .jl-user-avatar {
        width: 54px;
        height: 54px;
    }
    
    .jl-user-name {
        font-size: 1.2rem;
    }
    
    .jl-chat-area {
        height: 550px;
    }
    
    .jl-message-list, .jl-requests-list, .jl-friends-list {
        max-height: 450px;
    }
    
    /* 桌面版消息项略微增加间距 */
    .jl-message-content {
        padding: 14px 18px;
    }
    
    .jl-item-avatar {
        width: 46px;
        height: 46px;
    }
    
    .jl-section-header {
        padding: 14px 18px;
    }
    
    /* 桌面版聊天输入框 */
    .jl-chat-input {
        padding: 16px 20px;
    }
}

/* 手机版 */
@media (max-width: 767px) {
    .jl-header-card {
        padding: 15px;
    }
    
    .jl-user-avatar {
        width: 50px;
        height: 50px;
    }
    
    .jl-user-name {
        font-size: 1.1rem;
    }
    
    .jl-chat-area {
        height: 450px;
    }
}


/* ========== 滚动条样式 ========== */
.jl-message-list::-webkit-scrollbar,
.jl-requests-list::-webkit-scrollbar,
.jl-friends-list::-webkit-scrollbar,
.jl-posts-list::-webkit-scrollbar,
.jl-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.jl-message-list::-webkit-scrollbar-track,
.jl-requests-list::-webkit-scrollbar-track,
.jl-friends-list::-webkit-scrollbar-track,
.jl-posts-list::-webkit-scrollbar-track,
.jl-chat-messages::-webkit-scrollbar-track {
    background: #f1f2f6;
    border-radius: 3px;
}

.jl-message-list::-webkit-scrollbar-thumb,
.jl-requests-list::-webkit-scrollbar-thumb,
.jl-friends-list::-webkit-scrollbar-thumb,
.jl-posts-list::-webkit-scrollbar-thumb,
.jl-chat-messages::-webkit-scrollbar-thumb {
    background: #a4b0be;
    border-radius: 3px;
}

.jl-message-list::-webkit-scrollbar-thumb:hover,
.jl-requests-list::-webkit-scrollbar-thumb:hover,
.jl-friends-list::-webkit-scrollbar-thumb:hover,
.jl-posts-list::-webkit-scrollbar-thumb:hover,
.jl-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #747d8c;
}


/* ========== 动画效果 ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
