/* ============================================================
   2026年政策文件汇编 v2 - 全端 UI 优化版
   电脑端 ≥1025px  |  平板端 769-1024px  |  手机端 ≤768px
   ============================================================ */

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f4f6f9;
    --surface: #ffffff;
    --text: #1e293b;
    --text-sub: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
    --r: 10px;
    --r-sm: 6px;

    /* 顶部导航高度（PC端） */
    --header-h: 100px;
    /* 顶部导航高度（tablet） */
    --header-h-tablet: 96px;
    /* 顶部导航高度（mobile） */
    --header-h-mobile: 56px;

    /* 文档字体 */
    --doc-font: 16px;
    --doc-lh: 1.8;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    line-height: 1;
}

/* ---------- 页面切换 ---------- */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

/* ============================================================
   首页 - 顶部导航（固定）
   ============================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* 上行：标题 + 搜索 */
.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 52px;
    gap: 16px;
}

.header-left { flex-shrink: 0; }

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* 搜索框 */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 200px;
}

.search-box input {
    width: 100%;
    height: 34px;
    padding: 0 64px 0 12px;
    border: 1.5px solid var(--border);
    border-radius: 17px;
    font-size: 0.875rem;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}

.search-box input::placeholder { color: #aab4c0; }
.search-box input:focus { border-color: var(--primary); background: #fff; }

.search-clear-btn {
    position: absolute;
    right: 34px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    border-radius: 50%;
    transition: background 0.15s;
}
.search-clear-btn:hover { background: var(--bg); }

.search-icon-btn {
    position: absolute;
    right: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}
.search-icon-btn:hover { background: #eff2f7; color: var(--primary); }

/* 手机端分类按钮（默认隐藏） */
.mobile-cat-btn {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    height: 32px;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    font-size: 0.8125rem;
    color: var(--text);
    background: var(--bg);
    white-space: nowrap;
}
.mobile-cat-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 下行：分类导航 */
.category-nav-row {
    display: flex;
    flex-direction: column;
}

.category-nav {
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 42px;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.category-nav::-webkit-scrollbar { display: none; }

.cat-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    height: 30px;
    border-radius: 15px;
    font-size: 0.8125rem;
    color: var(--text-sub);
    background: transparent;
    transition: all 0.18s;
    white-space: nowrap;
}

.cat-btn:hover { color: var(--primary); background: rgba(37,99,235,0.07); }

.cat-btn.active {
    color: var(--primary);
    font-weight: 700;
    background: rgba(37,99,235,0.1);
}

.cat-more-btn {
    flex-shrink: 0;
    padding: 5px 10px;
    height: 30px;
    border-radius: 15px;
    font-size: 0.8125rem;
    color: var(--text-sub);
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 3px;
    transition: all 0.18s;
}
.cat-more-btn:hover { color: var(--primary); border-color: var(--primary); }
.cat-more-btn.active { color: var(--primary); border-color: var(--primary); background: rgba(37,99,235,0.07); }

/* 平板端锚点条（默认隐藏，tablet时显示） */
.tablet-anchor-bar {
    display: none;
    align-items: center;
    justify-content: space-around;
    padding: 0 16px;
    height: 32px;
    background: #f0f2f5;
    border-top: 1px solid var(--border);
}

.tablet-anchor-bar .anchor-num {
    flex: 1;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text);
    padding: 4px 2px;
    transition: all 0.15s;
    border-radius: 4px;
}
.tablet-anchor-bar .anchor-num:hover,
.tablet-anchor-bar .anchor-num.active {
    color: var(--primary);
    font-weight: 700;
}

/* 手机端分类下拉 */
.mobile-cat-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    right: 12px;
    width: 50vw;
    min-width: 140px;
    max-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-md);
    z-index: 300;
    padding: 6px 0;
    max-height: 70vh;
    overflow-y: auto;
}

.mob-cat-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 16px;
    font-size: 0.875rem;
    color: var(--text);
    transition: background 0.15s;
}
.mob-cat-item:hover { background: #f5f7fa; }
.mob-cat-item.active { color: var(--primary); font-weight: 700; }

/* ============================================================
   首页 - 主体内容区
   ============================================================ */
.home-body {
    display: flex;
    padding-top: var(--header-h);
    min-height: 100vh;
    position: relative;
}

.list-area {
    flex: 1;
    min-width: 0;
    padding: 20px 24px 32px;
    max-width: calc(100% - 60px); /* 为右侧锚点栏留空 */
}

/* 统计栏 */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 0.8125rem;
    color: var(--text-sub);
    padding: 0 2px;
}

#search-result-count { color: var(--primary); }
.hidden { display: none !important; }

