/* ================================================================
 * 资源目录页样式
 * ================================================================ */
html { overflow-x: hidden; overflow-y: visible; }
body { overflow: visible; }

/* ============ 页面 Hero ============ */
.catalog-hero {
    position: relative;
    padding: 100px 0 40px;
    background-color: #1a1a2e;
    background-image:
        linear-gradient(rgba(10, 15, 30, 0.55), rgba(10, 15, 30, 0.7)),
        var(--search-bg, none);
    background-size: cover;
    background-position: center;
    background-blend-mode: normal;
    overflow: hidden;
}
.catalog-hero::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.25) 0%, transparent 70%);
    pointer-events: none;
    clip-path: circle(50%);
}
.catalog-hero::after {
    content: "";
    position: absolute;
    bottom: -100px;
    left: -60px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    pointer-events: none;
    clip-path: circle(50%);
}
.catalog-hero .container {
    position: relative;
    z-index: 2;
}

/* 面包屑 */
.catalog-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}
.catalog-breadcrumb a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color .2s;
}
.catalog-breadcrumb a:hover { color: #fff; }
.catalog-breadcrumb i { font-size: 11px; opacity: 0.5; }
.catalog-breadcrumb span {
    color: #fff;
    font-weight: 500;
}

/* 标题 */
.catalog-title {
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    letter-spacing: 0.5px;
    line-height: 1.3;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.catalog-subtitle {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 24px;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}
.catalog-subtitle strong {
    color: #fbbf24;
    font-weight: 700;
}

/* 搜索框 */
.catalog-search {
    max-width: 640px;
}
.catalog-search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all .3s ease;
}
.catalog-search-box:focus-within {
    border-color: rgba(147, 197, 253, 0.5);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 16px 40px rgba(0, 0, 0, 0.25);
}
.catalog-search-box > i {
    color: rgba(255, 255, 255, 0.5);
    font-size: 17px;
    flex-shrink: 0;
}
.catalog-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 14.5px;
    color: #fff;
    outline: none;
    min-width: 0;
}
.catalog-search-box input::placeholder { color: rgba(255, 255, 255, 0.4); }
.catalog-search-btn {
    padding: 0 26px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all .25s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}
.catalog-search-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

/* ============ 分类筛选条 ============ */
.catalog-filter {
    background: var(--bg-card, #fff);
    border-bottom: 1px solid var(--border-color, #f1f5f9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    position: relative;
    z-index: 10;
    overflow: hidden;
}
[data-theme="dark"] .catalog-filter {
    background: #1e1e2e;
    border-bottom-color: #2a2a3e;
}
.catalog-filter-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 12px 0;
    -webkit-overflow-scrolling: touch;
}
.catalog-filter-inner::-webkit-scrollbar { display: none; }

.catalog-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-body, #f8fafc);
    border: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-secondary, #475569);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s ease;
    flex-shrink: 0;
}
.catalog-tab i { font-size: 12px; }
.catalog-tab:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
}
.catalog-tab.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}
[data-theme="dark"] .catalog-tab {
    background: #2a2a3e;
    border-color: #3a3a50;
    color: #cbd5e1;
}
[data-theme="dark"] .catalog-tab:hover {
    background: rgba(96, 165, 250, 0.15);
    border-color: #60a5fa;
    color: #60a5fa;
}
[data-theme="dark"] .catalog-tab.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

/* ============ 主内容区 ============ */
.catalog-main {
    padding: 28px 0 50px;
}

.catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.catalog-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--text-muted, #94a3b8);
}
.catalog-count i {
    font-size: 15px;
    color: #3b82f6;
}
.catalog-count strong {
    color: var(--text-primary, #1e293b);
    font-weight: 700;
    font-size: 15px;
}
[data-theme="dark"] .catalog-count strong { color: #fff; }

.catalog-keyword-tip {
    font-size: 12.5px;
    color: var(--text-muted, #94a3b8);
}
.catalog-keyword-tip a {
    color: #3b82f6;
    text-decoration: none;
    margin-left: 4px;
}
.catalog-keyword-tip a:hover { text-decoration: underline; }

/* ============ 资源网格 ============ */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.catalog-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #f1f5f9);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color .3s ease, box-shadow .3s ease;
    position: relative;
    min-width: 0;
}
.catalog-card:hover {
    transform: translateY(-5px);
    border-color: #bfdbfe;
    box-shadow: 0 14px 32px rgba(59, 130, 246, 0.15);
}
[data-theme="dark"] .catalog-card {
    background: #1e1e2e;
    border-color: #2a2a3e;
}
[data-theme="dark"] .catalog-card:hover {
    border-color: rgba(96, 165, 250, 0.4);
}

.catalog-card .cc-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-body, #f5f6fa);
}
.catalog-card .cc-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .55s ease;
    display: block;
    max-width: 100%;
}
.catalog-card:hover .cc-img-wrap img { transform: scale(1.06); }

