/* 响应式设计优化 CSS */

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

/* 大屏幕设备 */
@media (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .intro-grid {
        gap: 3rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 中等屏幕设备 */
@media (max-width: 991.98px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .community-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

/* 平板设备 */
@media (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
    
    .nav {
        padding: 0.5rem 0;
    }
    
    .nav-logo {
        font-size: 1.5rem;
    }
    
    .main-content {
        margin-top: 70px;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .community-section,
    .features-section {
        padding: 3rem 0;
    }
    
    .community-grid,
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .community-card,
    .feature-card {
        padding: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    /* 移动端按钮样式优化 */
    .cta-button,
    .join-button {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
}

/* 小屏幕设备 */
@media (max-width: 575.98px) {
    .container {
        padding: 0 10px;
    }
    
    .header {
        padding: 0.5rem 0;
    }
    
    .nav {
        padding: 0;
    }
    
    .main-content {
        margin-top: 60px;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    
    .community-section,
    .features-section {
        padding: 2.5rem 0;
    }
    
    .community-card,
    .feature-card {
        padding: 1.2rem;
    }
    
    .community-icon,
    .feature-icon {
        font-size: 2rem;
    }
    
    .community-title,
    .feature-title {
        font-size: 1.1rem;
    }
    
    .community-description,
    .feature-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .cta-button,
    .join-button {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-width: auto;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    .footer-bottom {
        font-size: 0.8rem;
    }
}

/* 极小屏幕设备 */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-description {
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .community-card,
    .feature-card {
        padding: 1rem;
    }
    
    .cta-button,
    .join-button {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-title,
    .section-title {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 打印样式 */
@media print {
    .header,
    .footer,
    .back-to-top,
    .mobile-menu-toggle,
    .mobile-menu {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .hero-section {
        background: none !important;
        color: #333 !important;
    }
    
    .codex-intro {
        background: none !important;
        color: #333 !important;
    }
    
    .community-section,
    .features-section {
        break-inside: avoid;
    }
    
    .community-card,
    .feature-card {
        border: 1px solid #ddd;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a202c;
        --text-color: #e2e8f0;
        --card-bg: #2d3748;
        --border-color: #4a5568;
    }
    
    .community-card,
    .feature-card {
        background: var(--card-bg);
        color: var(--text-color);
    }
    
    .community-description,
    .feature-description {
        color: #cbd5e0;
    }
}

/* 减少动画的无障碍设置 */
@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;
    }
}

/* 焦点可见性改善 */
@media (prefers-reduced-motion: no-preference) {
    .cta-button:focus,
    .join-button:focus,
    .nav-menu a:focus {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        padding: 1.5rem 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .hero-description {
        display: none;
    }
}

/* 触屏设备优化 */
@media (hover: none) and (pointer: coarse) {
    .cta-button,
    .join-button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-menu a {
        padding: 0.5rem 1rem;
    }
    
    .back-to-top {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }
    
    /* 移除hover效果，改为点击效果 */
    .community-card:active,
    .feature-card:active {
        transform: scale(0.98);
    }
    
    .cta-button:active,
    .join-button:active {
        transform: scale(0.95);
    }
}