/* ---------- 政策文件卡片 ---------- */
.policy-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.policy-card {
    background: var(--surface);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 90%;
    flex-wrap: wrap;
}

.policy-card:hover {
    background: #f5f7fb;
    box-shadow: var(--shadow-md);
}

/* 全文命中时卡片主行包裹层 */
.card-main-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

/* 全文命中正文摘要 */
.card-snippet {
    width: 100%;
    font-size: 0.8125rem;
    color: var(--text-sub);
    line-height: 1.55;
    padding: 4px 0 2px 0;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    word-break: break-all;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.policy-card.has-snippet {
    align-items: flex-start;
    flex-direction: column;
}

/* 新版卡片子元素（app.js v2 生成） */
.card-num {
    flex-shrink: 0;
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-sub);
    min-width: 2em;
}

.card-sep {
    flex-shrink: 0;
    color: #c8d3e0;
    font-size: 0.875rem;
    user-select: none;
}

.card-title {
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-cat {
    flex-shrink: 0;
    font-size: 0.8125rem;
    color: var(--text-sub);
    white-space: nowrap;
}

.card-fmt {
    flex-shrink: 0;
    font-size: 0.8125rem;
    color: var(--text-sub);
    white-space: nowrap;
}

/* 旧版兼容 */
.policy-num {
    flex-shrink: 0;
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-sub);
    min-width: 2.5em;
    text-align: right;
}

.policy-title {
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.policy-category {
    flex-shrink: 0;
    font-size: 0.8125rem;
    color: var(--text-sub);
    white-space: nowrap;
}

.policy-format {
    flex-shrink: 0;
    font-size: 0.8125rem;
    color: var(--text-sub);
    white-space: nowrap;
}

/* ---------- 电脑端右侧锚点栏 ---------- */
.desktop-anchor-bar {
    position: fixed;
    right: 20px;
    top: calc(var(--header-h) + 20px);
    width: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    z-index: 100;
    max-height: calc(100vh - var(--header-h) - 40px);
    overflow-y: auto;
    scrollbar-width: none;
}
.desktop-anchor-bar::-webkit-scrollbar { display: none; }

.desktop-anchor-bar .anchor-num {
    width: 100%;
    text-align: center;
    padding: 4px 0;
    font-size: 0.75rem;
    color: var(--text);
    transition: all 0.15s;
    border-radius: 4px;
}
.desktop-anchor-bar .anchor-num:hover,
.desktop-anchor-bar .anchor-num.active {
    color: var(--primary);
    font-weight: 700;
}

/* ---------- 手机端跳转浮层 ---------- */
.mobile-jump-btn {
    display: none;
    position: fixed;
    right: 10px;
    bottom: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(37,99,235,0.4);
    z-index: 150;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
}
.mobile-jump-btn:hover { background: var(--primary-hover); transform: scale(1.07); }

.mobile-jump-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 400;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 10px 74px 0;
}

.mobile-jump-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-md);
    padding: 14px;
    width: clamp(160px, 35vw, 210px);
}

.mobile-jump-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 10px;
    text-align: center;
}

