/* ============================================================
   传书文化图书平台 · 全站样式
   设计风格：深蓝 + 古典金 · 专业商务
   颜色由 config.js 注入 CSS 变量，换肤只需改变量值
   
   维护记录：
   - 2026-09：删除 .book 的 cursor:pointer 及 .book:hover 位移阴影
   - 2026-09：删除 .dtable thead th 的 sticky（父容器无纵向滚动，规则无效）
   - 2026-09：侧栏折叠弃用 nth-of-type，改为 .cat-extra 类名控制
   - 2026-09：.sidebar-list.expanded 加 overflow-x: hidden
   - 2026-09：删除 480px 里重复的 .partners-grid 定义
   - 2026-09：删除 --radius-full 变量，直接写 9999px
   - 2026-09：@media print 里只打 .tab-panel.active
   - 2026-09：新增图书库加载提示条样式（.books-loading-tip）
   - 2026-09：新增 :focus-visible 键盘焦点样式
   - 2026-09：新增 prefers-reduced-motion 减少动画
   ============================================================ */

/* ----- 1. 全局变量（默认值，运行时由 config.js 覆盖） ----- */
:root {
    --primary: #1f3a5f;
    --primary-light: #35567f;
    --primary-dark: #152a45;
    --accent: #c8853f;
    --accent-light: #dfb078;
    --accent-pale: #f5e8d8;

    --bg: #f7f5f0;
    --card: #ffffff;
    --text: #2b2b2b;
    --text-light: #7a7a7a;
    --text-muted: #999999;
    --line: #e6e1d6;
    --line-light: #f1ede3;

    --radius: 10px;
    --radius-sm: 6px;
    /* 完全圆角直接用 9999px 写死，不纳入可换肤变量 */

    --shadow: rgba(31, 58, 95, 0.06);
    --shadow-md: rgba(31, 58, 95, 0.12);
    --shadow-lg: rgba(31, 58, 95, 0.20);

    --font-sans: 'Source Han Sans SC', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
    --font-serif: 'Source Han Serif SC', 'Noto Serif SC', 'Songti SC', 'SimSun', serif;

    --transition: 0.25s ease;
    --container: 1240px;
}

/* ----- 2. 重置 & 基础 ----- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition);
}

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

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
}

/* ----- 3. 工具类 ----- */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.spacer {
    flex: 1;
}

/* ----- 4. 顶部条 ----- */
.topbar {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12.5px;
    padding: 7px 0;
}

.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.topbar-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-links {
    display: flex;
    gap: 16px;
}

.topbar-links a {
    color: rgba(255, 255, 255, 0.85);
}

.topbar-links a:hover {
    color: var(--accent-light);
}

/* ----- 5. 页头 ----- */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.brand-logo {
    width: 120px;
    height: 88px;
    flex: 0 0 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: var(--radius-sm);
    border: none;
    padding: 0;
    overflow: hidden;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    line-height: 1.2;
    font-family: var(--font-serif);
}

.brand-en {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}

.header-search {
    flex: 1;
    min-width: 260px;
    display: flex;
    border: 2px solid var(--primary);
    border-radius: 9999px;
    overflow: hidden;
    background: #fff;
    max-width: 520px;
}

.header-search input {
    flex: 1;
    border: none;
    padding: 10px 18px;
    font-size: 14px;
    outline: none;
    background: transparent;
    color: var(--text);
}

.header-search button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 24px;
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
}

.header-search button:hover {
    background: var(--accent);
}

.header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex: 0 0 auto;
}

.header-stats {
    font-size: 12.5px;
    color: var(--text-light);
}

.header-stats b {
    color: var(--primary);
    font-weight: 700;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 9999px;
    padding: 7px 18px;
    font-size: 13.5px;
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 500;
}

.login-btn:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.login-btn.logged-in {
    background: var(--accent);
}

.login-btn.logged-in:hover {
    background: var(--accent-light);
}

.login-icon {
    font-size: 14px;
}

