/* =====================================================
 *  资料分享站 - 前台样式
 *  风格：极简现代、白色卡片、浅灰底色、柔和阴影
 * ===================================================== */

/* ============= 设计令牌 ============= */
:root {
    --bg:           #f3f7fb;
    --card:         #ffffff;
    --text:         #102033;
    --text-2:       #52657a;
    --text-3:       #91a1b3;
    --border:       #dbe5ef;
    --border-2:     #edf3f8;
    --primary:      #102033;
    --primary-hover:#07111f;
    --accent:       #2f6fed;
    --accent-hover: #245bd4;
    --accent-soft:  #eaf2ff;
    --mint:         #10b981;
    --mint-soft:    #e8fbf4;
    --warm:         #f59e0b;
    --success:      #0f9f6e;
    --success-soft: #ecfdf5;
    --danger:       #dc2626;
    --danger-soft:  #fef2f2;
    --warning:      #d97706;
    --warning-soft: #fffbeb;
    --shadow-sm:    0 1px 2px rgba(16,32,51,.05);
    --shadow:       0 8px 26px rgba(47,111,237,.08), 0 1px 2px rgba(16,32,51,.05);
    --shadow-hover: 0 18px 46px rgba(47,111,237,.14), 0 3px 10px rgba(16,32,51,.06);
    --radius:       8px;
    --radius-lg:    8px;
    --radius-sm:    6px;
    --container:    1180px;
    --header-h:     68px;
}

/* ============= 基础 ============= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ============= 布局 ============= */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============= 顶部导航 ============= */
.site-header {
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--text);
}
.logo:hover { color: var(--text); }
.logo-img { height: 30px; width: auto; border-radius: 6px; }
.logo-text { line-height: 1; }

/* ============= 搜索 + 分类筛选 ============= */
.filter-section {
    max-width: var(--container);
    margin: 28px auto 24px;
    padding: 0 24px;
}
.search-row {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 16px;
    transition: border-color .15s, box-shadow .15s;
}
.search-row:focus-within {
    border-color: var(--text-2);
    box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
.search-icon {
    display: flex;
    color: var(--text-3);
    margin-right: 10px;
}
.search-input {
    flex: 1;
    height: 48px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    color: var(--text);
}
.search-input::placeholder { color: var(--text-3); }

.cat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
.cat-chip {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
}
.cat-chip:hover {
    border-color: var(--text-2);
    color: var(--text);
}
.cat-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.cat-chip.active:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.results-info {
    max-width: var(--container);
    margin: 0 auto 16px;
    padding: 0 24px;
    font-size: 14px;
    color: var(--text-2);
}
.results-info strong { color: var(--text); font-weight: 600; }

/* ============= 卡片网格 ============= */
.grid {
    max-width: var(--container);
    margin: 0 auto;
    padding: 8px 24px 48px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

/* ============= 卡片 ============= */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
    display: flex;
    flex-direction: column;
    height: 360px; /* 固定卡片高度 */
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: #d4d4d8;
}

.card-cover-link { display: block; }
.card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #fafafa;
}
.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.card:hover .card-cover img { transform: scale(1.05); }
.card-cover--ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f4f4f5 0%, #e4e4e7 100%);
    color: var(--text-3);
    font-size: 48px;
    font-weight: 600;
}

