/* 移动端适配样式表 */

/* 移动端页面选择器 */
.mobile-page-selector {
    display: none;
    background: linear-gradient(90deg, #1a4747 0%, #003333 100%);
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative; /* 使用相对定位 */
    z-index: 200;
    margin: 0;
    border-radius: 0;
}

.mobile-page-selector h3 {
    color: white;
    font-size: 16px;
    margin: 0 0 12px 0;
    text-align: center;
    font-weight: 600;
}

.mobile-page-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.mobile-page-btn {
    flex: 1;
    max-width: 130px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mobile-page-btn:hover,
.mobile-page-btn:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.mobile-page-btn.active {
    background: rgba(76, 255, 179, 0.4);
    border-color: #4cffb3;
    color: #4cffb3;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(76, 255, 179, 0.3);
}

.mobile-page-btn .icon {
    font-size: 18px;
}

.mobile-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* 基础响应式设置 */
@media screen and (max-width: 768px) {
    /* 显示移动端页面选择器 */
    .mobile-page-selector {
        display: block;
    }
    
    /* 隐藏原有的侧边栏 */
    .sidebar {
        display: none;
    }
    
    /* 主容器调整 */
    .main-container {
        flex-direction: column;
        padding-top: 0; /* 移除padding-top，让内容从顶部开始 */
    }
    
    /* 头部样式调整 */
    header {
        min-height: 100px;
        padding: 10px 15px;
        position: fixed;
        z-index: 1000;
    }
    
    .logo-container {
        flex-direction: column;
        gap: 10px;
        padding-bottom: 10px;
    }
    
    .logo {
        min-width: auto;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 22px;
    }
    
    .logo p {
        font-size: 12px;
    }
    
    .slogan {
        padding: 0;
        font-size: 14px;
    }
    
    .user-actions {
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }
    
    /* 导航栏调整 */
    nav {
        margin-top: 5px;
        padding-top: 10px;
    }
    
    .nav-btn, .lang-btn {
        padding: 6px 12px;
        font-size: 13px;
        min-width: auto;
    }
    
    .language-selector {
        display: none;
    }
    
    /* 主内容区调整 - 关键修改：设置margin-top为header高度 */
    #main-content {
        margin-left: 0;
        margin-top: 100px; /* 设置为header的高度，确保不被遮挡 */
        padding: 10px;
        min-height: calc(100vh - 100px);
    }
    
    /* 内容容器样式正常 */
    .basketball-container,
    #football {
        padding: 10px;
    }
    
    /* 表格容器调整 */
    .match-table-container {
        padding: 10px 5px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 表格响应式处理 */
    .match-table {
        min-width: 800px;
    }
    
    .match-table th,
    .match-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    /* 表格字体大小调整 */
    .match-table th:nth-child(1),
    .match-table td:nth-child(1) { font-size: 11px; }
    
    .match-table th:nth-child(2),
    .match-table td:nth-child(2) { font-size: 11px; }
    
    .match-table th:nth-child(3),
    .match-table td:nth-child(3) { font-size: 11px; }
    
    /* 横幅调整 */
    .banner {
        min-height: 120px;
        margin: 15px 5px 10px 5px;
        padding: 0;
    }
    
    .banner h2 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .subscription-status {
        bottom: 10px;
        right: 10px;
        padding: 5px 10px;
        font-size: 12px;
    }
    
    /* 提示卡片容器调整 */
    .tips-container {
        gap: 10px;
    }
    
    /* 提示卡片调整 */
    .tip-card {
        flex: 0 0 240px;
        width: 240px;
        min-width: 240px;
    }
    
    /* 滚动按钮调整 */
    .scroll-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .scroll-left {
        left: -10px;
    }
    
    .scroll-right {
        right: -10px;
    }
    
    /* 登录框调整 */
    .simple-login-box {
        width: 90%;
        max-width: 300px;
    }
    
    .simple-login-form {
        padding: 20px 15px;
    }
    
    .simple-login-btn {
        padding: 10px;
    }
    
    /* 模态窗口调整 */
    .month-detail-modal .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
    }
    
    .month-detail-modal .modal-header {
        padding: 10px 0;
    }
    
    .month-detail-modal .modal-header h2 {
        font-size: 18px;
    }
    
    .month-detail-modal .modal-body {
        padding: 10px 0;
    }
    
    /* 图表容器调整 */
    .charts-container {
        flex-direction: column;
    }
    
    /* 表格操作按钮区域调整 */
    .table-actions {
        display: flex;
        justify-content: center;
        margin-bottom: 15px;
        padding: 0 10px;
    }
    
    .action-buttons {
        display: flex;
        gap: 10px;
        justify-content: center;
    }
}

