/* ============================================================
   九乐文化图书平台 · 全站样式
   设计风格：暖色中式 · 书香典雅
   颜色由 config.js 注入 CSS 变量，换肤只需改变量值
   
   维护记录：
   - 2026-09：删除 .dtable thead th 的 sticky（父容器无纵向滚动，规则无效）
   - 2026-09：删除 --radius-full 变量，直接写 9999px
   - 2026-09：新增 :focus-visible 键盘焦点样式
   - 2026-09：新增 prefers-reduced-motion 减少动画
   - 2026-09：新增 footer .foot-copy a 样式（备案号链接颜色，
               替代原 <b> 包裹方案的继承颜色）
   ============================================================ */

/* ----- 1. 全局变量（由 config.js 动态注入，这里仅作默认值和回退） ----- */
:root {
    --primary: #6d1622;
    --primary-light: #9c2b3a;
    --primary-dark: #4a0e16;
    --gold: #c9a227;
    --gold-light: #e3bd4b;
    --gold-pale: #f5e8c8;

    --bg: #faf5ea;
    --card: #fffdf7;
    --text: #3a2a24;
    --text-light: #8a7466;
    --text-muted: #b69a76;
    --line: #e6d6b8;
    --line-light: #f0e6d4;

    --shadow: rgba(58, 26, 18, 0.08);
    --shadow-hover: rgba(109, 22, 34, 0.16);
    --shadow-heavy: rgba(58, 26, 18, 0.20);

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

    /* 无衬线字体：思源黑体优先，回退到系统字体 */
    --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;
    --transition-slow: 0.4s ease;

    --container: 1200px;
}

/* ----- 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.7;
    min-height: 100vh;
}

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

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

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

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

.serif {
    font-family: var(--font-serif);
}

/* ----- 4. 顶部条 ----- */
.topbar {
    background: var(--primary-dark);
    color: var(--gold-pale);
    font-size: 12.5px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.topbar b {
    color: var(--gold-light);
}

.topbar .contact-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
}

.topbar .contact-info a {
    color: var(--gold-pale);
    transition: color var(--transition);
}

.topbar .contact-info a:hover {
    color: var(--gold-light);
}

/* ----- 5. 主品牌头 ----- */
.masthead {
    background: linear-gradient(135deg, var(--primary), var(--primary-light) 60%, var(--primary-light));
    color: #fff;
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.20);
    position: relative;
    overflow: hidden;
}

.masthead::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 30%, rgba(201, 162, 39, 0.10), transparent 50%);
    pointer-events: none;
}

.masthead-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.masthead .logo {
    margin: 0;
}

.masthead .logo-badge {
    width: 86px;
    height: 96px;
    flex: 0 0 86px;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: transform var(--transition);
}

.masthead .logo-badge:hover {
    transform: scale(1.02);
}

.masthead .logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.brand-text-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
}

.company-name-box {
    position: relative;
    background: linear-gradient(180deg, #f8eed6, #eddcae);
    border: 1px solid #dcc692;
    border-radius: 5px;
    box-shadow: inset 0 0 14px rgba(90, 58, 26, .22), 0 4px 14px rgba(0, 0, 0, .28);
    padding: 16px 44px;
}

.company-name-box::before,
.company-name-box::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 16px;
    border-radius: 5px;
}

.company-name-box::before {
    left: -9px;
    background: linear-gradient(90deg, #7a4c22, #9a6a35, #6e421e);
}

.company-name-box::after {
    right: -9px;
    background: linear-gradient(90deg, #6e421e, #9a6a35, #7a4c22);
}

.company-title {
    margin: 0;
    font-size: 27px;
    font-weight: 800;
    color: #4a2a12;
    letter-spacing: 5px;
    line-height: 1.1;
    white-space: nowrap;
    font-family: var(--font-serif);
}

.slogan-line {
    font-size: 11.5px;
    letter-spacing: 9px;
    color: #f0c968;
}

/* ----- 6. 主导航 ----- */
.mainnav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card);
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 2px 12px var(--shadow);
}

