/* ======================================================= */
/* Futebol hoy  */
/* ======================================================= */

/* ---------- FOUC ---------- */
#matches-container { opacity: 0; transition: opacity .2s ease; }
#matches-container.loaded { opacity: 1; }

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana,sans-serif; background:#f9f9fb; color:#2c3e50; line-height:1.5; }
.hoy-wrapper,.hoy-main,.hoy-matches,.hoy-match,.hoy-teams-row,
.hoy-match-header,.hoy-match-footer,.hoy-times,.hoy-team,.hoy-status-venue { min-width:0; }

/* ---------- 容器 ---------- */
.hoy-wrapper { display:block;margin:0 auto; padding:16px; background:#f9f9fb; min-height:100vh; }
.hoy-sidebar { display:none; }
.hoy-main { width:100%; background:#fff; border-radius:12px; padding:24px; box-shadow:0 4px 16px rgba(0,0,0,.06); overflow:hidden; }

/* ---------- 顶部操作栏（带折叠） ---------- */
.hoy-topbar {
    position: relative;
    padding: 12px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    overflow: hidden;
}

.hoy-topbar-toggle {
    display: none;
    width: 100%;
    padding: 12px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
}

.hoy-topbar-toggle .toggle-arrow {
    font-size: 18px;
    font-weight: bold;
}

.hoy-topbar-content {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    margin-top: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
    scrollbar-width: thin;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 500px;
    opacity: 1;
    align-items: center;
}

.hoy-topbar.collapsed .hoy-topbar-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* 日期 + 按钮 */
.hoy-date-picker { display:flex; gap:8px; align-items:center; white-space:nowrap; flex: 1; min-width: 200px; }
#date-input {
    padding:10px 12px; border:1px solid #ced4da; border-radius:8px; font-size:15px;
    background:#fff; color:#22c3e50; flex: 1;
}
.hoy-btn-primary {
    padding:10px 18px; background:linear-gradient(135deg,#007cba,#005a87);
    color:#fff; border:none; border-radius:8px; cursor:pointer; font-weight:600;
    font-size:15px; box-shadow:0 3px 8px rgba(0,124,186,.3); transition:all .2s;
    min-width:60px; white-space:nowrap;
}
.hoy-btn-primary:hover { background:linear-gradient(135deg,#005a87,#003d5f); transform:translateY(-1px); box-shadow:0 5px 12px rgba(0,124,186,.4); }

/* 下拉框 */
.hoy-filter-select {
    padding:10px 12px; border:1px solid #ced4da; border-radius:8px; font-size:15px; background:#fff; min-width: 160px;
}

/* 搜索框 */
.hoy-search-box { flex:1; min-width:200px; max-width:400px; }
#universal-search {
    width:100%; padding:10px 12px 10px 36px; border:1px solid #ced4da; border-radius:8px;
    font-size:15px;
    background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 12px center;
    background-size:16px; background-color:#fff;
}

/* 清除按钮 */
.hoy-btn-small {
    padding:10px 16px; background:#6c757d; color:#fff; border:none; border-radius:8px;
    cursor:pointer; font-size:14px; white-space:nowrap; min-width: 80px;
}
.hoy-btn-small:hover { background:#5a6268; }

/* ---------- 用户当前时间条（新增） ---------- */
.info-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background: #f0f7ff;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
}

#current-time {
    text-align: center;
}

#time-display {
    color: #0066cc;
    font-weight: 700;
}

/* ---------- 自动刷新指示器 ---------- */
#auto-refresh-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #1565c0;
    font-weight: 600;
}

#auto-refresh-indicator.visible {
    display: flex;
}

.refresh-icon {
    font-size: 18px;
}

.refresh-icon.spinning {
    animation: spin 1s linear infinite;
}

#refresh-countdown {
    min-width: 30px;
    text-align: center;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- 国家分组 ---------- */
