/* 移动端适配（在 Bootstrap + site.css 之后加载） */
@media (max-width: 991.98px) {
    .topbar-search { max-width: none; }
    .hero h1 { font-size: 1.8rem; }
}

@media (max-width: 767.98px) {
    body { font-size: 15px; }
    .container { padding-left: 12px; padding-right: 12px; }

    /* 顶部条纵向堆叠 */
    .topbar .container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: .5rem !important;
    }
    .topbar-brand { align-self: flex-start; }
    .topbar-account { align-self: stretch; justify-content: flex-end; }
    /* 重置 flex-basis：在 column 里 flex-basis 是高度，避免搜索框被撑高 */
    .topbar-search { flex: 0 0 auto !important; width: 100%; max-width: none; }
    .topbar-account .btn { width: auto; }

    /* 分类导航保持横向滚动 */
    .cat-nav-item { padding: .6rem .8rem; font-size: .95rem; }

    /* Hero */
    .hero { padding: 2rem .5rem 1.6rem; }
    .hero h1 { font-size: 1.6rem; }
    .hero-search { flex-direction: column; border-radius: 1rem; gap: .35rem; }
    .hero-search input { width: 100%; }
    .hero-search button { width: 100%; }
    .hero-stats { gap: .6rem 1rem; }

    /* 列表网格小屏：恢复为块级单列（覆盖桌面 grid） */
    .news-list-3col, .news-list-2col {
        display: block;
    }

    /* 首页分类板块：移动端隐藏二级分类，只显示一级 */
    .block-sub { display: none; }
    .cat-chips .chip-sub { display: none; }
    .block-tags { display: none !important; }
    .nl-title { max-width: 75%; }

    /* 最新 + 排行：在小屏完全堆叠（col-lg-8/4 Bootstrap 已堆叠） */
    .latest-row > .row { row-gap: 1rem; }

    /* 热门卡片 */
    .hot-item { padding: .55rem .75rem; }

    /* CTA / 横条 */
    .vip-cta, .pkg-banner { padding: 1.4rem 1.2rem; text-align: center; justify-content: center; }
    .vip-cta h3 { font-size: 1.15rem; }
    .block-tags { display: none !important; }

    /* 工具条 */
    .toolbar { gap: .5rem; }
    .toolbar-search { width: 100%; max-width: none; }

    /* 文档详情 */
    .doc-title { font-size: 1.3rem; }
    .doc-meta { display: block; }
    .paywall .btn { display: block; width: 100%; margin: .3rem 0 0 !important; text-align: center; }

    /* 富信息卡列表（移动端：元数据横排、不断行） */
    .doc-rich-item { flex-wrap: wrap; gap: .5rem; padding: .55rem .25rem; }
    .doc-rich-no { width: 24px; height: 24px; font-size: .68rem; }
    .doc-rich-meta {
        flex-direction: row;
        align-items: center;
        gap: .65rem;
        min-width: 0;
        text-align: left;
        flex-basis: 100%;
    }

    /* 表格小屏滚动 */
    table { display: block; overflow-x: auto; }

    .auth-card { padding: 1.25rem; }
    .auth-card form button { width: 100%; }
}
