/* ============================================
   中小学电子资料下载站 - 主样式表
   兼容 ZBlog 模板结构
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --accent: #F97316;

    --success: #10B981;
    --danger: #EF4444;
    --bg: #F1F5F9;
    --bg-card: #FFFFFF;
    --text: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --header-h: 64px;
    --max-width: 1280px;
    --transition: 0.2s ease;
}

/* ---------- A11y: Screen Reader Only ---------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol { list-style: none; }

input, button, select {
    font-family: inherit;
    font-size: inherit;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Header ---------- */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

/* Desktop Nav */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-desktop .nav-item {
    position: relative;
}

.nav-desktop .nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-desktop .nav-link:hover,
.nav-desktop .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-desktop .nav-link .arrow {
    font-size: 10px;
    transition: transform var(--transition);
}

.nav-desktop .nav-item:hover .nav-link .arrow {
    transform: rotate(180deg);
}

/* Mega Dropdown */
.mega-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 24px;
    min-width: 640px;
    max-width: 800px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 100;
}

.nav-desktop .nav-item:hover .mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(4px);
}

.mega-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.mega-col h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.mega-col .sub-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mega-col .sub-tag {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--bg);
    transition: all var(--transition);
}

.mega-col .sub-tag:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* Mobile Category Nav */
.mobile-cat-nav { display: none; }

@media (max-width: 768px) {
    .mobile-cat-nav {
        display: flex;
        position: sticky;
        top: 52px;
        z-index: 99;
        gap: 6px;
        padding: 8px 12px;
        background: #fff;
        border-bottom: 1px solid #E5E7EB;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .mobile-cat-nav::-webkit-scrollbar { display: none; }
    .mobile-cat-link {
        display: flex;
        align-items: center;
        gap: 3px;
        padding: 6px 14px;
        font-size: 13px;
        font-weight: 600;
        color: #6B7280;
        background: #F3F4F6;
        border-radius: 20px;
        white-space: nowrap;
        transition: all 0.2s;
        flex-shrink: 0;
    }
    .mobile-cat-link:hover,
    .mobile-cat-link.active {
        color: #fff;
        background: var(--primary);
    }
    .mobile-cat-link .cat-icon { font-size: 14px; }
}

/* Header Search */
.header-search {
    display: flex;
    align-items: center;
    flex: 0 1 300px;
    max-width: 340px;
    height: 38px;
    background: var(--bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.header-search:focus-within {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.header-search-input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    padding: 0 14px;
    font-size: 0.88rem;
    min-width: 0;
}

.header-search-input::placeholder {
    color: var(--text-light);
}

.header-search-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.header-search-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 50%;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--bg);
    color: var(--text);
}

.menu-toggle {
    display: none;
}

/* ---------- Mobile Category Overlay ---------- */
.category-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.category-overlay.active {
    opacity: 1;
    visibility: visible;
}

.category-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: #fff;
    z-index: 2001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.category-overlay.active .category-panel {
    right: 0;
}

.category-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.category-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.category-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-secondary);
}

/* Level-1 Tabs in Panel */
.category-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-panel-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
    flex-shrink: 0;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
}

.cat-tab.active {
    color: var(--primary);
    font-weight: 600;
}

.cat-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* Level-2/3 Content in Panel */
.category-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.cat-l2-group {
    margin-bottom: 4px;
}

.cat-l2-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}

.cat-l2-toggle:hover,
.cat-l2-toggle.active {
    background: var(--primary-light);
    color: var(--primary);
}

.cat-l2-toggle .l2-arrow {
    font-size: 10px;
    transition: transform var(--transition);
}

.cat-l2-toggle.active .l2-arrow {
    transform: rotate(180deg);
}

.cat-l3-list {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 8px 12px 8px;
}

.cat-l2-toggle.active + .cat-l3-list {
    display: flex;
}

.cat-l3-tag {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 5px 12px;
    background: var(--bg);
    border-radius: 20px;
    transition: all var(--transition);
}

.cat-l3-tag:hover {
    color: #fff;
    background: var(--primary);
}

/* ---------- Main Layout ---------- */
.main {
    flex: 1;
    padding: 24px 0;
}

/* Two-column layout for homepage */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Section ---------- */
.section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.section-more {
    font-size: 13px;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.section-more:hover { color: var(--primary); }

/* ---------- Card Grid ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ---------- Article Card (Horizontal Image+Text) ---------- */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-thumb {
    position: relative;
    width: 180px;
    min-width: 180px;
    flex-shrink: 0;
    background: #E2E8F0;
    overflow: hidden;
}

.card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-thumb .card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
    z-index: 1;
}

.badge-hot { background: var(--danger); }
.badge-new { background: var(--success); }
.badge-recommend { background: var(--accent); }