/* ----- 6. 主导航 ----- */
.mainnav {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nav-inner {
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.nav-inner::-webkit-scrollbar {
    height: 3px;
}

.nav-inner::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.mainnav a {
    display: block;
    padding: 14px 24px;
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
    transition: all var(--transition);
    font-weight: 500;
    letter-spacing: 0.3px;
    border-bottom: 3px solid transparent;
}

.mainnav a:hover,
.mainnav a.active {
    background: var(--accent);
    color: #fff;
    border-bottom-color: var(--accent-light);
}

/* ----- 7. 标签页面板 ----- */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ----- 8. 首页横幅 ----- */
.banner {
    background: linear-gradient(120deg, var(--primary) 0%, var(--primary-light) 55%, #48688f 100%);
    color: #fff;
    padding: 52px 0;
    position: relative;
    overflow: hidden;
}

.banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 78% 30%, rgba(200, 133, 63, 0.18), transparent 50%);
    pointer-events: none;
}

.banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.banner-content {
    flex: 1;
    min-width: 280px;
}

.banner-content h2 {
    font-size: 32px;
    margin-bottom: 14px;
    letter-spacing: 1px;
    font-family: var(--font-serif);
    font-weight: 700;
}

.banner-content p {
    opacity: 0.92;
    max-width: 720px;
    font-size: 15px;
    line-height: 1.8;
}

.banner-badges {
    margin-top: 22px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.banner-badge {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
}

.banner-icon {
    font-size: 120px;
    opacity: 0.3;
    line-height: 1;
    flex-shrink: 0;
}

/* ----- 9. 数据卡 ----- */
.stats-bar {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
    padding: 0;
}

.stat-card {
    background: var(--card);
    padding: 26px 16px;
    text-align: center;
    transition: background var(--transition);
}

.stat-card:hover {
    background: var(--line-light);
}

.stat-num {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    font-family: var(--font-serif);
    line-height: 1.2;
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-light);
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* ----- 10. 首页区块标题（带背景色块） ----- */
.home-section {
    margin: 44px auto;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 14px 22px;
    background: linear-gradient(90deg,
        var(--accent-pale) 0%,
        var(--line-light) 60%,
        #f5f0e8 100%);
    border-left: 5px solid var(--accent);
    border-radius: var(--radius-sm);
    position: relative;
}

.section-head h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    font-family: var(--font-serif);
    line-height: 1.2;
}

.section-sub {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    line-height: 1.6;
    text-align: right;
    white-space: nowrap;
}

.more-link {
    font-size: 13.5px;
    color: var(--accent);
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.more-link:hover {
    color: var(--primary);
    transform: translateX(3px);
}

/* ----- 11. 图书网格 ----- */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.home-recommend {
    grid-template-columns: repeat(4, 1fr);
}

.book {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 书籍卡片无点击交互，故不设 .book:hover 卡片位移效果 */

.book-cover {
    height: 220px;
    flex: 0 0 220px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.book:hover .book-cover img {
    transform: scale(1.05);
}

.book-cover .cover-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    color: #fff;
}

.book-cover .cover-text .ct-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-size: 11px;
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 500;
}

.book-info {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
    max-height: 2.8em;
}

.book-author {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-publisher {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.book-price {
    color: #c0392b;
    font-weight: 700;
    font-size: 16px;
}

.book-price small {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ----- 12. 合作单位 ----- */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.partner-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
}

.partner-item:hover {
    border-color: var(--accent);
    color: var(--primary);
    box-shadow: 0 4px 12px var(--shadow);
}

/* ----- 13. 选书中心 ----- */
.books-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    margin: 28px auto 60px;
    align-items: flex-start;
}

.books-sidebar {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    position: sticky;
    top: 76px;
}

.sidebar-title {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-list {
    max-height: 560px;
    overflow-y: auto;
}

.sidebar-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    font-size: 14px;
    color: #444;
    border-bottom: 1px solid var(--line-light);
    transition: all 0.15s ease;
    cursor: pointer;
}

.sidebar-list a:last-child {
    border-bottom: none;
}

.sidebar-list a:hover,
.sidebar-list a.active {
    background: var(--accent-pale);
    color: var(--primary);
    font-weight: 600;
    padding-left: 20px;
}

.sidebar-list a span {
    color: var(--text-muted);
    font-size: 12px;
}

.sidebar-list a.active span {
    color: var(--accent);
}

/* 桌面端：不显示"更多"按钮 */
.sidebar-toggle {
    display: none;
}

.books-main {
    min-width: 0;
}

.books-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--line);
    margin-bottom: 16px;
}

.books-tab {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    font-weight: 500;
}

.books-tab:hover {
    color: var(--primary);
}

.books-tab.active {
    color: var(--primary);
    border-bottom-color: var(--accent);
    font-weight: 700;
}

.books-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.books-head h3 {
    font-size: 18px;
    color: var(--primary);
    font-weight: 600;
}

.books-count {
    font-size: 13px;
    color: var(--text-light);
}

.books-count b {
    color: var(--accent);
}

/* ----- 14. 分页 ----- */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 18px;
}

.pager-info {
    font-size: 13px;
    color: var(--text-light);
}

.pager-links {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.pager-links a,
.pager-links span {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #555;
    cursor: pointer;
    padding: 0 10px;
    transition: all 0.15s ease;
    user-select: none;
}

.pager-links a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--line-light);
}

