/* 响应式设计优化 */

/* 移动端优先的媒体查询 */
@media (max-width: 640px) {
    /* 导航栏优化 */
    .nav-item {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }
    
    /* 英雄区域优化 */
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* 按钮优化 */
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .hero-buttons a {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* 统计卡片优化 */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
    
    /* 服务特色区域优化 */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .service-icon {
        width: 4rem;
        height: 4rem;
        margin-bottom: 1rem;
    }
    
    /* 容器内边距优化 */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 文字大小优化 */
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
}

/* 平板设备优化 */
@media (min-width: 641px) and (max-width: 1024px) {
    /* 英雄区域 */
    .hero-title {
        font-size: 3.5rem;
    }
    
    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* 服务特色 */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .service-card {
        padding: 2rem;
    }
    
    /* 导航栏 */
    .nav-item {
        font-size: 0.95rem;
    }
}

/* 大屏幕优化 */
@media (min-width: 1025px) {
    /* 服务特色 */
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* 容器最大宽度 */
    .container {
        max-width: 1200px;
    }
}

/* 超大屏幕优化 */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大可点击区域 */
    .nav-item {
        padding: 1rem 0.5rem;
        min-height: 44px;
    }
    
    .hero-buttons a {
        min-height: 48px;
        padding: 1rem 2rem;
    }
    
    /* 禁用悬停效果 */
    .hover-lift:hover {
        transform: none;
    }
    
    .hover-scale:hover {
        transform: none;
    }
    
    /* 简化动画 */
    .service-card:hover .service-icon {
        transform: none;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .text-gradient {
        background: none;
        color: #1d4ed8;
    }
    
    .bg-white\/80 {
        background-color: white;
    }
    
    .shadow-soft,
    .shadow-medium,
    .shadow-large {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-float,
    .animate-float-delayed,
    .animate-fade-in-up {
        animation: none;
    }
    
    .hover-lift,
    .hover-scale {
        transition: none;
    }
}

/* 打印样式优化 */
@media print {
    .fixed,
    .animate-slide-down,
    .bg-gradient-to-br {
        position: static;
        background: white;
        animation: none;
    }
    
    .shadow-soft,
    .shadow-medium,
    .shadow-large,
    .shadow-glow {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .text-gradient {
        background: none;
        color: #1f2937;
    }
    
    .bg-primary-600 {
        background-color: #2563eb !important;
        color: white !important;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .min-h-screen {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
    
    .stats-card {
        padding: 0.75rem;
    }
}

/* 可访问性增强 */
@media (prefers-color-scheme: dark) {
    /* 为支持暗色模式的设备提供基础样式 */
    .bg-white {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .text-gray-900 {
        color: #f9fafb;
    }
    
    .text-gray-600 {
        color: #d1d5db;
    }
    
    .bg-gray-50 {
        background-color: #111827;
    }
}

/* 焦点可见性增强 */
.nav-item:focus,
.hero-buttons a:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* 文本选择优化 */
::selection {
    background-color: #3b82f6;
    color: white;
}

::-moz-selection {
    background-color: #3b82f6;
    color: white;
}