/* 移动端专用样式 */
@media screen and (max-width: 768px) {
    /* 确保移动端视口设置 */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        overflow-x: hidden;
    }
    
    /* 移动端触摸优化 */
    .nav-item {
        -webkit-tap-highlight-color: rgba(0, 188, 212, 0.3);
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        min-height: 80px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    /* 移动端手势支持 */
    .nav-item:active {
        background: rgba(0, 188, 212, 0.3);
        transform: scale(0.95);
    }
    
    /* 移动端字体优化 */
    .hero-title {
        font-size: clamp(2.5rem, 8vw, 4rem);
    }
    
    .hero-subtitle h2 {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }
    
    .hero-subtitle h3 {
        font-size: clamp(1rem, 4vw, 1.4rem);
    }
    
    .hero-description {
        font-size: clamp(0.8rem, 3vw, 0.9rem);
    }
    
    /* 移动端间距优化 */
    .hero-section {
        padding: clamp(40px, 10vh, 60px) 15px clamp(30px, 8vh, 40px);
    }
    
    .main-content {
        padding: clamp(30px, 8vh, 40px) 15px;
    }
    
    /* 移动端网格优化 */
    .nav-grid {
        gap: clamp(12px, 4vw, 20px);
        max-width: min(400px, 90vw);
    }
    
    /* 移动端滚动优化 */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 移动端性能优化 */
    .nav-item {
        will-change: transform;
        transform: translateZ(0);
    }
    
    .hero-section::before {
        will-change: opacity;
    }
}

/* 超小屏幕优化 */
@media screen and (max-width: 320px) {
    .nav-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        max-width: 280px;
    }
    
    .nav-item {
        padding: 15px 8px;
        min-height: 70px;
    }
    
    .nav-icon {
        width: 30px;
        height: 30px;
        margin-bottom: 8px;
    }
    
    .nav-text {
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    .hero-section {
        padding: 30px 10px 25px;
    }
    
    .main-content {
        padding: 25px 10px;
    }
}

/* 横屏模式优化 */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 20px 15px 15px;
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }
    
    .hero-subtitle h2 {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
    
    .hero-subtitle h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .hero-description {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .nav-grid {
        gap: 15px;
    }
    
    .nav-item {
        padding: 15px 10px;
        min-height: 60px;
    }
}

/* 高分辨率屏幕优化 */
@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 192dpi) {
    .nav-icon svg {
        shape-rendering: geometricPrecision;
    }
    
    .hero-title {
        text-rendering: optimizeLegibility;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .nav-item {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-item:hover {
        background: rgba(0, 188, 212, 0.15);
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .hero-content,
    .nav-item {
        animation: none;
    }
    
    .nav-item {
        transition: none;
    }
    
    .nav-item:hover {
        transform: none;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: none;
    }
    
    .nav-item:active {
        transform: scale(0.95);
        background: rgba(0, 188, 212, 0.3);
    }
}