/* ========== 动态样式 ========== */
.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-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-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    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-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-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;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.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;
    position: relative;
}

.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;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.jl-user-badge {
    width: 48px;
    height: 14px;
    object-fit: contain;
    vertical-align: middle;
    border-radius: 4px;
    flex-shrink: 0;
}

.jl-post-user-badge {
    width: 50px;
    height: 15px;
}

.jl-comment-user-badge {
    width: 44px;
    height: 13px;
}

.jl-post-card-username-text {
    min-width: 0;
}

.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); /* 首屏尽量拉满 */
    max-height: none;
    overflow: visible;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
}

@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 {
    margin: 10px 0;
    width: 100%;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 18px;
    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-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    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;
}

/* 统一消息/好友列表的列表间距与贴底体验 */
#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-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; } /* 默认居中 */
