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

/* 大屏幕 (≥1200px) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .hero-title {
        font-size: 48px;
    }
    
    .section-header h2 {
        font-size: 36px;
    }
}

/* 中等屏幕 (768px - 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .hero .container {
        gap: var(--spacing-lg);
    }
    
    .advantages-grid,
    .services-grid,
    .news-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* 平板设备 (768px - 991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
        padding: 0 var(--spacing-md);
    }
    
    /* 导航栏响应式 */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--bg-primary);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: var(--spacing-md);
        padding: var(--spacing-xl) 0;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-medium);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu a {
        font-size: var(--font-size-lg);
        padding: var(--spacing-sm) var(--spacing-lg);
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero区域 */
    .hero {
        padding: 100px 0 var(--spacing-2xl);
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
        margin-bottom: var(--spacing-lg);
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    /* 服务卡片 */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* 新闻区域 */
    .news-section .section-header {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    /* 页脚 */
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--spacing-lg);
    }
}

/* 小屏幕设备 (576px - 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 var(--spacing-sm);
    }
    
    /* 导航栏 */
    .navbar .container {
        padding: var(--spacing-sm);
    }
    
    .brand-text {
        font-size: var(--font-size-lg);
    }
    
    /* Hero区域 */
    .hero {
        padding: 90px 0 var(--spacing-xl);
    }
    
    .hero-title {
        font-size: 28px;
        margin-bottom: var(--spacing-sm);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-base);
        margin-bottom: var(--spacing-lg);
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* 章节标题 */
    .section-header h2 {
        font-size: 24px;
    }
    
    .section-header p {
        font-size: var(--font-size-base);
    }
    
    /* 核心优势 */
    .advantages {
        padding: var(--spacing-2xl) 0;
    }
    
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .advantage-card {
        padding: var(--spacing-lg);
    }
    
    .card-icon {
        width: 60px;
        height: 60px;
        margin-bottom: var(--spacing-sm);
    }
    
    .card-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .advantage-card h3 {
        font-size: var(--font-size-lg);
    }
    
    /* 服务概览 */
    .services-overview {
        padding: var(--spacing-2xl) 0;
    }
    
    .service-content {
        padding: var(--spacing-md);
    }
    
    .service-content h3 {
        font-size: var(--font-size-lg);
    }
    
    /* 新闻动态 */
    .news-section {
        padding: var(--spacing-2xl) 0;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .news-content {
        padding: var(--spacing-md);
    }
    
    .news-content h3 {
        font-size: var(--font-size-base);
    }
    
    /* 联系CTA */
    .contact-cta {
        padding: var(--spacing-2xl) 0;
    }
    
    .cta-content h2 {
        font-size: 24px;
    }
    
    .cta-content p {
        font-size: var(--font-size-base);
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    /* 页脚 */
    .footer {
        padding: var(--spacing-xl) 0 var(--spacing-sm);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .footer-section h4 {
        margin-bottom: var(--spacing-sm);
    }
}

/* 超小屏幕设备 (≤575px) */
@media (max-width: 575px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* 导航栏 */
    .brand-text {
        display: none;
    }
    
    /* Hero区域 */
    .hero {
        padding: 80px 0 var(--spacing-xl);
    }
    
    .hero-title {
        font-size: 24px;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-sm);
    }
    
    /* 按钮 */
    .btn {
        padding: 10px 20px;
        font-size: var(--font-size-sm);
    }
    
    /* 章节标题 */
    .section-header {
        margin-bottom: var(--spacing-lg);
    }
    
    .section-header h2 {
        font-size: 22px;
    }
    
    .section-header p {
        font-size: var(--font-size-sm);
    }
    
    /* 卡片间距调整 */
    .advantage-card,
    .service-card,
    .news-card {
        margin-bottom: var(--spacing-sm);
    }
    
    .advantage-card {
        padding: var(--spacing-md);
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
    }
    
    .card-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .advantage-card h3 {
        font-size: var(--font-size-base);
        margin-bottom: var(--spacing-xs);
    }
    
    .advantage-card p {
        font-size: var(--font-size-sm);
    }
    
    /* 服务卡片 */
    .service-image {
        height: 160px;
    }
    
    .service-content {
        padding: var(--spacing-sm);
    }
    
    .service-content h3 {
        font-size: var(--font-size-base);
    }
    
    .service-content p {
        font-size: var(--font-size-sm);
    }
    
    /* 新闻卡片 */
    .news-image {
        height: 140px;
    }
    
    .news-content {
        padding: var(--spacing-sm);
    }
    
    .news-content h3 {
        font-size: var(--font-size-sm);
    }
    
    .news-content p {
        font-size: var(--font-size-xs);
    }
    
    /* 联系CTA */
    .cta-content h2 {
        font-size: 20px;
    }
    
    .cta-content p {
        font-size: var(--font-size-sm);
    }
    
    /* 页脚 */
    .footer-section h4 {
        font-size: var(--font-size-base);
    }
    
    .footer-brand h3 {
        font-size: var(--font-size-lg);
    }
    
    .contact-info p {
        font-size: var(--font-size-sm);
    }
    
    .footer-bottom {
        font-size: var(--font-size-xs);
        line-height: 1.5;
    }
}

/* ==========================================================================
   触摸设备优化
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
    /* 移除hover效果，使用active状态 */
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn:active {
        transform: translateY(-2px);
        box-shadow: var(--shadow-medium);
    }
    
    .advantage-card:hover,
    .service-card:hover,
    .news-card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
    }
    
    .advantage-card:active,
    .service-card:active,
    .news-card:active {
        transform: translateY(-4px);
        box-shadow: var(--shadow-medium);
    }
    
    /* 增加触摸目标大小 */
    .nav-menu a {
        padding: 12px 20px;
        min-height: 44px;
    }
    
    .btn {
        min-height: 44px;
        padding: 12px 24px;
    }
    
    .service-link,
    .view-all {
        padding: 8px 0;
        min-height: 32px;
    }
}

/* ==========================================================================
   打印样式
   ========================================================================== */

@media print {
    .navbar,
    .nav-toggle,
    .hero-buttons,
    .cta-buttons,
    .service-link,
    .view-all {
        display: none !important;
    }
    
    .hero {
        padding: var(--spacing-md) 0;
    }
    
    .section-header h2::after {
        display: none;
    }
    
    .advantage-card,
    .service-card,
    .news-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
    
    .footer {
        background-color: transparent;
        color: var(--text-primary);
    }
    
    .contact-cta {
        background: transparent;
        color: var(--text-primary);
    }
    
    a {
        color: var(--text-primary) !important;
        text-decoration: underline;
    }
}

/* ==========================================================================
   高对比度模式支持
   ========================================================================== */

@media (prefers-contrast: high) {
    :root {
        --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.3);
        --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.4);
        --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.5);
    }
    
    .advantage-card,
    .service-card,
    .news-card {
        border: 2px solid var(--border-color);
    }
    
    .btn-outline {
        border-width: 3px;
    }
}

/* ==========================================================================
   减少动画运动（可访问性）
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-content,
    .hero-image,
    .advantage-card,
    .service-card,
    .news-card {
        animation: none;
    }
}