.card-body {
    padding: 14px 16px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-category {
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 6px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
}

.card-title a:hover { color: var(--primary); }

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
}

.card-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ---------- Sidebar ---------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border);
}

.sidebar-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
    color: var(--text);
}

/* Sidebar hot list */
.hot-list li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.hot-list li:last-child { border-bottom: none; }

.hot-list a {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 6px;
    transition: color var(--transition);
}

.hot-list a:hover { color: var(--primary); }

.hot-list .hot-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--bg);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    flex-shrink: 0;
    margin-top: 2px;
}

.hot-list li:nth-child(1) .hot-num,
.hot-list li:nth-child(2) .hot-num,
.hot-list li:nth-child(3) .hot-num {
    background: var(--danger);
    color: #fff;
}

/* Copyright Card */
.copyright-card {
    background: linear-gradient(180deg, #F8FAFC 0%, #fff 40%);
    border: 1px solid #E2E8F0;
}

.copyright-card h4 {
    border-bottom: 2px solid #FDE68A;
}

.copyright-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.copyright-list li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 5px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    transition: all var(--transition);
}

.copyright-list li:hover {
    background: #FFFBEB;
}

.copyright-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: #F1F5F9;
    border-radius: 4px;
    margin-top: 1px;
}

/* Disclaimer Box */
.disclaimer-box {
    margin-top: 24px;
    padding: 16px 20px;
    background: #FEFCE8;
    border: 1px solid #FDE68A;
    border-left: 4px solid #F59E0B;
    border-radius: 8px;
    font-size: 13px;
    color: #92400E;
    line-height: 1.7;
}

.disclaimer-box h4 {
    font-size: 14px;
    font-weight: 600;
    color: #B45309;
    margin-bottom: 6px;
    border-bottom: none;
}

.disclaimer-box p {
    margin: 0;
    text-indent: 0;
}

