@charset "UTF-8";
/* ============================================================
   front_article.css - 前台文章模块专用样式
   ============================================================ */

/* ============================================================
   文章列表页
   ============================================================ */
.article-page {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ===== 左侧边栏 ===== */
.article-sidebar {
    flex: 0 0 260px;
    min-width: 0;
}

.sidebar-block {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
}
.sidebar-block:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

/* ===== 分类树 ===== */
.category-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-tree .category-item {
    margin: 2px 0;
}
.category-tree .category-item a {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}
.category-tree .category-item a:hover {
    background: #e9ecef;
    color: #1a73e8;
}
.category-tree .category-item.active > a {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 500;
}
.category-tree .category-item .toggle-icon {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    transition: transform 0.3s;
}
.category-tree .category-item.open > a .toggle-icon {
    transform: rotate(180deg);
}
.category-tree .sub-category {
    list-style: none;
    padding: 0 0 0 12px;
    margin: 0;
    display: none;
}
.category-tree .sub-category.open {
    display: block;
}
.category-tree .level-1 a {
    padding-left: 16px;
    font-size: 13px;
}
.category-tree .level-2 a {
    padding-left: 28px;
    font-size: 13px;
}
.category-tree .level-3 a {
    padding-left: 40px;
    font-size: 12px;
}

/* ============================================================
   侧边栏最新评论（独立类名 sc-*，不与 style.css 冲突）
   ============================================================ */
.sidebar-comments .recent-comments {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-comments .recent-comments .sc-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    background: transparent;
    border-radius: 0;
    display: block;
}
.sidebar-comments .recent-comments .sc-item:last-child {
    border-bottom: none;
}

/* 第一行：会员名 + 评论内容 */
.sidebar-comments .sc-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.sidebar-comments .sc-author {
    font-weight: 600;
    font-size: 13px;
    color: #1a73e8;
    flex-shrink: 0;
}
.sidebar-comments .sc-text {
    font-size: 13px;
    color: #555;
    word-break: break-all;
    line-height: 1.4;
}

/* 第二行：评论于 + 文章标题 + 日期 */
.sidebar-comments .sc-article {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 1px;
    font-size: 12px;
    color: #999;
}
.sidebar-comments .sc-on {
    color: #bbb;
    flex-shrink: 0;
}
.sidebar-comments .sc-article a {
    color: #1a73e8;
    font-weight: 500;
    text-decoration: none;
}
.sidebar-comments .sc-article a:hover {
    text-decoration: underline;
}
.sidebar-comments .sc-target {
    color: #ccc;
}
.sidebar-comments .sc-time {
    color: #bbb;
    margin-left: auto;
    flex-shrink: 0;
    font-size: 11px;
}

/* ===== 右侧文章列表 ===== */
.article-main {
    flex: 1;
    min-width: 0;
}

.article-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
}
.article-list-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}
.article-count {
    font-size: 14px;
    color: #999;
}

/* ===== 子分类导航 ===== */
.sub-category-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 8px 14px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 14px;
    border: 1px solid #e9ecef;
}
.sub-category-label {
    font-size: 13px;
    font-weight: 600;
    color: #888;
}
.sub-category-tab {
    padding: 2px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
    font-size: 13px;
    transition: all 0.2s;
}
.sub-category-tab:hover {
    background: #f0f0f0;
    text-decoration: none;
}
.sub-category-tab.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

/* ===== 文章列表项 ===== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.article-item {
    display: flex;
    gap: 16px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: background 0.3s, transform 0.2s;
}
.article-item:hover {
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.article-thumb {
    flex-shrink: 0;
    width: 180px;
    height: 120px;
    overflow: hidden;
    border-radius: 6px;
    background: #e9ecef;
}
.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===== 文章列表标题（左对齐） ===== */
.article-list-item-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 6px 0;
    line-height: 1.4;
}
.article-list-item-title a {
    color: #1a1a2e;
    transition: color 0.2s;
}
.article-list-item-title a:hover {
    color: #1a73e8;
    text-decoration: none;
}

.article-summary {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 文章列表元信息（左对齐） ===== */
.article-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: #bbb;
}
.article-list-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.pagination a {
    padding: 6px 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all 0.25s;
}
.pagination a:hover {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}
.pagination a.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