.pager-links a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.pager-links span.dots {
    border: none;
    background: none;
    min-width: 20px;
    color: var(--text-muted);
}

/* ----- 15. 通用页面区块 ----- */
.page-section {
    margin: 28px auto 60px;
}

/* ----- 16. 面板 ----- */
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.panel-title {
    font-size: 17px;
    color: var(--primary);
    border-left: 5px solid var(--accent);
    padding-left: 12px;
    margin-bottom: 16px;
    font-weight: 600;
}

.panel-note {
    background: var(--accent-pale);
    border: 1px solid var(--accent-light);
    color: #7a5a24;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    line-height: 1.7;
}

/* ----- 17. 采访数据 ----- */
.filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.filter-label {
    font-size: 13.5px;
    color: var(--text-light);
}

.filter-row select,
.filter-row input {
    border: 1px solid var(--line);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    background: #fff;
    color: #444;
    outline: none;
    transition: border-color var(--transition);
    font-family: inherit;
}

.filter-row select:focus,
.filter-row input:focus {
    border-color: var(--accent);
}

.filter-row input {
    min-width: 180px;
}

.dt-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.sel-count {
    font-size: 13px;
    color: var(--text-light);
}

.sel-count b {
    color: var(--accent);
    font-weight: 700;
}

/* ----- 18. 按钮 ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
    line-height: 1.4;
}

.btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-md);
}

.btn-accent {
    background: var(--accent);
}

.btn-accent:hover {
    background: var(--accent-light);
}

.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--line-light);
    color: var(--primary);
}

/* ----- 19. 表格 ----- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}

.dtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 860px;
}

.dtable thead th {
    background: var(--primary);
    color: #fff;
    padding: 11px 12px;
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
    /* 原先的 position:sticky; top:0; 因父容器无纵向滚动而无效，已移除 */
}

.dtable thead th.chk {
    width: 40px;
    text-align: center;
}

.dtable tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-light);
    vertical-align: middle;
}

.dtable tbody td.chk {
    text-align: center;
}

.dtable tbody tr:hover td {
    background: var(--line-light);
}

.dtable tbody input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ----- 20. 出版动态 ----- */
.news-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.news-tab {
    padding: 8px 18px;
    border: 1px solid var(--line);
    border-radius: 9999px;
    background: #fff;
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #555;
    user-select: none;
}

.news-tab:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.news-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.news-item {
    display: flex;
    gap: 16px;
    padding: 16px 6px;
    border-bottom: 1px solid var(--line-light);
    cursor: pointer;
    transition: background 0.15s ease;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background: var(--line-light);
}

.news-date {
    flex: 0 0 76px;
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 4px;
    height: fit-content;
}

.news-date b {
    display: block;
    font-size: 20px;
    color: var(--primary);
    line-height: 1.2;
    font-family: var(--font-serif);
}

.news-date span {
    font-size: 11px;
    color: var(--text-muted);
}

.news-main {
    flex: 1;
    min-width: 0;
}

.news-main h4 {
    font-size: 16px;
    color: var(--text);
    margin: 2px 0 6px;
    line-height: 1.5;
    font-weight: 600;
    transition: color var(--transition);
}

.news-item:hover .news-main h4 {
    color: var(--primary);
}

.news-main p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.7;
}

.news-tag {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: 1px;
    font-weight: 500;
}