.mainnav .container {
    display: flex;
    align-items: center;
    overflow-x: auto;
    gap: 0;
    padding: 0 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) transparent;
}

.mainnav .container::-webkit-scrollbar {
    height: 3px;
}

.mainnav .container::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.mainnav a {
    display: block;
    padding: 14px 22px;
    font-size: 14.5px;
    color: var(--text);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all var(--transition);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.mainnav a:hover,
.mainnav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--line-light);
}

.mainnav .nav-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    flex-shrink: 0;
}

.mainnav .nav-search input {
    border: 1.5px solid var(--line);
    border-radius: 9999px;
    padding: 8px 16px;
    font-size: 13px;
    outline: none;
    width: 200px;
    background: var(--bg);
    transition: all var(--transition);
    color: var(--text);
}

.mainnav .nav-search input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
    background: #fff;
}

.mainnav .nav-search button {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 9999px;
    padding: 8px 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 500;
}

.mainnav .nav-search button:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

/* ----- 7. 首页横幅 ----- */
.hero {
    background: linear-gradient(120deg, var(--primary-dark) 0%, var(--primary) 45%, var(--primary-light) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 75% 30%, rgba(201, 162, 39, 0.15), transparent 50%);
    pointer-events: none;
}

.hero .container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 100px;
    align-items: center;
    padding: 52px 20px;
    position: relative;
    z-index: 1;
}

.hero .hero-cover {
    height: 380px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
    transform: rotate(-2deg);
    border: 4px solid rgba(255, 255, 255, 0.8);
    transition: transform var(--transition-slow);
}

.hero .hero-cover:hover {
    transform: rotate(-1deg) scale(1.01);
}

.hero .hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero .hero-content .kicker {
    color: var(--gold-light);
    letter-spacing: 5px;
    font-size: 12px;
    margin-bottom: 10px;
    font-weight: 400;
    text-transform: uppercase;
}

.hero .hero-content h2 {
    font-size: 38px;
    line-height: 1.25;
    margin-bottom: 16px;
    font-family: var(--font-serif);
    font-weight: 700;
}

.hero .hero-content p {
    color: rgba(255, 255, 255, 0.85);
    max-width: 100%;
    font-size: 15px;
    line-height: 1.8;
}

.hero .hero-content .btn {
    margin-top: 28px;
    display: inline-block;
    background: var(--gold);
    color: var(--primary);
    font-weight: 700;
    padding: 12px 36px;
    border-radius: 9999px;
    font-size: 15px;
    transition: all var(--transition);
    box-shadow: 0 6px 24px rgba(201, 162, 39, 0.30);
    border: none;
    cursor: pointer;
}

.hero .hero-content .btn:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(201, 162, 39, 0.35);
}

/* ----- 8. 统计栏 ----- */
.stats {
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

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

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

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

.stats .stat .num {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
}

.stats .stat .num span {
    color: var(--gold);
}

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

/* ----- 9. 通用区块 ----- */
.sec {
    max-width: var(--container);
    margin: 48px auto 64px;
    padding: 0 20px;
}

.sec .sec-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.sec .sec-head .bar {
    width: 5px;
    height: 28px;
    background: var(--primary);
    border-radius: 3px;
    flex-shrink: 0;
}

.sec .sec-head h2 {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-serif);
    letter-spacing: 1px;
}

.sec .sec-head .sub {
    color: var(--text-light);
    font-size: 13px;
    margin-left: 4px;
    font-weight: 400;
}

