﻿/* 自托管字体 */
@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 统一管理，这里不再重复定义 */

/* ========== 模态框聊天消息样式 ========== */
/* 参考chat.css的消息布局结构 */
.jl-modal-message {
    margin: 4px 0;
    padding: 8px;
    border-radius: 8px;
    animation: fadeInDown 0.3s ease-out;
}

/* 左右分布样式 */
.jl-modal-message.message-self {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
}

.jl-modal-message.message-other {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

/* 消息包装器 */
.jl-modal-message .message-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 80%; /* 增加最大宽度，给消息更多空间 */
    width: fit-content;
}

.jl-modal-message.message-self .message-wrapper {
    flex-direction: row !important;
    justify-content: flex-end !important;
    margin-left: 20%; /* 增加左边距，更明显的右对齐 */
    margin-right: 0;
}

.jl-modal-message.message-other .message-wrapper {
    flex-direction: row !important;
    justify-content: flex-start !important;
    margin-left: 0;
    margin-right: 20%; /* 增加右边距，更明显的左对齐 */
}

/* 强化自己消息的右对齐 */
.jl-modal-message.message-self .message-content-area {
    order: 1;
}

.jl-modal-message.message-self .message-avatar {
    order: 2;
}

.jl-modal-message.message-other .message-avatar {
    order: 1;
}

.jl-modal-message.message-other .message-content-area {
    order: 2;
}

/* 消息内容区域 */
.jl-modal-message .message-content-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* 消息头部 */
.jl-modal-message .message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 2px;
    min-height: 26px;
    line-height: 1.2;
}

.jl-modal-message .message-user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

/* 自己消息的头部布局 */
.jl-modal-message.message-self .message-header {
    color: #6c757d;
    flex-direction: row-reverse;
}

.jl-modal-message.message-self .message-user-info {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

/* 他人消息的头部布局 */
.jl-modal-message.message-other .message-header {
    color: #6c757d;
}

.jl-modal-message.message-other .message-user-info {
    justify-content: flex-start;
}

/* 头像样式 */
.jl-modal-message .message-avatar {
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #dee2e6;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    align-self: flex-start;
}

.jl-modal-message .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.jl-modal-message .message-avatar:hover img {
    transform: scale(1.1);
}

/* 消息气泡 */
.jl-modal-message .message-bubble {
    border-radius: 10px;
    padding: 8px 12px;
    position: relative;
    border: 1px solid #dee2e6;
    min-width: 30px;
    max-width: 100%;
    width: fit-content;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    font-size: 1rem;
}

/* 自己消息的气泡：浅蓝色 */
.jl-modal-message.message-self .message-bubble {
    background: #f0f8ff !important;
    color: #495057;
    border-color: #cce7ff;
    margin-left: auto;
    text-align: left !important;
}

/* 他人消息的气泡：白色 */
.jl-modal-message.message-other .message-bubble {
    background: #ffffff !important;
    color: #495057;
    border-color: #dee2e6;
    margin-right: auto;
}

/* 消息内容 */
.jl-modal-message .message-content {
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
    margin: 0;
    text-align: left !important;
    direction: ltr;
}

/* 用户名样式 */
.jl-modal-message .message-user {
    font-weight: 600;
    font-size: 0.8rem;
    color: #6c757d;
}

/* 时间样式 */
.jl-modal-message .message-time {
    font-size: 0.75rem;
    opacity: 0.6;
    color: #6c757d;
}

/* 保留旧样式类名以兼容现有代码 */
.jl-modal-message.self {
    flex-direction: row-reverse;
}

.jl-modal-message .jl-message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8e8e8;
}

.jl-modal-message .jl-message-content {
    max-width: 80%; /* 增加最大宽度，与新样式保持一致 */
    display: flex;
    flex-direction: column;
}

.jl-modal-message.self .jl-message-content {
    align-items: flex-end;
}

