/**
 * 分类详情页基础样式
 * 所有分类详情页共用的通用样式
 *
 * @package GoodBase
 * @since 1.0.0
 */

/* 分类详情页容器 */
.category-detail-page {
    padding: 12px 0;
}

.category-detail-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.category-detail-main {
    flex: 1;
    min-width: 0;
}

/* 分类头部 */
.category-detail-header {
    margin-bottom: 12px;
}

.category-banner {
    position: relative;
    width: 100%;
    height: 80px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.category-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.category-header-simple {
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.category-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.category-header-simple .category-title {
    color: #333;
    text-shadow: none;
}

/* 面包屑导航 */
.category-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.category-breadcrumb a {
    color: #666;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 500;
}

.category-breadcrumb a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: linear-gradient(90deg, #ff6600 0%, #ff8533 100%);
    transform: scaleX(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-breadcrumb a:hover {
    color: #ff6600;
    background: rgba(255, 102, 0, 0.08);
}

.category-breadcrumb a:hover::before {
    transform: scaleX(1);
}

.category-breadcrumb .separator {
    color: #cbd5e1;
    margin: 0 0.25rem;
    font-weight: 300;
}

.category-breadcrumb .current {
    color: #1e293b;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
}

/* 章节标题 */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: #ff6600;
    font-size: 1.25rem;
}

/* 分类描述（包含标签信息，合并到一个卡片） */
.category-description-section {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-description {
    font-size: 1rem;
    line-height: 1.8;
    color: #666;
}

.category-description p {
    margin: 0 0 1rem 0;
}

.category-description p:last-child {
    margin-bottom: 0;
}

/* 描述卡片内的标签区域（在同一卡片内，用分隔线区分） */
.category-tags-in-description {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #f0f0f0;
}

.category-tags-in-description .tags-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-tags-in-description .tags-title i {
    color: #ff6600;
    font-size: 1rem;
}

/* 确保标签云在描述卡片内正确显示 */
.category-description-section .category-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* 分类统计 */
.category-stats-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    border-radius: 10px;
    color: #fff;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* 子分类 */
.category-children-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.child-category-item {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.child-category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.child-category-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.child-category-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    border-radius: 10px;
    color: #fff;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.child-category-item:hover .child-category-icon {
    transform: translateY(-2px);
}

.child-category-info {
    flex: 1;
    min-width: 0;
}

.child-category-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    transition: color 0.25s ease;
    line-height: 1.4;
}

.child-category-item:hover .child-category-name {
    color: #ff6600;
}

.child-category-count {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.child-category-count::before {
    content: '📁';
    font-size: 0.875rem;
}

/* 相关标签 */
.category-tags-section {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.category-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.category-tags-cloud .tag-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    text-decoration: none;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.category-tags-cloud .tag-link:hover {
    background: #ff6600;
    border-color: #ff6600;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.category-tags-cloud .tag-link:hover,
.category-tags-cloud .tag-link:hover *,
.category-tags-cloud .tag-link:hover span {
    color: #ffffff;
}

.category-tags-cloud .tag-count {
    color: #64748b;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    background: #f1f5f9;
    border-radius: 10px;
    transition: all 0.25s ease;
    line-height: 1.2;
}

.category-tags-cloud .tag-link:hover .tag-count {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.25);
}

/* 最新文章区域 - 复用分类页的卡片样式 */
.category-posts-section {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 简单列表样式 - 适用于所有分类详情页 */
.category-posts-section .category-posts-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 0 !important;
}

/* 列表项样式 - 带边框的框 */
.category-posts-section .category-post-item-simple {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.875rem 1rem !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.category-posts-section .category-post-item-simple:hover {
    background-color: #fafafa !important;
    border-color: #d1d5db !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* 文章标题链接 */
.category-posts-section .category-post-item-simple .post-title-link {
    flex: 1 !important;
    color: #000000 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    margin-right: 1rem !important;
    transition: color 0.2s ease !important;
}

.category-posts-section .category-post-item-simple .post-title-link:hover {
    color: #ff6600 !important;
}

/* 浏览量 */
.category-posts-section .category-post-item-simple .post-views-count {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    color: #999999 !important;
    font-size: 13px !important;
    white-space: nowrap !important;
}

.category-posts-section .category-post-item-simple .post-views-count i {
    font-size: 12px !important;
    color: #999999 !important;
}

/* 响应式 */
@media (max-width: 768px) {
    .category-posts-section .category-post-item-simple .post-title-link {
        font-size: 13px !important;
    }
    
    .category-posts-section .category-post-item-simple .post-views-count {
        font-size: 12px !important;
    }
}

.view-all-posts {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 2.5rem;
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.btn-view-all::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-view-all:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 102, 0, 0.4);
    background: linear-gradient(135deg, #ff8533 0%, #ff6600 100%);
}

.btn-view-all:hover::before {
    width: 300px;
    height: 300px;
}

.btn-view-all i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.btn-view-all:hover i {
    transform: translateX(4px);
}

.btn-view-all span,
.btn-view-all {
    position: relative;
    z-index: 1;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .category-detail-content {
        flex-direction: column;
    }
    
    .category-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-children-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-posts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .category-banner {
        height: 80px;
    }
    
    .category-title {
        font-size: 2rem;
    }
    
    .category-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .category-children-grid {
        grid-template-columns: 1fr;
    }
}

