/* 响应式样式 */

/* 大屏幕设备 (大于等于1200px) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* 中等屏幕设备 (大于等于992px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .hero-slider {
        height: 500px;
    }
    
    .slide-content h1 {
        font-size: 2.2em;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* 平板设备 (大于等于768px) */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    .hero-slider {
        height: 450px;
    }
    
    .slide {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .slide-content {
        padding-right: 0;
        margin-bottom: 30px;
    }
    
    .slide-content h1 {
        font-size: 2em;
    }
    
    .slide-image img {
        max-height: 250px;
    }
    
    .intro-content {
        flex-direction: column;
    }
    
    .intro-text {
        padding-right: 0;
        margin-bottom: 30px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
    
    .cases-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-logo {
        flex: 100%;
        margin-bottom: 40px;
    }
    
    .footer-links {
        flex: 100%;
    }
    
    .footer-column {
        flex: 50%;
    }
}

/* 手机设备 (小于768px) */
@media (max-width: 767px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .header .container {
        height: 70px;
    }
    
    .logo img {
        height: 40px;
    }
    
    .main-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: #ffffff;
        flex-direction: column;
        padding: 20px;
        transition: left var(--transition-speed);
        z-index: 999;
    }
    
    .main-nav.active {
        left: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        width: 100%;
    }
    
    .main-nav li {
        margin: 10px 0;
        width: 100%;
    }
    
    .main-nav a {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .language-selector {
        margin-right: 50px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* 手机端轮播图优化 - 切换按钮在文字下方 */
    .hero-slider {
        height: auto;
        min-height: 350px; /* 增加高度为按钮留空间 */
        margin-top: 60px;
        margin-bottom: 20px;
        overflow: hidden;
        background-color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        position: relative;
    }

    .slider-container {
        position: relative;
        width: 100%;
        height: 100%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .slide {
        flex-direction: column;
        text-align: center;
        padding: 0;
        height: auto;
        min-height: 350px;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        justify-content: flex-start; /* 改为从顶部开始排列 */
        align-items: center;
        overflow: hidden;
        display: flex;
        background-color: transparent;
        padding-top: 40px; /* 顶部留空间 */
    }

    /* 隐藏手机端的轮播图片 */
    .slide-image {
        display: none !important;
    }

    .slide-content {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        margin: 0;
        background-color: transparent;
        border-radius: 0;
        z-index: 2;
        position: relative;
        box-shadow: none;
        order: 1;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    .slide-content h1 {
        font-size: 1.6em;
        margin-bottom: 15px;
        color: var(--secondary-color);
        line-height: 1.3;
        font-weight: 700;
        text-align: center;
        width: 100%;
    }

    .slide-content p {
        font-size: 1em;
        margin-bottom: 25px;
        color: var(--dark-gray);
        line-height: 1.5;
        text-align: center;
        width: 100%;
    }

    .slide-content .btn {
        padding: 14px 45px;
        font-size: 1.1em;
        margin-top: 10px;
        margin-bottom: 30px; /* 增加底部间距 */
        border-radius: 25px;
        font-weight: 600;
        box-shadow: 0 3px 12px rgba(0, 123, 255, 0.25);
        transition: all 0.3s ease;
        display: block;
        text-align: center;
        width: auto;
        min-width: 160px;
        margin-left: auto;
        margin-right: auto;
    }

    .slide-content .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.35);
    }

    /* 切换按钮放在最下方 */
    .slider-controls {
        position: absolute !important;
        bottom: 10px !important; /* 改为bottom定位 */
        top: auto !important; /* 移除top定位 */
        left: 50% !important;
        transform: translateX(-50%) !important; /* 只需要水平居中 */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 10 !important;
        background-color: transparent !important;
    }

    .prev-slide,
    .next-slide {
        width: 35px;
        height: 35px;
        margin: 0 10px;
        background: rgba(0, 123, 255, 0.8);
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 16px;
        transition: all 0.3s ease;
        border: none;
        cursor: pointer;
    }

    .prev-slide:hover,
    .next-slide:hover {
        background: var(--primary-color);
        transform: scale(1.1);
        box-shadow: 0 3px 12px rgba(0, 123, 255, 0.3);
    }

    .dots-container {
        display: flex;
        align-items: center;
        margin: 0 15px;
    }

    .dot {
        width: 10px;
        height: 10px;
        margin: 0 4px;
        background: rgba(0, 123, 255, 0.4);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .dot.active {
        background: var(--primary-color);
        transform: scale(1.2);
    }

    .dot:hover {
        background: var(--primary-color);
        transform: scale(1.1);
    }

    /* 超小屏幕优化 */
    @media (max-width: 360px) {
        .hero-slider {
            min-height: 320px;
            padding: 0;
        }
        
        .slide {
            min-height: 320px;
            padding-top: 30px;
        }
        
        .slide-content {
            padding: 15px;
        }
        
        .slide-content h1 {
            font-size: 1.4em;
            margin-bottom: 12px;
        }
        
        .slide-content p {
            font-size: 0.9em;
            margin-bottom: 20px;
        }
        
        .slide-content .btn {
            padding: 12px 35px;
            font-size: 1em;
            min-width: 140px;
            margin-bottom: 25px;
        }
        
        .slider-controls {
            bottom: 20px;
        }
        
        .prev-slide,
        .next-slide {
            width: 32px;
            height: 32px;
            margin: 0 8px;
            font-size: 14px;
        }
        
        .dot {
            width: 8px;
            height: 8px;
            margin: 0 3px;
        }
    }
}

/* 超小屏幕进一步优化 */
@media (max-width: 479px) {
    .hero-slider {
        min-height: 260px;
        margin-top: 50px;
    }
    
    .slide {
        min-height: 260px;
    }
    
    .slide-content {
        padding: 25px 15px 15px 15px;
    }
    
    .slide-content h1 {
        font-size: 1.4em;
        margin-bottom: 12px;
    }
    
    .slide-content p {
        font-size: 0.95em;
        margin-bottom: 20px;
    }
    
    .slide-content .btn {
        padding: 10px 35px;
        font-size: 0.95em;
        min-width: 120px;
        margin-bottom: 15px;
    }
    
    .slider-controls {
        bottom: 15px;
        padding: 6px 12px;
    }
    
    .prev-slide,
    .next-slide {
        width: 26px;
        height: 26px;
        margin: 0 6px;
        font-size: 12px;
    }
}

/* 小屏幕手机 (小于480px) */
@media (max-width: 479px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .header .container {
        height: 70px;
    }
    
    .logo img {
        height: 40px;
    }
    
    .main-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: #ffffff;
        flex-direction: column;
        padding: 20px;
        transition: left var(--transition-speed);
        z-index: 999;
    }
    
    .main-nav.active {
        left: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        width: 100%;
    }
    
    .main-nav li {
        margin: 10px 0;
        width: 100%;
    }
    
    .main-nav a {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .language-selector {
        margin-right: 50px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .stat-item {
        padding: 10px;
        margin: 5px 0;
    }
    
    .stat-number {
        font-size: 1.8em;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    .section-header h2 {
        font-size: 1.8em;
    }
    
    .section-header p {
        font-size: 0.9em;
    }
}

/* 关于部分优化 */
@media (max-width: 767px) {
    .company-intro {
        padding: 10px 0 40px 0 !important; /* 减少上边距，保持下边距 */
    }
}

@media (max-width: 479px) {
    .company-intro {
        padding: 15px 0 30px 0 !important; /* 小屏幕下进一步减少上边距 */
    }
}

.intro-content {
    flex-direction: column;
}

.intro-text {
    padding-right: 0;
    margin-bottom: 30px;
}

.intro-text p {
    font-size: 0.95em;
    line-height: 1.6;
    text-align: justify;
}

.intro-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.btn {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 10px;
    padding: 8px 20px;
    font-size: 0.9em;
}


/* 手机端统计数据2+1布局优化 - 减少边距充分利用屏幕宽度 */
@media (max-width: 767px) {
    .map-stats {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        margin-top: 20px;
        padding: 0 15px !important; /* 减少左右内边距 */
        margin-left: 0;
        margin-right: 0;
        justify-content: space-between !important; /* 改为两端对齐 */
        max-width: 100% !important; /* 移除宽度限制，充分利用屏幕宽度 */
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* 前两个统计项优化宽度 */
    .stat-item:nth-child(1),
    .stat-item:nth-child(2) {
        flex: 1 1 calc(50% - 4px) !important; /* 使用flex-grow让元素充分利用空间 */
        width: calc(50% - 4px) !important;
        max-width: none !important; /* 移除最大宽度限制 */
        min-width: 120px !important;
        padding: 15px 8px !important;
        background-color: #f8f8f8;
        border-radius: 6px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        transition: transform 0.3s ease;
        margin: 0 !important;
        text-align: center;
        box-sizing: border-box !important;
    }
    
    /* 第三个元素（产品型号）独占一行 */
    .stat-item:nth-child(3) {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: none !important; /* 移除最大宽度限制 */
        margin: 8px 0 0 0 !important; /* 移除左右自动边距 */
        padding: 15px 12px !important;
        background-color: #f8f8f8;
        border-radius: 6px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        transition: transform 0.3s ease;
        text-align: center;
        box-sizing: border-box !important;
    }
    
    .stat-number {
        font-size: 1.6em !important;
        margin-bottom: 5px !important;
        line-height: 1.2 !important;
    }
    
    .stat-label {
        font-size: 0.8em !important;
        line-height: 1.2 !important;
    }
}

/* 更小屏幕进一步优化 */
@media (max-width: 479px) {
    .map-stats {
        padding: 0 10px !important; /* 进一步减少边距 */
        gap: 6px !important;
    }
    
    .stat-item:nth-child(1),
    .stat-item:nth-child(2) {
        min-width: 100px !important;
        padding: 12px 6px !important;
    }
    
    .stat-item:nth-child(3) {
        padding: 12px 8px !important;
    }
}

/* 订单实况优化 */
.refresh-notice {
    font-size: 0.75em;
    padding: 0 15px 8px;
}

.ticker-item {
    padding: 10px 8px;
    padding-right: 10px;
    gap: 5px;
}

.ticker-item-flag {
    width: 25px;
    height: 16px;
    margin-right: 3px;
}

.ticker-item-details {
    max-width: 55%;
}

.ticker-item-country {
    font-size: 0.9em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
}

.ticker-item-product {
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.ticker-item-time-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.ticker-item-bulk,
.bulk-type,
.ticker-item-b2b {
    font-size: 0.7em;
    padding: 1px 4px;
}

.ticker-item-carrier {
    font-size: 0.75em;
    padding: 1px 3px;
}

.ticker-item-time {
    font-size: 0.75em;
    color: #888;
}

.ticker-item-status {
    font-size: 0.75em;
    padding: 2px 6px;
}

.ticker-item-right-info {
    gap: 5px;
    display: flex;
    align-items: center;
}

/* 手机端社交媒体按钮2x2布局 - 保持原有大小和间距 */
@media (max-width: 767px) {
    .social-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 15px;
        justify-items: end;
    }
    
    .social-links a {
        margin: 0;
    }
}

@media (max-width: 768px) {
    /* 手机端轮播图 - 完全重新设计布局 */
    .hero-slider {
        margin-top: 60px;
        margin-bottom: 20px;
        background-color: #ffffff;
        position: relative;
        display: flex;
        flex-direction: column;
    }

    /* 文字内容区域 - 独立于轮播图 */
    .slide-content {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 30px 20px !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto 20px auto !important;
        background-color: #ffffff;
        order: 1 !important; /* 确保文字在最上方 */
    }

    /* 隐藏非活动轮播项的文字内容 */
    .slide:not(.active) .slide-content {
        display: none !important;
    }

    /* 活动轮播项的文字内容显示 */
    .slide.active .slide-content {
        display: flex !important;
    }

    .slide-content h1 {
        font-size: 1.6em;
        margin-bottom: 15px;
        color: var(--secondary-color);
        line-height: 1.3;
        font-weight: 700;
    }

    .slide-content p {
        font-size: 1em;
        margin-bottom: 25px;
        color: var(--dark-gray);
        line-height: 1.5;
    }

    .slide-content .btn {
        padding: 14px 45px;
        font-size: 1.1em;
        margin: 10px auto 20px auto;
        border-radius: 25px;
        font-weight: 600;
        box-shadow: 0 3px 12px rgba(0, 123, 255, 0.25);
        transition: all 0.3s ease;
        display: block;
        min-width: 160px;
    }

    /* 轮播图控制区域 - 独立的切换按钮区域 */
    .slider-container {
        position: relative;
        width: 100%;
        height: 350px; /* 增加高度 */
        padding-top: 40px; /* 添加顶部内边距 */
        background-color: #ffffff;
        border-radius: 10px;
        margin-top: 0;
        order: 2 !important;
    }

    .slider-controls {
        position: absolute !important;
        bottom: 20px !important; /* 调整底部距离 */
        top: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 10 !important;
        background-color: transparent !important;
    }

    .prev-slide,
    .next-slide {
        width: 35px;
        height: 35px;
        margin: 0 10px;
        background: rgba(0, 123, 255, 0.8);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 16px;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .prev-slide:hover,
    .next-slide:hover {
        background: rgba(0, 123, 255, 1);
        transform: scale(1.1);
    }

    .slider-dots {
        display: flex;
        margin: 0 15px;
    }

    .dot {
        width: 10px;
        height: 10px;
        margin: 0 4px;
        background: rgba(0, 123, 255, 0.4);
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .dot.active {
        background: rgba(0, 123, 255, 1);
    }


}

/* 手机端相关产品限制显示2个 */
@media (max-width: 767px) {
    .related-products-slider {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 隐藏第3个及之后的产品 */
    .related-product-item:nth-child(n+3) {
        display: none;
    }
}

/* 移动设备上的表单蒙版优化 */
@media (max-width: 767px) {
    /* 添加在文件末尾 */
    .form-overlay-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 999;
    }
    
    .form-overlay-backdrop.show {
        display: block;
    }
    
    /* 修改表单蒙版样式 */
    .form-overlay {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 85%;
        height: auto;
        max-width: 320px;
        background-color: rgba(0, 86, 179, 0.95);
        border-radius: 12px;
        z-index: 1000;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        opacity: 1;
        visibility: visible;
        display: none;
    }
    
    .form-overlay.show {
        display: flex;
    }
    
    .form-overlay-content {
        padding: 30px 20px;
        max-width: 100%;
        text-align: center;
    }
    
    .form-overlay h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
        color: white;
    }
    
    .form-overlay p {
        margin-bottom: 20px;
        font-size: 1rem;
        line-height: 1.5;
    }
    
    /* 添加关闭按钮 */
    .form-overlay-close {
        position: absolute;
        top: 10px;
        right: 15px;
        width: 30px;
        height: 30px;
        color: white;
        font-size: 24px;
        line-height: 30px;
        text-align: center;
        cursor: pointer;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.2);
    }
    
    .form-overlay-close:hover {
        background-color: rgba(255, 255, 255, 0.3);
    }
    
    /* 社交按钮样式优化 */
    .form-overlay .social-buttons {
        display: flex;
        justify-content: center;
        gap: 15px;
        margin-top: 10px;
    }
    
    .form-overlay .social-buttons .btn {
        min-width: 120px;
    }
    
    /* 表单弹出框中的社交按钮垂直布局 */
    .form-overlay .social-buttons .btn-facebook,
    .form-overlay .social-buttons .btn-whatsapp {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 15px 20px;
        min-width: 100px;
        text-align: center;
    }
    
    .form-overlay .social-buttons .btn-facebook i,
    .form-overlay .social-buttons .btn-whatsapp i {
        font-size: 1.2rem;
        margin: 0;
    }
}

@media (max-width: 767px) {
    /* 联系页面移动端优化 - 修复右侧白边问题 */
    .contact-section {
        padding: 40px 0;
        overflow-x: hidden; /* 防止水平溢出 */
    }
    
    .contact-container {
        flex-direction: column;
        gap: 20px;
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .contact-info,
    .contact-form {
        flex: none;
        min-width: auto;
        width: 100%;
        margin: 0;
        padding: 20px 15px;
        box-sizing: border-box;
    }
    
    /* 确保表单元素不超出容器 */
    .form-group {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        box-sizing: border-box;
        padding: 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
    
    /* WhatsApp按钮优化 */
    .whatsapp-button {
        margin-top: 20px;
        width: 100%;
    }
    
    .whatsapp-button .btn {
        width: 100%;
        text-align: center;
        padding: 12px;
        box-sizing: border-box;
    }
    
    /* 防止整体页面溢出 */
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 15px;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .stat-item {
        padding: 10px;
        margin: 5px 0;
    }
    
    .stat-number {
        font-size: 1.8em;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    .section-header h2 {
        font-size: 1.8em;
    }
    
    .section-header p {
        font-size: 0.9em;
    }
}
