/* CLAF 全站移动端适配 v3 */
@media (max-width: 767px) {
    /* 1. Header Logo */
    .logo-icon { width: 32px !important; height: 32px !important; }
    .logo-chinese { font-size: 14px !important; white-space: nowrap !important; }
    .logo-english { font-size: 6px !important; display: block !important; color: #94A3B8 !important; white-space: nowrap !important; }
    .logo-text-wrapper { height: 32px !important; }
    .logo-container { gap: 6px !important; }
    .flex.items-center.space-x-6 { gap: 4px !important; }
    .flex.items-center.space-x-6 > * { margin-left: 0 !important; }
    header .border-b.border-stone-100.py-4 { padding-top: 8px !important; padding-bottom: 8px !important; }
    .logo-chinese { font-size: 13px !important; white-space: nowrap !important; }
    .logo-icon { width: 28px !important; height: 28px !important; }
    .logo-text-wrapper { height: 28px !important; }
    header .tracking-\[0\.2em\] { display: none !important; }
    header span.hidden.lg\:block { display: none !important; }
    header a[href="user_login.html"] { display: none !important; }
    /* 右侧功能区紧凑排列 */
    header .flex.items-center.space-x-3,
    header .flex.items-center.space-x-4 {
        gap: 6px !important;
    }
    header .flex.items-center.space-x-3 > *,
    header .flex.items-center.space-x-4 > * {
        margin-left: 0 !important;
    }
    /* 捐赠按钮缩小 */
    header .bg-red-700 { padding: 5px 10px !important; font-size: 12px !important; }
    /* 搜索框缩小 */
    .search-container { display: none !important; }
    /* 搜索图标独立显示 */

    .max-container { padding-left: 12px !important; padding-right: 12px !important; }
    body { overflow-x: hidden !important; }

    /* 2. 二级导航栏在手机端完全隐藏 */
    .hidden.lg\:block.bg-white.border-b.h-14 {
        display: none !important;
    }

    /* 3. Hero 轮播 16:9 */
    .hero { height: auto !important; min-height: unset !important; aspect-ratio: 16 / 9 !important; }
    .hero-slide img { object-position: center center !important; }
    .hero-content { padding: 0 16px !important; }
    .hero-title { font-size: 22px !important; line-height: 1.4 !important; }
    .hero-subtitle { font-size: 13px !important; }
    .hero-badge { font-size: 12px !important; padding: 4px 10px !important; margin-bottom: 16px !important; }
    .hero-btn { padding: 6px 14px !important; font-size: 13px !important; }
    .slideshow-indicators { bottom: 8px !important; }
    .indicator { width: 6px !important; height: 6px !important; }

    /* 4. 品牌项目卡片横向滑动 */
    .projects-grid {
        display: flex !important; overflow-x: auto !important;
        scroll-snap-type: x mandatory !important; -webkit-overflow-scrolling: touch !important;
        gap: 16px !important; padding-bottom: 16px !important; scrollbar-width: none !important;
    }
    .projects-grid::-webkit-scrollbar { display: none !important; }
    .project-card { flex: 0 0 75vw !important; scroll-snap-align: start !important; aspect-ratio: 1 / 1 !important; }

    /* 5. Footer */
    /* G4: 全站移动端防溢出 */
    body { overflow-x: hidden !important; }
    img { max-width: 100% !important; height: auto !important; }
    pre, code, table { max-width: 100% !important; overflow-x: auto !important; }
    /* #6: 社会专项基金移动端删除字母筛选 */
    .letter-nav { display: none !important; }
    /* F1+#6: 移动端分类导航隐藏 */
    .category-sidebar {
        display: none !important;
    }
    /* #1: header固定在顶部（只选顶部导航header，排除文章内header） */
    body > header, body > div > header, .bg-white.shadow-sm, .bg-white.border-b { position: sticky !important; top: 0 !important; z-index: 100 !important; background: white !important; }
    article header, main header { position: static !important; }

    /* #2: 移动端footer新方案 */
    footer { padding: 32px 0 20px !important; }
    footer .grid.grid-cols-1 {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
        padding-bottom: 20px !important;
        text-align: center !important;
    }
    footer .grid.grid-cols-1 > div:first-child { display: none !important; }
    footer .grid.grid-cols-1 > div:nth-child(2) { order: 1 !important; text-align: center !important; width: 100% !important; }
    footer .grid.grid-cols-1 > div:nth-child(2) h2 { font-size: 22px !important; margin-bottom: 4px !important; text-align: center !important; }
    footer .grid.grid-cols-1 > div:nth-child(2) p { text-align: center !important; margin-bottom: 12px !important; }
    footer .grid.grid-cols-1 > div:nth-child(2) .px-6 { padding: 4px 16px !important; margin: 0 auto !important; }
    footer .grid.grid-cols-1 > div:nth-child(2) .px-6 span { font-size: 13px !important; }
    footer .grid.grid-cols-1 > div:nth-child(3) { order: 2 !important; text-align: center !important; width: 100% !important; }
    footer .grid.grid-cols-1 > div:nth-child(3) h3 { display: none !important; }
    footer .grid.grid-cols-1 > div:nth-child(3) .flex.gap-4 { justify-content: center !important; gap: 24px !important; }
    footer .grid.grid-cols-1 > div:nth-child(3) .w-11 { width: 48px !important; height: 48px !important; }
    footer .pt-10 { padding-top: 16px !important; text-align: center !important; justify-content: center !important; align-items: center !important; }


    /* 6. 文章详情页 */
    .article-title, .article-title.serif-kai, h1.serif-kai { font-size: 22px !important; line-height: 1.4 !important; }
    .detail-container { padding: 24px 16px !important; margin: 20px auto !important; }
    .article-content { font-size: 15px !important; line-height: 1.6 !important; }
    .article-content p { margin-bottom: 16px !important; }
    .article-meta { flex-direction: column !important; gap: 8px !important; font-size: 13px !important; }
    .article-cover { width: 100% !important; max-width: 100% !important; border-radius: 8px !important; }
    .share-section { margin-top: 32px !important; padding-top: 24px !important; }
    .share-btn { width: 36px !important; height: 36px !important; }

    /* 7. 列表页 - 字体缩小 + 翻页按钮适配 */
    .page-header { padding: 32px 0 !important; }
    .page-title { font-size: 22px !important; }
    .page-subtitle { font-size: 13px !important; }
    .lecture-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
    .lecture-image { height: 200px !important; }
    .lecture-info { padding: 16px !important; }
    .lecture-guest { font-size: 18px !important; }
    .news-item { padding: 12px 0 !important; }
    .news-title { font-size: 15px !important; line-height: 1.6 !important; }
    .news-date { font-size: 12px !important; }
    /* 文章列表项 */
    .article-item { padding: 12px 8px !important; }
    .article-number { font-size: 15px !important; min-width: 28px !important; }
    .article-title { font-size: 15px !important; }
    .article-date { font-size: 12px !important; }
    /* 翻页按钮 */
    .pagination, [style*="display:flex"][style*="justify-content:center"][style*="gap:8px"] {
        flex-wrap: wrap !important;
        padding: 16px 8px !important;
    }
    .pagination-btn, [onclick*="goPage"], [onclick*="goWyjPage"], [onclick*="changePage"] {
        padding: 6px 12px !important;
        font-size: 13px !important;
        min-width: 32px !important;
        text-align: center !important;
    }

    /* 8. 面包屑 */
    .breadcrumb { padding: 12px 0 !important; }
    .breadcrumb-nav { font-size: 13px !important; flex-wrap: wrap !important; }
    .breadcrumb-current { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* 9. 基金/繁星工程 */
    .fund-title, .project-title { font-size: 22px !important; }
    .fund-tab, .project-tabs .project-tab { font-size: 13px !important; padding: 8px 16px !important; }

    /* 10. 搜索页 */
    .main-search-input { font-size: 15px !important; }
    .search-btn { padding: 10px 16px !important; font-size: 13px !important; }

    /* 11. 图片表格防溢出 */
    img { max-width: 100% !important; height: auto !important; }
    table { display: block !important; overflow-x: auto !important; max-width: 100% !important; }
    [style*="max-width: 800px"], [style*="max-width: 900px"], [style*="max-width: 840px"] {
        max-width: 100% !important; padding: 0 16px !important;
    }

    /* 12. Tab切换按钮 */
    .tab-item { font-size: 13px !important; padding: 8px 12px !important; }

    /* 13. 发展专项基金介绍容器 */
    .intro-container {
        max-width: 100% !important;
        padding: 24px 16px !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    }
    .intro-title { font-size: 22px !important; margin-bottom: 20px !important; }
    .content-body h2 { font-size: 18px !important; margin-top: 24px !important; margin-bottom: 12px !important; }
    .content-body h3 { font-size: 15px !important; }
    .content-body p { font-size: 15px !important; line-height: 1.6 !important; }

    /* 13. 发展专项基金介绍容器 */
    .intro-container {
        max-width: 100% !important;
        padding: 24px 16px !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    }
    .intro-title { font-size: 22px !important; margin-bottom: 20px !important; }
    .content-body h2 { font-size: 18px !important; margin-top: 24px !important; margin-bottom: 12px !important; }
    .content-body h3 { font-size: 15px !important; }
    .content-body p { font-size: 15px !important; line-height: 1.6 !important; }
}

/* ====== 汉堡菜单 ====== */
/* PC端隐藏（Tailwind lg:hidden 已处理，这里确保不覆盖） */
@media (min-width: 1024px) {
    #hamburgerBtn { display: none !important; }
}
/* 移动端显示并确保可点击 */
@media (max-width: 1023px) {
    #hamburgerBtn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 999 !important;
        position: relative !important;
        padding: 8px !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
        user-select: none !important;
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 18px !important;
        flex-shrink: 0 !important;
    }
    #hamburgerBtn i { pointer-events: none !important; }
}
#mobileMenu { z-index: 9999 !important; }
#mobileMenuPanel { z-index: 10000 !important; }

/* ====== 折叠屏展开态 + iPad 适配（768px - 1023px） ====== */
@media (min-width: 768px) and (max-width: 1023px) {
    /* 导航栏显示（PC端用 hidden lg:block 隐藏了，这个区间需要恢复） */
    .hidden.lg\:block.bg-white.border-b.h-14 {
        display: block !important;
    }
    /* 或者显示汉堡菜单替代 */
    #hamburgerBtn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 999 !important;
        padding: 8px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        font-size: 20px !important;
    }
    /* 隐藏桌面导航文字（放不下10个菜单项） */
    .hidden.lg\:block.bg-white.border-b.h-14 {
        display: none !important;
    }
    /* Logo 适配 */
    .logo-chinese { font-size: 15px !important; white-space: nowrap !important; }
    .logo-english { font-size: 7px !important; }
    .logo-icon { width: 36px !important; height: 36px !important; }
    /* Slogan 隐藏（空间不够） */
    header .tracking-\[0\.2em\] { display: none !important; }
    header span.hidden.lg\:block { display: none !important; }
    /* 登录按钮保留 */
    header a[href="user_login.html"] { font-size: 13px !important; }
    /* Hero 轮播 */
    .hero { height: 60vh !important; min-height: 400px !important; }
    /* 品牌项目卡片两列 */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
    /* 文章详情页 */
    .article-title, h1.serif-kai { font-size: 22px !important; }
    .detail-container { padding: 32px 24px !important; }
    /* 列表页 */
    .lecture-grid { grid-template-columns: repeat(2, 1fr) !important; }
    /* Footer 两列 */
    footer .grid { grid-template-columns: repeat(2, 1fr) !important; gap: 24px !important; }
    /* 面包屑 */
    .breadcrumb-nav { font-size: 13px !important; }
    /* 防溢出 */
    body { overflow-x: hidden !important; }
    img { max-width: 100% !important; height: auto !important; }
    .max-container { padding-left: 20px !important; padding-right: 20px !important; }
}

/* ====== 超窄屏适配（360px以下，华为P70等） ====== */
@media (max-width: 380px) {
    .logo-chinese { font-size: 12px !important; }
    .logo-icon { width: 24px !important; height: 24px !important; }
    .logo-text-wrapper { height: 24px !important; }
    .logo-english { font-size: 5px !important; }
    header .bg-red-700 { padding: 4px 8px !important; font-size: 12px !important; }
    #hamburgerBtn { padding: 6px !important; min-width: 32px !important; min-height: 32px !important; font-size: 16px !important; }
    .max-container { padding-left: 10px !important; padding-right: 10px !important; }

    /* G4: 全站移动端防溢出 */
    body { overflow-x: hidden !important; }
    img { max-width: 100% !important; height: auto !important; }
    pre, code, table { max-width: 100% !important; overflow-x: auto !important; }
    /* #6: 社会专项基金移动端删除字母筛选 */
}