/* ========================================
   niu2涓婚 - 响应式样式
   ======================================== */

/* 大屏 */
@media (max-width: 1200px) {
    :root { --niu2-container: 100%; }
    .container { padding: 0 16px; }
    .posts-grid { grid-template-columns: repeat(3, 1fr); }

    /* 内容页资源信息卡片：中等宽度转纵向布局
       防止 993-1200px 区间详情区被压缩过窄，导致长下载链接换行撑高、图片被拉伸 */
    .resource-info-card-v2 .resource-info-top {
        flex-direction: column !important;
    }
    .resource-info-card-v2 .resource-thumb-v2 {
        flex: none !important;
        width: 100% !important;
        height: 220px !important;
    }
    .resource-info-card-v2 .resource-details-v2 {
        width: 100% !important;
    }
}

/* 平板 */
@media (max-width: 992px) {
    .header-search { display: none; }
    .header-nav { display: none; }
    .mobile-menu-btn { display: flex; }

    .latest-content,
    .archive-layout,
    .single-layout {
        grid-template-columns: 1fr;
    }
    .latest-sidebar,
    .archive-sidebar,
    .single-sidebar {
        order: -1;
    }

    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .cms-grid { grid-template-columns: 1fr 1fr; }
    .cms-card.cms-featured { grid-row: span 1; flex-direction: row; }
    .cms-featured .cms-thumb { width: 120px; height: 80px; }
    .cms-featured .cms-card-title { font-size: 14px; margin-top: 0; }
    .cms-featured .cms-card-excerpt { display: none; }

    .vip-intro-inner { grid-template-columns: 1fr; gap: 24px; }
    .vip-intro-plans { justify-content: center; }

    .niu2-vip-pricing { grid-template-columns: 1fr; max-width: 400px; margin: 32px auto; }
    .pricing-card.featured { transform: none; }

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

    .niu2-user-center { grid-template-columns: 1fr; }
    .uc-sidebar { position: static; }
    .uc-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .uc-affiliate { grid-template-columns: 1fr; }

    .footer-widgets { grid-template-columns: 1fr 1fr; }
}

/* 手机 */
@media (max-width: 768px) {
    body { font-size: 14px; }
    .header-inner { height: 56px; gap: 12px; }
    .logo-text { font-size: 18px; }
    .header-actions .niu2-btn { display: none; }
    .header-actions .user-link .user-name { display: none; }

    .niu2-slider { height: 240px; border-radius: var(--niu2-radius); }
    .slider-content { left: 20px; max-width: 280px; }
    .slider-title { font-size: 18px; }
    .slider-excerpt { display: none; }
    .slider-cat { font-size: 11px; }

    .home-search-banner { padding: 32px 20px; }
    .banner-title { font-size: 20px; }
    .banner-subtitle { font-size: 13px; }
    .banner-search { flex-direction: column; border-radius: var(--niu2-radius); padding: 12px; gap: 8px; }
    .banner-search-input { width: 100%; text-align: center; }
    .banner-search-btn { width: 100%; justify-content: center; }

    .posts-grid { grid-template-columns: 1fr; gap: 16px; }
    .cms-grid { grid-template-columns: 1fr; }
    .cms-card { flex-direction: row; }
    .cms-thumb { width: 100px; height: 70px; }

    .vip-intro-plans { flex-direction: column; }
    .vip-plan-card { padding: 16px; }

    .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .section-tabs { gap: 12px; }

    .single-article { padding: 20px 16px; }
    .article-title { font-size: 22px; }
    .article-meta { gap: 10px; font-size: 13px; }
    .article-content { font-size: 16px; }

    .article-nav { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

    .article-actions { flex-wrap: wrap; }
    .action-btn { flex: 1 1 calc(50% - 6px); }

    .niu2-filter-bar { padding: 10px 12px; gap: 8px; }
    .filter-link { padding: 3px 10px; font-size: 12px; }

    .uc-stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .uc-stat-card { padding: 16px 12px; }
    .uc-stat-card .stat-num { font-size: 20px; }
    .uc-content { padding: 20px 16px; }

    .uc-table { font-size: 12px; }
    .uc-table th, .uc-table td { padding: 8px 6px; }

    .features-grid { grid-template-columns: 1fr; }
    .niu2-stats-bar { grid-template-columns: 1fr; }

    .footer-widgets { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
    .footer-nav { justify-content: center; flex-wrap: wrap; }

    .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }

    .modal-content { padding: 24px 20px; }
    .pay-amount { font-size: 28px; }

    .submit-form { padding: 20px 16px; }
    .form-actions { flex-direction: column; align-items: stretch; }

    .error-code { font-size: 80px; }
    .error-actions { flex-direction: column; align-items: center; }

    .niu2-top-notice .container { padding: 0 32px; }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .posts-grid { grid-template-columns: 1fr; }
    .uc-stats-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .banner-tags { display: none; }
}

/* 横屏 */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-menu-panel { width: 320px; }
}

/* ========================================
   v5.4 手机版全面优化
   ======================================== */

