/* ========================================
   移动端完美适配 - 修复所有问题
   ======================================== */

/* 基础设置 */
* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* 防止内容溢出 */
.container {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

/* 平板适配 (768px - 992px) */
@media (max-width: 992px) {
    /* 导航栏隐藏，显示汉堡菜单 */
    .nav {
        display: none !important;
    }
    
    .mobile-menu-btn {
        display: block !important;
    }
    
    /* Hero 区域调整 */
    .hero {
        height: 80vh;
    }
    
    .hero-title {
        font-size: 32px !important;
        padding: 0 15px;
    }
    
    .hero-desc {
        font-size: 16px;
        padding: 0 15px;
    }
    
    /* 统计卡片 - 2 列 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 36px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    /* 新闻卡片 - 2 列 */
    .news-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
    
    /* Footer - 2 列 */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 30px;
    }
}

/* 手机适配 (≤768px) */
@media (max-width: 768px) {
    /* Header 调整 */
    .header-inner {
        padding: 0 15px;
        height: 60px;
    }
    
    .logo-title {
        font-size: 14px;
    }
    
    .logo-subtitle {
        font-size: 10px;
    }
    
    /* Hero 区域 */
    .hero {
        height: 60vh;
    }
    
    .hero-title {
        font-size: 24px !important;
    }
    
    .hero-desc {
        font-size: 14px;
    }
    
    .hero-btn {
        padding: 12px 25px;
        font-size: 14px;
    }
    
    /* Section 调整 */
    .section {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 24px;
        padding: 0 15px;
    }
    
    .section-desc {
        font-size: 14px;
        padding: 0 15px;
    }
    
    /* 统计卡片 - 1 列 */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .stat-card {
        padding: 25px 20px;
    }
    
    .stat-number {
        font-size: 42px;
    }
    
    /* 新闻卡片 - 1 列 */
    .news-grid {
        grid-template-columns: 1fr !important;
    }
    
    .news-image {
        height: 180px;
    }
    
    .news-content {
        padding: 20px;
    }
    
    /* Footer - 1 列 */
    .footer-grid {
        grid-template-columns: 1fr !important;
    }
    
    .footer {
        padding: 50px 0 20px;
    }
    
    /* Page Banner */
    .page-banner {
        height: 250px;
        margin-top: 60px;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .page-subtitle {
        font-size: 14px;
    }
}

/* 小屏手机 (≤480px) */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .hero-title {
        font-size: 20px !important;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .stat-number {
        font-size: 36px;
    }
    
    .news-image {
        height: 150px;
    }
}

/* 汉堡菜单样式 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: -3px 0 15px rgba(0,0,0,0.15);
    z-index: 1000;
    flex-direction: column;
    padding: 70px 25px 30px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.mobile-nav.show {
    display: flex;
    transform: translateX(0);
}

.mobile-nav a {
    padding: 16px 0;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 17px;
    font-weight: 500;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    transition: all 0.2s;
}

.mobile-nav a:active {
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary);
}

/* 遮罩层 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

/* 触摸优化 - 禁用悬停效果 */
@media (hover: none) and (pointer: coarse) {
    .magnetic-btn:hover {
        transform: none;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
    
    .news-card:hover {
        transform: none;
    }
}

/* 安全区域适配（iPhone 刘海屏） */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .header-inner {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}