/* 超小屏幕特殊处理 */
@media screen and (max-width: 480px) {
    /* 移动端页面选择器进一步优化 */
    .mobile-page-selector {
        padding: 12px 10px;
    }
    
    .mobile-page-selector h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .mobile-page-btn {
        padding: 10px 12px;
        font-size: 13px;
        max-width: 110px;
        gap: 4px;
    }
    
    .mobile-page-btn .icon {
        font-size: 16px;
    }
    
    /* 头部进一步压缩 */
    header {
        min-height: 80px;
        padding: 8px 10px;
    }
    
    /* 主容器调整 */
    .main-container {
        padding-top: 100px; /* 移除padding-top */
    }
    
    /* 主内容区调整 - 设置margin-top为小屏幕header高度 */
    #main-content {
        margin-top: 80px; /* 设置为小屏幕header的高度 */
        padding: 8px;
    }
    
    /* 内容容器调整 */
    .basketball-container,
    #football {
        padding: 8px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .logo p {
        display: none;
    }
    
    .slogan p {
        font-size: 14px;
    }
    
    .nav-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    /* 表格按钮调整 */
    .action-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    /* 卡片更小 */
    .tip-card {
        flex: 0 0 200px;
        width: 200px;
        min-width: 200px;
    }
    
    .tip-card .league, .tip-card .teams {
        font-size: 12px;
    }
    
    .tip-card .time {
        font-size: 11px;
    }
    
    .tip-card .tip {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    /* 修复登录表单按钮显示问题 */
    .header-login-btn, .logout-btn {
        padding: 6px 15px;
        font-size: 12px;
    }
    
    /* 表格进一步缩小 */
    .match-table th,
    .match-table td {
        padding: 6px 3px;
        font-size: 11px;
    }
}

/* 添加手势提示样式 */
.swipe-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    opacity: 0.8;
    z-index: 100;
    pointer-events: none;
    animation: fadeInOut 2s ease-in-out;
    animation-iteration-count: 1;
    display: none;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 0.8; }
    80% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* 当在移动设备上访问时才显示提示 */
@media (max-width: 768px) {
    .swipe-hint {
        display: block;
    }
}

/* 修复移动设备上的滚动问题 */
body {
    -webkit-overflow-scrolling: touch;
}

/* 确保移动设备上的内容不会被意外缩放 */
html {
    touch-action: manipulation;
}

/* 适配深色模式的移动设备 */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .match-table {
        background-color: #1a1a1a;
        color: #f0f0f0;
    }
    
    .match-table th {
        background: #2a2a2a;
        color: #00a854;
    }
    
    .match-table td {
        border-bottom: 1px solid #333;
    }
    
    .mobile-page-selector {
        background: linear-gradient(90deg, #2a2a2a 0%, #1a1a1a 100%);
    }
}

/* 针对iOS设备的额外优化 */
@supports (-webkit-touch-callout: none) {
    /* 修复iOS表单输入问题 */
    input[type="text"],
    input[type="password"] {
        -webkit-appearance: none;
        border-radius: 6px;
    }
    
    /* 修复iOS上的按钮点击延迟 */
    .action-btn,
    .nav-btn,
    .lang-btn,
    .simple-login-btn,
    .mobile-page-btn {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
}

/* 添加侧边栏菜单选择指示器 */
.sidebar-indicator {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: #4cffb3;
    border-radius: 50%;
    display: none;
}

.sidebar a.active .sidebar-indicator {
    display: block;
}

@media (max-width: 768px) {
    /* 侧边栏导航显示当前选中项的指示器 */
    .sidebar-menu-hint {
        text-align: center;
        color: rgba(255, 255, 255, 0.7);
        font-size: 12px;
        padding: 5px 0;
        background-color: rgba(0, 51, 51, 0.8);
        position: absolute;
        bottom: -20px;
        left: 0;
        right: 0;
        z-index: 10;
        display: none;
    }
    
    /* 增加侧边栏的可见度 */
    .sidebar {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        margin-bottom: 5px;
    }
} 