/* ----- 10. 分类图例 ----- */
.legend {
    display: flex;
    gap: 18px;
    margin-bottom: 8px;
    font-size: 12.5px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.legend i {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: -2px;
}

.legend i.social {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.legend i.professional {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

/* ----- 11. 图书书架 ----- */
.shelf {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.bk {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bk:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px var(--shadow-hover);
    border-color: var(--gold);
}

.bk .bk-cover {
    height: 250px;
    flex: 0 0 250px;
    overflow: hidden;
    background: var(--line-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.bk .bk-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.bk:hover .bk-cover img {
    transform: scale(1.04);
}

.bk .bk-info {
    padding: 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.bk .bk-info .au {
    font-size: 12.5px;
    color: var(--text-light);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.7em;
}

.bk .bk-info .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    flex-wrap: wrap;
    gap: 6px;
}

.bk .bk-info .price {
    color: var(--primary);
    font-weight: 700;
    font-size: 17px;
}

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

.bk .bk-info .tag {
    font-size: 10.5px;
    background: var(--line-light);
    color: var(--primary-light);
    padding: 3px 12px;
    border-radius: 9999px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bk .bk-info .tag.pro {
    background: var(--gold-pale);
    color: #8a6d00;
}

/* ----- 12. 分页控件 ----- */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
    font-size: 13px;
    color: var(--text-light);
}

.pagination-bar .info b {
    color: var(--primary-light);
}

.pagination-bar .links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.pagination-bar .links a,
.pagination-bar .links span {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: all var(--transition);
    cursor: pointer;
    min-width: 32px;
    text-align: center;
}

.pagination-bar .links a {
    border: 1px solid var(--line);
    color: var(--text-light);
    background: var(--card);
}

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

.pagination-bar .links a.active {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
    cursor: default;
}

.pagination-bar .links span.dots {
    border: none;
    background: none;
    color: var(--text-muted);
    padding: 5px 4px;
}

/* ----- 13. 时间线（出版动态） ----- */
.timeline {
    position: relative;
    padding-left: 32px;
}

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

.tl-item {
    position: relative;
    margin-bottom: 24px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 22px;
    transition: all var(--transition);
    box-shadow: 0 2px 8px var(--shadow);
}

.tl-item:hover {
    box-shadow: 0 8px 24px var(--shadow-hover);
    border-color: var(--gold);
}

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

.tl-item .date {
    font-size: 12px;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 1px;
}

.tl-item h3 {
    font-size: 16.5px;
    margin: 6px 0 8px;
    font-weight: 600;
    line-height: 1.4;
}

.tl-item p {
    font-size: 13.5px;
    color: var(--text-light);
    line-height: 1.7;
}

.tl-item .src {
    display: inline-block;
    margin-top: 10px;
    font-size: 11.5px;
    color: var(--primary-light);
    background: var(--line-light);
    padding: 3px 14px;
    border-radius: 9999px;
    font-weight: 500;
}

/* ----- 14. 数据面板 ----- */
.data-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 28px;
    align-items: start;   /* 两个 panel 各自按内容高度，不强制等高 */
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: 0 4px 12px var(--shadow);
}

.panel h3 {
    color: var(--primary);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    font-family: var(--font-serif);
    letter-spacing: 0.5px;
}

/* 分类列表：固定高度 + 滚动（纯 CSS，不依赖 JS） */
#catbox {
    min-height: 600px;
    max-height: 840px;
    overflow-y: auto;
    padding-right: 10px;
    margin-right: -10px;
}

#catbox::-webkit-scrollbar {
    width: 10px;
}
#catbox::-webkit-scrollbar-track {
    background: var(--line-light);
    border-radius: 5px;
}
#catbox::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 5px;
    border: 2px solid var(--line-light);
}
#catbox::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* 手机（≤ 768px）：矮一点 */
@media (max-width: 768px) {
    #catbox {
        max-height: 480px;
        min-height: 360px;
    }
}

.cat-bar {
    margin-bottom: 14px;
}

.cat-bar .cl {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text);
}

.cat-bar .cl b {
    color: var(--primary);
}

.cat-bar .track {
    height: 8px;
    background: var(--line-light);
    border-radius: 4px;
    overflow: hidden;
}

.cat-bar .track .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.8s ease;
}

