/* ============================================
   零贰书单 - 全站样式
   设计规范：浅色主题 / 主色 #2563EB / 圆角卡片
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --text: #1f2937;
    --text-2: #4b5563;
    --text-3: #9ca3af;
    --border: #e8eaef;
    --bg: #f5f6f8;
    --card: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(31, 41, 55, 0.06);
    --shadow-hover: 0 6px 20px rgba(31, 41, 55, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ---------------- 头部导航 ---------------- */

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 64px;
}

.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; flex-shrink: 0; }

.logo-mark {
    width: 32px; height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}

.main-nav { display: flex; gap: 28px; flex: 1; }

.nav-link { color: var(--text-2); font-size: 15px; padding: 4px 0; white-space: nowrap; transition: color .15s; }
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; }

.header-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 5px 5px 16px;
}
.header-search input {
    border: none; background: transparent; outline: none;
    width: 190px; font-size: 14px; color: var(--text);
}
.header-search input::placeholder { color: var(--text-3); }

.menu-toggle { display: none; background: none; border: none; flex-direction: column; gap: 5px; padding: 8px; }
.menu-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* ---------------- 按钮 ---------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    padding: 10px 20px;
    white-space: nowrap;
    transition: all .15s;
}
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary.loading { opacity: .7; pointer-events: none; }
.btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text-3); }
.btn-link { color: var(--primary); font-size: 14px; font-weight: 500; }
.btn-link:hover { text-decoration: underline; }

/* ---------------- 面包屑 ---------------- */

.breadcrumb { padding: 16px 24px 0; font-size: 13px; color: var(--text-3); }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--primary); }
.crumb-sep { margin: 0 6px; }
.crumb-current { color: var(--text-2); }

/* ---------------- 标签 ---------------- */

