/* ===========================
   响应式布局样式文件
   =========================== */

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
        --font-size-3xl: 3rem;
        --font-size-2xl: 2rem;
        --font-size-xl: 1.75rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    /* 导航栏 */
    .nav-links {
        gap: var(--spacing-sm);
    }

    .nav-links a {
        font-size: var(--font-size-xs);
    }

    /* Hero Section */
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: var(--font-size-md);
    }

    .hero-icon {
        width: 120px;
        height: 120px;
    }

    /* Grid 调整 */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Features Tab Content */
    .tab-content.active {
        grid-template-columns: 1fr;
    }

    .features-preview {
        order: -1;
    }

    /* Timeline */
    .timeline-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .timeline-icon {
        margin-bottom: var(--spacing-sm);
    }

    /* Tech Metrics */
    .tech-metrics {
        grid-template-columns: 1fr;
    }
}

/* 手机设备 (最大 767px) */
@media (max-width: 767px) {
    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 2rem;
        --spacing-xl: 3rem;
        --font-size-3xl: 2rem;
        --font-size-2xl: 1.5rem;
        --font-size-xl: 1.25rem;
        --font-size-lg: 1.125rem;
    }

    /* 导航栏 */
    .nav-container {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .nav-logo span {
        font-size: var(--font-size-md);
    }

    .nav-logo img {
        width: 32px;
        height: 32px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: var(--spacing-sm);
        box-shadow: var(--shadow-lg);
        gap: 0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: var(--spacing-sm);
        border-bottom: 1px solid var(--bg-gray);
    }

    .nav-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--text-dark);
    }

    /* Section */
    section {
        padding: var(--spacing-lg) 0;
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    .section-subtitle {
        font-size: var(--font-size-sm);
    }

    /* Hero Section */
    #hero {
        min-height: 100vh;
        padding: var(--spacing-lg) 0;
    }

    .hero-content {
        padding: var(--spacing-sm);
    }

    .hero-icon {
        width: 100px;
        height: 100px;
        margin-bottom: var(--spacing-sm);
    }

    .hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: var(--font-size-sm);
    }

    .hero-description {
        font-size: var(--font-size-sm);
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .stat-number {
        font-size: var(--font-size-xl);
    }

    /* Grid 调整为单列 */
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    /* Value Props */
    .value-grid {
        gap: var(--spacing-sm);
    }

    .value-icon {
        font-size: 2.5rem;
    }

    /* Timeline */
    .timeline-item {
        flex-direction: column;
        margin-bottom: var(--spacing-md);
    }

    .timeline-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .timeline-title {
        font-size: var(--font-size-lg);
    }

    .timeline-features {
        grid-template-columns: 1fr;
    }

    /* Features */
    .features-tabs {
        flex-direction: column;
        width: 100%;
    }

    .tab-button {
        width: 100%;
        text-align: center;
    }

    .tab-content.active {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .features-list {
        order: 1;
    }

    .features-preview {
        order: 0;
        margin-bottom: var(--spacing-md);
    }

    /* Screenshots Carousel */
    .carousel-button {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-md);
    }

    /* Platforms */
    .platforms-grid {
        gap: var(--spacing-sm);
    }

    .platform-icon {
        font-size: 3rem;
    }

    .platform-name {
        font-size: var(--font-size-lg);
    }

    /* Tech Stack */
    .tech-grid {
        gap: var(--spacing-sm);
    }

    .tech-icon {
        font-size: 2.5rem;
    }

    .tech-metrics {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .metric-number {
        font-size: var(--font-size-2xl);
    }

    /* Use Cases */
    .cases-grid {
        gap: var(--spacing-sm);
    }

    .case-icon {
        font-size: 2.5rem;
    }

    /* Roadmap */
    .progress-bars {
        padding: 0 var(--spacing-sm);
    }

    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .roadmap-versions {
        gap: var(--spacing-sm);
    }

    .version-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    /* Footer */
    .footer-info {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .footer-disclaimer {
        padding: var(--spacing-sm);
    }

    .disclaimer-title {
        font-size: var(--font-size-md);
    }

    /* 卡片 */
    .card {
        padding: var(--spacing-sm);
    }

    .card-icon {
        font-size: 2.5rem;
    }

    /* 按钮 */
    .btn {
        padding: 0.75rem var(--spacing-sm);
        font-size: var(--font-size-sm);
    }
}

/* 小屏手机 (最大 480px) */
@media (max-width: 480px) {
    :root {
        --spacing-sm: 0.75rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.375rem;
        --font-size-xl: 1.125rem;
        --font-size-lg: 1rem;
    }

    /* Hero */
    .hero-icon {
        width: 80px;
        height: 80px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: var(--font-size-xs);
    }

    .hero-description {
        font-size: var(--font-size-xs);
        line-height: 1.6;
    }

    /* Section */
    .section-title {
        font-size: var(--font-size-xl);
    }

    .section-subtitle {
        font-size: var(--font-size-xs);
    }

    /* Timeline */
    .timeline-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .timeline-title {
        font-size: var(--font-size-md);
    }

    .timeline-description,
    .timeline-features li {
        font-size: var(--font-size-xs);
    }

    /* Cards */
    .value-icon,
    .platform-icon,
    .tech-icon,
    .case-icon {
        font-size: 2rem;
    }

    .value-title,
    .platform-name,
    .tech-title,
    .case-title {
        font-size: var(--font-size-md);
    }

    /* Carousel */
    .carousel-container {
        border-radius: var(--radius-md);
    }

    .carousel-slide img {
        border-radius: var(--radius-md);
    }

    /* Progress */
    .progress-bar {
        height: 8px;
    }

    .metric-number {
        font-size: var(--font-size-xl);
    }

    /* Version Cards */
    .version-number {
        font-size: var(--font-size-lg);
    }
}

/* 横屏模式优化 */
@media (max-height: 600px) and (orientation: landscape) {
    #hero {
        min-height: auto;
        padding: var(--spacing-md) 0;
    }

    .hero-icon {
        width: 60px;
        height: 60px;
        margin-bottom: var(--spacing-xs);
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: var(--font-size-sm);
    }

    .hero-description {
        font-size: var(--font-size-xs);
        margin-bottom: var(--spacing-sm);
    }

    .hero-stats {
        margin-top: var(--spacing-sm);
    }

    section {
        padding: var(--spacing-md) 0;
    }
}

/* 大屏幕优化 (>1440px) */
@media (min-width: 1441px) {
    .container {
        max-width: 1400px;
    }

    .container-wide {
        max-width: 1600px;
    }

    .hero-title {
        font-size: 4rem;
    }

    .section-title {
        font-size: 4rem;
    }
}

/* 打印样式 */
@media print {
    #navbar,
    .hero-buttons,
    .carousel-controls,
    .carousel-dots,
    .btn {
        display: none !important;
    }

    section {
        page-break-inside: avoid;
        padding: var(--spacing-sm) 0;
    }

    body {
        background: white;
        color: black;
    }

    .card,
    .platform-card,
    .tech-card,
    .case-card,
    .version-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    }

    .btn-primary,
    .tab-button.active {
        border: 2px solid var(--text-dark);
    }

    .card,
    .platform-card,
    .tech-card,
    .case-card,
    .version-card {
        border: 1px solid var(--text-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;
    }

    .hero-icon {
        animation: none;
    }
}

/* 暗色模式支持（可选） */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f5f5f7;
        --text-light: #a1a1a6;
        --bg-light: #000000;
        --bg-gray: #1c1c1e;
    }

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

    #navbar {
        background: rgba(0, 0, 0, 0.8);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    #navbar.scrolled {
        background: rgba(0, 0, 0, 0.95);
    }

    .card,
    .value-card,
    .platform-card,
    .tech-card,
    .case-card,
    .version-card,
    .timeline-content,
    .features-preview,
    .metric-card {
        background: var(--bg-gray);
        color: var(--text-dark);
    }

    .btn-secondary {
        background: var(--bg-gray);
        color: var(--primary-color);
        border-color: var(--primary-color);
    }

    .case-result {
        background: rgba(255, 255, 255, 0.05);
    }

    .tab-button {
        background: var(--bg-gray);
    }

    .carousel-button {
        background: var(--bg-gray);
        color: var(--text-dark);
    }

    .dot {
        background: rgba(255, 255, 255, 0.3);
    }

    .progress-bar {
        background: rgba(255, 255, 255, 0.1);
    }
}
