/* ==========================================
   爆发富论坛 - 响应式样式表
   断点: 320px, 768px, 1200px
   ========================================== */

/* 大屏桌面 (1200px+) */
@media screen and (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .recommend-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .recommend-card.featured {
        grid-column: span 2;
        grid-row: span 2;
    }
}

/* 平板与中小桌面 (768px - 1199px) */
@media screen and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        gap: 40px;
    }
    
    .recommend-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recommend-card.featured {
        grid-column: span 2;
        grid-row: span 1;
    }
    
    .chart-grid {
        grid-template-columns: 1fr;
    }
    
    .expert-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .testimonial-slider {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sync-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 平板 (768px - 991px) */
@media screen and (max-width: 991px) {
    .main-nav .container {
        flex-wrap: wrap;
    }
    
    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border-color);
    }
    
    .search-box {
        order: 2;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .expert-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sync-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 移动端 (小于768px) */
@media screen and (max-width: 767px) {
    .header-top .container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .main-nav .container {
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: flex;
        order: 3;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 16px 20px;
        margin-top: 0;
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        z-index: 1001;
        gap: 4px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu a {
        padding: 12px 16px;
        border-radius: var(--radius-sm);
    }
    
    .search-box {
        display: none;
    }
    
    .hero-section {
        padding: 48px 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-desc {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 24px;
    }
    
    .recommend-grid {
        grid-template-columns: 1fr;
    }
    
    .recommend-card.featured {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .section-title {
        font-size: 1.375rem;
        flex-wrap: wrap;
    }
    
    .update-time {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }
    
    .expert-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonial-slider {
        grid-template-columns: 1fr;
    }
    
    .sync-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .topic-item {
        flex-direction: column;
    }
    
    .topic-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .topic-meta {
        gap: 12px;
    }
    
    .chart-card canvas {
        max-height: 250px;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
}

/* 小屏手机 (小于480px) */
@media screen and (max-width: 479px) {
    .container {
        padding: 0 16px;
    }
    
    .hero-title {
        font-size: 1.25rem;
    }
    
    .hero-desc {
        font-size: 0.9375rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .card-content h3 {
        font-size: 1rem;
    }
    
    .card-meta {
        gap: 12px;
        font-size: 0.75rem;
    }
    
    .expert-card {
        padding: 24px 16px;
    }
    
    .expert-avatar {
        width: 80px;
        height: 80px;
    }
    
    .testimonial-item {
        padding: 24px 16px;
    }
    
    .sync-item {
        padding: 24px 16px;
    }
    
    .sync-item i {
        font-size: 2rem;
    }
    
    .btn-primary {
        padding: 10px 24px;
        font-size: 0.9375rem;
    }
}

/* 超小屏 (320px) */
@media screen and (max-width: 320px) {
    html {
        font-size: 14px;
    }
    
    .hero-title {
        font-size: 1.125rem;
    }
    
    .logo-text {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 1.125rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* 横屏模式优化 */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 32px 0;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 24px;
    }
}

/* 打印样式 */
@media print {
    .main-header,
    .back-to-top,
    .mobile-menu-toggle {
        display: none !important;
    }
    
    body {
        background: #fff;
    }
    
    .container {
        max-width: 100%;
    }
    
    .recommend-card,
    .chart-card,
    .expert-card,
    .testimonial-item,
    .sync-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 减少动画偏好 */
@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-color-scheme: dark) {
    :root {
        --text-primary: #e8eaed;
        --text-secondary: #9aa0a6;
        --text-muted: #80868b;
        --bg-primary: #202124;
        --bg-secondary: #303134;
        --bg-dark: #171717;
        --border-color: #5f6368;
    }
    
    .recommend-card,
    .chart-card,
    .expert-card,
    .testimonial-item,
    .sync-item,
    .source-content,
    .topic-item {
        background: var(--bg-secondary);
    }
    
    .search-box {
        background: var(--bg-dark);
        border-color: var(--border-color);
    }
}