.mobile-jump-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.jump-num {
    height: 32px;
    border-radius: var(--r-sm);
    font-size: 0.8125rem;
    color: var(--text);
    background: var(--bg);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jump-num:hover, .jump-num:active { background: var(--primary); color: #fff; }

/* ============================================================
   详情页
   ============================================================ */

/* 固定头部 */
.detail-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.detail-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 52px;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.detail-title {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* 文字/扫描切换 */
.view-toggle {
    display: flex;
    gap: 2px;
    background: var(--bg);
    padding: 3px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.toggle-btn {
    padding: 4px 14px;
    border-radius: 17px;
    font-size: 0.8125rem;
    color: var(--text-sub);
    transition: all 0.18s;
}
.toggle-btn.active {
    background: var(--surface);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.toggle-btn:hover:not(.active) { color: var(--text); }
.toggle-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 返回按钮 */
.back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    height: 32px;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    font-size: 0.8125rem;
    color: var(--text-sub);
    background: var(--bg);
    transition: all 0.18s;
    white-space: nowrap;
}
.back-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 内容区 */
.detail-body {
    padding-top: 52px;
    min-height: 100vh;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 24px 48px;
}

.content-panel {
    display: none;
}
.content-panel.active {
    display: block;
}

/* ============================================================
   文档内容样式（保持原格式）
   ============================================================ */
#text-content {
    line-height: var(--doc-lh);
    font-size: var(--doc-font);
    color: var(--text);
}

#text-content .doc-heading {
    color: var(--text);
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    line-height: 1.4;
}
#text-content h1.doc-heading { font-size: 1.75em; border-bottom: 2px solid var(--border); padding-bottom: 0.5em; margin-top: 0; }
#text-content h2.doc-heading { font-size: 1.5em; }
#text-content h3.doc-heading { font-size: 1.25em; }
#text-content h4.doc-heading { font-size: 1.125em; }
#text-content h5.doc-heading, #text-content h6.doc-heading { font-size: 1em; }

#text-content .doc-para {
    margin-bottom: 1em;
    text-align: justify;
}
#text-content .doc-para.text-indent { text-indent: 2em; }
#text-content .doc-para.align-center { text-align: center; }
#text-content .doc-para.align-right { text-align: right; }
#text-content .doc-para.align-justify { text-align: justify; }
#text-content .empty-para { height: 0.5em; }

/* 旧版兼容 */
#text-content h1 { font-size: 1.75em; margin-bottom: 1em; color: var(--text); border-bottom: 2px solid var(--border); padding-bottom: 0.5em; }
#text-content h2 { font-size: 1.5em; margin-top: 1.5em; margin-bottom: 0.75em; color: var(--text); }
#text-content h3 { font-size: 1.25em; margin-top: 1.25em; margin-bottom: 0.75em; color: var(--text); }
#text-content p { margin-bottom: 1em; text-align: justify; }
#text-content strong { font-weight: 700; }
#text-content em { font-style: italic; }
#text-content u { text-decoration: underline; }
#text-content s, #text-content strike { text-decoration: line-through; }

/* 列表 */
#text-content ul, #text-content ol { margin-bottom: 1em; padding-left: 2em; }
#text-content li { margin-bottom: 0.5em; }
#text-content ul ul, #text-content ol ol, #text-content ul ol, #text-content ol ul { margin-top: 0.5em; margin-bottom: 0.5em; }

/* 图片 */
#text-content .doc-image { max-width: 100%; height: auto; display: block; margin: 1em auto; border-radius: var(--r-sm); }

/* ---------- 表格 - 电脑端 ---------- */
#text-content .table-wrapper {
    margin: 1.5em 0;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

#text-content .doc-table,
#text-content .excel-table,
#text-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375em;
    table-layout: fixed;
}

#text-content .doc-table th,
#text-content .doc-table td,
#text-content .excel-table th,
#text-content .excel-table td,
#text-content th,
#text-content td {
    border: 1px solid var(--border);
    padding: 0.75em 1em;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: break-word;
}

#text-content .doc-table th,
#text-content .excel-table th,
#text-content th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text);
}

/* Excel表格 */
#text-content .excel-wrapper { margin: 1.5em 0; }
#text-content .excel-title { font-size: 1.25em; font-weight: 600; margin-bottom: 1em; }

/* 搜索高亮 */
.highlight,
mark.hl {
    background: #fef08a;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
    font-style: normal;
}

/* 文档加载 */
.doc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-sub);
    gap: 12px;
}

/* 通用 loading spinner */
.loading-spin {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

/* PDF 页面包裹 */
.pdf-pages-wrap {
    padding: 20px;
    background: #f5f5f5;
}

.pdf-page-item {
    margin-bottom: 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

/* ---------- 扫描版图片 ---------- */
.pdf-images-container {
    padding: 20px;
    background: #f5f5f5;
}

.pdf-page-wrapper {
    margin-bottom: 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.pdf-page-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.pdf-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.pdf-footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 12px;
}
.pdf-footer a { color: var(--primary); text-decoration: none; }
.pdf-footer a:hover { text-decoration: underline; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-sub);
}
.empty-state h3 { font-size: 1.125rem; margin-bottom: 0.5rem; color: var(--text); }

/* 加载 */
.loading { display: flex; align-items: center; justify-content: center; padding: 4rem; }
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   平板端适配（769-1024px）
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --header-h: var(--header-h-tablet);
    }

    /* 分类导航 - 前6个可见，其余收起 */
    .category-nav { padding: 0 16px; }

    /* 显示平板锚点条 */
    .tablet-anchor-bar { display: flex; }

    /* 隐藏电脑端右侧锚点栏 */
    .desktop-anchor-bar { display: none; }

    /* 主列表区全宽 */
    .list-area { padding: 16px 16px 32px; max-width: 100%; }

    /* 卡片宽度 */
    .policy-card { width: 95%; }

    /* 搜索框宽度 */
    .search-box { width: 150px; }

    /* 内容区 */
    .content-wrapper { max-width: 100%; padding: 16px 16px 48px; }
    #text-content { font-size: 14px; }

    /* 表格 */
    #text-content .doc-table,
    #text-content .excel-table,
    #text-content table { font-size: 12px; table-layout: auto; }

    #text-content .doc-table th,
    #text-content .doc-table td,
    #text-content .excel-table th,
    #text-content .excel-table td,
    #text-content th,
    #text-content td {
        padding: 0.5em 0.75em;
        white-space: normal;
        word-break: break-word;
    }

    /* 扫描版图片 */
    .pdf-images-container { padding: 12px; }
}