/* Sidebar tags */
.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sidebar-tags a {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--bg);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.sidebar-tags a:hover {
    background: var(--primary);
    color: #fff;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-light); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ---------- List Page ---------- */
.list-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.list-filter {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* 年级标签换到第二行 */
.list-filter .filter-label:nth-of-type(2) {
    flex-basis: 100%;
    margin-top: 4px;
}

.filter-label-ml {
    margin-left: 8px;
}

.list-filter-suggestions {
    margin-bottom: 16px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tag {
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: #fff;
    cursor: pointer;
    transition: all var(--transition);
}

.filter-tag:hover,
.filter-tag.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* List items */
.list-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    gap: 16px;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.list-item:hover {
    box-shadow: var(--shadow-md);
}

.list-item-thumb {
    width: 180px;
    min-width: 180px;
    height: 120px;
    border-radius: var(--radius);
    overflow: hidden;
    background: #E2E8F0;
    flex-shrink: 0;
}

.list-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.list-item-cat {
    font-size: 12px;
    color: var(--primary);
}

.list-item-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-item-title a:hover { color: var(--primary); }

.list-item-desc {
    font-size: 13px;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-highlight {
    color: #EF4444;
    font-style: normal;
}

.list-item-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.list-item-footer .tag-disk {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.tag-baidu { background: #E8F4FD; color: #2468E6; }
.tag-quark { background: #FFF3E0; color: #E65100; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-secondary);
    background: #fff;
    cursor: pointer;
    transition: all var(--transition);
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.page-btn-ellipsis {
    border: none;
    color: var(--text-light);
    pointer-events: none;
}
.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- Detail Page ---------- */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.article {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border);
}

.article-header {
    margin-bottom: 20px;
}

.article-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Download Section (Dual Card) ---------- */
.download-box {
    margin: 24px 0;
}

.download-box-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-left: 2px;
}

.download-box-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 10px;
}

.dl-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 18px 16px;
    text-align: center;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    border: 1.5px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.dl-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.dl-card.card-bd {
    border-color: #BFDBFE;
    background: linear-gradient(180deg, #F0F7FF 0%, #fff 30%);
}

.dl-card.card-bd:hover { border-color: #93C5FD; }

.dl-card.card-qk {
    border-color: #FED7AA;
    background: linear-gradient(180deg, #FFF9F0 0%, #fff 30%);
}

.dl-card.card-qk:hover { border-color: #FDBA74; }

.dl-card .dl-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.dl-card.card-bd .dl-card-icon {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: #1D4ED8;
}

.dl-card.card-qk .dl-card-icon {
    background: linear-gradient(135deg, #FED7AA, #FDBA74);
    color: #C2410C;
}

.dl-card .dl-card-platform {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 3px;
}

.dl-card.card-bd .dl-card-platform { color: #1D4ED8; }
.dl-card.card-qk .dl-card-platform { color: #C2410C; }

.dl-card .dl-card-sub {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
    color: #fff;
}

.btn-baidu {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.btn-baidu:hover {
    background: linear-gradient(135deg, #1D4ED8, #1E40AF);
    box-shadow: 0 4px 16px rgba(37,99,235,0.4);
}

.btn-quark {
    background: linear-gradient(135deg, #F97316, #EA580C);
    box-shadow: 0 2px 8px rgba(249,115,22,0.25);
}

.btn-quark:hover {
    background: linear-gradient(135deg, #EA580C, #C2410C);
    box-shadow: 0 4px 16px rgba(249,115,22,0.4);
}

.btn-download .dl-icon { font-size: 16px; }

.download-box-tips {
    color: #92400E;
    font-size: 12px;
    text-align: center;
    padding: 0 4px;
}

/* Article Content */
.article-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
}

.article-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}

.article-content p {
    margin-bottom: 12px;
    text-indent: 2em;
}

.article-content ul {
    margin: 8px 0 16px;
    padding-left: 20px;
}

.article-content ul li {
    list-style: disc;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

/* Related Articles */
.related-articles {
    margin-top: 32px;
}

.related-articles h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}

.related-articles .card-title {
    font-size: 14px;
    -webkit-line-clamp: 3;
}

.related-articles .card-meta {
    font-size: 11px;
}

/* ---------- Search Page ---------- */
.search-header {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    text-align: center;
}

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 0;
}

.search-input-wrap {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 44px 0 16px;
    border: 2px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
}

.search-input:focus {
    border-color: var(--primary);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    display: none;
    align-items: center;
    justify-content: center;
}

.search-clear.visible { display: flex; }

.btn-search {
    height: 44px;
    padding: 0 28px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-search:hover { background: var(--primary-dark); }

.search-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.search-info strong {
    color: var(--primary);
}

/* ---------- Home Hero / Featured ---------- */
.hero-slider {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.hero-main {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: #667EEA;
    background-size: cover;
    background-position: center;
    min-height: 320px;
}

.hero-main::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102,126,234,0.45), rgba(118,75,162,0.65));
    z-index: 1;
}

.hero-main .hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
    z-index: 2;
}

.hero-main .hero-tag {
    display: inline-block;
    font-size: 12px;
    padding: 4px 10px;
    background: var(--accent);
    border-radius: 4px;
    margin-bottom: 8px;
}

.hero-main .hero-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hero-main .hero-desc {
    font-size: 13px;
    opacity: 0.85;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-side-item {
    flex: 1;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: #84C4FF;
    background-size: cover;
    background-position: center;
    min-height: 0;
}

.hero-side-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(132,196,255,0.4), rgba(59,130,246,0.6));
    z-index: 1;
}

.hero-side-item:nth-child(2) { background-color: #FCA5A5; }
.hero-side-item:nth-child(2)::after {
    background: linear-gradient(135deg, rgba(252,165,165,0.4), rgba(239,68,68,0.6));
}

.hero-side-item .hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    z-index: 2;
}

.hero-side-item .hero-tag {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    background: rgba(255,255,255,0.25);
    border-radius: 4px;
    margin-bottom: 4px;
}

.hero-side-item .hero-title {
    font-size: 15px;
    font-weight: 600;
}

/* ---------- 栏目分类（首页） ---------- */
.cat-section-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.cat-section-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 18px 16px 14px;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.cat-section-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.cat-sec-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.cat-sec-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.cat-sec-icon.elem { background: linear-gradient(135deg, #60A5FA, #3B82F6); }
.cat-sec-icon.mid { background: linear-gradient(135deg, #34D399, #10B981); }
.cat-sec-icon.high { background: linear-gradient(135deg, #F472B6, #EC4899); }
.cat-sec-icon.exam { background: linear-gradient(135deg, #FBBF24, #F59E0B); }

.cat-sec-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cat-sec-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.cat-sec-count {
    font-size: 12px;
    color: var(--text-light);
}

.cat-sec-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cat-sec-tags a {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg);
    color: var(--text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
}

.cat-sec-tags a:hover {
    background: var(--primary);
    color: #fff;
}

/* ---------- Footer ---------- */
.footer {
    background: #1E293B;
    color: #94A3B8;
    padding: 20px 16px;
    margin-top: 40px;
    text-align: center;
    font-size: 12px;
    line-height: 2;
}

.footer a {
    color: #94A3B8;
    transition: color 0.2s;
    margin: 0 6px;
}

.footer a:hover { color: #fff; }

.footer .footer-sep { color: #475569; margin: 0 2px; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* ---------- Back to Top ---------- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* Tablet */
@media (max-width: 1024px) {
    .home-layout,
    .list-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .sidebar { display: none; }

    .card-grid,
    .card-grid.col-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-thumb { width: 160px; min-width: 160px; }

    .hero-slider {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hero-main { min-height: 240px; }
    .hero-side {
        flex-direction: row;
    }
    .hero-side-item { min-height: 120px; }

    .cat-section-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --header-h: 56px;
    }

    .header { height: auto; }
    .header-inner { padding: 8px 12px; }

    .logo { font-size: 16px; }
    .logo-icon { width: 30px; height: 30px; font-size: 15px; }

    /* Hide desktop nav, show mobile toggle */
    .nav-desktop { display: none; }
    .menu-toggle { display: flex; }

    /* Header search on mobile - compact, same row */
    .header-search {
        display: flex;
        flex: 0 0 auto;
        width: 160px;
        height: 34px;
        border-radius: 17px;
        margin: 0 8px;
    }
    .header-search-input { font-size: 0.8rem; padding: 0 10px; }
    .header-search-btn { width: 32px; height: 34px; font-size: 0.9rem; }

    /* Category section */
    .cat-section-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .cat-section-card { padding: 14px 12px 12px; }
    .cat-sec-name { font-size: 14px; }
    .cat-sec-icon { width: 36px; height: 36px; font-size: 16px; }

    /* Card grid */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card-thumb { width: 140px; min-width: 140px; }
    .card-body { padding: 10px 14px; }
    .card-title { font-size: 14px; }
    .card-meta { font-size: 11px; gap: 8px; }

    .related-articles { margin-top: 24px; }
    .related-articles h4 { font-size: 15px; }
    .related-articles .card-title { font-size: 13px; -webkit-line-clamp: 2; }

    /* Hero */
    .hero-slider { gap: 10px; margin-bottom: 24px; }
    .hero-main { min-height: 180px; border-radius: var(--radius); }
    .hero-side { gap: 10px; }
    .hero-side-item { min-height: 90px; border-radius: var(--radius); }
    .hero-main .hero-content { padding: 16px; }
    .hero-main .hero-title { font-size: 16px; }
    .hero-main .hero-desc { font-size: 12px; }
    .hero-side-item .hero-content { padding: 12px; }
    .hero-side-item .hero-title { font-size: 13px; }

    /* List page */
    .list-filter { padding: 12px; gap: 8px; }
    .list-item { flex-direction: column; padding: 12px; }
    .list-item-thumb {
        width: 100%;
        min-width: 100%;
        height: 180px;
    }
    .list-item-info { gap: 8px; }
    .list-item-title { font-size: 15px; }

    /* Detail */
    .article { padding: 16px; }
    .article-title { font-size: 18px; }
    .article-content { font-size: 14px; }
    .article-content h3 { font-size: 16px; }
    .btn-download { padding: 8px 0; font-size: 13px; }
    .download-box-grid { gap: 12px; }
    .dl-card { padding: 16px 12px 14px; }
    .dl-card .dl-card-icon { width: 40px; height: 40px; font-size: 18px; }
    .dl-card .dl-card-platform { font-size: 14px; }

    /* Search */
    .search-header { padding: 16px; }

    /* Section title */
    .section-title { font-size: 17px; }

    .footer { padding: 16px 12px; }

    /* Breadcrumb */
    .breadcrumb { font-size: 12px; }

    /* Pagination */
    .page-btn { width: 32px; height: 32px; font-size: 13px; }

    /* Disclaimer */
    .disclaimer-box { margin-top: 16px; padding: 10px 12px; font-size: 11px; line-height: 1.5; border-left-width: 3px; }
    .disclaimer-box h4 { font-size: 12px; margin-bottom: 4px; }
}

/* Small Mobile */
@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .card { flex-direction: column; }
    .card-thumb { width: 100%; min-width: 100%; padding-top: 52%; }
    .card-body { padding: 10px 12px; }
    .card-title { font-size: 13px; }

    .related-articles { margin-top: 20px; }
    .related-articles h4 { font-size: 14px; }
    .related-articles .card-title { font-size: 12px; }

    .hero-main { min-height: 160px; }
    .hero-side-item { min-height: 80px; }
    .hero-main .hero-title { font-size: 14px; }
    .hero-side-item .hero-title { font-size: 12px; }

    .search-form { flex-direction: column; gap: 8px; }
    .search-input {
        border-radius: var(--radius);
        border-right: 2px solid var(--border);
    }
    .btn-search {
        border-radius: var(--radius);
        width: 100%;
    }
    .search-clear { right: 12px; }

    .footer a { display: inline-block; margin: 0 4px; }

    .pagination { gap: 2px; flex-wrap: wrap; }

    .download-box-grid { grid-template-columns: 1fr; gap: 10px; }
    .dl-card { padding: 14px 16px; }
    .btn-download { font-size: 13px; }

    .cat-section-grid { grid-template-columns: 1fr; }

    .disclaimer-box { padding: 8px 10px; font-size: 10px; margin-top: 12px; }
    .disclaimer-box h4 { font-size: 11px; }
}
