/* ================================================
   移动端增强样式 - Mobile Enhanced Styles
   ================================================ */

/* 基础移动端优化 */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: none;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* 移动端导航菜单改进 */
@media (max-width: 768px) {
    .nav-list {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(10, 25, 49, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        z-index: 999;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .nav-list.active {
        max-height: 400px;
        display: flex !important;
    }
    
    .nav-list li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-list li:last-child {
        border-bottom: none;
    }
    
    .nav-list a {
        display: block;
        padding: 1rem;
        color: white !important;
        font-size: 1.1rem;
    }
    
    .mobile-menu-toggle {
        display: block !important;
        font-size: 1.5rem;
        padding: 0.5rem;
        z-index: 1001;
        transition: transform 0.3s ease;
    }
    
    .mobile-menu-toggle.active {
        transform: rotate(90deg);
    }
    
    .mobile-menu-toggle i::before {
        transition: content 0.3s ease;
    }
    
    .mobile-menu-toggle.active i::before {
        content: "\f00d"; /* Font Awesome X icon */
    }
}

/* 图片响应式优化 */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    .product-image,
    .news-image,
    .blog-image {
        height: auto;
        min-height: 200px;
    }
    
    .hero-product-image img,
    .about-image img {
        width: 100%;
        height: auto;
    }
}

/* 表格横向滚动 */
@media (max-width: 768px) {
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* 为新闻详情和产品规格添加滚动容器 */
    .specs-table,
    .news-detail-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* 按钮和表单移动端优化 */
@media (max-width: 768px) {
    .btn {
        padding: 14px 28px;
        font-size: 1rem;
        min-height: 48px; /* iOS推荐最小点击区域 */
        width: 100%;
        text-align: center;
    }
    
    .hero-btns {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }
    
    .hero-btns .btn {
        width: 100%;
    }
    
    .form-control {
        font-size: 16px; /* 防止iOS自动放大 */
        padding: 14px 15px;
        min-height: 48px;
    }
    
    select,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        font-size: 16px;
        -webkit-appearance: none;
        border-radius: 4px;
    }
}

/* WhatsApp浮动按钮移动端优化 */
@media (max-width: 768px) {
    .whatsapp-float {
        right: 15px;
        bottom: 15px;
        top: auto;
        transform: none;
        width: 56px;
        height: 56px;
        font-size: 28px;
    }
    
    .whatsapp-float:hover {
        transform: scale(1.1);
    }
}

/* 桌面端和移动端图片切换 */
.hero-video-mobile {
    display: none;
}

.hero-video-desktop {
    display: block;
}

/* Hero区域移动端优化 */
@media (max-width: 768px) {
    /* 切换为移动端图片 */
    .hero-video-desktop {
        display: none !important;
    }
    
    .hero-video-mobile {
        display: block !important;
    }
    
    .home-hero,
    .page-hero {
        height: 75vh;
        min-height: 600px;
    }
    
    /* 移动端视频背景优化 - 确保船只完整显示 */
    .hero-video {
        object-fit: contain !important;
        object-position: center 40% !important;
        background: #0a1931;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* 增强Hero内容区域以适应新布局 */
    .home-hero-content {
        padding-top: 100px !important;
        justify-content: flex-start !important;
    }
    
    .home-hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .home-hero-content p {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    .page-hero-content h1 {
        font-size: 2rem;
    }
    
    .page-hero-content p {
        font-size: 1rem;
    }
}

/* 卡片布局移动端优化 */
@media (max-width: 768px) {
    .product-cards,
    .project-grid,
    .blog-grid,
    .news-grid,
    .advantages-grid,
    .service-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-card,
    .blog-card,
    .news-card,
    .advantage-card {
        margin-bottom: 0;
    }
}

/* 文字大小移动端优化 */
@media (max-width: 768px) {
    body {
        font-size: 15px;
        line-height: 1.6;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .section-title p {
        font-size: 1rem;
    }
}

/* Footer移动端优化 */
@media (max-width: 768px) {
    .compact-footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-column {
        text-align: center;
    }
    
    .footer-column h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .social-links {
        justify-content: center;
    }
}

/* 容器和内边距优化 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
    
    .contact-form,
    .product-detail-section {
        padding: 1.5rem;
    }
}

/* 弹窗和模态框移动端优化 */
@media (max-width: 768px) {
    .modal,
    .popup {
        width: 95%;
        max-width: 95%;
        margin: 2.5%;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
}

/* 小手机端额外优化 (iPhone SE等) */
@media (max-width: 576px) {
    .home-hero {
        height: 80vh;
        min-height: 650px;
    }
    
    .hero-video {
        object-fit: contain !important;
        object-position: center 35% !important;
    }
    
    .home-hero-content {
        padding-top: 120px !important;
    }
    
    .home-hero-content h1 {
        font-size: 1.5rem;
    }
    
    .home-hero-content p {
        font-size: 0.9rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 12px 20px;
    }
    
    .language-selector {
        display: none;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .section-padding {
        padding: 2.5rem 0;
    }
}

/* 横屏模式优化 */
@media (max-width: 992px) and (orientation: landscape) {
    .home-hero,
    .page-hero {
        height: 100vh;
    }
    
    .nav-list.active {
        max-height: 300px;
        overflow-y: auto;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    /* 移除hover效果，只保留active状态 */
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
}

/* 防止内容溢出 */
@media (max-width: 768px) {
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    pre,
    code {
        overflow-x: auto;
        white-space: pre-wrap;
    }
}

/* 改进的点击区域 */
@media (max-width: 768px) {
    a,
    button,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-list a {
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 禁用双击放大 (需要配合touch-action) */
button,
a {
    touch-action: manipulation;
}

/* 滚动性能优化 */
.nav-list,
.modal,
.popup {
    -webkit-overflow-scrolling: touch;
}

/* 加载动画移动端优化 */
@media (max-width: 768px) {
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
}