/* ============================================================
   手机端适配（≤768px）
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --header-h: var(--header-h-mobile);
        --doc-font: 15px;
    }

    /* 顶部 */
    .header-top-row { padding: 0 12px; height: var(--header-h-mobile); }

    /* 隐藏桌面分类导航，显示手机按钮 */
    .category-nav-row { display: none; }
    .mobile-cat-btn { display: flex; }

    /* 搜索框 */
    .search-box { width: 120px; }
    .search-box input { font-size: 0.8125rem; height: 30px; }

    /* 标题 */
    .site-title { font-size: 1rem; }

    /* 主体 */
    .home-body { padding-top: var(--header-h-mobile); }
    .list-area { padding: 12px 10px 80px; max-width: 100%; }

    /* 卡片 */
    .policy-card {
        width: 100%;
        padding: 10px 12px;
        gap: 8px;
        border-radius: 8px;
        flex-wrap: wrap;
    }
    .policy-num,
    .card-num { font-size: 0.8125rem; min-width: 2em; }
    .policy-title,
    .card-title { font-size: 0.8125rem; white-space: normal; }
    .policy-category,
    .card-cat { font-size: 0.75rem; }
    .policy-format,
    .card-fmt { font-size: 0.75rem; }
    .card-snippet { font-size: 0.75rem; }

    /* 隐藏电脑端锚点 */
    .desktop-anchor-bar { display: none; }

    /* 显示手机跳转按钮 */
    .mobile-jump-btn { display: flex; }

    /* 详情页 */
    .detail-header-inner { padding: 0 12px; height: 50px; }
    .detail-title { font-size: 0.875rem; }
    .back-btn-text { /* 缩短文字 */ }
    .back-btn { padding: 4px 10px; font-size: 0.75rem; }
    .toggle-btn { padding: 3px 10px; font-size: 0.75rem; }

    .detail-body { padding-top: 50px; }
    .content-wrapper { padding: 10px 10px 48px; max-width: 100%; }

    #text-content { font-size: 14px; }
    #text-content h1 { font-size: 1.375em; }
    #text-content h2 { font-size: 1.125em; }
    #text-content h3 { font-size: 1em; }

    /* 手机端表格 - 核心优化
       取消横向滚动，纯上下滚动，保留原结构 */
    #text-content .table-wrapper {
        margin: 1em 0;
        overflow: hidden; /* 禁止横向滚动 */
        overflow-x: hidden;
        -webkit-overflow-scrolling: unset;
    }

    #text-content .doc-table,
    #text-content .excel-table,
    #text-content table {
        width: 100% !important;
        min-width: unset !important;
        font-size: 10px !important;
        table-layout: fixed !important;
        word-break: break-all;
    }

    #text-content .doc-table th,
    #text-content .doc-table td,
    #text-content .excel-table th,
    #text-content .excel-table td,
    #text-content th,
    #text-content td {
        padding: 4px 5px !important;
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        max-width: none !important;
        /* 行高自适应 */
        height: auto !important;
        line-height: 1.4 !important;
    }

    /* 扫描版 */
    .pdf-images-container { padding: 8px !important; }
    .pdf-page-wrapper { margin-bottom: 10px !important; border-radius: 2px; }
}

/* ============================================================
   平板端 - 分类导航更多下拉（电脑端隐藏）
   ============================================================ */
.cat-dropdown-panel {
    position: absolute;
    top: calc(100% + 2px);
    left: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-md);
    z-index: 300;
    padding: 6px 0;
    min-width: 140px;
    display: none;
}
.cat-dropdown-panel.open { display: block; }

.cat-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    font-size: 0.875rem;
    color: var(--text);
    transition: background 0.15s;
}
.cat-dropdown-item:hover { background: #f5f7fa; }
.cat-dropdown-item.active { color: var(--primary); font-weight: 700; }

/* ============================================================
   滚动条美化
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   焦点 & 动画
   ============================================================ */
button:focus-visible, input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.policy-card { animation: fadeInUp 0.25s ease-out; }

/* ============================================================
   打印
   ============================================================ */
@media print {
    .site-header, .detail-header, .back-btn, .view-toggle,
    .desktop-anchor-bar, .mobile-jump-btn { display: none !important; }
    .content-wrapper { padding: 0; max-width: 100%; }
    #scan-content { display: none !important; }
    #text-content { display: block !important; }
}
