/* ========================================
   H5移动端响应式样式优化
   ======================================== */

/* 通用响应式基线（不影响桌面端布局） */

/* 媒体元素与排版安全 */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* 表格在小屏横向滚动 */
.table-responsive, table {
    width: 100%;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 长链接/长英文自动换行，避免溢出 */
body, p, a, li, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* 移动端导航抽屉样式（只在小屏启用） */
@media (max-width: 900px) {
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
    }

    .hamburger {
        display: flex !important;
    }

    .nav-menu {
        position: fixed;
        top: 70px; /* 与 .nav-container 高度保持一致 */
        left: -100%;
        right: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(30, 58, 138, 0.98);
        backdrop-filter: blur(10px);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem 1rem 1.5rem;
        border-top: 1px solid rgba(0, 255, 255, 0.3);
        transition: left 0.25s ease;
        overflow-y: auto;
        z-index: 1000;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .nav-link {
        padding: 0.9rem 0.4rem;
        font-size: 0.95rem;
    }

    /* 主内容区留出导航栏空间 */
    body {
        padding-top: 70px;
    }
    
    /* Hero区域优化 - 协调顶部间距 */
    .hero {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
        min-height: 70vh !important;
    }

    /* 网格布局调整为单列 */
    .solutions-grid,
    .products-grid,
    .features-grid,
    .cases-grid,
    .benefits-grid,
    .team-grid,
    .partners-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* 容器内边距调整 - 统一协调 */
    .container {
        padding: 1.5rem 1rem;
    }

    /* Section间距统一优化 */
    .section {
        padding: 2.5rem 0;
    }
    
    section + section,
    .section + .section {
        margin-top: 0;
    }

    /* 按钮调整 */
    .btn, .cta-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }

    /* 卡片调整 */
    .card, .solution-card, .product-card, .case-card {
        margin-bottom: 1.5rem;
    }

    /* Footer调整 - 协调底部间距 */
    .footer {
        padding: 2rem 0 1rem !important;
        margin-top: 2rem !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-section {
        margin-bottom: 1.5rem;
    }
    
    /* 联系信息紧凑显示 */
    .footer-contact {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-contact p {
        margin-bottom: 0.3rem;
        font-size: 0.95rem;
        line-height: 1.4;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        text-align: left;
    }
    
    .footer-bottom {
        margin-top: 1.5rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 255, 255, 0.2);
    }
}

/* 平板设备优化 (481px - 768px) */
@media (max-width: 768px) {
    /* 标题尺寸调整 - 协调视觉层次 */
    h1 {
        font-size: 2rem;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.5rem;
        line-height: 1.4;
    }

    /* 网格布局 2列 */
    .solutions-grid,
    .products-grid,
    .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* 平板Hero区域调整 */
    .hero {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
        min-height: 65vh !important;
    }
    
    /* 容器内边距微调 */
    .container {
        padding: 1.2rem 1rem;
    }
    
    /* Section间距 */
    .section {
        padding: 2rem 0;
    }
}

/* 超小屏优化 (≤ 480px) - 手机竖屏 */
@media (max-width: 480px) {
    /* Hero区域 - 协调顶部视觉 */
    .hero {
        padding: 1.5rem 1rem 2rem !important;
        min-height: 60vh !important;
    }

    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.3;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        gap: 0.8rem;
        flex-direction: column;
    }

    /* 标题统一优化 */
    .section-title {
        font-size: 1.8rem !important;
        line-height: 1.3;
        margin-bottom: 1.5rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }

    /* 所有网格改为单列 */
    .solutions-grid,
    .products-grid,
    .features-grid,
    .cases-grid,
    .benefits-grid,
    .team-grid,
    .partners-grid {
        grid-template-columns: 1fr !important;
        gap: 1.2rem;
    }

    /* 容器内边距 - 协调中部间距 */
    .container {
        padding: 1rem 0.75rem;
    }
    
    /* Section间距优化 - 保持协调 */
    .section {
        padding: 1.8rem 0;
    }
    
    section + section,
    .section + .section {
        margin-top: 0;
    }

    /* 按钮全宽优化 */
    .cta-buttons,
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
    }

    .btn, .cta-btn {
        width: 100%;
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
    }
    
    /* Footer优化 - 协调底部视觉 */
    .footer {
        padding: 1.5rem 0 0.8rem !important;
        margin-top: 1.5rem !important;
    }
    
    .footer-section {
        margin-bottom: 1.2rem;
    }
    
    /* 超小屏联系信息更紧凑 */
    .footer-contact p {
        margin-bottom: 0.25rem;
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .footer-bottom {
        margin-top: 1rem;
        padding-top: 0.8rem;
        font-size: 0.85rem;
    }
    
    .footer-bottom p {
        margin: 0.3rem 0;
    }
}

/* ========================================
   移动端视觉协调优化
   ======================================== */

/* 确保页面整体协调 - 适用所有移动端 */
@media (max-width: 900px) {
    /* 移除body的额外margin/padding */
    body {
        margin: 0;
        padding-top: 70px;
    }
    
    html {
        overflow-x: hidden;
    }
    
    /* 统一section背景过渡 */
    section {
        position: relative;
    }
    
    /* 卡片/内容块统一间距 */
    .card,
    .product-card,
    .solution-card,
    .case-card,
    .feature-card,
    .blog-card {
        margin-bottom: 1.5rem;
    }
    
    /* 图片容器优化 */
    .product-image,
    .case-image,
    .blog-image,
    .feature-icon {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    /* 文本块统一行高 */
    p {
        line-height: 1.7;
        margin-bottom: 1rem;
    }
    
    /* 列表优化 */
    ul, ol {
        padding-left: 1.5rem;
        margin-bottom: 1rem;
    }
    
    li {
        margin-bottom: 0.5rem;
        line-height: 1.6;
    }
    
    /* 表单元素优化 */
    input,
    textarea,
    select {
        width: 100%;
        padding: 0.8rem;
        font-size: 1rem;
        border-radius: 4px;
        margin-bottom: 1rem;
    }
    
    /* CTA区域优化 */
    .cta-section,
    .call-to-action {
        padding: 2rem 1rem;
        text-align: center;
    }
}

/* 手机横屏优化 */
@media (max-width: 900px) and (orientation: landscape) {
    .hero {
        min-height: 50vh !important;
        padding: 1.5rem 1rem !important;
    }
    
    .section {
        padding: 1.5rem 0;
    }
}

/* 确保所有页面底部无额外空白 */
@media (max-width: 900px) {
    body {
        padding-bottom: 0;
    }
    
    .footer {
        margin-bottom: 0;
    }
    
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
}