.jl-modal-message .jl-message-bubble {
    background: #f5f5f5;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
    margin-bottom: 5px;
    border: 1px solid #e8e8e8;
}

.jl-modal-message .jl-message-bubble.self {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.jl-modal-message .jl-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* 添加fadeInDown动画 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 聊天模态框样式优化 */
.jl-chat-modal-body {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
}

.jl-chat-modal-footer {
    padding: 15px;
    border-top: 1px solid #e8e8e8;
}

/* ========== 用户信息卡片 ========== */
.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;
}

.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;
}

.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-more-menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

.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-chat-area {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    height: 500px;
}

.jl-chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
}

.jl-chat-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jl-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
}

.jl-chat-name {
    font-weight: 500;
    color: #333;
    font-size: 15px;
}

.jl-chat-status {
    font-size: 12px;
    color: #999;
}

.jl-chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: #f8f8f8;
}

.jl-message {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
}

.jl-message.self {
    flex-direction: row-reverse;
    justify-content: flex-start;
    margin-left: 15%; /* 适度的左边距，保持右对齐但不过度压缩 */
    margin-right: 0;
}

/* 好友消息左对齐 */
.jl-message:not(.self) {
    justify-content: flex-start;
    margin-left: 0;
    margin-right: 15%; /* 适度的右边距，保持左对齐但不过度压缩 */
}

.jl-message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
}

.jl-message-content {
    max-width: 75%; /* 增加最大宽度，给消息更多空间 */
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.jl-message-bubble {
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
    border: 1px solid #e8e8e8;
}

.jl-message.self .jl-message-bubble {
    background: #1890ff;
    color: white;
    border: 1px solid #1890ff;
}

.jl-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.jl-message.self .jl-message-time {
    text-align: right;
}

.jl-chat-input {
    padding: 12px 16px;
    border-top: 1px solid #e8e8e8;
    background: white;
}

.jl-chat-input .input-group {
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    overflow: hidden;
}

.jl-chat-input .form-control {
    border: none;
    padding: 8px 16px;
    outline: none;
    box-shadow: none;
}

.jl-chat-input .btn {
    border: none;
    padding: 8px 16px;
    background: #1890ff;
    color: white;
}

/* ========== 搜索样式 ========== */
.jl-search-box {
    padding: 15px 20px;
}

.jl-search-results {
    max-height: 200px;
    overflow-y: auto;
}

.jl-search-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f2f6;
    display: flex;
    align-items: center;
    gap: 12px;
}

.jl-search-item:last-child {
    border-bottom: none;
}

/* ========== 好友请求样式 ========== */
.jl-request-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.jl-request-actions .btn {
    font-size: 0.8rem;
    padding: 4px 12px;
}

/* ========== 动态样式 ========== */
.jl-post-form {
    padding: 15px 20px;
}

/* 发布动态区域 */
.jl-post-publish {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.jl-publish-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.jl-publish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.publish-icon {
    font-size: 18px;
}

.publish-text {
    font-size: 16px;
}

.jl-post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.jl-posts-list {
    /* 让列表参与页面整体滚动，避免内层滚动导致底部空白 */
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
}

.jl-post-item {
    padding: 20px;
    border-bottom: 1px solid #f1f2f6;
}

.jl-post-item:last-child {
    border-bottom: none;
}

.jl-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.jl-post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.jl-post-user {
    flex: 1;
}

.jl-post-username {
    font-weight: 600;
    color: #2f3542;
    margin: 0;
}

.jl-post-time {
    font-size: 0.8rem;
    color: #a4b0be;
    margin: 0;
}

.jl-post-content {
    margin: 10px 0;
    line-height: 1.5;
    color: #2f3542;
}

.jl-post-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #f8f9fa;
}

.jl-post-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #747d8c;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.jl-post-action:hover {
    color: #667eea;
}

.jl-post-action.liked {
    color: #ff4757;
}

