/* ================================
   响应式设计 - 移动端优先
   ================================ */

/* 平板设备 (768px 及以下) */
@media (max-width: 768px) {
    /* 导航栏 */
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: flex-start;
        padding: 40px;
        gap: 0;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

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

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
        padding: 15px 0;
    }

    .nav-menu a {
        display: block;
        width: 100%;
        font-size: 18px;
    }

    /* 下拉菜单在移动端 */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--bg-light);
        margin-top: 10px;
        padding: 15px;
        border-radius: 8px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .dropdown.active .dropdown-menu {
        max-height: 500px;
    }

    .dropdown > a::after {
        content: ' ▼';
        font-size: 12px;
    }

    .dropdown.active > a::after {
        content: ' ▲';
    }

    /* 移动端菜单打开时的汉堡图标动画 */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* 英雄区域 */
    .hero {
        height: 80vh;
        min-height: 500px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    /* 区块 */
    section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 28px;
    }

    .section-subtitle {
        font-size: 16px;
    }

    /* 核心优势 */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* 服务领域 */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* 处理工艺流程 */
    .process-timeline {
        flex-direction: column;
        gap: 20px;
    }

    .process-step {
        width: 100%;
    }

    .process-arrow {
        transform: rotate(90deg);
        margin: 10px 0;
    }

    /* 核心技术 */
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* CTA */
    .cta h2 {
        font-size: 26px;
    }

    .cta p {
        font-size: 16px;
    }

    /* 页脚 */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer {
        padding: 40px 0 20px;
    }
}

/* 小型平板 (576px 及以下) */
@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }

    .logo h1 {
        font-size: 22px;
    }

    .logo .tagline {
        font-size: 11px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .section-title {
        font-size: 24px;
    }

    .feature-card {
        padding: 30px 20px;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
    }

    .feature-icon svg {
        width: 30px;
        height: 30px;
    }

    .service-image {
        height: 150px;
        font-size: 20px;
    }

    .step-number {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .btn-large {
        padding: 14px 32px;
        font-size: 16px;
    }
}

/* 大屏幕 (1200px 及以上) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }

    .hero-title {
        font-size: 56px;
    }

    .hero-subtitle {
        font-size: 22px;
    }

    .section-title {
        font-size: 42px;
    }

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

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 超大屏幕 (1600px 及以上) */
@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
}

/* ================================
   打印样式
   ================================ */
@media print {
    .navbar,
    .hero,
    .mobile-menu-toggle,
    .scroll-indicator,
    .cta,
    .footer {
        display: none;
    }

    section {
        page-break-inside: avoid;
        padding: 20px 0;
    }

    .feature-card,
    .service-item,
    .process-step,
    .tech-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* ================================
   横屏模式优化
   ================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 400px;
        padding: 100px 0 50px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .scroll-indicator {
        display: none;
    }
}

/* ================================
   暗色模式支持（可选）
   ================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #e0e0e0;
        --text-light: #b0b0b0;
        --bg-light: #1a1a1a;
        --bg-white: #2c2c2c;
        --border-color: #404040;
    }

    body {
        background: var(--bg-white);
        color: var(--text-dark);
    }

    .navbar {
        background: rgba(44, 44, 44, 0.95);
    }

    .feature-card,
    .service-item,
    .process-step {
        background: var(--bg-white);
    }

    .tech-card {
        background: var(--bg-light);
    }

    .footer {
        background: #1a1a1a;
    }
}

/* ================================
   触摸设备优化
   ================================ */
@media (hover: none) and (pointer: coarse) {
    .feature-card:hover,
    .service-item:hover,
    .process-step:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    /* 增大点击区域 */
    .nav-menu a,
    .btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ================================
   减少动画（用户偏好）
   ================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-indicator {
        animation: none;
    }
}

/* ================================
   可访问性增强
   ================================ */
@media (min-width: 769px) {
    .feature-card:focus-within,
    .service-item:focus-within,
    .tech-card:focus-within {
        outline: 3px solid var(--primary-color);
        outline-offset: 3px;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }

    .feature-card,
    .service-item,
    .process-step,
    .tech-card {
        border: 2px solid var(--border-color);
    }
}