/* ===== 空状态 ===== */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}
.no-data .icon {
    font-size: 48px;
    margin-bottom: 6px;
}
.no-data p {
    margin: 0;
}

/* ============================================================
   文章详情页样式（独立的，不影响列表页）
   ============================================================ */

/* ===== 面包屑导航 ===== */
.breadcrumb-nav {
    padding: 10px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
}
.breadcrumb-nav .breadcrumb-label {
    color: #666;
}
.breadcrumb-nav a {
    color: #1a73e8;
    text-decoration: none;
}
.breadcrumb-nav a:hover {
    text-decoration: underline;
}
.breadcrumb-nav .breadcrumb-sep {
    margin: 0 6px;
    color: #ccc;
}

/* ===== 文章详情容器 ===== */
.article-detail-container {
    padding: 20px 24px 28px 24px;
}

/* ===== 文章详情标题（居中） ===== */
.article-detail-container .article-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

/* ===== 文章详情元信息（居中） ===== */
.article-detail-container .article-meta {
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 13px;
    color: #bbb;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 24px;
}
.article-detail-container .article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ===== 文章正文 ===== */
.article-detail-container .article-body {
    font-size: 16px;
    line-height: 1.9;
    color: #2d2d3f;
    margin-bottom: 28px;
}
.article-detail-container .article-body p {
    margin-bottom: 14px;
}
.article-detail-container .article-body img {
    max-width: 80%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 16px auto;
}
.article-detail-container .article-body a {
    color: #1a73e8;
    text-decoration: underline;
}
.article-detail-container .article-body a:hover {
    color: #1557b0;
}
.article-detail-container .article-body blockquote {
    border-left: 4px solid #1a73e8;
    padding-left: 16px;
    margin-left: 0;
    color: #57606a;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
}
.article-detail-container .article-body ul,
.article-detail-container .article-body ol {
    padding-left: 24px;
}
.article-detail-container .article-body h1 { font-size: 26px; font-weight: 700; margin: 20px 0 12px; }
.article-detail-container .article-body h2 { font-size: 22px; font-weight: 700; margin: 18px 0 10px; }
.article-detail-container .article-body h3 { font-size: 19px; font-weight: 600; margin: 16px 0 8px; }
.article-detail-container .article-body h4 { font-size: 16px; font-weight: 600; margin: 14px 0 6px; }
.article-detail-container .article-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
}
.article-detail-container .article-body table th,
.article-detail-container .article-body table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}
.article-detail-container .article-body table th {
    background: #f8f9fa;
    font-weight: 600;
}
.article-detail-container .article-body pre {
    background: #f6f8fa;
    padding: 14px 18px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid #e9ecef;
}
.article-detail-container .article-body code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #d63384;
}

/* ===== 隐藏内容占位符（正文中） ===== */
.hide-placeholder {
    background: #fff3e0;
    padding: 10px 16px;
    border-radius: 6px;
    border-left: 4px solid #ff9800;
    color: #e65100;
    font-size: 14px;
    margin: 16px 0;
    text-align: center;
}

/* ===== 隐藏内容（已解锁） ===== */
.hide-content-revealed {
    background: #e8f5e9;
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
    margin: 16px 0;
}
.hide-content-revealed .hide-label {
    font-weight: 700;
    color: #2e7d32;
    font-size: 15px;
    margin-bottom: 8px;
}
.hide-content-revealed .hide-body {
    font-size: 15px;
    line-height: 1.8;
    color: #2d2d3f;
}

/* ===== 上一篇/下一篇 ===== */
.article-pagination {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid #f0f2f5;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 24px;
}
.article-pagination .prev-article,
.article-pagination .next-article {
    display: flex;
    flex-direction: column;
    max-width: 45%;
}
.article-pagination .prev-article {
    align-items: flex-start;
}
.article-pagination .next-article {
    align-items: flex-end;
}
.article-pagination .nav-label {
    font-size: 12px;
    color: #bbb;
    margin-bottom: 2px;
}
.article-pagination a {
    color: #1a73e8;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.article-pagination a:hover {
    text-decoration: underline;
}
.article-pagination .nav-empty {
    font-size: 14px;
    color: #ccc;
}

