/* =================================== */
/* Primera División de Chile  */
/* =================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&display=swap');

/* === 主题变量（Chile 蓝红白）=== */
:root {
    --blue-border: #0039a6;
    --blue-bg: rgba(0, 57, 166, 0.92);
    --blue-light: #1e40af;
    --blue-main: #0039a6;
    --blue-dark: #002b7f;
    --red-accent: #d52b1e;
    --red-dark: #a61c0e;
    --text-white: #ffffff;
    --text-main: #1e293b;
}

/* === 全局重置 === */
*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}
html, body { 
    margin: 0; 
    padding: 0; 
    min-height: 100vh; 
    overflow-x: hidden; 
}

/* === 容器 === */
.container {
    margin: 0 auto;
    padding: 20px 10px;
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--blue-main) 0%, #ffffff 50%, #f8f9fa 100%);
    color: var(--text-main);
    min-height: 100vh;
    width: 100%;
}

/* === 头部 === */
.container h1 {
    color: white;
    text-align: center;
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.league-logo, .country-flag {
    width: 50px; height: 50px; object-fit: contain;
    filter: drop-shadow(0 0 8px var(--blue-light));
}
.league-logo { border-radius: 50%; border: 3px solid #ffffff; padding: 4px; }
.country-flag { animation: sunflare 2s infinite; }
@keyframes sunflare {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* === SEO 年份链接 === */
.seo-year-links {
    position: absolute; left: -9999px; opacity: 0; pointer-events: none;
}

/* === 信息栏（默认）=== */
.info-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
    padding: 10px 14px;
    background: var(--blue-bg);
    border: 3.5px solid #ffffff;
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(0, 57, 166, 0.6);
    font-weight: 900;
    font-size: 14px;
    color: var(--text-white);
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.info-item {
    flex: 1;
    min-width: 180px;
    padding: 0;
    margin: 0;
    color: var(--text-white);
}
.info-item::before {
    content: '●';
    display: inline-block;
    color: var(--text-white);
    font-size: 11px;
    margin-right: 10px;
    vertical-align: middle;
    text-shadow: 0 0 8px var(--blue-main);
}

/* === 通知 === */
.notice {
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--blue-bg);
    color: var(--text-white);
    border: 3.5px solid #ffffff;
    text-align: center;
    font-weight: 900;
    font-size: 15px;
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(0, 57, 166, 0.6);
    line-height: 1.5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* === 章节标题（醒目）=== */
.section-title {
    font-size: 18px;
    font-weight: 800;
    color: white;
    text-align: center;
    margin: 24px 0 16px;
    padding: 10px 16px;
    background: linear-gradient(90deg, transparent, var(--blue-main) 50%, transparent);
    border-bottom: 4px solid var(--red-accent);
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,57,166,0.5);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* === 日期导航 === */
.date-nav {
    display: none; flex-wrap: wrap; gap: 10px;
    background: rgba(255, 255, 255, 0.9); padding: 15px;
    border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    margin-bottom: 20px; justify-content: center;
    backdrop-filter: blur(8px); overflow-x: auto;
}
.date-nav.active { display: flex; }
.date-nav::-webkit-scrollbar { height: 8px; }
.date-nav::-webkit-scrollbar-thumb { background: var(--blue-main); border-radius: 4px; }

.date-tag {
    padding: 8px 14px;
    background: rgba(0,57,166,0.12);
    border: 1.5px solid var(--blue-main);
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s;
    white-space: nowrap;
    font-weight: 700;
    min-width: 100px;
    flex: 0 1 auto;
    color: var(--text-main);
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
.date-tag:hover, .date-tag.active {
    background: var(--blue-main);
    color: #fff;
    transform: translateY(-2px);
}
.date-tag.current {
    background: var(--red-accent);
    color: white;
    font-weight: 800;
    border-color: var(--red-accent);
}

/* === 过滤器 === */
.filters {
    display: none; grid-template-columns: 1fr; gap: 16px;
    background: rgba(255, 255, 255, 0.9); padding: 18px;
    border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    margin-bottom: 20px; border: 1.5px solid var(--blue-main);
    backdrop-filter: blur(8px);
}
.filters.active { display: grid; }
.filters label {
    font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 8px;
}
.filters select, .filters input, .filters button {
    width: 100%; padding: 12px; border: 1.5px solid var(--blue-main);
    border-radius: 10px; font-size: 15px; background: rgba(255,255,255,0.9);
    color: var(--text-main); height: 44px; transition: all 0.3s;
}
.filters select:focus, .filters input:focus {
    border-color: var(--red-accent); box-shadow: 0 0 0 3px rgba(213,43,30,0.3); outline: none;
}
.filters button {
    background: linear-gradient(45deg, var(--blue-main), var(--blue-dark));
    color: white; font-weight: 700; cursor: pointer; text-transform: uppercase;
}
.filters button:hover {
    background: linear-gradient(45deg, var(--blue-dark), #001f5c);
    transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,57,166,0.4);
}

/* === 按钮组 === */
.button-group {
    display: flex; gap: 16px; justify-content: center; margin: 16px 0; flex-wrap: wrap;
}
.toggle-filters, .refresh-matches {
    background: linear-gradient(45deg, #ffffff, var(--blue-dark));
    color: white; border: none; padding: 12px 20px; border-radius: 10px;
    cursor: pointer; font-weight: 700; font-size: 15px; text-transform: uppercase;
    transition: all 0.3s; min-width: 140px;
}
.toggle-filters:hover, .refresh-matches:hover {
    background: linear-gradient(45deg, var(--blue-dark), #001f5c);
    transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,57,166,0.4);
}

/* === 比赛卡片 === */
.match-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    border-left: 5px solid var(--blue-main);
    transition: all 0.3s ease;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--text-main);
}
.match-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0,57,166,0.25);
    border-left-color: var(--red-accent);
}

/* 新增：比赛日期样式（与阿根廷一致） */
.match-card .date {
    font-size: 16px;
    font-weight: 800;
    color: var(--blue-main);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(0,57,166,0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--blue-main);
    margin-bottom: 8px;
}

/* 队伍 + 比分 */
.match-card .teams { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 16px; 
    margin: 16px 0; 
}
.match-card .team { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 8px; 
    flex: 1; 
    min-width: 0; 
}
.match-card .team-logo { 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    border: 3px solid var(--blue-main); 
}
.match-card .team span { 
    font-weight: 600; 
    font-size: 16px; 
    color: var(--text-main); 
    text-align: center; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    width: 100%; 
}
.match-card .score { 
    font-size: 32px; 
    font-weight: 900; 
    color: var(--blue-main); 
    background: rgba(0,57,166,0.1); 
    padding: 8px 16px; 
    border-radius: 12px; 
    min-width: 80px; 
    text-align: center; 
}

/* 状态标签 */
.match-card .status { 
    text-align: center; 
    font-weight: bold; 
    color: var(--text-main); 
    font-size: 15px; 
    text-transform: uppercase; 
    background: rgba(0,57,166,0.1); 
    padding: 6px 12px; 
    border-radius: 8px; 
    border: 1px solid var(--blue-main);
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* 详情网格 */
.match-card .details { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 12px; 
    font-size: 14px; 
    color: var(--text-main); 
    background: rgba(0,57,166,0.05); 
    padding: 14px; 
    border-radius: 10px; 
    line-height: 1.5; 
}

/* === 自动刷新提示 - 右上角 === */
#auto-refresh-indicator {
    position: fixed;
    top: 200px;
    right: 12px;
    background: rgba(30, 41, 59, 0.92);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    z-index: 9999;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(-10px);
}

#auto-refresh-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.refresh-icon {
    font-size: 16px;
    animation: spin 1.5s linear infinite;
    animation-play-state: paused;
}