.hoy-country { margin-bottom:34px; padding-bottom:22px; border-bottom:1px solid #e9ecef; }
.hoy-country:last-child { border-bottom:none; margin-bottom:0; padding-bottom:0; }
.hoy-country-name { font-size:24px; font-weight:700; color:#2c3e50; display:flex; align-items:center; gap:10px; margin:0 0 16px; padding:8px 0; }

/* ---------- 联赛大板块 ---------- */
.hoy-league-block { margin-bottom:32px; padding-bottom:24px; border-bottom:1px solid #e9ecef; }
.hoy-league-block:last-child { border-bottom:none; margin-bottom:0; padding-bottom:0; }
.hoy-league-title { font-size:22px; font-weight:700; color:#2c3e50; display:flex; align-items:center; gap:10px; margin:0 0 16px; padding:8px 0; }
.hoy-league-title .league-logo { width:28px; height:28px; border-radius:50%; }

/* ---------- 轮次小板块 ---------- */
.hoy-round-group { margin-bottom:20px; padding:16px; background:#f8f9fa; border-radius:14px; border:1px solid #e2e6ea; }
.hoy-round-group:last-child { margin-bottom:0; }
.hoy-round-title { font-size:16px; font-weight:600; color:#495057; margin:0 0 14px; padding-bottom:8px; border-bottom:1px dashed #dee2e6; text-transform:uppercase; letter-spacing:.5px; }

/* ---------- 比赛卡片 ---------- */
.hoy-matches { display:flex; flex-direction:column; gap:16px; width:100%; }
.hoy-match { background:#fff; border:1px solid #e0e0e0; border-radius:18px; padding:18px 20px; display:flex; flex-direction:column; gap:14px; font-size:17px; transition:all .25s; box-shadow:0 1px 5px rgba(0,0,0,.04); min-height:160px; }
.hoy-match:hover { transform:translateY(-2px); box-shadow:0 8px 20px rgba(0,0,0,.1); border-color:#007cba; }

/* 球队行 */
.hoy-teams-row { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:nowrap; min-width:0; padding:0 4px; min-height:50px; }
.hoy-team { flex:1; min-width:0; overflow:hidden; display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center; }
.hoy-team img { width:60px; height:60px; border-radius:50%; flex-shrink:0; border:2px solid #f0f0f0; transition:transform .2s; }
.hoy-team img:hover { transform:scale(1.1); }
.hoy-team .team-name { white-space:normal; overflow:visible; text-overflow:clip; font-size:16px; font-weight:600; color:#2c3e50; max-width:140px; line-height:1.4; }

/* 比分区 */
.hoy-score { font-weight:900; font-size:30px; min-width:70px; text-align:center; color:#d32f2f; background:#fff0f0; padding:12px 20px; border-radius:8px; box-shadow:0 1px 4px rgba(211,47,47,.2); flex-shrink:0; }
.hoy-score-wrapper { display:flex; flex-direction:column; align-items:center; gap:6px; }
.hoy-score-details { display:flex; flex-direction:column; gap:4px; font-size:13px; color:#d32f2f; text-align:center; margin-top:4px; }
.hoy-score-details > div { background:#fff0f0; padding:3px 8px; border-radius:5px; font-weight:600; min-height:20px; line-height:1.4; }

/* 卡片底部 - 简化，只显示单一时间 */
.hoy-match-footer { display:flex; flex-direction:column; gap:12px; font-size:13.5px; color:#555; min-width:0; }
.hoy-times { display:flex; justify-content:center; font-size:16px; font-weight:700; color:#0066cc; }
.hoy-times .match-date { min-width:140px; text-align:center; }

/* 状态与场地 */
.hoy-status-venue { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; min-width:0; }
.hoy-status { font-size:13px; text-transform:uppercase; font-weight:600; padding:5px 10px; border-radius:5px; background:#eee; white-space:nowrap; }
.hoy-venue { font-size:13.5px; color:#777; font-style:italic; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; min-width:0; max-width:100%; }

/* 状态颜色 */
.hoy-match.match-finished .hoy-status,
.hoy-match.finished .hoy-status { background:#c8e6c9 !important; color:#2e7d32 !important; }
.hoy-match.in-progress .hoy-status,
.hoy-match.first-half .hoy-status,
.hoy-match.second-half .hoy-status,
.hoy-match.halftime .hoy-status { background:#fff3e0 !important; color:#ef6c00 !important; }
.hoy-match.not-started .hoy-status { background:#e0e0e0 !important; color:#616161 !important; }
.hoy-match.postponed .hoy-status { background:#ffcdd2 !important; color:#c62828 !important; }

/* 空状态 */
.hoy-empty { text-align:center; padding:40px 20px; color:#95a5a6; font-size:1.1rem; background:#f8f9fa; border-radius:12px; margin:20px 0; }

/* ---------- 视图切换按钮 ---------- */
.view-toggle-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #007cba;
    color: white;
    width: 100px;
    height: 56px;
    border-radius: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 999;
    transition: all 0.3s ease;
    font-size: 12px;
    gap: 2px;
}

.view-toggle-btn:hover {
    transform: scale(1.1);
    background: #005a87;
}

.view-toggle-btn svg {
    fill: white;
}

.toggle-text {
    font-weight: 600;
    margin-top: 2px;
}

.view-container {
    transition: opacity 0.3s ease;
}

.notice {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    color: #495057;
    font-size: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.utc-notice {
    background: rgba(255, 255, 255, 0.9);
    border-left: 4px solid #007cba;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 8px;
    font-size: 14px;
    color: #2c3e50;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.utc-notice strong {
    color: #007cba;
    font-weight: 700;
}

.utc-notice a {
    color: #007cba;
    text-decoration: underline;
    font-weight: 600;
}

.utc-notice a:hover {
    color: #005a87;
    text-decoration: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
    .hoy-topbar { gap:10px; padding:14px; }
}

@media (max-width: 768px) {
    .hoy-topbar-toggle {
        display: flex !important;
    }
    
    .hoy-topbar-content {
        flex-wrap: wrap;
        gap: 10px;
        padding-top: 12px;
    }
    
    .hoy-topbar.collapsed .hoy-topbar-content {
        max-height: 0 !important;
        opacity: 0 !important;
        padding: 0 !important;
    }

    .hoy-match {
        min-height: 200px !important;
        padding: 18px !important;
        gap: 16px;
    }

    .hoy-team img {
        width: 50px !important;
        height: 50px !important;
    }

    .hoy-team .team-name {
        font-size: 13.5px !important;
        max-width: 100px !important;
    }

    .hoy-score {
        font-size: 24px !important;
        padding: 8px 14px !important;
    }

    .hoy-status-venue {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .hoy-date-picker,
    .hoy-filter-select,
    .hoy-search-box,
    .hoy-btn-small {
        width: 100%;
    }

    .hoy-country-name { font-size:20px; }
    .hoy-league-title { font-size:19px; }

    /* 移动端强制表格视图 */
    #card-view   { display: none !important; }
    #table-view  { display: block !important; }
    #view-toggle { display: none !important; }
    
    .view-toggle-btn {
        width: 56px !important;
        height: 56px !important;
        border-radius: 50% !important;
        font-size: 11px !important;
    }
    .toggle-text { font-size: 9px !important; }
    
    .utc-notice {
        font-size: 13px;
        padding: 10px 12px;
        margin: 12px 0;
    }
}

/* 桌面端默认卡片视图 */
@media (min-width: 769px) {
    #card-view  { display: block; }
    #table-view { display: none; }
    
    /* 桌面端卡片底部优化 */
    .hoy-match-footer {
        align-items: center;
        text-align: center;
        gap: 12px;
        padding-top: 8px;
    }

    .hoy-times {
        justify-content: center;
        gap: 14px;
        font-size: 16px;
        font-weight: 700;
        color: #0066cc;
    }

    .hoy-status {
        display: block;
        min-width: 130px;
        font-size: 15px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 7px 18px;
        border-radius: 10px;
        margin: 0 auto;
        box-shadow: 0 2px 8px rgba(0,0,0,.12);
        text-align: center;
    }

    .hoy-venue {
        font-size: 13.5px;
        color: #777;
        font-style: italic;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        text-align: center;
        display: block;
        margin: 0 auto;
    }

    .hoy-status-venue {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
    }
}
/* 表格视图状态颜色强化（覆盖内联样式，确保一致性） */
#table-matches-content tbody tr.match-finished span[style*="background"] {
    background: #c8e6c9 !important;
    color: #2e7d32 !important;
}

#table-matches-content tbody tr.in-progress span[style*="background"] {
    background: #fff3e0 !important;
    color: #ef6c00 !important;
    animation: pulse 2s infinite; /* 进行中轻微脉动，突出直播比赛 */
}

#table-matches-content tbody tr.not-started span[style*="background"] {
    background: #e0e0e0 !important;
    color: #616161 !important;
}

#table-matches-content tbody tr.postponed span[style*="background"] {
    background: #ffcdd2 !important;
    color: #c62828 !important;
}

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