/* 动态发布图片预览 */
.post-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.remove-preview-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
}

/* ========== 加载状态 ========== */
.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;
}

/* ========== 动画效果 ========== */
.jl-section {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jl-message {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== 聊天模态框样式 ========== */
.jl-chat-modal {
    border-radius: 12px;
    border: none;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.jl-chat-modal-header {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-bottom: 1px solid #e8e8e8;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
}

.jl-chat-modal-header .jl-chat-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jl-chat-modal-header .jl-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

/* 让模态框头部的在线点显示在头像右下角 */
.jl-chat-modal-header .jl-avatar-wrap { position: relative; }
.jl-chat-modal-header .jl-status-dot { right: -2px; bottom: -2px; }

.jl-chat-modal-header .jl-chat-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}

.jl-chat-modal-header .jl-chat-status {
    font-size: 0.85rem;
    color: #666;
}

.jl-chat-modal-body {
    padding: 0;
    height: 500px;
    overflow: hidden;
    position: relative; /* 让回到底部按钮绝对定位到此容器内 */
}

.jl-chat-modal-body .jl-chat-messages {
    height: 100%;
    padding: 20px;
    overflow-y: auto;
    background: #f8f8f8;
}

/* 回到底部悬浮按钮 */
.jl-scroll-bottom-btn {
    position: absolute;
    right: 16px;
    bottom: 76px; /* 避开底部输入区 */
    padding: 8px 12px;
    border-radius: 16px;
    border: 1px solid rgba(24,144,255,0.25);
    background: #1890ff;
    color: #fff;
    font-size: 12px;
    box-shadow: 0 6px 18px rgba(24,144,255,0.35);
    transition: transform .15s ease, opacity .15s ease;
}

.jl-scroll-bottom-btn:hover {
    transform: translateY(-1px);
}

.jl-chat-modal-footer {
    border-top: 1px solid #e8e8e8;
    background: white;
    padding: 16px 20px;
    border-radius: 0 0 12px 12px;
}

.jl-chat-modal-footer .input-group {
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    overflow: hidden;
}

.jl-chat-modal-footer .form-control {
    border: none;
    padding: 10px 16px;
    outline: none;
    box-shadow: none;
}

.jl-chat-modal-footer .btn {
    border: none;
    padding: 10px 20px;
    background: #1890ff;
    color: white;
}

/* 模态框响应式 */
@media (max-width: 767px) {
    .jl-chat-modal .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .jl-chat-modal-body {
        height: 400px;
    }
}

/* ========== 发布动态模态框样式 ========== */
.jl-publish-modal {
    border-radius: 15px;
    border: none;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.jl-publish-modal .modal-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-bottom: 1px solid #e3e6f0;
    border-radius: 15px 15px 0 0;
    padding: 15px 20px;
    flex-shrink: 0;
}

.jl-publish-modal .modal-body {
    padding: 15px 20px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(100vh - 200px);
}

/* 确保发布模态框在桌面端也没有滚动条 */
@media (min-width: 769px) {
    #publishModal .modal-dialog {
        max-width: 600px;
        height: auto;
        max-height: calc(100vh - 60px);
    }

    #publishModal .modal-content {
        height: auto;
        max-height: calc(100vh - 60px);
        display: flex;
        flex-direction: column;
    }

    .jl-publish-modal .modal-body {
        max-height: calc(100vh - 240px);
        overflow-y: auto;
    }
}

/* 模板选择器 */
.jl-template-selector {
    margin-bottom: 15px;
}

.jl-template-selector h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 16px;
}

/* 字体选择器 */
.jl-font-selector {
    margin-bottom: 15px;
}

.jl-font-selector h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 16px;
}

.jl-font-selector .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.jl-font-selector .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 分类标签容器 */
.jl-template-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* 分类按钮样式 */
.jl-category-btn {
    padding: 6px 14px;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    background: white;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.jl-category-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f8f9ff;
}