.tag {
    display: inline-flex; align-items: center;
    font-size: 12px; font-weight: 500;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.tag-type { background: var(--primary-light); color: var(--primary); }
.tag-age-0-3  { background: #ffedd5; color: #ea580c; }
.tag-age-3-6  { background: #dcfce7; color: #16a34a; }
.tag-age-6-9  { background: #dbeafe; color: #2563eb; }
.tag-age-9-12 { background: #ede9fe; color: #7c3aed; }
.tag-age-12   { background: #f3f4f6; color: #6b7280; }

/* ---------------- 封面占位 ---------------- */

.cover {
    background: #e5e7eb;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3);
    font-size: 14px;
    overflow: hidden;
    position: relative;
}
.cover::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.5), transparent 60%);
}

/* ---------------- 通用区块 ---------------- */

.section { padding-top: 56px; padding-bottom: 56px; }
.section.alt { background: #fff; }

.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: 24px;
}
.section-head h2 { font-size: 24px; font-weight: 700; }
.section-head .sub { color: var(--text-3); font-size: 13px; margin-top: 6px; }

/* ---------------- 卡片网格 ---------------- */

.grid { display: grid; gap: 20px; }
.grid-book { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
/* 自适应密度：按容器宽度自动决定每行列数，尽量填满整行 */
.grid-fluid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
a.card:hover, .card.link:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.card-body { padding: 16px 18px 18px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.card-desc { font-size: 13px; color: var(--text-2); }
.card-meta { font-size: 12px; color: var(--text-3); }
.card-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--border);
}

.cover-card { height: 150px; border-radius: 0; }
.cover-book { height: 210px; }

/* ---------------- 首页 Hero ---------------- */

.hero {
    background: #fff;
    text-align: center;
    padding: 72px 24px 48px;
}
.hero h1 { font-size: 40px; font-weight: 800; margin-bottom: 14px; }
.hero p { color: var(--text-2); font-size: 15px; margin-bottom: 32px; }

.hero-search {
    display: flex; align-items: center; gap: 8px;
    max-width: 560px; margin: 0 auto 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 8px 8px 20px;
    box-shadow: var(--shadow);
}
.hero-search input {
    flex: 1; border: none; outline: none; font-size: 15px; background: transparent;
}
.hot-keywords { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.hot-keywords span { color: var(--text-3); font-size: 13px; }
.hot-keywords a {
    font-size: 13px; color: var(--text-2);
    background: var(--bg);
    padding: 4px 12px; border-radius: 999px;
}
.hot-keywords a:hover { color: var(--primary); background: var(--primary-light); }

/* ---------------- 按年龄找书 ---------------- */

.age-card { padding: 20px; }
.age-card .age-label { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.age-card .age-desc { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.age-card .age-count { font-size: 12px; color: var(--text-3); }
.age-0-3  { background: #fff7ed; } .age-0-3 .age-label { color: #ea580c; }
.age-3-6  { background: #f0fdf4; } .age-3-6 .age-label { color: #16a34a; }
.age-6-9  { background: #eff6ff; } .age-6-9 .age-label { color: #2563eb; }
.age-9-12 { background: #f5f3ff; } .age-9-12 .age-label { color: #7c3aed; }
.age-12   { background: #f9fafb; } .age-12 .age-label { color: #6b7280; }

/* ---------------- 按分类找书 ---------------- */

.cat-card { display: flex; align-items: center; gap: 14px; padding: 20px; }
.cat-icon {
    width: 42px; height: 42px; flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.cat-name { font-size: 15px; font-weight: 700; }
.cat-count { font-size: 12px; color: var(--text-3); }

/* ---------------- 榜单卡片 ---------------- */

.rank-card { padding: 20px; position: relative; }
.rank-card .badge-type { position: static; display: inline-block; margin-bottom: 10px; }
.rank-source { font-size: 12px; color: var(--text-3); }
.rank-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-3);
}

/* ---------------- 页头区（内页 Hero） ---------------- */

.page-head { padding-top: 32px; padding-bottom: 24px; }
.page-head h1 { font-size: 30px; font-weight: 800; margin-bottom: 10px; }
.page-head .desc { color: var(--text-2); font-size: 14px; }

/* ---------------- 筛选面板 ---------------- */

.filter-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 16px;
}
.filter-panel h3 { font-size: 16px; margin-bottom: 18px; }

.filter-row { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.filter-row:last-of-type { margin-bottom: 22px; }
.filter-label { width: 48px; flex-shrink: 0; font-size: 14px; color: var(--text-2); padding-top: 7px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-2);
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 999px;
    transition: all .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.selected { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }

.filter-actions { text-align: center; }
.filter-actions .btn { min-width: 180px; }
.filter-tip { font-size: 12px; color: var(--text-3); margin-top: 12px; }

/* 关键词输入框：占满标签行剩余宽度 */
.kw-input {
    flex: 1;
    max-width: 460px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 13px;
    outline: none;
}
.kw-input:focus { border-color: var(--primary); }

/* 已选条件条 */
.selected-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}
.selected-bar .label { font-size: 13px; color: var(--text-3); margin-right: 4px; }
.selected-bar .sep { color: var(--text-3); margin: 0 4px; font-size: 12px; }

/* ---------------- 列表工具条 ---------------- */

.list-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.list-toolbar .total { font-size: 14px; color: var(--text-2); }
.list-toolbar .total strong { color: var(--text); }
.sort-select {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #fff; color: var(--text-2);
    font-size: 13px; padding: 7px 12px; outline: none;
}

/* ---------------- 分页 ---------------- */

.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 36px 0 8px; }
.page-btn {
    min-width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #fff; color: var(--text-2); font-size: 14px;
    padding: 0 12px;
}
.page-btn:hover:not(:disabled):not(.current) { border-color: var(--primary); color: var(--primary); }
.page-btn.current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.page-btn:disabled { color: var(--text-3); cursor: not-allowed; opacity: .6; }

/* ---------------- 详情页 Hero 卡 ---------------- */

.detail-hero {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex; gap: 32px;
    margin-bottom: 40px;
}
.detail-cover {
    width: 190px; height: 260px; flex-shrink: 0;
    font-size: 16px;
}
.detail-info { flex: 1; min-width: 0; }
.detail-badges { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.detail-updated { font-size: 12px; color: var(--text-3); }
.detail-info h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.detail-en { color: var(--text-3); font-size: 14px; margin-bottom: 12px; }
.detail-stats { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.detail-desc { font-size: 14px; color: var(--text-2); margin-bottom: 20px; max-width: 640px; }
.detail-actions { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.like-btn .count { font-weight: 400; }

.meta-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 24px;
    margin-top: 4px;
}
.meta-item .meta-label { font-size: 12px; color: var(--text-3); }
.meta-item .meta-value { font-size: 14px; color: var(--text); font-weight: 500; margin-top: 2px; }

.search-links { display: inline-flex; gap: 12px; margin-left: 2px; flex-wrap: wrap; vertical-align: middle; align-items: center; }
.search-links a {
    font-size: 14px; font-weight: 600; color: var(--primary);
    background: #fff; border: 1px solid var(--primary); border-radius: var(--radius-sm);
    padding: 9px 18px; transition: all .15s; white-space: nowrap;
    display: inline-flex; align-items: center; justify-content: center;
    text-align: center; line-height: 1.4;
}
.search-links a:hover { background: var(--primary); color: #fff; }
/* 各搜索按钮采用对应网站的品牌配色系 */
.search-links a.site-taobao   { color: #ff5000; border-color: #ff5000; }
.search-links a.site-taobao:hover   { background: #ff5000; color: #fff; }
.search-links a.site-jd       { color: #e1251b; border-color: #e1251b; }
.search-links a.site-jd:hover       { background: #e1251b; color: #fff; }
.search-links a.site-dangdang { color: #ff2832; border-color: #ff2832; }
.search-links a.site-dangdang:hover { background: #ff2832; color: #fff; }
.search-links a.site-kongfz   { color: #2f9e44; border-color: #2f9e44; }
.search-links a.site-kongfz:hover   { background: #2f9e44; color: #fff; }

/* ---------------- 目录列表 ---------------- */

.detail-layout {
    display: grid; grid-template-columns: 1fr 300px; gap: 32px;
    align-items: start;
}

.toc-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 6px; }
.toc-head h2 { font-size: 20px; font-weight: 700; }
.toc-sub { font-size: 12px; color: var(--text-3); margin-bottom: 16px; }

.toc-list { display: flex; flex-direction: column; gap: 12px; }
.toc-item {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px;
    transition: box-shadow .15s;
}
.toc-item:hover { box-shadow: var(--shadow); }
.toc-pos { width: 28px; flex-shrink: 0; color: var(--text-3); font-size: 13px; font-weight: 600; }
.toc-cover { width: 44px; height: 60px; flex-shrink: 0; font-size: 11px; }
.toc-main { flex: 1; min-width: 0; }
.toc-title { font-size: 15px; font-weight: 700; }
.toc-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.toc-tags { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.toc-pos-label { font-size: 12px; color: var(--text-3); flex-shrink: 0; margin-right: 4px; }
.toc-arrow { color: var(--text-3); flex-shrink: 0; }

/* ---------------- 侧栏 ---------------- */

.sidebar { display: flex; flex-direction: column; gap: 20px; }
.side-box {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.side-box.gray { background: var(--bg); }
.side-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.side-links { display: flex; flex-direction: column; }
.side-links a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; font-size: 13px; color: var(--text-2);
    border-bottom: 1px dashed var(--border);
}
.side-links a:last-child { border-bottom: none; }
.side-links a:hover { color: var(--primary); }
.side-dl { display: flex; flex-direction: column; gap: 10px; }
.side-dl .row { display: flex; justify-content: space-between; font-size: 13px; }
.side-dl .row dt { color: var(--text-3); }
.side-dl .row dd { color: var(--text); font-weight: 500; }

/* ---------------- 书籍详情 ---------------- */

.book-hero { align-items: flex-start; }

.intro-section h2 { font-size: 19px; font-weight: 700; margin-bottom: 12px; }
.intro-section p { font-size: 14px; color: var(--text-2); margin-bottom: 24px; }

.appear-list { display: flex; flex-direction: column; gap: 12px; }
.appear-group-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 18px 0 8px; padding-left: 8px; border-left: 3px solid var(--primary); line-height: 1.3; }
.appear-item {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    transition: box-shadow .15s;
}
.appear-item:hover { box-shadow: var(--shadow); }
.appear-title { font-size: 14px; font-weight: 700; }
.appear-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ---------------- 关于我们 ---------------- */

.about-hero { text-align: center; padding-top: 40px; padding-bottom: 8px; }
.about-hero h1 { font-size: 32px; font-weight: 800; margin-bottom: 12px; }
.about-hero p { color: var(--text-2); }

.about-scene {
    height: 280px; max-width: 880px; margin: 28px auto 0;
    font-size: 18px;
}

.about-content { max-width: 880px; margin: 0 auto; }
.about-content h2 { font-size: 20px; font-weight: 700; margin: 32px 0 12px; }
.about-content p { font-size: 14px; color: var(--text-2); margin-bottom: 12px; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 40px 0; }
.stat-card {
    background: var(--bg); border-radius: var(--radius); padding: 24px;
}
.stat-num { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 6px; }

.value-card { padding: 22px; }
.value-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; margin-bottom: 14px;
}
.value-card h3 { font-size: 15px; margin-bottom: 8px; }
.value-card p { font-size: 13px; color: var(--text-2); }

.join-cta { text-align: center; padding-top: 24px; padding-bottom: 8px; }
.join-cta h2 { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.join-cta p { color: var(--text-2); font-size: 14px; margin-bottom: 20px; }
.join-cta .actions { display: flex; justify-content: center; gap: 12px; }
.join-note { font-size: 12px; color: var(--text-3); margin-top: 14px; }

/* ---------------- 页脚 ---------------- */

.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 48px 0 40px;
    margin-top: 64px;
}
.footer-inner { display: flex; gap: 60px; }
.footer-brand { flex: 1.2; min-width: 260px; }
.footer-desc { font-size: 13px; color: var(--text-2); margin: 14px 0 16px; max-width: 300px; }
.footer-meta { font-size: 12px; color: var(--text-3); }
.footer-cols { display: flex; gap: 56px; }
.footer-col h4 { font-size: 14px; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13px; color: var(--text-2); padding: 5px 0; }
.footer-col a:hover { color: var(--primary); }

/* ---------------- 搜索小按钮 ---------------- */

.search-go {
    border: none; background: transparent;
    font-size: 14px; padding: 0 4px;
    opacity: .55;
}
.search-go:hover { opacity: 1; }

/* ---------------- 交流群弹窗 ---------------- */

.modal-mask {
    position: fixed; inset: 0;
    background: rgba(31, 41, 55, .5);
    backdrop-filter: blur(2px);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.modal-mask[hidden] { display: none; }

.modal-card {
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 36px 32px 28px;
    text-align: center;
    max-width: 320px; width: 100%;
    animation: modalIn .2s ease-out;
}
@keyframes modalIn {
    from { transform: translateY(12px) scale(.97); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.modal-qr {
    width: 200px; height: 200px;
    margin: 0 auto 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.modal-card h3 { font-size: 17px; margin-bottom: 8px; }
.modal-card p { font-size: 13px; color: var(--text-2); }
.modal-close {
    position: absolute; top: 10px; right: 12px;
    border: none; background: none;
    font-size: 24px; line-height: 1;
    color: var(--text-3); padding: 4px;
}
.modal-close:hover { color: var(--text); }

/* ---------------- 空状态 ---------------- */

.empty-state {
    text-align: center; padding: 60px 20px;
    background: #fff; border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { color: var(--text-3); font-size: 14px; }

/* ============================================
   响应式
   ============================================ */

@media (max-width: 1024px) {
    .header-inner { gap: 16px; }
    .main-nav { gap: 16px; }
    .header-search input { width: 130px; }
}

@media (max-width: 960px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .detail-layout { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }

    /* ≤960：页脚紧凑居中——保留品牌介绍文字，隐藏三栏链接 */
    .site-footer { padding-top: 28px; padding-bottom: 24px; margin-top: 32px; }
    .footer-inner { flex-direction: column; gap: 12px; align-items: center; text-align: center; }
    .footer-brand { text-align: center; }
    .footer-desc { margin: 8px auto 0; max-width: 420px; }
    .footer-cols, .footer-meta { display: none; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }

    .main-nav {
        display: none;
        position: absolute; top: 64px; left: 0; right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        gap: 0;
        box-shadow: var(--shadow);
    }
    .main-nav.open { display: flex; }
    .main-nav .nav-link { padding: 16px 24px; border-bottom: 1px solid var(--border); }
    .main-nav .nav-link.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
    .menu-toggle { display: flex; }

    /* 小屏头部：隐藏搜索框，只留 logo + 进交流群 + 菜单（与设计稿移动端一致） */
    .header-search { background: transparent; border: none; padding: 0; }
    .header-search input { display: none; }

    /* 小屏页脚：与 ≤960 布局一致（品牌文字居中，无链接栏） */
    .footer-desc { font-size: 12px; max-width: 340px; }

    .hero h1 { font-size: 28px; }
    .hero { padding: 48px 16px 36px; }
    /* 小屏保持一行 2 个，避免单卡片铺满整行 */
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .section { padding-top: 40px; padding-bottom: 40px; }
    .section-head h2 { font-size: 20px; }

    .detail-hero { flex-direction: column; padding: 20px; }
    .detail-cover { width: 140px; height: 190px; }
    .detail-info h1 { font-size: 22px; }
    .meta-grid { grid-template-columns: repeat(2, 1fr); }

    /* 小屏书目条目：第一行 = 序号 + 封面 + 册位/适龄；第二行 = 书名与版本信息占满整行 */
    .toc-item { flex-wrap: wrap; row-gap: 8px; padding: 14px 16px; }
    .toc-main { flex: 1 1 100%; order: 4; }
    .toc-pos-label { margin-left: auto; }
    .toc-arrow { display: none; }
    .filter-panel { padding: 20px; }
    .filter-row { flex-direction: column; gap: 8px; }
    .filter-label { width: auto; padding-top: 0; }
    .filter-actions .btn { width: 100%; }
}

/* 分享复制成功提示 */
.share-toast {
    position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%) translateY(8px);
    background: rgba(17, 24, 39, .92); color: #fff; font-size: 14px;
    padding: 10px 20px; border-radius: 999px; z-index: 999;
    opacity: 0; pointer-events: none; transition: all .25s;
}
.share-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================
   新增：导航二级菜单 / 年龄卡配色 / 封面图 / 排序 / 词云 / 友链
   ============================================ */

/* ---------- 导航「更多」二级菜单 ---------- */
.nav-drop { position: relative; display: flex; align-items: center; }
.nav-parent { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.nav-parent .caret { font-size: 10px; transform: translateY(1px); }
.nav-drop.active .nav-parent { color: var(--text); font-weight: 700; }
.nav-sub {
    position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%);
    min-width: 148px; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-hover);
    padding: 6px 0; display: none; z-index: 60;
}
/* 悬停桥：把「更多」与二级菜单之间 12px 的缝隙纳入可悬停区域，
   否则鼠标经过缝隙时二级菜单会消失，导致点不到 */
.nav-sub::before {
    content: ''; position: absolute; left: -12px; right: -12px; top: -14px; height: 14px;
}
.nav-drop:hover .nav-sub,
.nav-drop:focus-within .nav-sub { display: block; }
.nav-sub-link {
    display: block; padding: 10px 18px; font-size: 14px; color: var(--text-2); white-space: nowrap;
}
.nav-sub-link:hover { background: var(--primary-light); color: var(--primary); }
.nav-sub-link.active { color: var(--primary); font-weight: 600; }

/* ---------- 首页年龄卡：与书籍列表年龄标签同色 ---------- */
.age-card.tag-age-0-3  { background: #ffedd5; color: #ea580c; }
.age-card.tag-age-3-6  { background: #dcfce7; color: #16a34a; }
.age-card.tag-age-6-9  { background: #dbeafe; color: #2563eb; }
.age-card.tag-age-9-12 { background: #ede9fe; color: #7c3aed; }
.age-card.tag-age-12   { background: #f3f4f6; color: #6b7280; }
.age-card .age-label { color: inherit; }
.age-card .age-desc,
.age-card .age-count { color: inherit; opacity: .8; }

/* ---------- 封面上传图（有图时的呈现） ---------- */
.cover.has-img { padding: 0; overflow: hidden; background: #f3f4f6; }
.cover.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.has-img::after { content: none; }

/* ---------- 详情页信息行（更新时间 · 访问量，位于标题上方） ---------- */
.detail-time-bar { margin-bottom: 6px; }
.detail-time-bar .detail-updated { font-size: 13px; }

/* ---------- 赞同按钮：已赞同状态 ---------- */
.like-btn.liked {
    background: var(--primary-light, #eef4ff);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}
.like-btn.liked .count { opacity: .8; }

/* ---------- 列表工具条：左共N本 / 右排序 ---------- */
.list-toolbar .sort-select { margin-left: auto; }

/* ---------- 关于我们：统计卡与正文同宽并整体居中，卡内内容居中 ---------- */
.about-content .stat-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 100%;
    margin: 40px 0 0;
}
.about-content .stat-card { text-align: center; }

/* ---------- 搜索词云 ---------- */
.wordcloud { padding: 36px 32px; }
.wc-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; }
.wc-item {
    display: inline-block; line-height: 1.4; font-weight: 600;
    transition: transform .15s, color .15s;
}
.wc-item:hover { transform: scale(1.12); text-decoration: underline; }
.wc-1 { font-size: 14px; font-weight: 400; color: #9ca3af; }
.wc-2 { font-size: 17px; color: #6b7280; }
.wc-3 { font-size: 21px; color: #2563eb; }
.wc-4 { font-size: 27px; color: var(--primary); }
.wc-5 { font-size: 34px; color: #ea580c; }
.wc-tip { text-align: center; font-size: 13px; color: var(--text-3); margin-bottom: 18px; }
.wc-foot { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 28px; }

/* ---------- 友情链接 ---------- */
.friend-card { padding: 20px 22px; }
.friend-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.friend-arrow { color: var(--primary); font-size: 13px; }
.friend-desc { font-size: 13px; color: var(--text-2); margin-top: 8px; line-height: 1.7; }
.friend-host { font-size: 12px; color: var(--text-3); margin-top: 12px; }
.friend-apply { text-align: center; margin-top: 44px; }
.friend-apply h3 { font-size: 17px; margin-bottom: 8px; }
.friend-apply p { font-size: 13px; color: var(--text-2); margin-bottom: 18px; }

@media (max-width: 768px) {
    /* 小屏：二级菜单直接展开（缩进显示） */
    .nav-drop { display: block; }
    .nav-parent { padding: 16px 24px; border-bottom: 1px solid var(--border); justify-content: space-between; }
    .nav-sub {
        position: static; transform: none; display: block; box-shadow: none;
        border: none; border-radius: 0; padding: 0; min-width: 0;
    }
    .nav-sub-link { padding: 14px 24px 14px 44px; border-bottom: 1px solid var(--border); }
    .wordcloud { padding: 24px 18px; }
    .wc-5 { font-size: 26px; }
    .wc-4 { font-size: 22px; }
    .wc-3 { font-size: 18px; }
    .about-content .stat-cards { grid-template-columns: 1fr; }
}

/* ---------- 搜索词云：关键词右侧括号内的搜索次数（字号随词语缩放） ---------- */
.wc-n { font-size: .62em; font-weight: 400; opacity: .7; margin-left: 1px; }

/* ---------- 友情链接：大屏一行 5 个，随屏幕收窄递减 ---------- */
.friend-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }

/* ---------- 二维码未上传时的占位块 ---------- */
.modal-qr-empty {
    display: flex; align-items: center; justify-content: center; text-align: center;
    background: #f3f4f6; color: var(--text-3);
    font-size: 13px; line-height: 1.8; border-style: dashed;
}

@media (max-width: 1180px) { .friend-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) {
    .friend-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .friend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