.cat-bar .track .fill.gold {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.cat-bar .track .fill.green {
    background: linear-gradient(90deg, #3d7a4e, #5b9b6b);
}

.panel .total-row {
    text-align: right;
    color: var(--primary);
    font-weight: 700;
    margin-top: 8px;
    font-size: 14px;
}

/* 数据表格 */
.dtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

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

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

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

.dtable tbody tr:hover td {
    background: var(--gold-pale);
}

.dtable tbody td.pro {
    color: var(--primary-light);
    font-weight: 600;
}

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

.table-wrap {
    overflow-x: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

/* 操作按钮组 */
.exbtns {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
    align-items: center;
}

.exbtns .sel-count {
    font-size: 13px;
    color: var(--primary-light);
    font-weight: 600;
    margin-right: 8px;
}

/* ----- 15. 按钮 ----- */
.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 500;
    font-family: var(--font-sans);
    line-height: 1.4;
}

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

.btn.gold {
    background: var(--gold);
    color: var(--primary);
    font-weight: 600;
}

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

.btn.outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn.outline:hover {
    background: var(--primary);
    color: #fff;
}

/* ----- 16. 配货中心 ----- */
.dist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.ord {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all var(--transition);
}

.ord:hover {
    box-shadow: 0 8px 28px var(--shadow-hover);
    border-color: var(--gold);
}

.ord-head {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 16px 20px;
}

.ord-head .oid {
    font-size: 12px;
    opacity: 0.8;
    letter-spacing: 1px;
    font-weight: 400;
}

.ord-head h3 {
    font-size: 16px;
    margin-top: 4px;
    font-weight: 600;
}

.ord-head .proj {
    font-size: 11px;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.15);
    display: inline-block;
    padding: 2px 12px;
    border-radius: 9999px;
}

.ord-body {
    padding: 14px 20px;
}

.ord-body .oi {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
}

.ord-body .oi:last-child {
    border-bottom: none;
}

.ord-body .oi .qty {
    color: var(--primary);
    font-weight: 700;
}

.ord-foot {
    display: flex;
    justify-content: space-between;
    background: var(--line-light);
    padding: 10px 20px;
    font-size: 12.5px;
    color: var(--text-light);
}

.ord-progress {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gold-pale);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.ord-progress .label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-light);
    white-space: nowrap;
}

.ord-progress .track {
    flex: 1;
    height: 10px;
    background: var(--line-light);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.ord-progress .track .fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.ord-progress .track .fill.shipping {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.ord-progress .track .fill.processing {
    background: linear-gradient(90deg, #5aa7e6, #2b7fd0);
}

.ord-progress .track .fill.done {
    background: linear-gradient(90deg, #66bb6a, #2e7d32);
}

.ord-progress .status {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* 配货中心布局 */
.dist-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.dist-layout .dist-grid-wrap {
    flex: 1;
    min-width: 320px;
}

/* ----- 17. 配货统计侧栏 ----- */
.dist-stats {
    width: 300px;
    flex: 0 0 300px;
}

.dist-stats .card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    box-shadow: 0 4px 12px var(--shadow);
}

.dist-stats .card .header {
    background: linear-gradient(135deg, var(--gold-pale), var(--gold));
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    padding: 14px;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--line);
}

.dist-stats .card .item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px dashed var(--line);
}

.dist-stats .card .item:last-child {
    border-bottom: none;
}

.dist-stats .card .item .label {
    font-size: 13px;
    color: var(--text-light);
}

.dist-stats .card .item .value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ----- 18. 表单 ----- */
.order-form {
    max-width: 840px;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 32px;
    background: var(--card);
    box-shadow: 0 4px 16px var(--shadow);
}

.order-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.order-form .form-grid input {
    padding: 12px 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    outline: none;
    background: var(--bg);
    transition: all var(--transition);
    width: 100%;
    box-sizing: border-box;
}

.order-form .form-grid input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
    background: #fff;
}

.order-form textarea {
    width: 100%;
    box-sizing: border-box;
    margin-top: 16px;
    padding: 12px 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    outline: none;
    background: var(--bg);
    resize: vertical;
    min-height: 80px;
    font-family: var(--font-sans);
    transition: all var(--transition);
}

.order-form textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
    background: #fff;
}

.order-form .form-actions {
    margin-top: 18px;
    text-align: right;
}

.order-form .form-actions .btn {
    font-size: 14px;
    padding: 10px 32px;
}