.refresh-icon.spinning {
    animation-play-state: running;
}

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

.notice.utc-notice {
    margin: 12px 0 20px 0;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    background: rgb(255 195 0);
    border: 1.5px solid var(--gold-border);
    border-radius: 10px;
    text-align: left;
    box-shadow: 0 2px 6px rgba(166, 124, 0, 0.15);
}

.notice.utc-notice a {
    color: var(--blue-main);
    text-decoration: underline;
    font-weight: 700;
}

.notice.utc-notice a:hover {
    color: var(--blue-dark);
    text-decoration: none;
}

/* === 响应式：桌面端（≥769px）=== */
@media (min-width: 769px) {
    .container h1 { font-size: 32px; margin-bottom: 20px; }
    .league-logo, .country-flag { width: 60px; height: 60px; }
    .filters { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); padding: 20px; }
    .match-card { padding: 24px; }
    .match-card .team-logo { width: 60px; height: 60px; border-width: 3.5px; }
    .match-card .score { font-size: 36px; }
    .match-card .details { grid-template-columns: 1fr 1fr; font-size: 15px; }
    .date-nav { flex-direction: row; justify-content: center; }
    .date-tag { font-size: 15px; padding: 12px 20px; }
    .button-group { gap: 20px; }
    .section-title { font-size: 20px; margin: 28px 0 18px; }
    .match-card .date { font-size: 16px; }
}

