/**
 * 响应式样式
 * 适配不同设备和屏幕尺寸
 */

/* ===== 平板设备（768px - 1024px）===== */
@media screen and (max-width: 1024px) {
    .container {
        max-width: 960px;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-stats {
        gap: 40px;
    }

    .matches-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analysis-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .community-grid {
        grid-template-columns: 1fr;
    }

    .experts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .qa-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 移动设备（最大 768px）===== */
@media screen and (max-width: 768px) {
    /* 导航栏 */
    .mobile-menu-btn {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 999;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-item {
        margin-bottom: 15px;
    }

    .auth-buttons {
        display: none;
    }

    /* 移动端登录按钮显示在菜单中 */
    .nav-menu.active ~ .auth-buttons {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1000;
    }

    /* Hero 区块 */
    .hero {
        padding: 60px 0;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 20px;
    }

    .stat-item {
        flex: 0 0 calc(50% - 10px);
    }

    .stat-number {
        font-size: 28px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        padding: 0 20px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    /* 通用区块 */
    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 28px;
    }

    /* 赛事筛选 */
    .league-filter {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 10px;
    }

    .league-filter::-webkit-scrollbar {
        height: 4px;
    }

    .league-filter::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }

    .filter-btn {
        display: inline-block;
    }

    /* 赛事卡片 */
    .matches-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .match-card {
        padding: 15px;
    }

    /* 实时比分 */
    .live-match {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .live-score {
        margin: 10px 0;
    }

    /* 分析卡片 */
    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .analysis-card.featured {
        grid-column: 1;
    }

    .analysis-img {
        height: 180px;
    }

    /* 专家卡片 */
    .experts-grid {
        grid-template-columns: 1fr;
    }

    /* 历史战绩表格 */
    .records-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .records-table table {
        min-width: 600px;
    }

    /* 社区区块 */
    .community-grid {
        grid-template-columns: 1fr;
    }

    .post-form-card {
        padding: 20px;
    }

    .post-card {
        padding: 15px;
    }

    /* 专家问答 */
    .qa-grid {
        grid-template-columns: 1fr;
    }

    /* 关于我们 */
    .about-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 页脚 */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* 模态框 */
    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .modal-title {
        font-size: 20px;
    }

    /* 返回顶部 */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }

    /* Toast 提示 */
    .toast-container {
        right: 15px;
        left: 15px;
        top: 70px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ===== 小屏手机（最大 480px）===== */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    /* Hero 区块 */
    .hero-title {
        font-size: 24px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .stat-item {
        flex: 0 0 calc(50% - 10px);
    }

    .stat-number {
        font-size: 24px;
    }

    .stat-label {
        font-size: 12px;
    }

    /* 按钮 */
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* 赛事卡片 */
    .match-teams {
        flex-wrap: wrap;
    }

    .team {
        flex: 0 0 40%;
    }

    .match-time {
        flex: 0 0 20%;
        padding: 0 5px;
    }

    .match-time .time {
        font-size: 14px;
    }

    /* 实时比分 */
    .live-score {
        font-size: 24px;
    }

    /* 分析卡片 */
    .analysis-title {
        font-size: 18px;
    }

    .analysis-excerpt {
        font-size: 14px;
    }

    /* 专家卡片 */
    .expert-header {
        flex-direction: column;
        text-align: center;
    }

    .expert-avatar {
        width: 80px;
        height: 80px;
    }

    .expert-stats {
        justify-content: center;
    }

    /* 帖子 */
    .post-header {
        flex-direction: column;
        text-align: center;
    }

    .user-avatar {
        width: 50px;
        height: 50px;
    }

    .post-title {
        font-size: 16px;
    }

    .post-content {
        font-size: 14px;
    }

    .post-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* 页脚 */
    .footer {
        padding: 30px 0 15px;
    }

    .footer-title {
        font-size: 16px;
    }

    .footer-text {
        font-size: 13px;
    }

    .footer-links li {
        margin-bottom: 8px;
    }
}

/* ===== 横屏手机 ===== */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 40px 0;
    }

    .hero-stats {
        gap: 15px;
    }

    .stat-number {
        font-size: 24px;
    }

    .section {
        padding: 30px 0;
    }
}

/* ===== 高分辨率屏幕 ===== */
@media screen and (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }

    .hero-title {
        font-size: 56px;
    }

    .matches-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .analysis-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .experts-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== 打印样式 ===== */
@media print {
    .header,
    .hero,
    .back-to-top,
    .auth-buttons,
    .mobile-menu-btn,
    .load-more,
    .post-form-card,
    .modal,
    .toast-container {
        display: none !important;
    }

    body {
        background: white;
        font-size: 12pt;
    }

    .section {
        page-break-inside: avoid;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }
}

/* ===== 无障碍优化 ===== */
@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 {
        --bg-color: #1a1a1a;
        --bg-light: #2d2d2d;
        --text-color: #e0e0e0;
        --text-light: #a0a0a0;
        --border-color: #404040;
    }
    */
}

/* ===== 触控设备优化 ===== */
@media (hover: none) and (pointer: coarse) {
    /* 增大触控目标尺寸 */
    .btn {
        min-height: 44px;
    }

    .filter-btn {
        padding: 10px 20px;
    }

    .action-btn {
        padding: 10px;
    }

    /* 移除 hover 效果 */
    .match-card:hover,
    .analysis-card:hover,
    .expert-card:hover,
    .post-card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
}