/* ----- 21. 配货中心 ----- */
.dist-locked {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.lock-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    max-width: 460px;
    box-shadow: 0 4px 16px var(--shadow);
}

.lock-icon {
    font-size: 56px;
    margin-bottom: 16px;
    line-height: 1;
}

.lock-panel h3 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 700;
}

.lock-panel p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 22px;
    line-height: 1.7;
}

.dist-user-info {
    font-size: 13px;
    color: var(--text-light);
}

.dist-user-info b {
    color: var(--primary);
}

.dist-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.dist-sum-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    transition: all var(--transition);
}

.dist-sum-card:hover {
    box-shadow: 0 4px 14px var(--shadow-md);
    border-color: var(--accent);
}

.dist-sum-card .ds-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-serif);
    line-height: 1.2;
}

.dist-sum-card .ds-qty {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

.dist-sum-card .ds-label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 8px;
    letter-spacing: 0.5px;
}

.dist-order-detail {
    padding: 4px 0;
}

.order-progress-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
    flex-wrap: wrap;
}

.order-progress-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
}

.order-progress-track {
    flex: 1;
    min-width: 200px;
    height: 12px;
    background: var(--line-light);
    border-radius: 9999px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.order-progress-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transition: width 0.8s ease;
}

.order-progress-status {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.status-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.status-tag.done {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-tag.shipping {
    background: #e3f2fd;
    color: #1565c0;
}

.status-tag.partial {
    background: #fff3e0;
    color: #e65100;
}

.status-tag.pending {
    background: #fce4ec;
    color: #c62828;
}

/* ----- 22. 关于我们 ----- */
.about-block {
    margin-bottom: 20px;
}

.about-intro {
    font-size: 14.5px;
    color: var(--text);
    line-height: 2;
    text-indent: 2em;
}

.about-history {
    position: relative;
    padding-left: 32px;
}

.about-history::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.history-item {
    position: relative;
    padding: 12px 0 20px;
}

.history-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 2px var(--accent);
}

.history-year {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 1px;
    font-family: var(--font-serif);
}

.history-title {
    font-size: 15.5px;
    color: var(--text);
    font-weight: 600;
    margin: 6px 0 4px;
}

.history-desc {
    font-size: 13.5px;
    color: var(--text-light);
    line-height: 1.7;
}

.about-certs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.cert-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    background: var(--line-light);
    transition: all var(--transition);
}

.cert-item:hover {
    border-color: var(--accent);
    background: var(--accent-pale);
}

.cert-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}

.cert-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.7;
}

.about-advantages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.advantage-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 20px 18px;
    text-align: center;
    transition: all var(--transition);
    background: var(--card);
}

.advantage-item:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 18px var(--shadow-md);
    transform: translateY(-3px);
}

.advantage-icon {
    font-size: 32px;
    margin-bottom: 10px;
    line-height: 1;
}

.advantage-title {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}

.advantage-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.7;
}

.about-contact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--line-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

.contact-item .ci-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ----- 23. 页脚 ----- */
.site-footer {
    background: var(--primary-dark);
    color: #b9c4d1;
    font-size: 13px;
    padding: 40px 0 24px;
    margin-top: 40px;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-col h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 14px;
    letter-spacing: 1px;
    font-family: var(--font-serif);
    font-weight: 600;
}

.footer-col p {
    line-height: 2;
    font-size: 13px;
}

.footer-about p {
    line-height: 1.9;
    color: #9dabb9;
}

.footer-copy {
    text-align: center;
    padding-top: 18px;
    font-size: 12px;
    color: #7f8f9f;
    line-height: 2;
}

.footer-copy b {
    color: var(--accent-light);
    font-weight: 500;
}

