/**
 * 资源中心（页面模板 zb-resource-page）前端样式
 * 覆盖：Hero（统计 / 搜索 / 发布入口）、筛选工具栏（类型 / 分类 / 排序）、资源卡片网格、空状态与底部 CTA
 * 变量体系：跟随主题 CSS 变量（var(--ri-*, fallback)；主题为按需裁剪版 Bootstrap）
 * 由 inc/template-assets.php 在资源中心页面条件加载（filemtime 版本号防缓存）
 */

/* ============================================================
 * 基础
 * ============================================================ */
.res-body {
    background-color: #f5f7fc;
    padding: 24px 0 64px;
}

.res-hero {
    position: relative;
    overflow: hidden;
    padding: 54px 0 46px;
    color: #fff;
    background:
        radial-gradient(900px 340px at 18% 0%, rgba(84, 156, 255, .38), transparent 62%),
        radial-gradient(760px 320px at 88% 12%, rgba(247, 195, 46, .16), transparent 60%),
        linear-gradient(135deg, #0b1b3a 0%, #123c7a 56%, #1f6fd0 100%);
}

.res-hero::before,
.res-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.res-hero::before {
    width: 420px;
    height: 420px;
    right: -160px;
    bottom: -260px;
    background: rgba(84, 156, 255, .12);
}

.res-hero::after {
    width: 240px;
    height: 240px;
    left: -90px;
    top: -120px;
    background: rgba(247, 195, 46, .08);
}

.res-hero-inner {
    position: relative;
    z-index: 1;
}

.res-hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .86);
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
}

.res-hero-title {
    margin: 16px 0 10px;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.01em;
    color: #fff;
}

.res-hero-sub {
    max-width: 780px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.8;
    color: rgba(255, 255, 255, .76);
}

.res-hero-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 900px;
    margin: 26px auto 0;
}

.res-search {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.res-search-box {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 4px 6px 4px 18px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(4, 14, 35, .2);
}

.res-search-box > i {
    flex-shrink: 0;
    color: #8a94a6;
    font-size: 14px;
}

.res-search-box input {
    flex: 1;
    min-width: 0;
    padding: 12px 4px;
    font-size: 15px;
    color: #1a2233;
    background: transparent;
    border: 0;
    outline: 0;
}

.res-search-box input::placeholder {
    color: #9aa4b5;
}

.res-search-btn {
    flex-shrink: 0;
    padding: 11px 24px;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 24px;
    color: #191a1f;
    white-space: nowrap;
    cursor: pointer;
    background-color: #f7c32e;
    border: 0;
    border-radius: 999px;
    transition: all .25s ease;
}

.res-search-btn:hover {
    color: #fff;
    background-color: #66aeff;
}

.res-publish-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    padding: 11px 20px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 24px;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 999px;
    transition: all .25s ease;
}

.res-publish-btn:hover {
    color: #191a1f;
    background: #fff;
    border-color: #fff;
}

.res-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    max-width: 780px;
    margin: 28px auto 0;
}

.res-stat {
    padding: 12px 10px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
}

.res-stat b {
    display: block;
    margin-bottom: 2px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
}

.res-stat span {
    font-size: 12px;
    color: rgba(255, 255, 255, .7);
}

/* ============================================================
 * 筛选工具栏
 * ============================================================ */
.res-toolbar {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--ri-border-color, #e5e9f2);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(20, 40, 80, .04);
}

.res-toolbar-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.res-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #f2f5fb;
    border-radius: 999px;
}

.res-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #5b6475;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 999px;
    transition: all .2s ease;
}

.res-tab:hover {
    color: #1a2b52;
    text-decoration: none;
}

.res-tab.is-active {
    color: #1a2b52;
    background: #fff;
    box-shadow: 0 2px 8px rgba(20, 40, 80, .1);
}

.res-tab em {
    font-style: normal;
    font-size: 11.5px;
    font-weight: 700;
    color: #8a94a6;
}

