/* ============================================================
   学习资料网 前台样式
   ============================================================ */
:root {
    --primary: #2f6bff;
    --primary-dark: #1e50d8;
    --primary-light: #eaf0ff;
    --accent: #ff9f43;
    --green: #22c55e;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --bg: #f5f7fb;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(31, 45, 61, .08);
    --shadow-hover: 0 8px 28px rgba(47, 107, 255, .16);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: 90%; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部 ---------- */
.site-header {
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(150%) blur(10px);
    -webkit-backdrop-filter: saturate(150%) blur(10px);
    border-bottom: 1px solid rgba(229,231,235,.7);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 18px rgba(31,45,61,.06);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--primary); white-space: nowrap; }
.logo-icon {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #6a5bff);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; box-shadow: 0 4px 10px rgba(47,107,255,.28);
}
.logo-text { letter-spacing: .5px; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
.nav::-webkit-scrollbar { display: none; }
/* 悬停导航时解除横向滚动裁剪，避免下拉菜单被裁切 */
.nav:hover { overflow-x: visible; }
.nav-item { position: relative; display: inline-flex; }
.nav-link {
    position: relative;
    display: inline-flex; align-items: center;
    padding: 7px 13px; border-radius: 9px; color: #475569;
    font-size: 15px; font-weight: 500; white-space: nowrap;
    transition: color .2s, background .2s;
}
/* 悬停/当前项的渐变指示条 */
.nav-link::after {
    content: ''; position: absolute; left: 50%; bottom: 1px; width: 0; height: 3px;
    border-radius: 3px; background: linear-gradient(90deg, var(--primary), #6a5bff);
    transform: translateX(-50%); opacity: 0;
    transition: width .25s ease, opacity .25s ease;
}
.nav-link:hover { color: var(--primary); background: rgba(47,107,255,.07); }
.nav-link:hover::after { width: 56%; opacity: 1; }
.nav-link.active { color: var(--primary); background: rgba(47,107,255,.09); font-weight: 600; }
.nav-link.active::after { width: 56%; opacity: 1; }
/* 年级导航项的下拉指示箭头 */
.nav-caret {
    display: inline-block; width: 6px; height: 6px; margin-left: 6px;
    border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg) translateY(-2px); transition: transform .25s ease; opacity: .7;
}
.nav-item:hover .nav-caret { transform: rotate(225deg) translateY(0); opacity: 1; }
/* 下拉子菜单：外层为悬停热区（padding 桥接导航项与面板，鼠标移动不中断） */
.dropdown {
    position: absolute; top: 100%; left: 50%;
    padding-top: 12px;
    transform: translateX(-50%) translateY(8px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
    z-index: 300;
}
.dropdown-panel {
    position: relative; min-width: 156px; background: #fff;
    border: 1px solid rgba(47,107,255,.14); border-radius: 12px; padding: 7px;
    box-shadow: 0 14px 36px rgba(31,45,61,.14), 0 4px 10px rgba(31,45,61,.06);
}
/* 顶部小三角（描边 + 填充） */
.dropdown-panel::after {
    content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent;
    border-bottom: 9px solid rgba(47,107,255,.14); z-index: 0;
}
.dropdown-panel::before {
    content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent;
    border-bottom: 9px solid #fff; z-index: 1;
}
.nav-item:hover .dropdown { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.dropdown-link {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 13px; border-radius: 8px;
    font-size: 14px; color: #374151; white-space: nowrap;
    transition: background .18s ease, color .18s ease, padding-left .18s ease;
}
.dropdown-link::before {
    content: ''; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%;
    background: var(--primary-light); border: 1px solid #c9d8ff; transition: all .18s ease;
}
.dropdown-link:hover {
    background: linear-gradient(90deg, rgba(47,107,255,.10), rgba(47,107,255,.04));
    color: var(--primary); padding-left: 17px;
}
.dropdown-link:hover::before { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.search-box { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.search-box input { border: 0; outline: 0; background: transparent; padding: 7px 14px; width: 170px; font-size: 14px; }
.search-box button {
    border: 0; border-radius: 999px; background: var(--primary); color: #fff;
    padding: 8px 18px; cursor: pointer; font-size: 14px; transition: background .2s;
}
.search-box button:hover { background: var(--primary-dark); }
.nav-toggle { display: none; border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--text); }

/* ---------- 首页 Hero ---------- */
.hero {
    background: linear-gradient(120deg, #1e50d8 0%, #2f6bff 55%, #6a5bff 100%);
    color: #fff;
    padding: 56px 0 64px;
    position: relative;
    overflow: hidden;
}
.hero::before, .hero::after {
    content: ''; position: absolute; border-radius: 50%;
    background: rgba(255,255,255,.07);
}
.hero::before { width: 380px; height: 380px; top: -140px; right: -80px; }
.hero::after { width: 220px; height: 220px; bottom: -90px; left: 12%; }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; position: relative; z-index: 1; }
.hero-text { max-width: 640px; }
.hero-badge {
    display: inline-block; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
    padding: 5px 14px; border-radius: 999px; font-size: 13px; margin-bottom: 18px;
}
.hero h1 { font-size: 36px; line-height: 1.4; font-weight: 800; margin-bottom: 6px; }
.hero-subtitle {
    font-size: 20px; font-weight: 600; opacity: .95; margin-bottom: 14px;
    letter-spacing: 2px;
}
.hero p { font-size: 16px; opacity: .92; margin-bottom: 26px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; }
.btn {
    display: inline-block; padding: 11px 26px; border-radius: 999px;
    font-size: 15px; font-weight: 600; transition: all .2s; border: 0; cursor: pointer;
}
.btn-primary { background: #fff; color: var(--primary-dark); }
.btn-solid {
    background: linear-gradient(135deg, #2f6bff, #6a5bff); color: #fff !important;
    text-decoration: none; box-shadow: 0 8px 20px rgba(47,107,255,.28);
}
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(47,107,255,.36); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.26); }
.btn-lg { padding: 12px 34px; font-size: 16px; }
.hero-stats { display: flex; gap: 14px; }
.stat-item {
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--radius); padding: 18px 24px; text-align: center; backdrop-filter: blur(4px);
}
.stat-item b { display: block; font-size: 26px; font-weight: 800; }
.stat-item span { font-size: 13px; opacity: .85; }

/* ---------- 页面骨架 ---------- */
.site-main { min-height: 60vh; padding: 24px 0 48px; }
.page-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 20px; margin-top: 24px; }
.main-col { min-width: 0; }
.panel {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 22px; margin-bottom: 20px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-title { font-size: 18px; font-weight: 700; position: relative; padding-left: 14px; }
.panel-title::before {
    content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px;
    background: linear-gradient(180deg, var(--primary), #6a5bff); border-radius: 4px;
}
.panel-more { color: var(--primary); font-size: 14px; }
.panel-more:hover { text-decoration: underline; }
/* 全部资料页：标题+徽标 / 搜索框 / 返回首页 三段式面板头 */
.latest-head { gap: 14px; flex-wrap: wrap; }
.latest-head .cat-search { margin-left: auto; }
.latest-head .panel-more { white-space: nowrap; }
.badge-count {
    display: inline-block; vertical-align: middle; margin-left: 8px;
    background: var(--primary-light); color: var(--primary);
    border: 1px solid #d3dfff; padding: 0 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600;
}
.cat-desc { color: var(--text-light); font-size: 14px; margin: -6px 0 14px; }

/* ---------- 子类切换导航 ---------- */
.sub-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.sub-nav-item {
    display: inline-block; padding: 4px 14px; border-radius: 999px;
    background: #fff; border: 1px solid var(--border); color: var(--text);
    font-size: 13px; transition: all .2s;
}
.sub-nav-item:hover { border-color: var(--primary); color: var(--primary); }
.sub-nav-item.active { background: var(--primary); border-color: var(--primary); color: #fff; }
/* ---------- 学科筛选导航 ---------- */
.subject-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.subject-nav-item {
    display: inline-block; padding: 4px 14px; border-radius: 999px;
    background: #fff; border: 1px solid var(--border); color: var(--text);
    font-size: 13px; transition: all .2s;
}
.subject-nav-item:hover { border-color: var(--accent); color: var(--accent); }
.subject-nav-item.active { background: linear-gradient(135deg, var(--accent), #ff6b6b); border-color: transparent; color: #fff; }
/* ---------- 学科筛选行内关键词搜索 ---------- */
.subject-nav-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cat-search {
    margin-left: auto;
    display: flex; align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 3px 3px 13px;
    box-shadow: inset 0 1px 2px rgba(31, 45, 61, .03);
    transition: background .22s, border-color .22s, box-shadow .22s;
}
.cat-search:hover { border-color: #cbd5e1; background: #fff; }
.cat-search:focus-within {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, .13), 0 6px 18px rgba(47, 107, 255, .10);
}
.cs-icon { display: inline-flex; color: #a6b1c2; transition: color .22s; }
.cat-search:focus-within .cs-icon { color: var(--primary); }
.cs-input {
    border: 0; outline: 0; background: transparent;
    width: 200px; padding: 6px 10px; font-size: 14px; color: var(--text);
    font-family: inherit;
}
.cs-input::placeholder { color: #a9b4c6; }
.cs-btn {
    border: 0; border-radius: 999px; cursor: pointer;
    background: linear-gradient(135deg, var(--primary), #6a5bff);
    color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 1px;
    padding: 7px 20px;
    box-shadow: 0 2px 8px rgba(47, 107, 255, .26);
    transition: transform .18s, box-shadow .18s, filter .18s;
}
.cs-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(47, 107, 255, .34); filter: brightness(1.05); }
.cs-btn:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(47, 107, 255, .28); }
.filter-tip {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin: -4px 0 14px; padding: 9px 14px; border-radius: 8px;
    background: #f2f6ff; border: 1px solid #d6e2ff; color: #1e40af; font-size: 13px;
}
.filter-tip b { color: var(--primary); font-weight: 700; }
.filter-tip a { color: #1e50d8; text-decoration: underline; }
.filter-tip a:hover { color: var(--primary-dark); }
.doc-subject {
    display: inline-block; margin-left: 6px; padding: 0 8px;
    background: #f3e8ff; color: #9333ea; border-radius: 4px;
    font-size: 12px; font-style: normal; font-weight: 500;
}

/* ---------- 标签式导航（首页最新学习资料） ---------- */
.tab-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; border-bottom: 2px solid #eef2f8; }
.tab-item {
    padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--text-light);
    border-radius: 8px 8px 0 0; transition: all .2s;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab-item:hover { color: var(--primary); background: var(--primary-light); }
.tab-item.active { color: var(--primary); background: var(--primary-light); border-bottom-color: var(--primary); }

/* ---------- 最新资料行式列表 ---------- */
.latest-list { display: flex; flex-direction: column; }
.latest-row {
    display: flex; align-items: center; gap: 14px; padding: 10px 6px;
    border-bottom: 1px dashed var(--border); transition: background .15s;
}
.latest-row:last-child { border-bottom: 0; }
.latest-row:hover { background: #f6f9ff; }
.lr-thumb {
    width: 56px; height: 42px; border-radius: 6px; overflow: hidden; flex-shrink: 0;
    background: var(--primary-light); display: flex;
}
.lr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lr-thumb i {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-style: normal; font-weight: 700; font-size: 18px; color: #fff;
    background: linear-gradient(135deg, #2f6bff 0%, #6a5bff 100%);
}
.lr-title {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 14px; font-weight: 600;
}
.latest-row:hover .lr-title { color: var(--primary); }
.lr-tags { display: flex; gap: 6px; flex-shrink: 0; }
.lr-tags em {
    display: inline-block; padding: 1px 9px; border-radius: 999px;
    font-size: 12px; font-style: normal; font-weight: 600;
}
.lr-vol { background: #e8f0ff; color: #2f6bff; }
.lr-sub { background: #f3e8ff; color: #9333ea; }
.lr-meta { display: flex; gap: 12px; color: var(--text-light); font-size: 12px; flex-shrink: 0; }
.latest-empty { padding: 32px 0; text-align: center; color: var(--text-light); font-size: 14px; }

/* ---------- 资料卡片 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.doc-card {
    background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
    transition: all .22s;
}
.doc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: #c9d8ff; }
.doc-thumb { position: relative; aspect-ratio: 3/2; background: var(--primary-light); }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 800; color: #fff; letter-spacing: 1px;
    background: linear-gradient(135deg, #2f6bff 0%, #6a5bff 60%, #9b7bff 100%);
    text-shadow: 0 2px 6px rgba(0,0,0,.15);
    text-align: center; line-height: 1.25; padding: 0 4px; word-break: keep-all;
}
.doc-cat {
    position: absolute; left: 10px; top: 10px; background: rgba(47,107,255,.92); color: #fff;
    font-size: 12px; padding: 2px 10px; border-radius: 999px;
}
.doc-body { padding: 12px 14px 14px; }
.doc-title {
    font-size: 14px; font-weight: 600; line-height: 1.5; min-height: 42px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.doc-card:hover .doc-title { color: var(--primary); }
.doc-meta { display: flex; gap: 12px; color: var(--text-light); font-size: 12px; margin-top: 8px; }

/* ---------- 列表 ---------- */
.doc-list { list-style: none; }
.doc-list li { border-bottom: 1px dashed var(--border); padding: 11px 2px; }
.doc-list li:last-child { border-bottom: 0; }
.doc-list a { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.doc-list-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list a:hover .doc-list-title { color: var(--primary); }
.doc-list-meta { color: var(--text-light); font-size: 13px; white-space: nowrap; }

/* ---------- 文章列表（分类页） ---------- */
.article-list { list-style: none; }
.article-item {
    display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px dashed var(--border);
}
.article-item:last-child { border-bottom: 0; }
.article-thumb {
    flex: 0 0 150px; height: 100px; border-radius: 8px; overflow: hidden; background: var(--primary-light);
}
.article-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.article-item:hover .article-thumb img { transform: scale(1.05); }
.article-info { flex: 1; min-width: 0; }
.article-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.article-title a:hover { color: var(--primary); }
.article-desc {
    color: var(--text-light); font-size: 14px; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.article-meta { display: flex; gap: 14px; color: var(--text-light); font-size: 13px; margin-top: 8px; }
.tag {
    display: inline-block; background: var(--primary-light); color: var(--primary);
    padding: 1px 10px; border-radius: 999px; font-size: 12px;
}
.tag-subject { background: #f3e8ff; color: #9333ea; }

/* ---------- 分页 ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 6px 13px; border-radius: 8px; background: var(--bg); color: var(--text);
    font-size: 14px; border: 1px solid var(--border);
}
.pagination a:hover { color: var(--primary); border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 详情页 ---------- */
.detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 20px; margin-top: 20px; }
.breadcrumb { font-size: 14px; color: var(--text-light); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .cur { color: var(--text); }
.detail-head { border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 16px; }
.detail-head h1 { font-size: 26px; line-height: 1.5; font-weight: 800; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-light); font-size: 13px; margin-top: 12px; }
.detail-desc {
    background: var(--primary-light); border-left: 4px solid var(--primary);
    padding: 12px 16px; border-radius: 6px; color: #374151; font-size: 14px; margin-bottom: 18px;
}
.download-box {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: linear-gradient(120deg, #fff7ec, #fff);
    border: 1px dashed #f0b877; border-radius: 10px; padding: 18px 20px; margin-bottom: 20px;
}
.download-info { display: flex; flex-direction: column; gap: 4px; }
.download-info b { font-size: 16px; color: var(--accent); }
.download-info span { color: var(--text-light); font-size: 13px; }
.detail-content { font-size: 15px; color: #374151; }
.detail-content p { margin-bottom: 14px; }
.detail-content img { border-radius: 8px; margin: 8px 0; }
.detail-content .kw-inline {
    color: var(--primary); font-weight: 700;
    background: var(--primary-light); padding: 0 4px; border-radius: 4px;
}
.tag-section {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-top: 22px; padding: 14px 0 4px; border-top: 1px dashed #e5e7eb;
}
.tag-section-title { font-size: 14px; font-weight: 700; color: var(--text-light); margin-right: 2px; }
.tag-item {
    display: inline-block; background: var(--primary-light); color: var(--primary);
    padding: 3px 12px; border-radius: 999px; font-size: 13px; border: 1px solid #d3dfff;
    text-decoration: none; transition: all .18s ease;
}
.tag-item:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pan-box { margin-top: 18px; text-align: center; }
.btn-pan {
    display: inline-block; padding: 13px 36px; border-radius: 999px;
    font-size: 15px; font-weight: 700; background: linear-gradient(135deg, #2f6bff, #6a5bff);
    color: #fff; box-shadow: 0 6px 18px rgba(47,107,255,.28);
}
.btn-pan:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(47,107,255,.38); }

/* ---------- 侧栏 ---------- */
.hot-list { list-style: none; counter-reset: hot; }
.hot-list li { border-bottom: 1px dashed var(--border); padding: 9px 2px; font-size: 14px; }
.hot-list li:last-child { border-bottom: 0; }
.hot-list a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-list a:hover { color: var(--primary); }
.hot-list em {
    display: inline-block; width: 20px; height: 20px; line-height: 20px; text-align: center;
    background: var(--primary-light); color: var(--primary); border-radius: 5px;
    font-style: normal; font-size: 12px; margin-right: 8px;
}
.hot-list li:nth-child(-n+3) em { background: linear-gradient(135deg, #ff9f43, #ff6b6b); color: #fff; }
.side-cats { list-style: none; }
.side-cats li { border-bottom: 1px dashed var(--border); }
.side-cats li:last-child { border-bottom: 0; }
.side-cats a { display: flex; justify-content: space-between; padding: 10px 2px; color: var(--text); text-decoration: none; }
.side-cats a:hover { color: var(--primary); }
.side-cats span { color: var(--text-light); font-size: 13px; }

/* ---------- 分类横幅 ---------- */
.page-banner {
    background: linear-gradient(120deg, #2f6bff, #6a5bff);
    color: #fff; padding: 34px 0; text-align: center; border-radius: 0 0 20px 20px;
}
.page-banner h1 { font-size: 28px; margin-bottom: 8px; }
.page-banner p { opacity: .92; font-size: 15px; max-width: 760px; margin: 0 auto; }
.page-banner-meta { margin-top: 12px; font-size: 13px; opacity: .85; }

/* ---------- 页脚 ---------- */
.site-footer { background: #111827; color: #9ca3af; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding: 36px 0 24px; }
.footer-brand h3 { color: #fff; font-size: 20px; margin-bottom: 10px; }
.footer-brand p { font-size: 14px; line-height: 1.8; }
.footer-links h4, .footer-info h4 { color: #e5e7eb; font-size: 15px; margin-bottom: 12px; }
.footer-links a { display: inline-block; margin: 0 12px 8px 0; font-size: 14px; }
.footer-links a:hover, .footer-info a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08); padding: 16px 0; text-align: center; font-size: 13px;
}

.empty-tip { text-align: center; color: var(--text-light); padding: 40px 0; font-size: 15px; }

/* ---------- 404 页面 ---------- */
.error-wrap { padding: 40px 0 20px; }
.error-box {
    text-align: center; background: #fff; border: 1px solid var(--border); border-radius: 18px;
    padding: 44px 24px; box-shadow: var(--shadow);
}
.error-code {
    font-size: 76px; font-weight: 800; line-height: 1; letter-spacing: 2px;
    background: linear-gradient(120deg, #2f6bff, #6a5bff);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.error-box h1 { font-size: 22px; margin: 14px 0 10px; color: var(--text); }
.error-box p { color: var(--text-light); font-size: 14px; max-width: 620px; margin: 0 auto 22px; line-height: 1.8; }
.error-search { display: flex; gap: 10px; max-width: 560px; margin: 0 auto 20px; }
.error-search input {
    flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 11px 18px;
    font-size: 14px; outline: none; transition: all .18s ease; background: #f9fbff;
}
.error-search input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.error-search button {
    border: 0; border-radius: 999px; padding: 0 24px; font-size: 14px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #2f6bff, #6a5bff); cursor: pointer; transition: all .18s ease;
}
.error-search button:hover { filter: brightness(1.06); }
.error-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin-bottom: 24px; }
.error-links a {
    padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--text);
    background: #f4f7ff; border: 1px solid var(--border); text-decoration: none; transition: all .18s ease;
}
.error-links a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.error-hot { margin-top: 22px; }
@media (max-width: 720px) {
    .error-code { font-size: 58px; }
    .error-search { flex-direction: column; }
    .error-search button { padding: 11px 0; }
    .error-box { padding: 34px 16px; }
}

/* ---------- HTML 站点地图 ---------- */
.sitemap-group { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.sitemap-group:first-of-type { padding-top: 4px; }
.sitemap-group:last-child { border-bottom: 0; }
.sitemap-grade { font-size: 15px; margin-bottom: 8px; }
.sitemap-grade a { color: var(--primary); font-weight: 700; }
.sitemap-links { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.sitemap-links a {
    display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px;
    background: var(--bg-soft, #f4f7ff); color: var(--text); border: 1px solid var(--border);
    transition: all .18s ease;
}
.sitemap-links a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.sitemap-docs { list-style: none; }
.sitemap-docs li {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 10px 2px; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.sitemap-docs li:last-child { border-bottom: 0; }
.sitemap-docs a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sitemap-docs a:hover { color: var(--primary); }
.sitemap-docs em { color: var(--text-light); font-size: 12px; font-style: normal; flex: none; }

/* 详情页分类标签可点击 */
a.tag, a.tag-subject { text-decoration: none; transition: all .18s ease; }
a.tag:hover { background: var(--primary); color: #fff; }
a.tag-subject:hover { background: #9333ea; color: #fff; }

@media (max-width: 720px) {
    .sitemap-docs em { display: none; }
    .sitemap-group { padding: 10px 0; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    .card-grid { grid-template-columns: repeat(3, 1fr); }
    .page-grid, .detail-layout { grid-template-columns: 1fr; }
    .side-col { display: none; }
}
@media (max-width: 720px) {
    .header-inner { gap: 10px; height: 62px; }
    .nav { display: none; }
    .nav.open { display: flex; flex-direction: column; position: absolute; top: 62px; left: 0; right: 0; background: #fff; padding: 12px 16px; box-shadow: var(--shadow); }
    .nav.open .nav-item { display: block; }
    .nav.open .nav-link { display: flex; }
    .nav.open .nav-link::after { display: none; }
    /* 移动端展开菜单中，子菜单静态展示 */
    .nav.open .dropdown { position: static; padding-top: 0; opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
    .nav.open .dropdown-panel { box-shadow: none; border: 0; border-radius: 0; padding: 0 0 6px 18px; background: transparent; }
    .nav.open .dropdown-panel::before, .nav.open .dropdown-panel::after { display: none; }
    .nav.open .dropdown-link { padding: 6px 12px; }
    .nav.open .dropdown-link::before { display: none; }
    .search-box input { width: 100px; }
    .nav-toggle { display: block; }
    .hero h1 { font-size: 26px; }
    .hero-stats { display: none; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .article-thumb { flex: 0 0 96px; height: 72px; }
    /* 移动端最新资料行：缩略图缩小、隐藏发布时间、标签紧凑 */
    .lr-thumb { width: 44px; height: 34px; }
    .lr-tags em { padding: 0 7px; font-size: 11px; }
    .lr-meta > span:first-child { display: none; }
    /* 全部资料页移动端：搜索框整行后隐藏返回首页（顶部导航已有入口） */
    .latest-head .panel-more { display: none; }
    /* 移动端学科筛选行内搜索：整行换行、输入框自适应 */
    .cat-search { margin-left: 0; width: 100%; margin-top: 4px; }
    .cs-input { flex: 1; width: auto; min-width: 0; }
    .footer-inner { grid-template-columns: 1fr; }
    .download-box { flex-direction: column; align-items: flex-start; }
}

/* 小屏（≤480px）头部压缩，避免横向溢出 */
@media (max-width: 480px) {
    .header-inner { gap: 8px; height: 58px; }
    .logo { gap: 7px; font-size: 16px; }
    .logo-icon { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; box-shadow: 0 3px 8px rgba(47,107,255,.24); }
    .search-box { padding: 2px; }
    .search-box input { width: 72px; padding: 6px 8px; font-size: 13px; }
    .search-box button { padding: 7px 12px; font-size: 13px; }
    .nav-toggle { font-size: 19px; }
    .page-banner { padding: 26px 0; }
    .page-banner h1 { font-size: 23px; }
    .page-banner p { font-size: 13px; padding: 0 6px; }
    .page-banner-meta { font-size: 12px; }
}

/* 首页专题小卡 + 常见问题 */
.topic-mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.topic-mini {
    display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px;
    background: linear-gradient(160deg, #f6f9ff, #ffffff); border: 1px solid var(--border);
    text-decoration: none; transition: all .2s ease;
}
.topic-mini:hover { border-color: #cfdbfa; box-shadow: 0 8px 20px rgba(29,78,216,.12); transform: translateY(-2px); }
.topic-mini b { font-size: 16px; color: var(--text); }
.topic-mini span { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.topic-mini em { font-size: 12px; color: var(--text-light); font-style: normal; }

.faq-list { display: flex; flex-direction: column; gap: 14px; }
.faq-item { padding: 0 0 14px; border-bottom: 1px dashed var(--border); }
.faq-item:last-child { padding-bottom: 0; border-bottom: 0; }
.faq-q { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.faq-idx {
    flex: none; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700;
    color: #fff; background: linear-gradient(135deg, var(--primary), #6a5bff);
    display: inline-flex; align-items: center; justify-content: center;
}
.faq-a { font-size: 13.5px; color: var(--text-light); line-height: 1.85; padding-left: 28px; }

@media (max-width: 720px) {
    .topic-mini-grid { grid-template-columns: 1fr; }
    .faq-a { padding-left: 0; }
}

/* ================= 学习专题 ================= */
.topic-chip {
    display: inline-block; padding: 2px 12px; margin-bottom: 10px; border-radius: 999px;
    font-size: 12px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.42);
}
.topic-nav { margin-bottom: 14px; }
.topic-intro { margin-bottom: 16px; }
.topic-intro-text { color: var(--text-light); font-size: 14px; line-height: 1.9; }
.topic-kw { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.topic-kw > span { font-size: 13px; color: var(--text-light); }

.topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 18px; }
.topic-card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border);
    border-radius: 16px; padding: 20px; text-decoration: none; color: var(--text);
    box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s;
    position: relative; overflow: hidden;
}
.topic-card::after {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), #6a5bff, var(--accent));
    opacity: .9;
}
.topic-card:hover { transform: translateY(-3px); border-color: #cfdbfa; box-shadow: 0 14px 30px rgba(29,78,216,.14); }
.topic-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.topic-name { font-size: 19px; font-weight: 800; color: var(--text); }
.topic-count { font-size: 12px; color: var(--primary); background: var(--primary-light); padding: 2px 10px; border-radius: 999px; flex: none; }
.topic-subtitle { font-size: 13px; color: var(--accent); margin: 6px 0 12px; font-weight: 600; }
.topic-samples { list-style: none; flex: 1; }
.topic-samples li {
    font-size: 13px; color: var(--text-light); line-height: 1.6; padding: 4px 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topic-samples li::before { content: '·'; margin-right: 6px; color: var(--primary); font-weight: 800; }
.topic-empty { font-size: 13px; color: var(--text-light); flex: 1; }
.topic-more { margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--primary); }
.topic-card:hover .topic-more { text-decoration: underline; }
.topic-explain p { font-size: 14px; color: var(--text-light); line-height: 1.95; }

.empty-sub { font-size: 14px; margin: 8px 0 16px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

@media (max-width: 960px) {
    .topic-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .topic-card { padding: 16px; }
    .topic-name { font-size: 17px; }
    .topic-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
    .topic-nav::-webkit-scrollbar { display: none; }
    .topic-nav .sub-nav-item { flex: none; }
    .topic-intro .panel-head { padding-bottom: 4px; }
}

/* ================= H5 移动端深化 ================= */
/* 详情页吸底下载条：仅移动端出现 */
.m-dl-bar { display: none; }
@keyframes mbar-in { from { transform: translateY(110%); } to { transform: translateY(0); } }

@media (max-width: 720px) {
    /* 1. 吸底下载条 */
    .m-dl-bar {
        display: flex; align-items: center; gap: 12px;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255,255,255,.97);
        -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
        border-top: 1px solid var(--border);
        box-shadow: 0 -6px 22px rgba(15,23,42,.10);
        animation: mbar-in .28s ease both;
    }
    .m-dl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
    .m-dl-info b {
        font-size: 13px; color: var(--text); font-weight: 600;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .m-dl-info span { font-size: 11px; color: var(--text-light); }
    .m-dl-btn {
        flex: none; padding: 10px 22px; border-radius: 999px;
        font-size: 14px; font-weight: 700; color: #fff; text-decoration: none;
        background: linear-gradient(135deg, var(--primary), #6a5bff);
        box-shadow: 0 6px 16px rgba(47,107,255,.30);
    }
    .m-dl-btn:active { transform: translateY(1px); }
    body:has(.m-dl-bar) { padding-bottom: 72px; }

    /* 2. 筛选行横向滑动（册 / 学科胶囊一屏排开，可左右滑） */
    .sub-nav, .subject-nav-list {
        flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
        margin-right: -16px; padding-right: 16px; padding-bottom: 3px;
        scroll-snap-type: x proximity;
    }
    .sub-nav::-webkit-scrollbar, .subject-nav-list::-webkit-scrollbar { display: none; }
    .sub-nav-item, .subject-nav-item { flex: none; scroll-snap-align: start; }
    .subject-nav-list { width: 100%; }

    /* 3b. 全部资料页搜索行吸顶 */
    .latest-head {
        position: sticky; top: 0; z-index: 30;
        background: #fff; margin: -22px -22px 12px; padding: 12px 16px 10px;
        border-bottom: 1px solid #eef2fb; border-radius: var(--radius) var(--radius) 0 0;
    }
    .latest-head .panel-title { font-size: 16px; }
    .latest-head .badge-count { font-size: 11px; }

    /* 3. 分类页搜索行吸顶（滚动时随时可搜） */
    .subject-nav {
        position: sticky; top: 0; z-index: 30;
        background: rgba(255,255,255,.96);
        -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
        padding: 10px 0 8px; margin: 0 0 10px;
        border-bottom: 1px solid rgba(226,232,240,.9);
    }

    /* 4. 列表卡片化 */
    .panel:has(.article-list) { background: transparent; border: 0; box-shadow: none; padding: 0; }
    .panel:has(.article-list) .panel-head { padding: 0 2px; }
    .article-list { display: flex; flex-direction: column; gap: 12px; }
    .article-item {
        background: #fff; border: 1px solid #e8edf7; border-radius: 14px;
        padding: 12px; gap: 12px; border-bottom: 1px solid #e8edf7;
        box-shadow: 0 2px 10px rgba(15,23,42,.055);
    }
    .article-item:active { box-shadow: 0 1px 4px rgba(15,23,42,.10); }
    .article-thumb { flex: 0 0 92px; height: 68px; border-radius: 10px; }
    .article-title { font-size: 15px; line-height: 1.42; margin-bottom: 4px; }
    .article-desc { font-size: 12.5px; line-height: 1.6; -webkit-line-clamp: 2; }
    .article-meta { font-size: 12px; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
    .article-meta .tag { padding: 0 8px; font-size: 11px; }
}
