/* ============================================
   自适应响应式样式 - C7体育
   仅在小屏幕设备上生效，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;
    }
    .league-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .bottom-4col { grid-template-columns: repeat(2, 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-bar {
        display: none;
    }
    .main-nav {
        height: auto !important;
        min-height: 50px;
        padding: 0;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    .main-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;
    }
    .main-nav > .container > ul {
        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%;
    }
    .main-nav > .container > ul.show {
        display: flex !important;
    }
    .main-nav > .container > ul > li {
        width: 100%;
    }
    .main-nav > .container > ul > 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;
    }
    .main-nav > .container > ul > li > a:hover,
    .main-nav > .container > ul > li > a.active {
        border-bottom-color: #f0f0f0 !important;
    }
    .main-nav .dropdown-menu {
        position: static !important;
        box-shadow: none !important;
        display: none;
        background: #f5f5f5 !important;
    }
    .main-nav .dropdown:hover .dropdown-menu,
    .main-nav .dropdown.open .dropdown-menu {
        display: block;
    }
    /* C7特殊处理：header区域 */
    .header .container {
        flex-direction: column;
        text-align: center;
        padding: 8px 12px;
    }
    .header-right {
        display: none;
    }
    .cs-widget {
        bottom: 10px !important;
        right: 10px !important;
    }
    .cs-panel {
        width: 280px !important;
        right: 0 !important;
        bottom: 50px !important;
    }
    .league-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .bottom-4col { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .video-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }

    /* C7特殊布局处理 */
    .layout-3col {
        flex-direction: column !important;
    }
    .col-left, .side-menu {
        width: 100% !important;
        display: none !important;
    }
    .col-center {
        width: 100% !important;
    }
    .col-right {
        width: 100% !important;
    }
    .header .container {
        flex-direction: column;
        text-align: center;
        padding: 8px 12px;
    }
    .header-right {
        display: none;
    }
    .cs-widget {
        bottom: 10px !important;
        right: 10px !important;
    }
    .cs-panel {
        width: 280px !important;
        right: 0 !important;
        bottom: 50px !important;
    }
    /* 通用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;
    }
    .tabs, .tab-nav, .tab-header, .news-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        white-space: nowrap;
    }
    .tabs span, .tab-nav span, .tab-item {
        flex-shrink: 0;
        font-size: 13px !important;
        padding: 6px 12px !important;
    }
    .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;
    }
    .league-grid { grid-template-columns: 1fr !important; }
    .bottom-4col { grid-template-columns: 1fr !important; }
    .video-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;
    }
}
