/* =====================================================
   RockSlides Archive / Taxonomy — archive.css
   统一归档页与分类法页样式
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Reset & Base ── */
body.post-type-archive-rock_slide,
body.tax-rock_slide_scene,
body.tax-rock_slide_style,
body.tax-rock_slide_tone,
body.tax-rock_slide_mood,
body.tax-rock_slide_color_scheme,
body.tax-rock_slide_industry,
body.tax-rock_slide_theme,
body.tax-rock_slide_category,
body.tax-rock_slide_tag,
body.tax-rock_slide_tag_cn,
body.tax-rock_slide_ratio,
body.tax-rock_slide_page_role,
body.tax-rock_slide_layout_blocks {
    --rsa-brand: #16a34a;
    --rsa-brand-strong: #15803d;
    --rsa-brand-deep: #14532d;
    --rsa-brand-soft: #ecfdf3;
    --rsa-brand-line: rgba(22, 163, 74, 0.18);
    --rsa-brand-shadow: rgba(20, 83, 45, 0.12);
    --rsa-ink: #102016;
    --rsa-muted: #64746a;
    --rsa-line: #dfe9e3;
    --rsa-page: #f3f8f5;
    --rsa-surface: #ffffff;
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fbfdfb 0, var(--rsa-page) 36%, #eef5f1 100%);
    color: var(--rsa-ink);
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Archive Wrap ── */
.rsa-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ── Header ── */
.rsa-header {
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(251,253,251,.94)),
        linear-gradient(90deg, rgba(22,163,74,.08), rgba(255,255,255,0));
    border-bottom: 1px solid var(--rsa-line);
    padding: 36px max(20px, calc((100vw - 1360px) / 2)) 28px;
}

.rsa-header-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.rsa-header-copy {
    flex: 1;
    min-width: 0;
}

.rsa-eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--rsa-brand);
    letter-spacing: 0;
    text-transform: uppercase;
}

.rsa-title {
    margin: 0 0 10px;
    font-size: 36px;
    font-weight: 900;
    color: #0e1f16;
    line-height: 1.15;
    letter-spacing: 0;
}

.rsa-subtitle {
    margin: 0;
    max-width: 640px;
    font-size: 15px;
    color: var(--rsa-muted);
    line-height: 1.65;
}

/* Search */
.rsa-search-form {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    height: 44px;
    padding: 0 8px 0 14px;
    border: 1.5px solid var(--rsa-line);
    border-radius: 10px;
    background: rgba(255,255,255,.82);
    width: min(380px, 100%);
    transition: border-color .15s, box-shadow .15s;
}

.rsa-search-form:focus-within {
    border-color: var(--rsa-brand);
    box-shadow: 0 0 0 3px rgba(22,163,74,.1);
    background: #fff;
}

.rsa-search-form svg {
    color: #8ba195;
    flex-shrink: 0;
}

.rsa-search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 14px;
    color: #1a1a1a;
    background: transparent;
    font-family: inherit;
}

.rsa-search-form button {
    flex-shrink: 0;
    height: 30px;
    padding: 0 14px;
    border: none;
    border-radius: 7px;
    background: var(--rsa-brand);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
    white-space: nowrap;
}

.rsa-search-form button:hover {
    background: var(--rsa-brand-strong);
}

/* ── Filter Bar ── */
.rsa-filter-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(252,254,252,.94);
    border-bottom: 1px solid var(--rsa-line);
    box-shadow: 0 8px 28px rgba(20, 83, 45, .07);
    backdrop-filter: blur(12px);
}

.rsa-filter-inner {
    display: block;
    padding: 0 max(20px, calc((100vw - 1360px) / 2));
}

.rsa-filter-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 52px;
}

.rsa-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.rsa-filter-group-primary {
    flex: 1;
}

.rsa-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.rsa-filter-label {
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 700;
    color: #7d9387;
    text-transform: uppercase;
    letter-spacing: 0;
}

/* Tab strip */
.rsa-tabs {
    display: flex;
    gap: 4px;
    min-width: 0;
}

