/* ===================================
   足球赛事分析平台 - 响应式设计
   =================================== */

/* ====================
   大屏幕 (1200px+)
   ==================== */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* ====================
   中等屏幕 (992px - 1199px)
   ==================== */
@media (max-width: 1199px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-title .sub-title {
        font-size: 1.75rem;
    }
    
    .hero-stats {
        gap: var(--spacing-xl);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-card.featured {
        grid-row: span 1;
    }
    
    .prediction-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .expert-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .expert-card.featured {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ====================
   小屏幕 (768px - 991px)
   ==================== */
@media (max-width: 991px) {
    html {
        font-size: 15px;
    }
    
    .container {
        max-width: 960px;
    }
    
    .hero-section {
        padding: var(--spacing-2xl) 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-title .sub-title {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: var(--spacing-lg);
    }
    
    .stat-item {
        flex: 0 0 calc(50% - var(--spacing-lg));
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .prediction-grid {
        grid-template-columns: 1fr;
    }
    
    .expert-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .cta-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .cta-features {
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }
}

/* ====================
   平板屏幕 (576px - 767px)
   ==================== */
@media (max-width: 767px) {
    html {
        font-size: 14px;
    }
    
    .container {
        max-width: 720px;
    }
    
    /* 头部响应式 */
    .header-top-content {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .header-info {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--color-white);
        flex-direction: column;
        padding: var(--spacing-2xl);
        gap: var(--spacing-md);
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-base);
        z-index: 999;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 1.125rem;
    }
    
    /* Hero 区域 */
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-title .sub-title {
        font-size: 1.25rem;
    }
    
    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .stat-item {
        flex: 0 0 calc(50% - var(--spacing-lg));
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .hero-scroll-indicator {
        display: none;
    }
    
    /* Section */
    .section {
        padding: var(--spacing-2xl) 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-actions {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }
    
    .filter-group {
        flex-wrap: wrap;
    }
    
    .filter-select {
        flex: 1;
        min-width: 140px;
    }
    
    /* 赛事卡片 */
    .match-teams {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .team {
        width: 100%;
    }
    
    .team-home {
        justify-content: space-between;
    }
    
    .team-away {
        justify-content: space-between;
    }
    
    .match-score {
        padding: var(--spacing-lg) 0;
    }
    
    .score-value {
        font-size: 2rem;
    }
    
    .match-footer {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }
    
    .match-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* 预测卡片 */
    .prediction-tabs {
        flex-wrap: wrap;
    }
    
    .prediction-tab {
        flex: 1;
        min-width: 120px;
    }
    
    /* 图表 */
    .chart-container {
        height: 250px;
    }
    
    /* 专家卡片 */
    .expert-card.featured .expert-stats {
        flex-wrap: wrap;
    }
    
    /* CTA 区域 */
    .cta-title {
        font-size: 1.75rem;
    }
    
    .cta-description {
        font-size: 1rem;
    }
    
    .cta-actions {
        flex-direction: column;
    }
    
    .cta-features {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    /* 页脚 */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    /* 模态框 */
    .auth-modal {
        padding: var(--spacing-xl);
    }
    
    .social-login {
        flex-direction: column;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    /* 回到顶部按钮 */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .back-to-top .icon {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* ====================
   手机屏幕 (< 576px)
   ==================== */
@media (max-width: 575px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-title .sub-title {
        font-size: 1.125rem;
    }
    
    .hero-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .section-title {
        font-size: 1.25rem;
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .title-icon {
        font-size: 1.5rem;
    }
    
    .matches-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        white-space: nowrap;
    }
    
    .match-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
    }
    
    .prediction-header .match-info {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }
    
    .prediction-header .vs {
        margin: var(--spacing-xs) 0;
    }
    
    .charts-grid {
        gap: var(--spacing-lg);
    }
    
    .chart-container {
        height: 200px;
    }
    
    .expert-stats {
        flex-wrap: wrap;
        gap: var(--spacing-lg);
    }
    
    .expert-stat {
        flex: 0 0 calc(33.333% - var(--spacing-lg));
    }
    
    .features-grid .feature-card:nth-last-child(-n+2) {
        grid-column: span 1;
    }
    
    .cta-title {
        font-size: 1.5rem;
    }
    
    .cta-description {
        font-size: 0.9375rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form .btn {
        width: 100%;
    }
}

/* ====================
   超小屏幕 (< 375px)
   ==================== */
@media (max-width: 374px) {
    html {
        font-size: 13px;
    }
    
    .hero-title {
        font-size: 1.25rem;
    }
    
    .hero-title .sub-title {
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.125rem;
    }
    
    .prediction-score {
        font-size: 2rem;
    }
    
    .expert-stat {
        flex: 0 0 100%;
    }
}

/* ====================
   横屏模式
   ==================== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        display: flex;
        align-items: center;
    }
    
    .hero-content {
        margin: 0 auto;
    }
    
    .hero-stats {
        display: none;
    }
    
    .hero-scroll-indicator {
        display: none;
    }
    
    .modal {
        max-height: 95vh;
        overflow-y: auto;
    }
}

/* ====================
   打印样式
   ==================== */
@media print {
    .main-header,
    .hero-section,
    .back-to-top,
    .page-loader,
    .modal-overlay,
    .cta-section,
    .main-footer {
        display: none !important;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* ====================
   高对比度模式
   ==================== */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #0000ff;
        --color-secondary: #008000;
        --color-accent: #ff0000;
    }
    
    .btn {
        border-width: 3px;
    }
    
    .form-input {
        border-width: 3px;
    }
}

/* ====================
   减少动画
   ==================== */
@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 {
        --color-white: #111827;
        --color-gray-50: #1f2937;
        --color-gray-100: #374151;
        --color-gray-200: #4b5563;
        --color-gray-300: #6b7280;
        --color-gray-400: #9ca3af;
        --color-gray-500: #d1d5db;
        --color-gray-600: #e5e7eb;
        --color-gray-700: #f3f4f6;
        --color-gray-800: #f9fafb;
        --color-gray-900: #ffffff;
    }
    
    .main-header {
        background-color: var(--color-gray-900);
    }
    
    .header-top {
        background-color: var(--color-gray-800);
        border-bottom-color: var(--color-gray-700);
    }
    
    .matches-container,
    .prediction-card,
    .chart-card,
    .expert-card,
    .feature-card,
    .analysis-card {
        background-color: var(--color-gray-800);
    }
    
    .modal {
        background-color: var(--color-gray-800);
    }
}

/* ====================
   触摸设备优化
   ==================== */
@media (hover: none) and (pointer: coarse) {
    /* 增大触摸目标 */
    .btn,
    .nav-link,
    .tab-btn,
    .prediction-tab,
    .social-link {
        min-height: 44px;
    }
    
    /* 移除悬停效果 */
    .match-card:hover,
    .analysis-card:hover,
    .prediction-card:hover,
    .expert-card:hover,
    .feature-card:hover,
    .chart-card:hover {
        transform: none;
    }
    
    /* 优化滚动 */
    .matches-tabs,
    .prediction-tabs {
        scrollbar-width: thin;
    }
}

/* ====================
   超大屏幕
   ==================== */
@media (min-width: 1920px) {
    html {
        font-size: 18px;
    }
    
    .container {
        max-width: 1600px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-title .sub-title {
        font-size: 3rem;
    }
}