/* ===== 相关推荐 ===== */
.related-articles {
    margin-bottom: 28px;
}
.related-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f2f5;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.related-item {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: transform 0.3s, box-shadow 0.3s;
}
.related-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.related-item a {
    display: block;
    color: #333;
    text-decoration: none;
}
.related-thumb {
    width: 100%;
    height: 110px;
    overflow: hidden;
    background: #e9ecef;
}
.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.related-title-text {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px 4px 12px;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}
.related-date {
    display: block;
    padding: 0 12px 10px 12px;
    font-size: 12px;
    color: #bbb;
}

/* ============================================================
   文章详情页评论区
   ============================================================ */
.comments-section {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #f0f2f5;
}
.comments-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 14px 0;
}
.comment-form {
    margin-bottom: 20px;
}
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s;
}
.comment-form textarea:focus {
    border-color: #1a73e8;
    outline: none;
}
.comment-form .btn {
    margin-top: 8px;
}
.comment-login-tip {
    color: #888;
    font-size: 14px;
    padding: 8px 0;
}
.comment-login-tip a {
    color: #1a73e8;
}
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.comments-list .comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}
.comments-list .comment-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #1a73e8;
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
    text-transform: uppercase;
}
.comments-list .comment-body {
    flex: 1;
    min-width: 0;
}
.comments-list .comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}
.comments-list .comment-author strong {
    font-size: 14px;
    color: #1a1a2e;
}
.comments-list .comment-time {
    font-size: 12px;
    color: #bbb;
}
.comments-list .comment-content {
    font-size: 14px;
    color: #3d3d4f;
    line-height: 1.7;
    word-wrap: break-word;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 992px) {
    .article-sidebar {
        flex: 0 0 220px;
    }
    .article-thumb {
        width: 150px;
        height: 100px;
    }
    .article-detail-container .article-body img {
        max-width: 90%;
    }
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .article-page {
        flex-direction: column;
    }
    
    /* 移动端隐藏评论区块 */
    .sidebar-comments {
        display: none !important;
    }
    
    .article-sidebar {
        flex: none;
        width: 100%;
    }
    .article-sidebar .sidebar-block {
        margin-bottom: 12px;
    }
    
    .article-item {
        flex-direction: column;
        gap: 10px;
        padding: 12px 14px;
    }
    .article-thumb {
        width: 100%;
        height: 160px;
    }
    .article-list-item-title {
        font-size: 16px;
    }
    .article-summary {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    .article-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .sub-category-nav {
        padding: 6px 10px;
        gap: 4px 8px;
    }
    .sub-category-tab {
        font-size: 12px;
        padding: 2px 8px;
    }
    
    /* 文章详情页移动端 */
    .article-detail-container {
        padding: 14px 14px 20px 14px;
    }
    .article-detail-container .article-title {
        font-size: 20px;
    }
    .article-detail-container .article-meta {
        font-size: 12px;
        gap: 8px 14px;
    }
    .article-detail-container .article-body {
        font-size: 15px;
    }
    .article-detail-container .article-body img {
        max-width: 100%;
    }
    .article-pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .article-pagination .prev-article,
    .article-pagination .next-article {
        max-width: 100%;
        align-items: flex-start;
    }
    .article-pagination .next-article {
        align-items: flex-start;
    }
    .related-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .related-thumb {
        height: 90px;
    }
    .comment-item {
        padding: 10px 12px;
    }
    .breadcrumb-nav {
        font-size: 12px;
        padding: 8px 12px;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .article-sidebar .sidebar-block {
        padding: 10px 12px;
    }
    .article-list-item-title {
        font-size: 15px;
    }
    .article-thumb {
        height: 130px;
    }
    .article-list-meta {
        font-size: 12px;
        gap: 10px;
    }
    .category-tree .category-item a {
        font-size: 13px;
        padding: 4px 6px;
    }
    
    .article-detail-container .article-title {
        font-size: 18px;
    }
    .article-detail-container .article-meta {
        font-size: 11px;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    .article-detail-container .article-body {
        font-size: 14px;
    }
    .related-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .related-thumb {
        height: 75px;
    }
    .related-title-text {
        font-size: 12px;
        min-height: 34px;
        padding: 6px 8px 2px 8px;
    }
    .related-date {
        font-size: 11px;
        padding: 0 8px 6px 8px;
    }
    .comment-item {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }
    .comment-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    .sub-category-nav {
        flex-direction: column;
        align-items: flex-start;
    }
}