.card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.card-cat {
    display: inline-block;
    align-self: flex-start;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-cat:hover { background: #dbeafe; color: var(--accent); }

.card-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em; /* 固定 2 行高度 */
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }

.card-desc {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em; /* 固定 2 行高度，避免简介长度差异撑高卡片 */
}

/* 网盘按钮 */
.card-drives {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto; /* 钉在卡片底部 */
    padding-top: 8px;
}
.drive-btn {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff !important;
    font-size: 12px;
    font-weight: 500;
    transition: background .15s, transform .15s;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.drive-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}
.drive-more {
    background: var(--bg);
    color: var(--text-2) !important;
    border: 1px solid var(--border);
}
.drive-more:hover { background: #ebebed; }
.no-link {
    font-size: 12px;
    color: var(--text-3);
}

/* ============= 翻页 ============= */
.pagination {
    max-width: var(--container);
    margin: 0 auto 48px;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
}
.page-link {
    display: inline-flex;
    align-items: center;
    height: 36px;
    min-width: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
}
.page-link:hover {
    border-color: var(--text-2);
    color: var(--text);
}
.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.page-link.disabled {
    background: transparent;
    color: var(--text-3);
    cursor: not-allowed;
    border-color: var(--border-2);
}
.page-ellipsis {
    color: var(--text-3);
    padding: 0 4px;
}

/* ============= 空状态 ============= */
.empty {
    max-width: var(--container);
    margin: 60px auto;
    padding: 60px 24px;
    text-align: center;
    color: var(--text-2);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.empty p { margin: 0; }
.empty a { color: var(--accent); text-decoration: underline; }

/* ============= 详情页 ============= */
.detail-wrap {
    max-width: 960px;
    margin: 24px auto 60px;
    padding: 0 24px;
}
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: all .15s;
}
.btn-back:hover {
    border-color: var(--text-2);
    color: var(--text);
}

.detail {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.detail-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #fafafa;
    overflow: hidden;
}
.detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-cover-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f4f4f5 0%, #e4e4e7 100%);
    color: var(--text-3);
    font-size: 96px;
    font-weight: 600;
}

.detail-info { padding: 36px 40px 40px; }
.detail-cat {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}
.detail-title {
    margin: 0 0 16px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: 0;
}
.detail-desc {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-2);
    white-space: pre-wrap;
}
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--border-2);
    border-bottom: 1px solid var(--border-2);
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-3);
}
.detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.detail-drives h3 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.drives-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.drive-btn-lg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 20px;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff !important;
    font-size: 15px;
    font-weight: 500;
    transition: all .15s;
}
.drive-btn-lg:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.drive-btn-lg[data-index="0"] { background: var(--accent); }
.drive-btn-lg[data-index="0"]:hover { background: #1d4ed8; }
.drive-btn-lg[data-index="2"] { background: #16a34a; }
.drive-btn-lg[data-index="2"]:hover { background: #15803d; }
.drive-btn-lg[data-index="3"] { background: #ea580c; }
.drive-btn-lg[data-index="3"]:hover { background: #c2410c; }
.drive-btn-lg[data-index="4"] { background: #7c3aed; }
.drive-btn-lg[data-index="4"]:hover { background: #6d28d9; }
.drive-btn-lg .drive-arrow { font-size: 18px; opacity: .9; }

/* 分类页 hero */
.cat-hero {
    max-width: var(--container);
    margin: 0 auto 24px;
    padding: 32px 24px 8px;
}
.cat-hero .back-link {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-2);
}
.cat-hero h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
}
.cat-hero p { margin: 0; color: var(--text-2); font-size: 14px; }

/* ============= 页脚 ============= */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--card);
    padding: 28px 24px;
    text-align: center;
    margin-top: 40px;
}
.site-footer p { margin: 4px 0; font-size: 13px; color: var(--text-2); }
.footer-links a {
    color: var(--text-2);
    margin: 0 8px;
}
.footer-links a:hover { color: var(--text); }
.footer-icp { color: var(--text-3); font-size: 12px; }
.footer-custom { font-size: 13px; color: var(--text-2); }

/* ============= 响应式 ============= */
@media (max-width: 1024px) {
    .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    :root { --header-h: 56px; }
    .container, .header-inner, .filter-section, .results-info, .grid, .pagination, .cat-hero, .detail-wrap {
        padding-left: 16px; padding-right: 16px;
    }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .card { height: 320px; }
    .card-body { padding: 12px; }
    .card-title { font-size: 14px; }
    .card-desc { font-size: 12px; }
    .detail-info { padding: 24px 20px 28px; }
    .detail-cover { aspect-ratio: 4 / 3; }
    .detail-title { font-size: 22px; }
    .drive-btn-lg { height: 48px; font-size: 14px; padding: 0 16px; }
    .search-input { height: 44px; font-size: 14px; }
    .logo { font-size: 16px; }
    .logo-img { height: 26px; }
}
@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; }
    .card { height: auto; min-height: 0; }
    .card-cover { aspect-ratio: 16 / 10; }
    .card-body { padding: 12px 14px 14px; }
}


body {
    background:
        linear-gradient(180deg, #ffffff 0, #f8fafc 220px, var(--bg) 221px);
    letter-spacing: 0;
}

.site-header {
    background: rgba(255,255,255,.92);
    border-bottom-color: rgba(221,226,234,.78);
    box-shadow: 0 1px 0 rgba(15,23,42,.02);
}

.header-inner { height: var(--header-h); }
.logo { letter-spacing: 0; font-size: 17px; }
.logo-img { height: 32px; border-radius: 6px; }

.container {
    padding-left: 28px;
    padding-right: 28px;
}

.filter-section {
    margin-top: 34px;
    margin-bottom: 22px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255,255,255,.86);
    box-shadow: var(--shadow-sm);
}

.search-row {
    border-color: #cfd7e3;
    border-radius: 8px;
    padding: 0 15px;
    background: #fff;
}

.search-row:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

.search-input {
    height: 50px;
    font-size: 15px;
}

.cat-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.cat-chip {
    height: 32px;
    border-radius: 7px;
    background: #f8fafc;
    color: #526071;
    flex: 0 0 auto;
}

.cat-chip.active {
    background: var(--text);
    border-color: var(--text);
}

.results-info {
    margin-bottom: 6px;
    font-size: 13px;
}

.grid {
    padding-top: 12px;
    gap: 18px;
}

.card {
    height: 342px;
    border-radius: 8px;
    border-color: #e1e6ee;
    box-shadow: 0 1px 2px rgba(15,23,42,.03);
}

.card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.card-cover {
    aspect-ratio: 16 / 10;
    background: #f1f5f9;
}

.card-cover--ph {
    background: #f1f5f9;
    color: #94a3b8;
}

.card-body { padding: 14px 15px 15px; }

.card-cat {
    border-radius: 6px;
    color: #1d4ed8;
    background: #eff6ff;
    padding: 3px 7px;
    font-size: 11px;
}

.card-title {
    font-size: 15px;
    line-height: 1.42;
    letter-spacing: 0;
}

.card-desc {
    color: #64748b;
    min-height: 3em;
}

.card-drives {
    gap: 7px;
    padding-top: 10px;
}

.drive-btn {
    height: 30px;
    border-radius: 7px;
    padding: 0 11px;
    background: #111827;
}

.drive-more {
    background: #f8fafc;
    color: #475569 !important;
}

.pagination { margin-bottom: 56px; }
.page-link {
    border-radius: 7px;
    background: #fff;
}

.empty {
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.detail-wrap {
    max-width: 980px;
    margin-top: 32px;
}

.btn-back {
    border-radius: 7px;
    background: #fff;
}

.detail {
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.detail-info { padding: 34px 38px 38px; }
.detail-title {
    font-size: 30px;
    letter-spacing: 0;
}

.detail-desc { color: #475569; }
.detail-meta { color: #7c8798; }

.drive-btn-lg {
    height: 50px;
    border-radius: 8px;
    background: #111827;
}

.drive-btn-lg[data-index="0"] { background: #2563eb; }
.drive-btn-lg[data-index="2"] { background: #0f9f6e; }
.drive-btn-lg[data-index="3"] { background: #d97706; }
.drive-btn-lg[data-index="4"] { background: #475569; }

.cat-hero {
    padding-top: 34px;
}

.cat-hero h1 {
    letter-spacing: 0;
}

.site-footer {
    background: #fff;
    border-top-color: var(--border);
}

@media (max-width: 1024px) {
    .grid { gap: 16px; }
}

@media (max-width: 768px) {
    .container,
    .header-inner,
    .filter-section,
    .results-info,
    .grid,
    .pagination,
    .cat-hero,
    .detail-wrap {
        padding-left: 16px;
        padding-right: 16px;
    }
    .filter-section {
        margin-top: 18px;
        padding: 16px;
    }
    .grid { grid-template-columns: 1fr; }
    .card {
        height: auto;
        min-height: 0;
    }
    .card-cover { aspect-ratio: 16 / 9; }
    .detail-info { padding: 24px 18px 28px; }
    .detail-title { font-size: 23px; }
}

/* Mobile polish */
html, body {
    overflow-x: hidden;
}

@media (max-width: 640px) {
    :root {
        --header-h: 56px;
    }

    body {
        background: var(--bg);
        font-size: 14px;
    }

    .site-header {
        position: sticky;
    }

    .header-inner {
        padding-left: 14px;
        padding-right: 14px;
    }

    .logo {
        min-width: 0;
    }

    .logo-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .filter-section {
        margin: 14px 12px 14px;
        padding: 12px;
        width: auto;
    }

    .search-row {
        padding: 0 12px;
    }

    .search-input {
        height: 44px;
        min-width: 0;
    }

    .cat-row {
        gap: 7px;
        margin-top: 12px;
        margin-left: -2px;
        margin-right: -2px;
        padding: 0 2px 4px;
    }

    .cat-chip {
        height: 30px;
        padding: 0 12px;
        font-size: 12px;
    }

    .results-info {
        padding-left: 14px;
        padding-right: 14px;
    }

    .grid {
        padding: 4px 12px 34px;
        gap: 12px;
    }

    .card {
        border-radius: 8px;
    }

    .card-cover {
        aspect-ratio: 16 / 9;
    }

    .card-body {
        padding: 12px;
    }

    .card-title {
        min-height: auto;
    }

    .card-desc {
        min-height: auto;
        margin-bottom: 10px;
    }

    .card-drives {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .card-drives::-webkit-scrollbar {
        display: none;
    }

    .drive-btn {
        flex: 0 0 auto;
        height: 32px;
    }

    .pagination {
        padding: 0 12px;
        margin-bottom: 34px;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .page-link {
        flex: 0 0 auto;
        height: 34px;
        min-width: 34px;
    }

    .detail-wrap {
        margin: 14px auto 36px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .btn-back {
        margin-bottom: 12px;
    }

    .detail-cover {
        aspect-ratio: 16 / 10;
    }

    .detail-info {
        padding: 18px 14px 20px;
    }

    .detail-title {
        font-size: 21px;
        line-height: 1.35;
        word-break: break-word;
    }

    .detail-desc {
        font-size: 14px;
        line-height: 1.7;
        word-break: break-word;
    }

    .detail-meta {
        gap: 10px;
        padding: 12px 0;
        margin-bottom: 18px;
    }

    .detail-meta span {
        min-width: 0;
    }

    .drive-btn-lg {
        height: auto;
        min-height: 48px;
        padding: 12px 14px;
        gap: 10px;
    }

    .drive-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cat-hero {
        padding: 20px 14px 8px;
    }

    .cat-hero h1 {
        font-size: 22px;
    }
}

@media (max-width: 420px) {
    .filter-section {
        margin-left: 10px;
        margin-right: 10px;
    }

    .grid {
        padding-left: 10px;
        padding-right: 10px;
    }

    .card-cat {
        max-width: 100%;
    }

    .detail-wrap {
        padding-left: 10px;
        padding-right: 10px;
    }

    .detail-title {
        font-size: 20px;
    }
}


body {
    background:
        linear-gradient(180deg, #eef6ff 0, #f8fbff 260px, var(--bg) 560px);
    color: var(--text);
}

.site-header {
    background: rgba(255,255,255,.82);
    border-bottom-color: rgba(219,229,239,.74);
    box-shadow: 0 10px 30px rgba(16,32,51,.04);
}

.logo {
    color: #102033;
}

.logo:hover {
    color: #102033;
}

.logo-text::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--mint));
    box-shadow: 0 0 0 4px rgba(47,111,237,.10);
    vertical-align: 1px;
}

.filter-section {
    background: rgba(255,255,255,.78);
    border-color: rgba(219,229,239,.88);
    box-shadow: var(--shadow);
}

.search-row {
    border-color: #cad8e8;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.search-row:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(47,111,237,.12);
}

.search-icon {
    color: var(--accent);
}

.cat-chip {
    background: #f7fbff;
    border-color: #dce8f5;
    color: #52657a;
}

.cat-chip:hover {
    border-color: #b9cbe0;
    color: var(--text);
    background: #fff;
}

.cat-chip.active {
    background: linear-gradient(135deg, var(--accent), #5b8ff5);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 20px rgba(47,111,237,.20);
}

.grid {
    gap: 22px;
}

.card {
    height: 356px;
    border-color: rgba(219,229,239,.95);
    box-shadow: var(--shadow-sm);
    background: rgba(255,255,255,.94);
}

.card:hover {
    border-color: #b9cbe0;
    box-shadow: var(--shadow-hover);
}

.card-cover {
    background:
        linear-gradient(135deg, rgba(47,111,237,.08), rgba(16,185,129,.08)),
        #f3f7fb;
}

.card-cover img {
    filter: saturate(1.03) contrast(1.01);
}

.card-cover--ph {
    background:
        linear-gradient(135deg, rgba(47,111,237,.14), rgba(16,185,129,.14)),
        #eef6ff;
    color: #6c8bb4;
}

.card-body {
    padding: 15px;
}

.card-cat {
    background: var(--mint-soft);
    color: #047857;
    border-radius: 7px;
}

.card-cat:hover {
    background: #d9f8eb;
    color: #047857;
}

.card-title {
    font-size: 15.5px;
    color: var(--text);
}

.card-desc {
    color: var(--text-2);
}

.card-action {
    margin-top: auto;
    padding-top: 12px;
}

.detail-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #5b8ff5);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(47,111,237,.16);
    transition: transform .15s, box-shadow .15s, background .15s;
}

.detail-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(47,111,237,.22);
}

.detail-link svg {
    flex: 0 0 auto;
}

.drive-btn,
.drive-btn-lg {
    background: linear-gradient(135deg, var(--accent), #5b8ff5);
}

.drive-btn:hover,
.drive-btn-lg:hover,
.drive-btn-lg[data-index="0"]:hover {
    background: linear-gradient(135deg, var(--accent-hover), #447be8);
}

.drive-btn-lg[data-index="0"] {
    background: linear-gradient(135deg, var(--accent), #5b8ff5);
}

.drive-btn-lg[data-index="2"] {
    background: linear-gradient(135deg, var(--mint), #34d399);
}

.drive-btn-lg[data-index="2"]:hover {
    background: linear-gradient(135deg, #0f9f6e, #22c98b);
}

.drive-btn-lg[data-index="3"] {
    background: linear-gradient(135deg, var(--warm), #fbbf24);
}

.drive-btn-lg[data-index="3"]:hover {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.detail {
    border-color: rgba(219,229,239,.95);
    box-shadow: var(--shadow);
}

.detail-cat {
    background: var(--mint-soft);
    color: #047857;
}

.detail-title {
    color: var(--text);
}

.detail-meta {
    border-color: var(--border-2);
}

.page-link.active {
    background: linear-gradient(135deg, var(--accent), #5b8ff5);
    border-color: transparent;
}

@media (max-width: 640px) {
    .logo-text::before {
        width: 8px;
        height: 8px;
        margin-right: 7px;
    }

    .grid {
        gap: 14px;
    }

    .card {
        height: auto;
    }

    .card-action {
        padding-top: 10px;
    }

    .detail-link {
        height: 40px;
    }

    .detail-link {
        font-size: 13.5px;
    }

    .card-title a,
    .card-desc {
        word-break: break-word;
    }
}

@media (max-width: 420px) {
    .detail-link {
        height: 42px;
    }

    .card-body {
        padding: 13px;
    }
}

/* Category badge and configurable footer polish */
.card-body {
    position: relative;
}

.card-cat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    max-width: 100%;
    line-height: 1;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-title {
    margin-top: 0;
    clear: both;
}

.site-footer {
    padding: 30px 20px;
}

.footer-custom {
    max-width: 960px;
    margin: 0 auto;
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.8;
}

.footer-custom p {
    margin: 4px 0;
}

.footer-custom a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.footer-custom a:hover {
    color: var(--accent-hover);
}

.footer-default {
    margin: 0;
    color: var(--text-2);
    font-size: 13px;
}

.footer-icp {
    margin-top: 6px;
}

/* Final header/card fixes */
.logo-text::before {
    content: none !important;
    display: none !important;
}

.card {
    height: auto !important;
    min-height: 380px;
    overflow: visible;
}

.card-cover,
.card-cover-link {
    flex: 0 0 auto;
}

.card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.card-desc {
    min-height: 3.2em;
}

.card-action {
    margin-top: auto;
    padding-top: 14px;
    flex: 0 0 auto;
}

.detail-link {
    min-height: 42px;
    height: auto;
    line-height: 1.2;
    padding: 0 14px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .card {
        min-height: 0;
    }

    .card-desc {
        min-height: 0;
    }

    .detail-link {
        min-height: 42px;
    }
}

/* Card proportion refinement */
.grid {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 24px;
    max-width: 1120px;
}

.card {
    min-height: 0;
    height: 100% !important;
    overflow: hidden;
}

.card-cover {
    aspect-ratio: 16 / 9;
}

.card-cover--ph {
    font-size: 44px;
}

.card-body {
    padding: 16px;
}

.card-cat {
    margin-bottom: 12px;
}

.card-title {
    min-height: 0;
    margin-bottom: 10px;
}

.card-desc {
    min-height: 3.1em;
    margin-bottom: 12px;
}

.card-action {
    padding-top: 8px;
}

.detail-link {
    min-height: 40px;
}

@media (max-width: 1080px) {
    .grid {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
        max-width: 760px;
    }
}

@media (max-width: 640px) {
    .grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        gap: 16px;
    }

    .card {
        height: auto !important;
    }

    .card-cover {
        aspect-ratio: 16 / 9;
    }

    .card-desc {
        min-height: 0;
    }
}