.catalog-card .cc-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 5px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.4);
}

.catalog-card .cc-price-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fbbf24;
    font-size: 12px;
    font-weight: 800;
    z-index: 2;
    line-height: 1.2;
}
.catalog-card .cc-price-badge.free {
    color: #34d399;
    font-size: 10.5px;
}

.catalog-card .cc-tags {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    max-width: calc(100% - 16px);
    z-index: 2;
}
.catalog-card .cc-tags span {
    padding: 1px 8px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
}

.catalog-card .cc-body {
    flex: 1;
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.catalog-card .cc-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    line-height: 1.42;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
}
[data-theme="dark"] .catalog-card .cc-title {
    color: #e5e7eb;
}

.catalog-card .cc-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10.5px;
    color: var(--text-muted, #94a3b8);
    padding-top: 6px;
    border-top: 1px dashed var(--border-color, #f1f5f9);
    margin-top: auto;
}
[data-theme="dark"] .catalog-card .cc-meta {
    border-top-color: #2a2a3e;
}
.catalog-card .cc-meta span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.catalog-card .cc-meta i { font-size: 10.5px; }

/* ============ 空状态 ============ */
.catalog-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}
.catalog-empty .empty-icon {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 16px;
}
.catalog-empty .empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0 0 8px;
}
[data-theme="dark"] .catalog-empty .empty-title { color: #fff; }
.catalog-empty .empty-desc {
    font-size: 13.5px;
    color: var(--text-muted, #94a3b8);
    margin: 0 0 20px;
    line-height: 1.6;
}
.catalog-empty .empty-btn {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 40px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all .25s ease;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.catalog-empty .empty-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

/* ============ 分页 ============ */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 30px;
    padding: 8px 0;
    flex-wrap: wrap;
}
.pagination-wrap .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #333;
    transition: all .2s;
    gap: 3px;
    white-space: nowrap;
}
.pagination-wrap .page-btn:hover {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}
.pagination-wrap .page-btn.disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}
.pagination-wrap .page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    font-size: 13px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #333;
    transition: all .2s;
}
.pagination-wrap .page-num:hover {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}
.pagination-wrap .page-num.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: #fff !important;
    border-color: transparent !important;
    font-weight: 700;
    cursor: default;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.pagination-wrap .page-num.dots {
    border: none;
    background: transparent;
    cursor: default;
    color: #94a3b8;
    min-width: auto;
    padding: 0 4px;
    pointer-events: none;
}
[data-theme="dark"] .pagination-wrap .page-btn,
[data-theme="dark"] .pagination-wrap .page-num {
    background: #1e1e2e;
    color: #e5e5e5;
    border-color: #3a3a50;
}
[data-theme="dark"] .pagination-wrap .page-btn:hover,
[data-theme="dark"] .pagination-wrap .page-num:hover {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* ============ 响应式 ============ */
@media (max-width: 992px) {
    .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .catalog-hero { padding: 90px 0 28px; }
    .catalog-title { font-size: 22px; }
    .catalog-subtitle { font-size: 12.5px; margin-bottom: 18px; }
    .catalog-search-box { padding: 4px 4px 4px 16px; }
    .catalog-search-box input { padding: 8px 12px; font-size: 13.5px; }
    .catalog-search-btn { padding: 0 18px; height: 40px; font-size: 13px; }
    .catalog-filter-inner { padding: 10px 0; }
    .catalog-tab { padding: 5px 12px; font-size: 12.5px; }
    .catalog-main { padding: 22px 0 40px; }
    .catalog-count { font-size: 12.5px; }
    .catalog-count strong { font-size: 14px; }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .catalog-card .cc-title { font-size: 12.5px; min-height: 34px; }
    .catalog-card .cc-body { padding: 8px 10px 10px; gap: 4px; }
    .catalog-card .cc-meta { font-size: 10px; gap: 8px; padding-top: 5px; }
}
@media (max-width: 480px) {
    .catalog-title { font-size: 20px; }
    .catalog-grid { gap: 10px; }
    .catalog-card .cc-img-wrap { aspect-ratio: 4 / 3; }
    .catalog-card .cc-title { font-size: 12px; min-height: 32px; }
    .catalog-card .cc-price-badge { font-size: 11px; padding: 2px 8px; }
    .catalog-card .cc-price-badge.free { font-size: 10px; }
}