/* ----- 19. 联系我们 ----- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.contact-grid .panel ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    line-height: 2.4;
    color: var(--text);
    font-size: 14px;
}

.contact-grid .panel ul li a {
    color: var(--primary-light);
    font-weight: 500;
}

.contact-grid .panel ul li a:hover {
    color: var(--primary);
}

.contact-grid .panel p {
    color: var(--text-light);
    line-height: 1.9;
    margin-top: 10px;
}

.contact-grid .panel .highlight {
    color: var(--primary-light);
    font-weight: 600;
}

/* ----- 20. 弹窗 ----- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 10, 12, 0.60);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

.modal .mbox {
    background: var(--card);
    border-radius: var(--radius);
    max-width: 760px;
    width: 92%;
    max-height: 86vh;
    overflow: auto;
    padding: 32px 36px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
    position: relative;
    animation: modalIn 0.3s ease;
}

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

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

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

.modal .mrow {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.modal .mcover {
    width: 190px;
    height: 270px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 8px 28px var(--shadow-heavy);
    flex: 0 0 190px;
}

.modal .mcover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal .mbody {
    flex: 1;
    min-width: 240px;
}

.modal .mbody h2 {
    color: var(--primary);
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-serif);
}

.modal .mbody .au {
    margin: 4px 0 12px;
    color: var(--text-light);
    font-size: 14px;
}

.modal .mbody .desc {
    font-size: 14px;
    color: var(--text);
    line-height: 1.8;
    margin-bottom: 16px;
}

.modal .mbody .price {
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
}

.modal .mbody .meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 24px;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
    font-size: 13px;
}

.modal .mbody .meta b {
    color: var(--text);
    font-weight: 600;
}

/* ----- 21. 页脚 ----- */
footer {
    background: var(--primary-dark);
    color: var(--gold-pale);
    font-size: 13px;
    padding: 44px 0 28px;
    margin-top: 20px;
}

