/* ==================================================
   YJ 独立分类展示系统
   不覆盖 MirageV 原有 CSS
================================================== */

/* ---------- 分类 Banner ---------- */

.yj-cat-banner {
    width: 100%;
    min-height: 250px;
    background-color: #182536;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}

.yj-cat-banner-overlay {
    min-height: 250px;
    display: flex;
    align-items: center;
    background: linear-gradient(
        90deg,
        rgba(8, 18, 32, 0.86),
        rgba(8, 18, 32, 0.48)
    );
}

.yj-cat-banner-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;
    box-sizing: border-box;
}

.yj-cat-banner-inner h1 {
    margin: 0 0 16px;
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
}

.yj-cat-banner-description {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.9;
}

.yj-cat-banner-description p {
    margin: 0 0 8px;
}

/* ---------- 分类导航 ---------- */

.yj-cat-nav {
    width: 100%;
    margin: 24px 0;
    padding: 16px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    box-sizing: border-box;
}

.yj-cat-nav-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.yj-cat-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 17px;
    color: #444;
    background: #f5f6f8;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
    transition: all .2s ease;
}

.yj-cat-nav-item:hover,
.yj-cat-nav-item.is-current {
    color: #fff;
    background: #2563eb;
    text-decoration: none;
}

/* ---------- 模块标题 ---------- */

.yj-cat-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9e9e9;
}

.yj-cat-section-heading h2 {
    margin: 0;
    color: #222;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.5;
}

/* ---------- 精选文章 ---------- */

.yj-cat-featured {
    margin: 24px 0 36px;
}

.yj-cat-featured-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.yj-cat-featured-grid > * {
    min-width: 0;
}

/* ---------- 一级分类文章卡片 ---------- */

.yj-cat-main-posts {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.yj-cat-main-posts > .col-num-4 {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    box-sizing: border-box;
}

/* ---------- 二级分类卡片列数 ---------- */

.yj-cat-cards {
    display: grid !important;
    gap: 20px;
}

.yj-cat-cards.yj-cat-columns-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.yj-cat-cards.yj-cat-columns-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.yj-cat-cards.yj-cat-columns-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.yj-cat-cards.yj-cat-columns-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.yj-cat-cards > div[class*="col-num-"] {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    box-sizing: border-box;
}

/* =========================================
   YJ 二级分类卡片宽度修复
   只作用于 cards 模式，不影响列表模式
========================================= */

.yj-cat-cards > div[class*="col-num-"] > .card-item {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin: 0 !important;
    box-sizing: border-box;
}

/* ---------- 文章列表 ---------- */

.yj-cat-list {
    width: 100%;
    display: block;
}

.yj-cat-list > * {
    max-width: 100%;
    box-sizing: border-box;
}

/* ---------- 文章卡片统一处理 ---------- */

.yj-cat-posts .card-item,
.yj-cat-featured-grid .card-item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ---------- 分页 ---------- */

.yj-cat-pagination {
    width: 100%;
    margin: 35px 0;
    text-align: center;
}

.yj-cat-pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.yj-cat-pagination li {
    margin: 0;
    padding: 0;
}

.yj-cat-pagination a,
.yj-cat-pagination span {
    display: inline-flex;
    min-width: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    color: #444;
    background: #f4f5f7;
    border-radius: 6px;
    text-decoration: none;
    box-sizing: border-box;
}

.yj-cat-pagination .current,
.yj-cat-pagination a:hover {
    color: #fff;
    background: #2563eb;
}

/* ---------- 空分类提示 ---------- */

.yj-cat-empty {
    margin: 25px 0;
    padding: 35px 20px;
    color: #777;
    background: #f7f8fa;
    border-radius: 8px;
    text-align: center;
}

/* ---------- 平板适配 ---------- */

@media (max-width: 1024px) {
    .yj-cat-featured-grid,
    .yj-cat-main-posts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .yj-cat-cards.yj-cat-columns-3,
    .yj-cat-cards.yj-cat-columns-4,
    .yj-cat-cards.yj-cat-columns-5,
    .yj-cat-cards.yj-cat-columns-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .yj-cat-banner-inner h1 {
        font-size: 30px;
    }
}

/* ---------- 手机适配 ---------- */

@media (max-width: 600px) {
    .yj-cat-banner,
    .yj-cat-banner-overlay {
        min-height: 190px;
    }

    .yj-cat-banner-inner {
        padding: 35px 18px;
    }

    .yj-cat-banner-inner h1 {
        font-size: 25px;
    }

    .yj-cat-banner-description {
        font-size: 14px;
    }

    .yj-cat-nav {
        padding: 12px;
        margin: 18px 0;
    }

    .yj-cat-nav-inner {
        gap: 8px;
    }

    .yj-cat-nav-item {
        padding: 8px 12px;
        font-size: 13px;
    }

    .yj-cat-section-heading {
        margin: 24px 0 15px;
    }

    .yj-cat-section-heading h2 {
        font-size: 19px;
    }

    .yj-cat-featured-grid,
    .yj-cat-main-posts,
    .yj-cat-cards.yj-cat-columns-3,
    .yj-cat-cards.yj-cat-columns-4,
    .yj-cat-cards.yj-cat-columns-5,
    .yj-cat-cards.yj-cat-columns-6 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 15px;
    }
}

/* =========================================
   YJ 一级分类文章卡片通用适配
   全部一级分类共用，不再单独限制 category-3
========================================= */

.yj-cat-main-posts > .col-num-4 > .card-item {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin: 0 !important;
    box-sizing: border-box;
}