/* ----- 24. 弹窗（登录） ----- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(21, 42, 69, 0.65);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

.modal-box {
    background: var(--card);
    border-radius: var(--radius);
    max-width: 420px;
    width: 100%;
    padding: 32px 30px 28px;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 26px;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    transition: all var(--transition);
    padding: 4px 8px;
    border-radius: 4px;
}

.modal-close:hover {
    color: var(--primary);
    background: var(--line-light);
    transform: rotate(90deg);
}

.login-header {
    text-align: center;
    margin-bottom: 22px;
}

.login-header-icon {
    font-size: 40px;
    margin-bottom: 8px;
    line-height: 1;
}

.login-header h3 {
    font-size: 20px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 4px;
}

.login-header p {
    font-size: 13px;
    color: var(--text-light);
}

.login-form .form-group {
    margin-bottom: 14px;
}

.login-form label {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 6px;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    background: var(--bg);
    transition: all var(--transition);
    color: var(--text);
    font-family: inherit;
}

.login-form input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(200, 133, 63, 0.12);
}

.login-error {
    background: #fce4ec;
    border: 1px solid #f8bbd0;
    color: #c62828;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}

.login-submit {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-top: 4px;
}

/* ----- 25. 图书库加载提示条 ----- */
.books-loading-tip {
    position: sticky;
    top: 52px;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    background: #fff8e6;
    border-bottom: 1px solid #f0dca6;
    color: #8a6a1f;
    font-size: 13.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.books-loading-tip.error {
    background: #fce4ec;
    border-bottom-color: #f8bbd0;
    color: #c62828;
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(200, 133, 63, 0.3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: loadingSpin 0.8s linear infinite;
}

@keyframes loadingSpin {
    to { transform: rotate(360deg); }
}

.books-loading-tip.error .loading-spinner {
    display: none;
}

.loading-retry-btn {
    display: none;
    padding: 4px 14px;
    font-size: 12.5px;
    background: #c62828;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}

.books-loading-tip.error .loading-retry-btn {
    display: inline-block;
}

.loading-retry-btn:hover {
    background: #a01e1e;
}

/* ----- 26. 响应式：平板 ----- */
@media (max-width: 1024px) {
    .header-inner {
        gap: 14px;
    }

    .brand-logo {
        width: 100px;
        height: 72px;
        flex: 0 0 100px;
    }

    .brand-name {
        font-size: 17px;
    }

    .brand-en {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .header-search {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
    }

    .header-actions {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .header-stats {
        font-size: 12px;
    }

    .home-recommend {
        grid-template-columns: repeat(3, 1fr);
    }

    .books-layout {
        grid-template-columns: 1fr;
    }

    .books-sidebar {
        position: static;
    }

    .sidebar-list {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        max-height: none;
        padding: 8px;
        gap: 6px;
        scrollbar-width: thin;
        scrollbar-color: var(--accent) transparent;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-list::-webkit-scrollbar {
        height: 3px;
    }

    .sidebar-list::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 3px;
    }

    .sidebar-list a {
        flex: 0 0 auto;
        border: 1px solid var(--line);
        border-radius: 9999px;
        padding: 6px 14px;
        font-size: 13px;
        white-space: nowrap;
    }

    .sidebar-list a:hover,
    .sidebar-list a.active {
        padding-left: 14px;
    }

    .sidebar-list a span {
        margin-left: 6px;
    }
}

/* ----- 27. 响应式：手机 ----- */
@media (max-width: 768px) {
    .container {
        padding: 0 14px;
    }

    .topbar {
        font-size: 11.5px;
        padding: 6px 0;
    }

    .topbar-links {
        gap: 10px;
    }

    .site-header {
        padding: 12px 0;
    }

    .header-inner {
        gap: 12px;
    }

    .brand {
        gap: 10px;
    }

    .brand-logo {
        width: 88px;
        height: 62px;
        flex: 0 0 88px;
    }

    .brand-name {
        font-size: 15px;
        letter-spacing: 0;
    }

    .brand-en {
        display: none;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .header-stats {
        font-size: 11.5px;
    }

    .login-btn {
        padding: 6px 14px;
        font-size: 12.5px;
    }

    .mainnav a {
        padding: 12px 14px;
        font-size: 13px;
    }

    .banner {
        padding: 32px 0;
    }

    .banner-content h2 {
        font-size: 22px;
    }

    .banner-content p {
        font-size: 13.5px;
    }

    .banner-icon {
        display: none;
    }

    .banner-badges {
        gap: 8px;
    }

    .banner-badge {
        padding: 6px 12px;
        font-size: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 18px 10px;
    }

    .stat-num {
        font-size: 22px;
    }

    .stat-label {
        font-size: 11.5px;
    }

    /* 区块标题手机适配 */
    .home-section {
        margin: 28px auto;
    }

    .section-head {
        padding: 12px 16px;
        gap: 10px;
        margin-bottom: 18px;
    }

    .section-head h3 {
        font-size: 17px;
    }

    .section-sub {
        display: none;
    }

    .home-recommend {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .book-cover {
        height: 180px;
        flex: 0 0 180px;
    }

    .book-title {
        font-size: 13px;
    }

    .book-price {
        font-size: 14px;
    }

    .partners-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .partner-item {
        padding: 10px 12px;
        font-size: 12.5px;
        min-height: 48px;
    }

    /* 选书中心分类折叠：JS 会给第 4 个及之后的分类加 .cat-extra 类 */
    .sidebar-list .cat-extra {
        display: none;
    }

    .sidebar-list.expanded .cat-extra {
        display: flex;
    }

    .sidebar-list.expanded {
        flex-wrap: wrap;
        max-height: 240px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .sidebar-toggle {
        display: flex !important;
        color: var(--accent);
        font-weight: 600;
        justify-content: center;
        border-color: var(--accent);
    }

    .books-tabs {
        overflow-x: auto;
    }

    .books-tab {
        padding: 10px 16px;
        font-size: 14px;
    }

    .books-head h3 {
        font-size: 16px;
    }

    .dtable {
        font-size: 12px;
        min-width: 720px;
    }

    .dtable thead th,
    .dtable tbody td {
        padding: 8px 8px;
    }

    .pager {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }

    .pager-info {
        text-align: center;
    }

    .pager-links {
        justify-content: center;
    }

    .dt-actions {
        flex-wrap: wrap;
    }

    .btn {
        padding: 8px 14px;
        font-size: 12.5px;
    }

    .news-tab {
        padding: 6px 14px;
        font-size: 12.5px;
    }

    .news-item {
        gap: 10px;
        padding: 12px 4px;
    }

    .news-date {
        flex: 0 0 60px;
        padding: 6px 2px;
    }

    .news-date b {
        font-size: 17px;
    }

    .news-date span {
        font-size: 10px;
    }

    .news-main h4 {
        font-size: 14px;
    }

    .news-main p {
        font-size: 12.5px;
    }

    .lock-panel {
        padding: 32px 24px;
    }

    .lock-icon {
        font-size: 42px;
    }

    .lock-panel h3 {
        font-size: 17px;
    }

    .about-intro {
        font-size: 13.5px;
    }

    .about-history {
        padding-left: 26px;
    }

    .history-item::before {
        left: -25px;
        width: 12px;
        height: 12px;
    }

    .history-title {
        font-size: 14.5px;
    }

    .about-certs,
    .about-advantages,
    .about-contact {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .modal-box {
        padding: 26px 22px 24px;
    }

    .panel {
        padding: 18px 16px;
    }
}

/* ----- 28. 响应式：小屏手机 ----- */
@media (max-width: 480px) {
    .brand-logo {
        width: 72px;
        height: 50px;
        flex: 0 0 72px;
    }

    .brand-name {
        font-size: 13.5px;
    }

    .mainnav a {
        padding: 10px 12px;
        font-size: 12.5px;
    }

    .banner-content h2 {
        font-size: 19px;
    }

    .banner-content p {
        font-size: 13px;
    }

    .stat-num {
        font-size: 19px;
    }

    .book-cover {
        height: 150px;
        flex: 0 0 150px;
    }

    .book-title {
        font-size: 12.5px;
    }

    .book-author {
        font-size: 11px;
    }

    .book-publisher {
        display: none;
    }

    /* .partners-grid 的 2 列定义已在 768px 处设置，此处无需重复 */
}

/* ----- 29. 无障碍：键盘焦点 ----- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ----- 30. 无障碍：减少动画（晕动症用户系统设置） ----- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ----- 31. 打印样式 ----- */
@media print {
    .topbar,
    .mainnav,
    .banner,
    .stats-bar,
    .site-footer,
    .login-btn,
    .header-search,
    .dt-actions,
    .news-tabs,
    .books-tabs,
    .books-sidebar,
    .pager,
    .modal,
    .books-loading-tip {
        display: none !important;
    }

    /* 只打印当前激活的 Tab 面板，其他隐藏 */
    .tab-panel:not(.active) {
        display: none !important;
    }

    .tab-panel.active {
        display: block !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .panel {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}