.jl-category-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.jl-category-btn.active:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
}

.jl-templates-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 50px;
    gap: 8px;
    height: 116px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    scroll-behavior: smooth;
}

.jl-template-item {
    width: 100%;
    height: 50px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.jl-template-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.jl-template-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}


/* 内容输入区 */
.jl-content-input {
    margin-bottom: 15px;
}

.jl-content-input h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 16px;
}

.jl-content-input .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

.jl-content-input .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 预览区域 */
.jl-post-preview h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 16px;
}

.jl-preview-card {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    background: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.jl-template-bg {
    position: relative;
    min-height: 100px;
    display: block;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.jl-post-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1.5;
    color: #2c3e50;
    white-space: pre-wrap;
    word-break: keep-all;
    overflow-wrap: break-word;
    width: 100%;
    max-width: 100%;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}


/* 模板选择器预览样式 - 仅用于模板选择器 */
.jl-template-item.template-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.jl-template-item.template-2 { background: radial-gradient(circle, #A1FFCE 0%, #FAFFD1 100%); }
.jl-template-item.template-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.jl-template-item.template-4 { background: conic-gradient(from 45deg, #43e97b 0deg, #38f9d7 120deg, #43e97b 240deg, #38f9d7 360deg); }
.jl-template-item.template-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.jl-template-item.template-6 { background: radial-gradient(ellipse, #ff9a9e 0%, #fecfef 100%); }
.jl-template-item.template-7 { background: linear-gradient(135deg, #ff8a80 0%, #ffab91 100%); }
.jl-template-item.template-8 { background: conic-gradient(from 0deg, #ff6b6b 0deg, #ffa500 90deg, #ff1744 180deg, #ff6b6b 270deg, #ffa500 360deg); }
.jl-template-item.template-9 { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
.jl-template-item.template-10 { background: radial-gradient(circle, #5EFCE8 0%, #736EFE 100%); }
.jl-template-item.template-11 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.jl-template-item.template-12 { background: conic-gradient(from 90deg, #667eea 0deg, #764ba2 120deg, #f093fb 240deg, #667eea 360deg); }
.jl-template-item.template-13 { background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #95a5a6 100%); }
.jl-template-item.template-14 { background: radial-gradient(ellipse, #3498db 0%, #2c3e50 100%); }
.jl-template-item.template-15 { background: conic-gradient(from 0deg, #34495e 0deg, #7f8c8d 90deg, #bdc3c7 180deg, #34495e 270deg, #7f8c8d 360deg); }

/* 新增模板选择器样式 */
.jl-template-item.template-fresh-5 { background: linear-gradient(to right, #98FF98, #7CFC00); }
.jl-template-item.template-dreamy-5 { background: radial-gradient(circle, #FF69B4, #8A2BE2, #1E90FF); }
.jl-template-item.template-vibrant-1 { background: linear-gradient(45deg, #FF8C00, #8A2BE2); }
.jl-template-item.template-vibrant-2 { background: linear-gradient(to right, #FAD961, #F76B1C); }
.jl-template-item.template-vibrant-3 { background: linear-gradient(135deg, #00BFFF, #FF00FF); }
.jl-template-item.template-elegant-1 { background: linear-gradient(to bottom, #000080, #40E0D0); }
.jl-template-item.template-elegant-2 { background: linear-gradient(120deg, #4A4A4A, #F0E68C); }
.jl-template-item.template-elegant-3 { background: linear-gradient(to top, #607D8B, #B0BEC5); }

/* 评论模态框样式 */
.jl-comments-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.jl-comment-item {
    display: flex;
    gap: 12px;
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
}

.jl-comment-item:last-child {
    border-bottom: none;
}

.jl-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.jl-comment-content {
    flex: 1;
}

.jl-comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.jl-comment-user {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.jl-comment-time {
    font-size: 12px;
    color: #6c757d;
}

.jl-comment-text {
    color: #495057;
    line-height: 1.5;
    font-size: 14px;
}

/* 新的动态卡片样式 */
.jl-post-card {
    background: white;
    border-radius: 15px;
    margin-bottom: 0; /* 使用 grid gap 控制间距，避免底部出现额外空白 */
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jl-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.jl-post-card-header {
    padding: 20px 20px 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.jl-post-card-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.jl-post-card-user {
    flex: 1;
}

.jl-post-card-username {
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 2px 0;
    font-size: 16px;
}

.jl-post-card-time {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
}

.jl-post-card-template {
    margin: 15px 20px;
    border-radius: 12px;
    overflow: hidden;
}

.jl-post-card-actions {
    padding: 15px 20px 20px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-top: 1px solid #f1f3f4;
    margin-top: 15px;
}

.jl-post-card-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6c757d;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 5px;
    border-radius: 5px;
}

.jl-post-card-action:hover {
    color: #495057;
    background: #f8f9fa;
}

.jl-post-card-action.liked {
    color: #dc3545;
}

.jl-post-card-action.liked:hover {
    color: #c82333;
}

/* 响应式调整 */
@media (max-width: 768px) {
    /* 发布模态框手机端适配 - 改为合理尺寸，不占满屏幕 */
    #publishModal .modal-dialog {
        margin: 20px 15px;
        max-width: calc(100vw - 30px);
        height: auto;
        max-height: calc(100vh - 40px);
    }

    #publishModal .modal-content {
        height: auto;
        max-height: calc(100vh - 40px);
        display: flex;
        flex-direction: column;
    }

    .jl-publish-modal .modal-header {
        padding: 12px 15px;
        flex-shrink: 0;
    }

    .jl-publish-modal .modal-body {
        padding: 10px 15px;
        flex: 1;
        overflow-y: auto;
        max-height: calc(100vh - 180px);
    }

    .jl-publish-modal .modal-footer {
        padding: 12px 15px;
        flex-shrink: 0;
    }

    /* 分类按钮手机端优化 */
    .jl-template-categories {
        gap: 5px;
        margin-bottom: 8px;
    }

    .jl-category-btn {
        padding: 4px 8px;
        font-size: 11px;
        flex-shrink: 0;
    }

    /* 模板网格手机端优化 */
    .jl-templates-grid {
        grid-template-columns: repeat(5, 1fr);
        grid-auto-rows: 35px;
        gap: 6px;
        height: 82px;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 6px;
        scroll-behavior: smooth;
    }

    .jl-template-item {
        height: 35px;
    }

    /* 内容输入区域优化 */
    .jl-content-input {
        margin-bottom: 10px;
    }

    .jl-content-input .form-control {
        padding: 10px;
        font-size: 13px;
        min-height: 60px;
    }

    /* 预览区域优化 */
    .jl-template-bg {
        min-height: 80px;
        padding: 10px;
    }

    .jl-post-content {
        font-size: 12px;
        padding: 8px 12px;
    }

    .jl-post-card-header {
        padding: 15px 15px 0 15px;
    }

    .jl-post-card-template {
        margin: 12px 15px;
    }

    .jl-post-card-actions {
        padding: 12px 15px 15px 15px;
    }
}

/* ========== Posts 列表与模板背景（高雅简洁版增强） ========== */
.jl-posts-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: calc(100vh - 260px); /* 首屏尽量拉满 */
}

@media (min-width: 1200px) {
    /* 如果容器足够宽，可以两列展示，提高信息密度 */
    .jl-posts-list { grid-template-columns: 1fr 1fr; }
}

/* 背景模板与内容文本（去气泡） */
.jl-template-bg {
    position: relative;
    border-radius: 12px;
    min-height: clamp(120px, 28vw, 180px);
    display: block;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.jl-post-content {
    width: 100%;
    max-width: 100%;
    color: var(--jl-post-text, #1D2129);
    text-align: left;
    font-weight: 500;
    line-height: 1.6;
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    text-shadow: var(--jl-post-text-shadow, none);
    box-sizing: border-box;
    hyphens: auto;
}

.jl-post-content.size-xl { font-size: clamp(20px, 4.2vw, 26px); }
.jl-post-content.size-lg { font-size: clamp(18px, 3.6vw, 22px); }
.jl-post-content.size-md { font-size: clamp(16px, 3.2vw, 20px); }
.jl-post-content.size-sm { font-size: clamp(14px, 3.0vw, 18px); }
.jl-post-content.align-left { text-align: left; }

/* 渐变模板（含文本对比自适应变量） - 与上面保持一致，15个模板 */

/* 清新系列 (fresh) - 4个 */
.jl-template-bg.template-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }
.jl-template-bg.template-2 { background: radial-gradient(circle, #A1FFCE 0%, #FAFFD1 100%); --jl-post-text:#1D2129; }
.jl-template-bg.template-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }
.jl-template-bg.template-4 { background: conic-gradient(from 45deg, #43e97b 0deg, #38f9d7 120deg, #43e97b 240deg, #38f9d7 360deg); --jl-post-text:#0b1220; }

/* 暖色系列 (warm) - 4个 */
.jl-template-bg.template-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); --jl-post-text:#1D2129; }
.jl-template-bg.template-6 { background: radial-gradient(ellipse, #ff9a9e 0%, #fecfef 100%); --jl-post-text:#1D2129; }
.jl-template-bg.template-7 { background: linear-gradient(135deg, #ff8a80 0%, #ffab91 100%); --jl-post-text:#1D2129; }
.jl-template-bg.template-8 { background: conic-gradient(from 0deg, #ff6b6b 0deg, #ffa500 90deg, #ff1744 180deg, #ff6b6b 270deg, #ffa500 360deg); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }

/* 梦幻系列 (dreamy) - 4个 */
.jl-template-bg.template-9 { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); --jl-post-text:#1D2129; }
.jl-template-bg.template-10{ background: radial-gradient(circle, #5EFCE8 0%, #736EFE 100%); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }
.jl-template-bg.template-11{ background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }
.jl-template-bg.template-12{ background: conic-gradient(from 90deg, #667eea 0deg, #764ba2 120deg, #f093fb 240deg, #667eea 360deg); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }

/* 商务系列 (business) - 3个 */
.jl-template-bg.template-13{ background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #95a5a6 100%); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }
.jl-template-bg.template-14{ background: radial-gradient(ellipse, #3498db 0%, #2c3e50 100%); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }
.jl-template-bg.template-15{ background: conic-gradient(from 0deg, #34495e 0deg, #7f8c8d 90deg, #bdc3c7 180deg, #34495e 270deg, #7f8c8d 360deg); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }

/* 强制预览与卡片去除"白色气泡"，使用模板文本对比色 */
.jl-template-bg .jl-post-content {
    background: transparent !important;
    padding: 15px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--jl-post-text, #1D2129) !important;
    text-align: left !important;
    width: 100% !important;
    max-width: 100% !important;
    word-break: break-word !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}

/* 列表底部安全区与贴底（若存在此列表容器） */
.jl-posts-list {
    padding-bottom: max(4px, env(safe-area-inset-bottom));
}

/* 统一消息/好友列表的列表间距与贴底体验 */
#messagesList, #friendsList {
    display: grid;
    gap: 12px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
}

/* 列表骨架与重试样式 */
.jl-skeleton-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
}
.jl-skeleton-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
    background-size: 400% 100%;
    animation: jl-shimmer 1.2s infinite;
}
.jl-skeleton-lines .line { height: 10px; margin: 6px 0; border-radius: 6px;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
    background-size: 400% 100%; animation: jl-shimmer 1.2s infinite; }
.jl-skeleton-lines .w-70 { width: 70%; }
.jl-skeleton-lines .w-40 { width: 40%; }

@keyframes jl-shimmer { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }

.jl-list-retry { display: flex; align-items: center; gap: 8px; color: #6b7280; }

/* ========== 新增渐变模板 ========== */

/* 炫彩系列 (vibrant) */
.template-vibrant-1, .jl-template-bg.template-vibrant-1 { background: linear-gradient(45deg, #FF8C00, #8A2BE2); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }
.template-vibrant-2, .jl-template-bg.template-vibrant-2 { background: linear-gradient(to right, #FAD961, #F76B1C); --jl-post-text:#1D2129; }
.template-vibrant-3, .jl-template-bg.template-vibrant-3 { background: linear-gradient(135deg, #00BFFF, #FF00FF); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }

/* 雅致系列 (elegant) */
.template-elegant-1, .jl-template-bg.template-elegant-1 { background: linear-gradient(to bottom, #000080, #40E0D0); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }
.template-elegant-2, .jl-template-bg.template-elegant-2 { background: linear-gradient(120deg, #4A4A4A, #F0E68C); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }
.template-elegant-3, .jl-template-bg.template-elegant-3 { background: linear-gradient(to top, #607D8B, #B0BEC5); --jl-post-text:#1D2129; }

/* 分类补充 */
.template-fresh-5, .jl-template-bg.template-fresh-5 { background: linear-gradient(to right, #98FF98, #7CFC00); --jl-post-text:#1D2129; }
.template-dreamy-5, .jl-template-bg.template-dreamy-5 { background: radial-gradient(circle, #FF69B4, #8A2BE2, #1E90FF); --jl-post-text:#fff; --jl-post-text-shadow:0 1px 2px rgba(0,0,0,.25); }

/* ========== 新增字体样式 ========== */
.font-default {
    font-family: var(--bs-body-font-family), sans-serif;
}
.font-kuai-le {
    font-family: 'ZCOOL KuaiLe', cursive;
    word-break: break-all;
    line-height: 1.7;
}
.font-xiao-wei {
    font-family: 'ZCOOL XiaoWei', serif;
    word-break: break-all;
    line-height: 1.8;
}
.font-long-cang {
    font-family: 'Long Cang', cursive;
    word-break: break-all;
    line-height: 1.8;
}
.font-ma-shan-zheng {
    font-family: 'Ma Shan Zheng', cursive;
    word-break: break-all;
    line-height: 1.8;
}
.font-huang-you {
    font-family: 'Liu Jian Mao Cao', cursive;
    word-break: break-all;
    line-height: 1.7;
}
.font-zhi-mang-xing {
    font-family: 'Zhi Mang Xing', cursive;
    word-break: break-all;
    line-height: 1.9;
}
.font-lubrifont {
    font-family: 'Noto Sans SC', sans-serif;
    word-break: break-all;
    line-height: 1.6;
}
.font-noto-sans {
    font-family: 'Noto Sans SC', sans-serif;
    word-break: break-word;
    line-height: 1.6;
}
.font-noto-serif {
    font-family: 'Noto Serif SC', serif;
    word-break: break-word;
    line-height: 1.7;
}

/* ========== 预览区域文字换行优化 ========== */
/* 确保预览区域的文字像输入框一样自然换行 */
#previewContent {
    word-break: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: pre-wrap !important;
    hyphens: none !important;
    text-align: justify !important;
    text-justify: inter-ideograph !important;
}

/* 各种字体在预览区域的特殊优化 */
#previewContent.font-kuai-le,
#previewContent.font-xiao-wei,
#previewContent.font-long-cang,
#previewContent.font-ma-shan-zheng,
#previewContent.font-huang-you,
#previewContent.font-zhi-mang-xing {
    word-break: normal !important;
    line-height: 1.8 !important;
}

#previewContent.font-lubrifont,
#previewContent.font-noto-sans,
#previewContent.font-noto-serif {
    word-break: normal !important;
    line-height: 1.6 !important;
}

/* 动态操作菜单样式 */
.jl-post-menu-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.2s ease;
    user-select: none;
}

.jl-post-menu-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
    transform: scale(1.1);
}

.jl-post-card-header {
    position: relative;
}

.jl-post-menu {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    overflow: hidden;
    animation: fadeInScale 0.2s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.jl-post-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.jl-post-menu-item:last-child {
    border-bottom: none;
}

.jl-post-menu-item:hover {
    background-color: #f8f9fa;
}

.jl-post-menu-item.jl-admin-option {
    color: #dc3545;
}

.jl-post-menu-item.jl-admin-option:hover {
    background-color: #fff5f5;
}

/* 加黑模态框自定义样式 */
#blacklistModal .modal-title {
    color: #dc3545;
    font-weight: 600;
}

#blacklistModal .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

#blacklistModal .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

#blacklistModal textarea {
    resize: vertical;
    min-height: 80px;
}

/* 所见即所得输入区域样式 */
.jl-wysiwyg-container {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 120px;
}

.jl-wysiwyg-container .jl-template-bg {
    position: relative;
    min-height: 120px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jl-template-textarea {
    width: 100%;
    height: 100%;
    min-height: 80px;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    resize: none;
    color: var(--jl-post-text, #fff) !important; /* 使用CSS变量控制颜色 */
    text-shadow: var(--jl-post-text-shadow, none); /* 添加文字阴影 */
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-align: inherit;
    line-height: inherit;
    padding: 0;
    margin: 0;
    box-shadow: none !important;
}

.jl-template-textarea::placeholder {
    color: var(--jl-post-text, #fff);
    opacity: 0.6;
    font-size: 14px !important;
    font-weight: 400 !important;
    text-align: center !important;
}

.jl-template-textarea:focus {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 为输入区域添加默认样式 */
.jl-wysiwyg-container .jl-template-bg:not([class*="template-"]) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 确保输入框文字样式跟随模板 */
.jl-template-textarea.font-default { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.jl-template-textarea.font-kuai-le { font-family: "ZCOOL KuaiLe", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.jl-template-textarea.font-xiao-wei { font-family: "ZCOOL XiaoWei", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.jl-template-textarea.font-long-cang { font-family: "Long Cang", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.jl-template-textarea.font-ma-shan-zheng { font-family: "Ma Shan Zheng", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.jl-template-textarea.font-huang-you { font-family: "ZCOOL QingKe HuangYou", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.jl-template-textarea.font-zhi-mang-xing { font-family: "Zhi Mang Xing", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.jl-template-textarea.font-lubrifont { font-family: "Lubrifont", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.jl-template-textarea.font-noto-sans { font-family: "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.jl-template-textarea.font-noto-serif { font-family: "Noto Serif CJK SC", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* 输入区域的字体大小调整 */
.jl-template-textarea.size-xl { font-size: 24px; font-weight: 600; }
.jl-template-textarea.size-lg { font-size: 20px; font-weight: 500; }
.jl-template-textarea.size-md { font-size: 16px; font-weight: 400; }
.jl-template-textarea.size-sm { font-size: 14px; font-weight: 400; }

/* 确保placeholder在所有尺寸下都保持合适大小 */
.jl-template-textarea.size-xl::placeholder { font-size: 16px !important; }
.jl-template-textarea.size-lg::placeholder { font-size: 14px !important; }
.jl-template-textarea.size-md::placeholder { font-size: 14px !important; }
.jl-template-textarea.size-sm::placeholder { font-size: 12px !important; }

/* 输入区域的对齐方式 */
.jl-template-textarea.align-left { text-align: left; }
.jl-template-textarea.align-left::placeholder { text-align: left !important; }
.jl-template-textarea { text-align: center; } /* 默认居中 */




