/* ============================================
   自适应响应式样式 - 星空电竞
   仅在小屏幕设备上生效，PC端不受影响
   ============================================ */

/* 汉堡菜单按钮基础样式 - 仅在移动端显示 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    transition: all 0.3s;
    border-radius: 2px;
}
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============ 平板适配 (max-width: 1024px) ============ */
@media (max-width: 1024px) {
    body {
        min-width: auto !important;
    }
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 15px;
        box-sizing: border-box;
    }
    .footer-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ============ 手机适配 (max-width: 768px) ============ */
@media (max-width: 768px) {
    body {
        min-width: auto !important;
        overflow-x: hidden;
    }
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 12px;
        box-sizing: border-box;
    }
    .top-nav {
        height: auto !important;
        min-height: 50px;
        padding: 0;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    .top-nav .container {
        flex-wrap: wrap;
        height: auto !important;
        min-height: 50px;
        padding: 8px 12px;
        position: relative;
    }
    .logo h1, .logo .site-name, .logo-text {
        font-size: 18px !important;
    }
    .logo img {
        height: 30px !important;
    }
    .menu-toggle {
        display: flex !important;
        order: 3;
        margin-left: auto;
    }
    .nav-menu {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        z-index: 999;
        padding: 10px 0;
        width: 100%;
    }
    .nav-menu.show {
        display: flex !important;
    }
    .nav-menu li {
        width: 100%;
    }
    .nav-menu li a {
        height: auto !important;
        line-height: 1.5 !important;
        padding: 10px 20px !important;
        border-bottom: 1px solid #f0f0f0;
        font-size: 14px !important;
        white-space: normal !important;
    }
    .nav-menu li a:hover,
    .nav-menu li a.active {
        border-bottom-color: #f0f0f0 !important;
    }
    .nav-right {
        display: none;
    }
    .search-box {
        display: none;
    }
    .app-features { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .news-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    .footer-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .related-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .stats-bar .container, .stats-section .container {
        flex-wrap: wrap !important;
        gap: 15px;
        justify-content: center !important;
    }
    .stat-item {
        flex: 0 0 45% !important;
        justify-content: center;
    }

    /* 通用flex布局自适应 */
    .content-wrapper, .page-content, .content-area, .main-wrapper, .page-layout {
        flex-direction: column !important;
    }
    
    /* 表格自适应 */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 图片自适应 */
    img {
        max-width: 100%;
        height: auto !important;
    }
    
    /* Hero/Banner区域 */
    .hero, .banner, .hero-section, .slider, .hero-slider {
        height: auto !important;
        min-height: 200px;
        padding: 30px 15px !important;
    }
    .hero h1, .banner h1, .hero-title, .banner-title, .slide-content h2 {
        font-size: 22px !important;
    }
    .hero p, .banner p, .slide-content p {
        font-size: 14px !important;
    }
    .hero .btn-group, .slide-content .btn-group {
        flex-wrap: wrap;
        gap: 10px !important;
    }
    
    /* 页脚自适应 */
    .footer .container, footer .container {
        flex-direction: column !important;
    }
    .footer-links, .footer-nav, .footer-bottom .container {
        flex-direction: column !important;
        gap: 15px !important;
        text-align: center;
    }
    .footer-col, .footer-column {
        width: 100% !important;
        margin-bottom: 15px;
    }
    .match-card, .schedule-item, .match-item {
        flex-direction: column !important;
        text-align: center;
        padding: 10px !important;
    }
    .match-teams, .schedule-teams {
        flex-direction: column !important;
        gap: 5px;
    }
    .promo-cards, .promo-grid {
        grid-template-columns: 1fr !important;
    }
    .cta-grid, .cta-section .container {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* 区域标题 */
    .section-title h2, section h2 {
        font-size: 22px !important;
    }
    .section-title p, section > p {
        font-size: 14px !important;
    }
    
    /* 通用间距调整 */
    section, .section {
        padding: 30px 0 !important;
    }
}

/* ============ 小屏手机适配 (max-width: 480px) ============ */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    .app-features { grid-template-columns: 1fr !important; }
    .news-grid { grid-template-columns: 1fr !important; }
    .footer-grid { grid-template-columns: 1fr !important; }
    .related-grid { grid-template-columns: 1fr !important; }

    .hero h1, .banner h1, .hero-title, .banner-title, .slide-content h2 {
        font-size: 18px !important;
    }
    
    h1 { font-size: 22px !important; }
    h2 { font-size: 18px !important; }
    h3 { font-size: 16px !important; }
    
    .stat-item {
        flex: 0 0 100% !important;
    }
    
    .card, .game-card, .article-card, .news-card, .match-card {
        margin-bottom: 10px;
    }
    
    .btn, .btn-primary, .btn-register, .btn-login, [class*="btn-"] {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
}