/* 平板及以下：容器宽度100% */
@media (max-width: 992px) {
    :root { --niu2-container: 100% !important; }
    .container { max-width: 100% !important; padding: 0 12px !important; }
    
    /* 导航栏 */
    .niu2-header .header-inner { height: 56px !important; }
    .niu2-header .logo img { max-height: 36px !important; }
    .niu2-header .header-nav { display: none !important; }
    .niu2-header .header-search { display: none !important; }
    .niu2-header .mobile-menu-btn { display: flex !important; }
    .niu2-header .header-actions .niu2-btn { padding: 6px 12px !important; font-size: 12px !important; }
    
    /* 首页模块 */
    .niu2-slider { height: 200px !important; }
    .slider-content { left: 16px !important; max-width: 240px !important; }
    .slider-title { font-size: 16px !important; }
    .home-search-banner { padding: 24px 16px !important; }
    .banner-title { font-size: 18px !important; }
    .banner-search { flex-direction: column !important; padding: 12px !important; gap: 8px !important; }
    .banner-search-input, .banner-search-btn { width: 100% !important; }
    
    /* CMS分类模块 */
    .cms-grid { grid-template-columns: 1fr !important; }
    .cms-card { flex-direction: row !important; }
    .cms-thumb { width: 100px !important; height: 70px !important; }
    .cms-card.cms-featured { flex-direction: row !important; }
    .cms-featured .cms-thumb { width: 120px !important; height: 80px !important; }
    
    /* 最新文章 */
    .posts-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    .post-card .post-thumb { height: 120px !important; }
    .post-card .post-title { font-size: 13px !important; }
    .post-card .post-excerpt { display: none !important; }
    .post-card .post-meta { font-size: 11px !important; gap: 8px !important; }
    
    /* 分类页面 */
    .niu2-archive .posts-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    .niu2-archive .post-card .post-thumb { height: 120px !important; }
    .niu2-archive .archive-title { font-size: 22px !important; }
    .niu2-archive .archive-filter { padding: 10px 12px !important; }
    .niu2-archive .filter-tab { padding: 6px 12px !important; font-size: 12px !important; }
    
    /* 文章详情页 */
    .single-layout { grid-template-columns: 1fr !important; }
    .single-sidebar { order: -1 !important; margin-bottom: 20px !important; }
    .single-article { padding: 16px 12px !important; }
    .article-title { font-size: 21px !important; }
    .article-meta { font-size: 12px !important; gap: 8px !important; flex-wrap: wrap !important; }
    .article-content { font-size: 16px !important; line-height: 1.9 !important; }
    
    /* 资源信息卡片 - 手机端单列 */
    .resource-info-card-v2 { padding: 12px !important; }
    .resource-info-card-v2 .resource-info-top { flex-direction: column !important; gap: 12px !important; }
    .resource-info-card-v2 .resource-thumb-v2 { flex: none !important; width: 100% !important; height: 180px !important; }
    .resource-info-card-v2 .detail-grid { grid-template-columns: 1fr !important; gap: 6px !important; }
    .resource-info-card-v2 .download-buttons { flex-direction: column !important; }
    .resource-info-card-v2 .download-buttons .niu2-btn { width: 100% !important; }
    
    /* 会员提示模块 - 手机端 */
    .resource-vip-tip { flex-direction: column !important; gap: 8px !important; }
    .resource-vip-tip .vip-tip-item { padding: 10px !important; font-size: 13px !important; }
    
    /* 底部三栏 - 手机端单列 */
    .footer-three-col { flex-direction: column !important; gap: 20px !important; padding: 20px 0 !important; }
    .footer-three-col .footer-col { width: 100% !important; text-align: center !important; align-items: center !important; padding: 0 !important; }
    .footer-three-col .footer-left-col,
    .footer-three-col .footer-center-col,
    .footer-three-col .footer-right-col { text-align: center !important; align-items: center !important; padding: 0 !important; }
    .footer-three-col .footer-left-col .footer-logo,
    .footer-three-col .footer-left-col .footer-about-text { text-align: center !important; margin: 0 auto !important; }
    .footer-three-col .footer-right-col .footer-col-title,
    .footer-three-col .footer-right-col .footer-qrcodes,
    .footer-three-col .footer-right-col .footer-contact-info { text-align: center !important; justify-content: center !important; margin: 0 auto !important; }
    .footer-three-col .footer-qrcodes { justify-content: center !important; }
    
    /* 悬浮按钮 - 手机端 */
    .niu2-float-buttons { right: 10px !important; bottom: 20px !important; }
    .niu2-float-buttons .float-btn { width: 40px !important; height: 40px !important; font-size: 18px !important; }
    .niu2-float-buttons .float-btn-text { display: none !important; }
    
    /* 弹窗 - 手机端 */
    .modal-content { width: 92% !important; max-width: 400px !important; padding: 20px 16px !important; margin: 5vh auto !important; max-height: 90vh !important; overflow-y: auto !important; }
    .pay-modal .pay-qrcode { width: 180px !important; height: 180px !important; }
    .pay-amount { font-size: 24px !important; }
    
    /* 登录注册弹窗 */
    .auth-modal .auth-tabs { gap: 0 !important; }
    .auth-modal .auth-tab { padding: 10px !important; font-size: 14px !important; }
    .auth-modal .form-group { margin-bottom: 12px !important; }
    .auth-modal input { padding: 10px 12px !important; font-size: 14px !important; }
    .auth-modal .niu2-btn { padding: 10px !important; font-size: 14px !important; }
    
    /* 图像滑块验证 - 手机端 */
    .img-slide-captcha .img-slide-bg { height: 120px !important; }
    .img-slide-captcha .img-slide-track { height: 36px !important; }
    .img-slide-captcha .img-slide-handle { width: 36px !important; height: 36px !important; }
    .img-slide-captcha .img-slide-track-text { line-height: 36px !important; font-size: 12px !important; }
    
    /* 分享弹窗 - 手机端 */
    .share-popup { width: 90% !important; max-width: 360px !important; padding: 16px !important; }
    .share-platforms { gap: 12px !important; }
    .share-platform { flex: 1 1 calc(25% - 9px) !important; }
    .share-platform-icon { width: 44px !important; height: 44px !important; }
    .share-platform-name { font-size: 11px !important; }
    
    /* 用户中心 - 手机端 */
    .niu2-user-center { grid-template-columns: 1fr !important; }
    .uc-sidebar { position: static !important; margin-bottom: 20px !important; }
    .uc-stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .uc-stat-card { padding: 12px !important; }
    .uc-stat-card .stat-num { font-size: 18px !important; }
    .uc-content { padding: 16px 12px !important; }
    
    /* VIP页面 - 手机端 */
    .niu2-vip-pricing { grid-template-columns: 1fr !important; max-width: 360px !important; margin: 20px auto !important; }
    .pricing-card { padding: 20px !important; }
    .pricing-card.featured { transform: none !important; }
    
    /* 面包屑 - 手机端 */
    .niu2-breadcrumbs { font-size: 12px !important; padding: 8px 0 !important; flex-wrap: wrap !important; gap: 4px !important; }
    
    /* 分页 - 手机端 */
    .pagination-wrap { padding: 20px 0 !important; }
    .pagination-wrap .page-numbers { padding: 6px 10px !important; font-size: 12px !important; min-width: 32px !important; }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .container { padding: 0 10px !important; }
    
    /* 导航栏 */
    .niu2-header .header-inner { height: 50px !important; gap: 8px !important; }
    .niu2-header .logo img { max-height: 30px !important; }
    .niu2-header .header-actions .niu2-btn { padding: 5px 10px !important; font-size: 11px !important; }
    .niu2-header .header-actions .user-link .user-name { display: none !important; }
    
    /* 首页文章 - 小屏手机2列 */
    .posts-grid, .niu2-archive .posts-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .post-card .post-thumb, .niu2-archive .post-card .post-thumb { height: 100px !important; }
    .post-card .post-info, .niu2-archive .post-card .post-info { padding: 8px !important; }
    .post-card .post-title, .niu2-archive .post-card .post-title { font-size: 12px !important; line-height: 1.4 !important; }
    .post-card .post-price, .niu2-archive .post-card .post-price { font-size: 11px !important; padding: 2px 6px !important; top: 6px !important; right: 6px !important; }
    
    /* 幻灯片 - 小屏手机 */
    .niu2-slider { height: 160px !important; }
    .slider-content { left: 12px !important; max-width: 200px !important; }
    .slider-title { font-size: 14px !important; }
    .slider-cat { font-size: 10px !important; padding: 2px 6px !important; }
    
    /* 搜索Banner - 小屏手机 */
    .home-search-banner { padding: 20px 12px !important; }
    .banner-title { font-size: 16px !important; }
    .banner-subtitle { font-size: 12px !important; }
    
    /* 文章详情页 - 小屏手机 */
    .single-article { padding: 12px 10px !important; }
    .article-title { font-size: 18px !important; }
    .article-content { font-size: 15px !important; line-height: 1.8 !important; }
    
    /* 资源信息卡片 - 小屏手机 */
    .resource-info-card-v2 { padding: 12px !important; }
    .resource-info-card-v2 .resource-thumb-v2 { height: 160px !important; }
    .resource-info-card-v2 .detail-item { font-size: 13px !important; }
    
    /* 底部 - 小屏手机 */
    .footer-three-col { gap: 16px !important; padding: 16px 0 !important; }
    .footer-three-col .footer-about-text { font-size: 12px !important; }
    .footer-three-col .footer-qrcode-item img { width: 60px !important; height: 60px !important; }
    .footer-three-col .footer-copyright-text { font-size: 11px !important; }
    .footer-three-col .footer-icp { font-size: 10px !important; }
    
    /* 弹窗 - 小屏手机 */
    .modal-content { width: 95% !important; padding: 16px 12px !important; }
    .pay-modal .pay-qrcode { width: 160px !important; height: 160px !important; }
    
    /* 悬浮按钮 - 小屏手机 */
    .niu2-float-buttons .float-btn { width: 36px !important; height: 36px !important; font-size: 16px !important; }
}

/* 横屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content { max-height: 85vh !important; margin: 2vh auto !important; }
    .mobile-menu-panel { width: 280px !important; }
}