.rsa-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 12px;
    border-radius: 7px;
    border: 1.5px solid transparent;
    background: transparent;
    color: #2f4438;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
    font-family: inherit;
    cursor: pointer;
}

.rsa-tab:hover {
    background: var(--rsa-brand-soft);
    color: var(--rsa-brand);
}

.rsa-tab.is-active,
.rsa-tab[aria-current="page"] {
    background: linear-gradient(180deg, #ecfdf3, #dcfce7);
    color: var(--rsa-brand-strong);
    border-color: #b7efc6;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

/* All tab 只在没有激活 taxonomy 时高亮 */
.rsa-tab.is-all-active:not(.is-active) {
    background: var(--rsa-brand-soft);
    color: var(--rsa-brand-strong);
    border-color: #c6f3d2;
}

.rsa-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: rgba(20,83,45,.07);
    color: #658173;
    font-size: 11px;
    font-weight: 700;
    transition: background .15s, color .15s;
}

.rsa-tab.is-active .rsa-tab-count,
.rsa-tab[aria-current="page"] .rsa-tab-count {
    background: #16a34a;
    color: #fff;
}

/* Small tabs */
.rsa-tabs-sm {
    gap: 3px;
}

.rsa-tab-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: 6px;
}

.rsa-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1.5px solid #b7efc6;
    border-radius: 7px;
    background: linear-gradient(180deg, #f5fff8, #eafbf0);
    color: var(--rsa-brand-strong);
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.rsa-filter-toggle:hover,
.rsa-filter-bar.is-expanded .rsa-filter-toggle {
    background: #dcfce7;
    border-color: #86efac;
    color: var(--rsa-brand-deep);
}

.rsa-filter-panel {
    display: none;
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: min(42vh, 300px);
    overflow-y: auto;
    padding: 14px 0 16px;
    border-top: 1px solid var(--rsa-line);
}

.rsa-filter-bar.is-expanded .rsa-filter-panel {
    display: grid;
}

.rsa-panel-group {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.rsa-panel-group .rsa-filter-label {
    padding-top: 7px;
}

.rsa-panel-group .rsa-tabs {
    flex-wrap: wrap;
}

/* Result count */
.rsa-result-count {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--rsa-muted);
    white-space: nowrap;
}

.rsa-result-count strong {
    color: var(--rsa-ink);
    font-weight: 800;
}

/* ── Main Content ── */
.rsa-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 32px max(20px, calc((100vw - 1360px) / 2)) 60px;
}

/* ── Card Grid ── */
.rsa-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.rsa-grid-empty {
    flex: 1;
    min-height: clamp(220px, calc(100svh - 320px), 420px);
    align-content: center;
}

@media (max-width: 1200px) {
    .rsa-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 860px) {
    .rsa-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (max-width: 480px) {
    .rsa-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Card ── */
.rsa-card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(22, 163, 74, 0.16);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff 0%, #fbfefc 100%);
    text-decoration: none;
    color: var(--rsa-ink);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 14px 34px rgba(20, 83, 45, .055);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.rsa-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.9),
        inset 0 -1px 0 rgba(22,163,74,.055);
}

.rsa-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 2px 6px rgba(15, 23, 42, .06),
        0 22px 46px rgba(20, 83, 45, .12);
    border-color: rgba(22, 163, 74, 0.34);
}

.rsa-card:focus-visible {
    outline: 3px solid rgba(22, 163, 74, .2);
    outline-offset: 3px;
}

/* Thumb */
.rsa-card-thumb {
    position: relative;
    z-index: 2;
    display: flex;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #eff8f2, #f8fbf9);
    overflow: hidden;
    border-bottom: 1px solid rgba(22, 163, 74, .1);
}

.rsa-card-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0) 40%, rgba(20,83,45,.055));
}

.rsa-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.02) contrast(1.01);
}

.rsa-card-thumb-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #8aa091;
}

.rsa-card-thumb-empty span {
    font-size: 12px;
}

/* Badges */
.rsa-badge {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    pointer-events: none;
}