/* === 响应式：平板 & 手机（≤768px）=== */
@media (max-width: 768px) {
    html, body { height: 100dvh; min-height: 100dvh; }
    .container { padding: 16px 10px; min-height: 100dvh; }

    .container h1 { font-size: 22px; gap: 10px; margin-bottom: 14px; }
    .league-logo, .country-flag { width: 40px; height: 40px; }
    
    .notice {
        font-size: 14px;
        padding: 10px 14px;
        margin: 10px 0;
        border-width: 1.2px;
    }
    .info-bar {
        font-size: 12px;
    }
    /* 按钮 */
    .toggle-filters, .refresh-matches {
        padding: 10px 16px; font-size: 13px; min-width: 130px; font-weight: 600;
    }
    .button-group { gap: 12px; margin: 14px 0; }

    /* 过滤器 */
    .filters { padding: 14px; gap: 12px; }
    .filters label { font-size: 14px; margin-bottom: 6px; }
    .filters select, .filters input, .filters button {
        padding: 10px; font-size: 14px; height: 40px; border-radius: 8px; border-width: 1.2px;
    }
    .filters button { font-size: 14px; }

    /* 日期导航 */
    .date-nav { padding: 10px; gap: 8px; margin-bottom: 16px; }
    .date-tag { font-size: 12.5px; padding: 7px 12px; min-width: 90px; border-width: 1.2px; }

    /* 比赛卡片 - 布局不变，仅压缩 */
    .match-card {
        padding: 16px;
        gap: 14px;
        margin: 0 auto 16px;
        max-width: calc(100% - 20px);
    }
    .match-card .teams { gap: 12px; margin: 12px 0; }
    .match-card .team-logo { width: 40px; height: 40px; border-width: 2.5px; }
    .match-card .team span { font-size: 14px; }
    .match-card .score { font-size: 26px; padding: 6px 12px; min-width: 70px; }
    .match-card .status { font-size: 13px; padding: 5px 10px; }
    .match-card .details { font-size: 13px; padding: 12px; gap: 10px; }

    /* 响应式标题 */
    .section-title {
        font-size: 16px;
        margin: 20px 0 14px;
        padding: 8px 12px;
    }
    
    .match-card .date {
        font-size: 14px;
        padding: 6px 10px;
    }
    
    #auto-refresh-indicator {
        top: 155px;
        right: 8px;
        font-size: 12px;
        padding: 7px 12px;
    }
    .notice.utc-notice {
        font-size: 13px;
        padding: 12px 14px;
    }
}

/* === 极小屏（≤390px）=== */
@media (max-width: 390px) {
    .container { padding: 12px 8px; }
    .container h1 { font-size: 18px; gap: 8px; margin-bottom: 12px; }
    .league-logo, .country-flag { width: 32px; height: 32px; }

    .toggle-filters, .refresh-matches { font-size: 9px; min-width: 120px; }
    .date-tag { font-size: 11.5px; padding: 6px 10px; min-width: 80px; }
    .filters select, .filters input, .filters button { font-size: 13px; height: 38px; padding: 8px; }
    
    .match-card { padding: 14px; max-width: calc(100% - 10px); }
    .match-card .team-logo { width: 36px; height: 36px; border-width: 2px; }
    .match-card .team span { font-size: 13px; }
    .match-card .score { font-size: 22px; }
    .match-card .details { font-size: 12px; }

    .section-title {
        font-size: 15px;
        padding: 7px 10px;
    }
    .notice.utc-notice {
        font-size: 12px;
        padding: 10px 12px;
    }
}