/* ==================== 響應式設計 ==================== */

/* 大螢幕 (1920px+) - 預設樣式已優化 */

/* 筆記型電腦 (1024px - 1920px) */
@media (max-width: 1920px) {
    .hero-title {
        font-size: clamp(2.5rem, 8vw, 6rem);
    }
    
    .model-title {
        font-size: clamp(2rem, 6vw, 4rem);
    }
}

/* 平板橫向 (768px - 1024px) */
@media (max-width: 1024px) {
    /* 導航欄 */
    .navbar {
        padding: 1rem 2rem;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    /* Hero Section */
    .hero-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* 模型區塊 */
    .model-features {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    /* 間距調整 */
    .section {
        padding: 3rem 1.5rem;
    }
}

/* 平板直向 (600px - 768px) */
@media (max-width: 768px) {
    /* 導航欄 */
    .navbar {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-logo {
        font-size: 1.3rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
    }
    
    /* Hero Section */
    .hero-title {
        font-size: clamp(2rem, 10vw, 4rem);
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* 滾動指示器 */
    .scroll-indicator {
        bottom: 2rem;
    }
    
    /* 模型區塊 */
    .model-content {
        padding: 1rem;
    }
    
    .model-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }
    
    .model-description {
        font-size: 1rem;
    }
    
    .model-features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    .feature-card h3 {
        font-size: 1.1rem;
    }
    
    .feature-card p {
        font-size: 0.9rem;
    }
    
    /* Footer */
    .footer-logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    /* 返回頂部按鈕 */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .back-to-top span {
        line-height: 45px;
    }
}

/* 手機橫向 (480px - 600px) */
@media (max-width: 600px) {
    .hero-badge {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
        letter-spacing: 2px;
    }
    
    .model-badge {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
        letter-spacing: 1.5px;
    }
}

/* 手機直向 (< 480px) */
@media (max-width: 480px) {
    /* 導航欄 */
    .navbar {
        padding: 0.8rem 1rem;
    }
    
    .nav-logo {
        font-size: 1.1rem;
    }
    
    .nav-links {
        gap: 0.8rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
    }
    
    /* Hero Section */
    .hero-content {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 12vw, 3rem);
        letter-spacing: -1px;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }
    
    .hero-stats {
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* 滾動指示器 */
    .scroll-indicator {
        bottom: 1.5rem;
    }
    
    .scroll-indicator p {
        font-size: 0.75rem;
    }
    
    .mouse {
        width: 24px;
        height: 40px;
    }
    
    /* 模型區塊 */
    .section {
        padding: 2rem 1rem;
        min-height: auto;
    }
    
    .model-content {
        padding: 0.5rem;
    }
    
    .model-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.8rem;
        margin-bottom: 1rem;
    }
    
    .model-title {
        font-size: clamp(1.5rem, 10vw, 2.5rem);
        margin-bottom: 1rem;
    }
    
    .model-description {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }
    
    .model-features {
        margin-top: 2rem;
    }
    
    .feature-card {
        padding: 1.2rem;
    }
    
    .feature-icon {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .feature-card h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .feature-card p {
        font-size: 0.85rem;
    }
    
    /* Footer */
    .footer-content h2 {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }
    
    .footer-content > p {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .footer-copyright {
        font-size: 0.8rem;
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    /* 返回頂部按鈕 */
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.2rem;
    }
    
    .back-to-top span {
        line-height: 40px;
    }
}

/* 超小螢幕 (< 360px) */
@media (max-width: 360px) {
    .hero-title {
        font-size: clamp(1.5rem, 12vw, 2.5rem);
    }
    
    .model-title {
        font-size: clamp(1.3rem, 10vw, 2rem);
    }
    
    .nav-links {
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.7rem;
    }
}

/* ==================== 觸控優化 ==================== */

@media (hover: none) and (pointer: coarse) {
    /* 增加觸控目標大小 */
    .nav-link {
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .feature-card {
        min-height: 200px;
    }
    
    .back-to-top {
        min-width: 48px;
        min-height: 48px;
    }
    
    /* 移除懸停效果 */
    .feature-card:hover {
        transform: none;
    }
    
    /* 添加點擊效果 */
    .feature-card:active {
        transform: scale(0.98);
    }
    
    .back-to-top:active {
        transform: scale(0.95);
    }
}

/* ==================== 橫向模式優化 ==================== */

@media (max-height: 600px) and (orientation: landscape) {
    .section {
        min-height: auto;
        padding: 2rem 1rem;
    }
    
    .hero-content {
        padding: 1rem 0;
    }
    
    .hero-stats {
        margin-top: 2rem;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .model-features {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* ==================== 高解析度螢幕優化 ==================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* 確保在高解析度螢幕上文字清晰 */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ==================== 深色模式支援 ==================== */

@media (prefers-color-scheme: dark) {
    /* 已經是深色主題，無需額外調整 */
}

/* ==================== 減少動畫偏好 ==================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==================== 列印樣式 ==================== */

@media print {
    .navbar,
    .scroll-progress,
    .scroll-indicator,
    .back-to-top,
    #particles-canvas {
        display: none !important;
    }
    
    .section {
        page-break-inside: avoid;
        min-height: auto;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .feature-card {
        border: 1px solid #000;
        break-inside: avoid;
    }
}