.rsa-badge-free {
    top: 10px;
    left: 10px;
    background: linear-gradient(180deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 8px 18px rgba(22, 163, 74, .22);
}

.rsa-badge-price {
    top: 10px;
    left: 10px;
    background: linear-gradient(180deg, rgba(17, 38, 27, .88), rgba(10, 27, 18, .86));
    color: #fff;
    border: 1px solid rgba(187, 247, 208, .18);
    backdrop-filter: blur(4px);
    box-shadow: 0 8px 18px rgba(20, 83, 45, .22);
}

/* Hover Overlay */
.rsa-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(10,15,20,.72) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 18px;
    opacity: 0;
    transition: opacity .22s ease;
}

.rsa-card:hover .rsa-card-overlay {
    opacity: 1;
}

.rsa-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    transform: translateY(8px);
    transition: transform .22s ease;
    white-space: nowrap;
}

.rsa-card:hover .rsa-card-cta {
    transform: translateY(0);
}

/* Card Body */
.rsa-card-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 15px 15px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,253,251,.98));
}

.rsa-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--rsa-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rsa-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #7c8f84;
    font-weight: 600;
}

.rsa-meta-ratio {
    color: var(--rsa-brand-deep);
    font-weight: 800;
}

.rsa-score-pill {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 6px;
    border: 1px solid rgba(22, 163, 74, .16);
    border-radius: 4px;
    background: linear-gradient(180deg, #f6fff8, #ecfdf3);
    color: var(--rsa-brand-strong);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.rsa-meta-sep {
    color: #c8d6cf;
}

.rsa-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.rsa-card-tags span {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 4px;
    background: #effaf3;
    color: #22643f;
    border: 1px solid rgba(22, 163, 74, .12);
    font-size: 11.5px;
    font-weight: 700;
}

/* ── Empty State ── */
.rsa-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 0;
    padding: 48px 20px;
    text-align: center;
    color: #9ca3af;
}

.rsa-empty p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
}

.rsa-empty-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 7px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.rsa-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.rsa-empty-link-primary {
    background: #dcfce7;
    color: #15803d;
}

.rsa-empty-link:hover {
    background: #f0fdf4;
    color: #16a34a;
}

/* ── Pagination ── */
.rsa-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 52px;
}

.rsa-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 6px;
    border-radius: 9px;
    border: 1.5px solid #e5e9ef;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s;
}

.rsa-pagination .page-numbers.current,
.rsa-pagination .page-numbers:hover {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
}

.rsa-pagination .page-numbers.dots {
    border: none;
    background: none;
    color: #9ca3af;
}

/* ── Footer ── */
.rsa-footer {
    background: #fff;
    border-top: 1px solid #e5e9ef;
}

.rsa-footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 22px max(20px, calc((100vw - 1360px) / 2));
    font-size: 13px;
    color: #9ca3af;
}

.rsa-footer-inner nav {
    display: flex;
    gap: 20px;
}

.rsa-footer-inner nav a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 600;
    transition: color .15s;
}

.rsa-footer-inner nav a:hover {
    color: #16a34a;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .rsa-header {
        padding: 24px 20px 20px;
    }

    .rsa-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .rsa-title {
        font-size: 28px;
    }

    .rsa-subtitle {
        font-size: 14px;
    }

    .rsa-search-form {
        width: 100%;
    }

    .rsa-filter-inner {
        padding: 0 14px;
    }

    .rsa-filter-row {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 0;
    }

    .rsa-filter-group-primary {
        order: 2;
        width: 100%;
        align-items: flex-start;
    }

    .rsa-filter-actions {
        order: 1;
        width: 100%;
    }

    .rsa-filter-group-primary .rsa-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .rsa-filter-group-primary .rsa-tabs::-webkit-scrollbar {
        display: none;
    }

    .rsa-filter-panel {
        max-height: min(50vh, 360px);
        padding: 12px 0 14px;
    }

    .rsa-panel-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .rsa-panel-group .rsa-filter-label {
        padding-top: 0;
    }

    .rsa-main {
        padding: 24px 20px 48px;
    }

    .rsa-grid-empty {
        min-height: 180px;
    }

    .rsa-empty {
        padding: 32px 20px;
    }

    .rsa-footer-inner {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}