.res-tab.is-active em {
    color: var(--ri-primary, #2163e8);
}

.res-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.res-sort label {
    margin: 0;
    font-size: 13px;
    color: var(--ri-secondary-color, #6c757d);
    white-space: nowrap;
}

.res-sort select {
    min-width: 132px;
    padding: 8px 12px;
    font-size: 13.5px;
    color: #2a3446;
    background: #fff;
    border: 1px solid var(--ri-border-color, #e5e9f2);
    border-radius: 10px;
    outline: 0;
}

.res-sort select:focus {
    border-color: var(--ri-primary, #2163e8);
    box-shadow: 0 0 0 3px rgba(33, 99, 232, .1);
}

.res-sort-btn {
    padding: 8px 14px;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    background: var(--ri-primary, #2163e8);
    border: 0;
    border-radius: 10px;
}

.res-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e8edf5;
}

.res-cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    font-size: 13px;
    color: #5b6475;
    text-decoration: none;
    background: #f6f8fc;
    border: 1px solid #e8edf5;
    border-radius: 999px;
    transition: all .2s ease;
}

.res-cat-chip:hover {
    color: var(--ri-primary, #2163e8);
    text-decoration: none;
    background: #eef3ff;
    border-color: #cfdcf3;
}

.res-cat-chip.is-active {
    color: #fff;
    background: var(--ri-primary, #2163e8);
    border-color: var(--ri-primary, #2163e8);
}

.res-filter-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.res-reset {
    font-size: 13px;
    color: var(--ri-secondary-color, #6c757d);
    text-decoration: none;
}

.res-reset:hover {
    color: var(--ri-danger, #dc3545);
    text-decoration: none;
}

/* ============================================================
 * 资源卡片网格
 * ============================================================ */
.res-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.res-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ri-border-color, #e5e9f2);
    border-radius: 14px;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.res-card:hover {
    border-color: #cfdcf3;
    box-shadow: 0 14px 34px rgba(17, 38, 74, .12);
    transform: translateY(-4px);
}

.res-cover {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #eef3fb;
}

.res-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(8, 15, 30, 0) 52%, rgba(8, 15, 30, .34) 100%);
}

.res-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.res-card:hover .res-cover img {
    transform: scale(1.04);
}

.res-price {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.6;
    color: #fff;
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.res-price.is-free {
    background: rgba(15, 157, 110, .92);
}

.res-price.is-paid {
    background: rgba(12, 20, 35, .78);
}

.res-vip {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    color: #5c4300;
    background: linear-gradient(135deg, #ffe9a3, #f7c32e);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(247, 195, 46, .28);
}

.res-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 14px 16px 12px;
}

.res-cat {
    display: inline-block;
    align-self: flex-start;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ri-primary, #2163e8);
    text-decoration: none;
}

.res-cat:hover {
    text-decoration: underline;
}

.res-title {
    display: -webkit-box;
    min-height: 49px;
    margin: 0 0 8px;
    overflow: hidden;
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.5;
    color: #1a2233;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.res-title a {
    color: inherit;
    text-decoration: none;
}

.res-title a:hover {
    color: var(--ri-primary, #2163e8);
}

.res-desc {
    display: -webkit-box;
    min-height: 44px;
    margin: 0 0 12px;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.7;
    color: var(--ri-secondary-color, #6c757d);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.res-author {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    font-size: 12.5px;
    color: #7a8496;
}

.res-avatar {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    object-fit: cover;
    background: #e9eef7;
    border-radius: 50%;
}

.res-author-name {
    max-width: 110px;
    overflow: hidden;
    font-weight: 600;
    color: #3b475c;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.res-author-name:hover {
    color: var(--ri-primary, #2163e8);
}

.res-official {
    flex-shrink: 0;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--ri-primary, #2163e8);
    background: #eef3ff;
    border-radius: 999px;
}

.res-author time {
    margin-left: auto;
    color: #9aa4b5;
    white-space: nowrap;
}

.res-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    font-size: 12.5px;
    color: #7a8496;
    border-top: 1px solid #f0f3f9;
}

.res-metrics {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.res-metrics span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.res-more {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    font-weight: 600;
    color: var(--ri-primary, #2163e8);
    text-decoration: none;
}

.res-more:hover {
    color: #66aeff;
    text-decoration: none;
}

/* ============================================================
 * 空状态 / 底部 CTA / 分页
 * ============================================================ */
.res-empty {
    padding: 62px 20px;
    margin-top: 20px;
    color: #7a8496;
    text-align: center;
    background: #fff;
    border: 1px dashed #d9e2f0;
    border-radius: 14px;
}

.res-empty > i {
    margin-bottom: 14px;
    font-size: 38px;
    color: #b8c4d8;
}

.res-empty h3 {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #1a2233;
}

.res-empty p {
    margin-bottom: 18px;
    font-size: 14px;
}

.res-empty-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: var(--ri-primary, #2163e8);
    border-radius: 999px;
    transition: all .2s ease;
}

.res-empty-btn:hover {
    color: #fff;
    background: #66aeff;
    text-decoration: none;
}

.res-body .custom-nav {
    margin-top: 26px;
}

.res-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 30px;
    margin-top: 30px;
    color: #fff;
    background:
        radial-gradient(560px 220px at 88% 0%, rgba(247, 195, 46, .18), transparent 62%),
        linear-gradient(120deg, #0f2247, #1d4f9e);
    border-radius: 16px;
}

.res-cta h2 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.res-cta p {
    max-width: 720px;
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .72);
}

.res-cta-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    padding: 11px 22px;
    font-size: 14.5px;
    font-weight: 700;
    color: #191a1f;
    text-decoration: none;
    background: #f7c32e;
    border-radius: 999px;
    transition: all .25s ease;
}

.res-cta-btn:hover {
    color: #fff;
    background: #66aeff;
    text-decoration: none;
}

/* ============================================================
 * 响应式
 * ============================================================ */
@media (max-width: 991.98px) {
    .res-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .res-hero {
        padding: 40px 0 36px;
    }

    .res-hero-title {
        font-size: 27px;
    }

    .res-hero-sub {
        font-size: 14px;
    }

    .res-hero-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .res-search {
        flex-direction: column;
        align-items: stretch;
    }

    .res-search-btn {
        width: 100%;
    }

    .res-publish-btn {
        justify-content: center;
    }

    .res-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .res-tabs {
        justify-content: space-between;
        width: 100%;
    }

    .res-tab {
        flex: 1;
        justify-content: center;
        padding: 8px 8px;
        font-size: 13px;
    }

    .res-sort {
        width: 100%;
        margin-left: 0;
    }

    .res-sort select {
        flex: 1;
        min-width: 0;
    }

    .res-cats {
        flex-wrap: nowrap;
        padding-bottom: 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .res-cats::-webkit-scrollbar {
        display: none;
    }

    .res-cat-chip {
        flex-shrink: 0;
    }

    .res-cta {
        padding: 22px;
    }

    .res-cta-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .res-grid {
        grid-template-columns: 1fr;
    }
}
