/* ===================================================== */
/* 足球赛程卡片模式
/* ===================================================== */

.hoy-wrapper {
    padding: 8px 8px;
    background: #f8f9fa;
}

.hoy-main {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* 导航栏 */
.data-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0 12px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.data-nav a {
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.data-nav a.active {
    color: #dc2626;
    border-bottom: 3px solid #dc2626;
}

.data-nav .count {
    background: #e2e8f0;
    color: #475569;
    font-size: 12px;
    padding: 1px 7px;
    border-radius: 9999px;
}

/* 顶部筛选栏 */
.hoy-topbar {
    padding: 16px 12px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.hoy-topbar > div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#date-input, #country-filter, #league-filter, #universal-search {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    flex: 1;
    min-width: 160px;
}

button {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}

button[onclick="clearFilters()"] { background: #64748b; color: #fff; }

/* 时间条 */
.info-bar {
    padding: 12px 16px;
    background: #f0f7ff;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    text-align: center;
}

/* 卡片核心样式 */

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    padding: 12px 10px 20px;
    content-visibility: auto;
    contain-intrinsic-size: 160px;
}

@media (max-width: 480px) {
    .matches-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 8px;
    }
}

.match-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.match-card.in-progress { border-left: 5px solid #dc2626; }
.match-card.match-finished { border-left: 5px solid #16a34a; }
.match-card.not-started { border-left: 5px solid #64748b; }
.match-card.postponed { border-left: 5px solid #f59e0b; }

.match-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.match-card .league-tag {
    display: inline-flex;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
}

.match-card .status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    min-width: 56px;
    text-align: center;
}

.match-card.not-started .status { background: #64748b; color: #fff; }
.match-card.in-progress .status { background: #dc2626; color: #fff; animation: pulse 2s infinite; }
.match-card.match-finished .status { background: #16a34a; color: #fff; }
.match-card.postponed .status { background: #f59e0b; color: #fff; }

.match-card .teams-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px 10px;
    gap: 4px;
}

.match-card .team {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 0;
}

.match-card .home-team { justify-content: flex-start; }
.match-card .away-team { justify-content: flex-end; flex-direction: row-reverse; }

.match-card .team-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e5e7eb;
}

.match-card .team-name {
    font-weight: 700;
    font-size: 14.5px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-card .score-section {
    text-align: center;
    min-width: 68px;
}

.match-card .score {
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.match-card.in-progress .score,
.match-card.match-finished .score {
    color: #dc2626;
}

.match-card .score-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 3px;
    font-weight: 600;
}

.match-card .match-stats {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px 11px;
    background: #fafafa;
    border-top: 1px solid #f1f5f9;
}

/* 篮球专用四节分数样式 */
.match-card .quarter-scores {
    padding: 8px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 12.5px;
    color: #334155;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.match-card .quarter-item {
    padding: 4px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    line-height: 1.4;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

@keyframes pulse {
    0%,100%{opacity:1} 50%{opacity:0.75}
}

.notice {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    color: #64748b;
    border-radius: 8px;
    margin: 20px;
}
/* 足球/篮球切换按钮（仅手机端显示）*/
.sport-switch {
    display: flex;
    background: #f1f5f9;
    border-radius: 9999px;
    padding: 4px;
    margin: 8px auto 12px;
    width: fit-content;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* 电脑端隐藏 */
@media (min-width: 768px) {
    .sport-switch {
        display: none !important;
    }
}

.sport-switch a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    border-radius: 9999px;
    transition: all 0.2s ease;
    min-width: 120px;
}

.sport-switch a.active {
    background: #fff;
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-weight: 700;
}

.sport-switch a:hover:not(.active) {
    background: #e2e8f0;
    color: #1e40af;
}

/* 移动端/平板适配 - 筛选栏横向可滑动 + 滚动提示 */
@media (max-width: 768px) {
    .data-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        gap: 4px;
    }

    /* 显示细滚动条，明显提示用户可以左右滑动 */
    .data-nav::-webkit-scrollbar {
        height: 5px;
    }

    .data-nav::-webkit-scrollbar-thumb {
        background-color: #94a3b8;
        border-radius: 3px;
    }

    .data-nav::-webkit-scrollbar-track {
        background: #e2e8f0;
    }

    /* Firefox */
    .data-nav {
        scrollbar-width: thin;
        scrollbar-color: #94a3b8 #e2e8f0;
    }

    .data-nav a {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 14px;
    }

    .sport-switch {
        margin: 6px auto 8px;
        width: fit-content;
    }
    
    .sport-switch a {
        padding: 8px 12px;
        font-size: 14px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .match-card .teams-row {
        padding: 12px 10px 8px;
        gap: 8px;
        align-items: flex-start;
    }

    .match-card .team {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        flex: 1;
        min-width: 0;
    }

    .match-card .home-team,
    .match-card .away-team {
        justify-content: center;
    }

    .match-card .away-team {
        flex-direction: column;
    }

    .match-card .team-logo {
        width: 28px;
        height: 28px;
    }

    .match-card .team-name {
        font-size: 13px;
        font-weight: 600;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        line-height: 1.3;
    }

    .match-card .score-section {
        min-width: 64px;
        padding-top: 2px;
    }

    .match-card .score {
        font-size: 22px;
    }

    .match-card .score-sub {
        font-size: 10.5px;
    }
}

/* 修复 iOS 日期选择器溢出 */
@media (max-width: 480px) {
    /* 1. 让日期输入的父容器更灵活 */
    .hoy-topbar > div > div:first-child {
        min-width: 0 !important;           /* 关键！取消 200px 最小宽度 */
        flex: 1 1 140px;
    }

    /* 2. 强制约束日期输入框 */
    #date-input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
        font-size: 15px;
        padding: 10px 8px;
        -webkit-appearance: none;          /* iOS 特殊处理 */
    }
}

.sport-switch .sport-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 15px;
    cursor: pointer;
    color: #64748b;
}

.sport-switch .sport-btn.active {
    color: #1e40af;
    font-weight: 600;
    border-bottom: 2px solid #1e40af;
}