footer .footer-grid {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    padding: 0 20px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

footer .footer-grid h4 {
    color: var(--gold-light);
    font-size: 15px;
    margin-bottom: 12px;
    letter-spacing: 1.5px;
    font-family: var(--font-serif);
}

footer .footer-grid p {
    line-height: 2;
    font-size: 13px;
    opacity: 0.85;
}

footer .footer-grid a {
    color: var(--gold-pale);
}

footer .footer-grid a:hover {
    color: var(--gold-light);
}

footer .foot-copy {
    max-width: var(--container);
    margin: 0 auto;
    padding: 20px 20px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 2;
}

footer .foot-copy b {
    color: var(--gold-light);
}

/* 页脚链接（ICP / 公安备案号）：颜色跟原 <b> 包裹时一致 */
footer .foot-copy a {
    color: var(--gold-light);
}

footer .foot-copy a:hover {
    color: var(--gold);
}

/* ============================================================
   22. 响应式设计 —— 平板（≤ 1024px）
   ============================================================ */
@media (max-width: 1024px) {
    .shelf {
        grid-template-columns: repeat(3, 1fr);
    }

    .data-grid {
        grid-template-columns: 1fr;
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 40px 20px;
    }

    .hero .hero-cover {
        height: 300px;
        max-width: 400px;
        margin: 0 auto;
        transform: none;
    }

    .hero .hero-cover:hover {
        transform: none;
    }

    .hero .hero-content p {
        max-width: 100%;
        margin: 0 auto;
    }

    .hero .hero-content h2 {
        font-size: 30px;
    }

    .dist-stats {
        width: 100%;
        flex: 1 1 100%;
    }

    .dist-layout {
        flex-direction: column;
    }
}

/* ============================================================
   23. 响应式设计 —— 手机（≤ 768px）
   ============================================================ */
@media (max-width: 768px) {
    /* ---- 页头 ---- */
    .masthead {
        padding: 14px 0;
    }

    .masthead-inner {
        gap: 14px;
        padding: 0 12px;
    }

    .masthead .logo-badge {
        width: 60px;
        height: 68px;
        flex: 0 0 60px;
        padding: 4px;
    }

    .company-name-box {
        padding: 12px 22px;
    }

    .company-name-box::before,
    .company-name-box::after {
        width: 12px;
    }

    .company-name-box::before {
        left: -7px;
    }

    .company-name-box::after {
        right: -7px;
    }

    .company-title {
        font-size: 18px;
        letter-spacing: 2px;
        white-space: normal;
        word-break: break-all;
        text-align: center;
    }

    .slogan-line {
        font-size: 10px;
        letter-spacing: 5px;
    }

    /* ---- 导航 ---- */
    .mainnav .container {
        padding: 0 4px;
    }

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

    .mainnav .nav-search {
        padding: 4px 6px;
        gap: 4px;
    }

    .mainnav .nav-search input {
        width: 120px;
        font-size: 12px;
        padding: 6px 12px;
    }

    .mainnav .nav-search button {
        padding: 6px 14px;
        font-size: 12px;
    }

    /* ---- 统计栏 ---- */
    .stats .container {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats .stat {
        padding: 18px 10px;
    }

    .stats .stat .num {
        font-size: 24px;
    }

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

    /* ---- 区块通用 ---- */
    .sec {
        margin: 32px auto 48px;
        padding: 0 16px;
    }

    .sec .sec-head h2 {
        font-size: 20px;
    }

    .sec .sec-head .sub {
        display: none;
    }

    /* ---- 书库 ---- */
    .shelf {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .bk .bk-cover {
        height: 200px;
        flex: 0 0 200px;
    }

    .bk .bk-info {
        padding: 12px 14px;
    }

    .bk .bk-info h3 {
        font-size: 14px;
        min-height: 2.6em;
        max-height: 2.6em;
    }

    .bk .bk-info .au {
        font-size: 11.5px;
    }

    .bk .bk-info .price {
        font-size: 15px;
    }

    .bk .bk-info .tag {
        font-size: 10px;
        padding: 2px 8px;
    }

    /* ---- 分页 ---- */
    .pagination-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .pagination-bar .info {
        text-align: center;
    }

    .pagination-bar .links {
        justify-content: center;
    }

    /* ---- 数据面板 ---- */
    .panel {
        padding: 16px 16px;
    }

    .panel h3 {
        font-size: 15px;
    }

    /* ---- 表格 ---- */
    .dtable {
        font-size: 12px;
        min-width: 780px;
    }

    .dtable thead th,
    .dtable tbody td {
        padding: 8px 6px;
        white-space: nowrap;
    }

    .table-wrap {
        margin: 0 -12px;
        padding: 0 12px;
        -webkit-overflow-scrolling: touch;
    }

    /* ---- 导出按钮 ---- */
    .exbtns {
        flex-direction: column;
        align-items: stretch;
    }

    .exbtns .btn {
        text-align: center;
    }

    .exbtns .sel-count {
        text-align: center;
        margin-right: 0;
    }

    /* ---- 首页横幅 ---- */
    .hero .container {
        padding: 32px 16px;
    }

    .hero .hero-cover {
        max-width: 260px;
        height: 340px;
        border: 3px solid rgba(255, 255, 255, 0.8);
    }

    .hero .hero-content h2 {
        font-size: 26px;
    }

    .hero .hero-content p {
        font-size: 14px;
    }

    /* ---- 配货中心 ---- */
    .dist-grid {
        grid-template-columns: 1fr;
    }

    /* ---- 表单 ---- */
    .order-form {
        padding: 20px 16px;
    }

    .order-form .form-grid {
        grid-template-columns: 1fr;
    }

    /* ---- 联系我们 ---- */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* ---- 弹窗 ---- */
    .modal .mbox {
        padding: 22px 16px;
        max-height: 90vh;
    }

    .modal .mrow {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .modal .mcover {
        width: 150px;
        height: 210px;
        flex: 0 0 150px;
    }

    .modal .mbody {
        min-width: 100%;
    }

    .modal .mbody h2 {
        font-size: 18px;
        text-align: center;
    }

    .modal .mbody .au {
        text-align: center;
        font-size: 13px;
    }

    .modal .mbody .meta {
        grid-template-columns: 1fr;
    }

    /* ---- 页脚 ---- */
    footer {
        padding: 32px 0 20px;
    }

    footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-bottom: 20px;
    }

    footer .foot-copy {
        font-size: 11px;
        line-height: 1.9;
        padding: 16px 16px 0;
    }

    /* ---- 顶部条 ---- */
    .topbar {
        font-size: 11.5px;
        padding: 5px 0;
    }

    .topbar .contact-info {
        font-size: 11px;
        gap: 10px;
    }

    .topbar .contact-info span:last-child {
        display: none;
    }

    /* ---- 时间线 ---- */
    .timeline {
        padding-left: 24px;
    }

    .tl-item {
        padding: 14px 16px;
    }

    .tl-item::before {
        left: -21px;
        top: 20px;
    }

    .tl-item h3 {
        font-size: 15px;
    }

    .tl-item p {
        font-size: 12.5px;
    }

    /* ---- 图例 ---- */
    .legend {
        font-size: 12px;
        gap: 12px;
    }
}

/* ============================================================
   24. 响应式设计 —— 小屏手机（≤ 480px）
   ============================================================ */
@media (max-width: 480px) {
    /* ---- 页头 ---- */
    .masthead-inner {
        gap: 10px;
    }

    .masthead .logo-badge {
        width: 48px;
        height: 54px;
        flex: 0 0 48px;
    }

    .company-name-box {
        padding: 8px 14px;
    }

    .company-title {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .slogan-line {
        font-size: 9px;
        letter-spacing: 3px;
    }

    /* ---- 导航 ---- */
    .mainnav a {
        padding: 10px 10px;
        font-size: 12.5px;
    }

    .mainnav .nav-search input {
        width: 90px;
        font-size: 11px;
        padding: 5px 8px;
    }

    .mainnav .nav-search button {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* ---- 书库 ---- */
    .shelf {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .bk .bk-cover {
        height: 160px;
        flex: 0 0 160px;
    }

    .bk .bk-info {
        padding: 10px 10px;
    }

    .bk .bk-info h3 {
        font-size: 13px;
        min-height: 2.6em;
        max-height: 2.6em;
    }

    .bk .bk-info .price {
        font-size: 14px;
    }

    /* ---- 首页横幅 ---- */
    .hero .container {
        padding: 24px 12px;
    }

    .hero .hero-cover {
        max-width: 200px;
        height: 260px;
    }

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

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

    .hero .hero-content .btn {
        padding: 10px 24px;
        font-size: 13px;
    }

    /* ---- 统计栏 ---- */
    .stats .stat {
        padding: 14px 8px;
    }

    .stats .stat .num {
        font-size: 20px;
    }

    .stats .stat .label {
        font-size: 11px;
    }

    /* ---- 区块 ---- */
    .sec {
        margin: 24px auto 32px;
        padding: 0 12px;
    }

    .sec .sec-head h2 {
        font-size: 18px;
    }

    /* ---- 弹窗 ---- */
    .modal .mbox {
        padding: 18px 12px;
    }

    .modal .mcover {
        width: 130px;
        height: 180px;
        flex: 0 0 130px;
    }
}

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

/* ============================================================
   26. 无障碍：减少动画（晕动症用户系统设置）
   ============================================================ */
@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;
    }
}

/* ============================================================
   27. 打印样式
   ============================================================ */
@media print {
    .mainnav,
    .topbar,
    .hero,
    .stats,
    footer,
    .exbtns,
    .modal .close {
        display: none !important;
    }

    /* 隐藏未激活的区块（九乐用内联 display:none 切换，这条是双保险） */
    main > section[style*="display: none"],
    main > section[style*="display:none"] {
        display: none !important;
    }

    .sec {
        margin: 16px auto;
        break-inside: avoid;
    }

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

    .bk {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

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

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

    .dtable thead th {
        background: #333;
        color: #fff;
    }

    .dtable tbody td {
        border-bottom: 1px solid #ddd;
    }

    .dtable tbody tr:nth-child(even) td {
        background: #f9f9f9;
    }
}