/* ============================
   世界杯足球比赛信息系统 - 现代化设计
   ============================ */

/* 导入Google字体 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 - 深蓝绿配金色 */
    --primary: #0f4c3a;
    --primary-light: #1a6b52;
    --primary-dark: #0a3a2d;
    --accent: #f0c040;
    --accent-light: #f5d76e;
    
    /* 背景色 */
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-dark: #0f172a;
    
    /* 文本色 */
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* 状态色 */
    --win: #10b981;
    --draw: #f59e0b;
    --lose: #ef4444;
    
    /* 边框和阴影 */
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* 过渡 */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Header ---- */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 24px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    border-bottom: 4px solid var(--accent);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 4px;
}

.header .subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 1px;
}

/* ---- Navigation ---- */
.nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.nav-btn {
    padding: 10px 24px;
    border: 2px solid transparent;
    background: var(--bg);
    color: var(--text);
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(15, 76, 58, 0.3);
}

/* ---- Container ---- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* ---- Section ---- */
.section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
}

/* ---- Filter Bar ---- */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.filter-bar select,
.filter-bar input {
    padding: 10px 16px;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    min-width: 140px;
}

.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 76, 58, 0.1);
}

.filter-bar input {
    flex: 1;
    min-width: 200px;
}

/* ---- Match Card ---- */
.match-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.match-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.match-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.match-card:hover::before {
    opacity: 1;
}

.match-card .match-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.match-card .match-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.match-card .team {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.match-card .team.away {
    flex-direction: row-reverse;
    text-align: right;
}

.match-card .team-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg);
    border: 3px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.match-card:hover .team-logo {
    border-color: var(--primary);
    transform: scale(1.05);
}

.match-card .team-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.match-card .team-ranking {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.match-card .score-box {
    text-align: center;
    min-width: 120px;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius);
    color: white;
}

.match-card .score {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    letter-spacing: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.match-card .score .separator {
    margin: 0 4px;
    color: var(--accent);
}

.match-card .status {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-upcoming { 
    background: linear-gradient(135deg, #3b82f6, #2563eb); 
    color: white; 
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.status-live { 
    background: linear-gradient(135deg, #ef4444, #dc2626); 
    color: white; 
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.status-finished { 
    background: linear-gradient(135deg, #6b7280, #4b5563); 
    color: white; 
}

.match-card .half-score {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 4px;
}

.match-card .group-tag {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-weight: 500;
}

/* ---- Loading ---- */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading .spinner {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.02);
    }
}

/* ---- Detail Page ---- */
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.detail-back:hover { 
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateX(-4px);
}

.detail-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg) 100%);
}

.detail-header .match-time {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.detail-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin: 24px 0;
}

.detail-team {
    text-align: center;
    min-width: 160px;
}

.detail-team img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg);
    padding: 6px;
    margin-bottom: 12px;
    border: 3px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.detail-team img:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.detail-team .name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.detail-team .ranking {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-score {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 8px;
    text-shadow: 0 4px 8px rgba(15, 76, 58, 0.2);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-half {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
}

/* ---- Tab System ---- */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 3px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
}

.tab-btn {
    padding: 14px 28px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    transition: var(--transition);
    font-family: inherit;
}

.tab-btn:hover { 
    color: var(--text);
    background: var(--bg);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg);
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 24px;
    background: var(--bg-card);
    border-radius: 0 0 var(--radius) var(--radius);
    border: 1px solid var(--border);
    border-top: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

/* ---- Stats ---- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 100px 1fr;
    gap: 12px;
    align-items: center;
}

.stats-row {
    display: contents;
}

.stats-row .stat-label {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.stats-row .stat-bar {
    position: relative;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.stats-row .stat-bar .fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-row .stat-value {
    font-weight: 600;
    font-size: 1rem;
    padding: 8px;
}

.stats-row .home-val { 
    text-align: right; 
    color: var(--primary);
}

.stats-row .away-val { 
    text-align: left; 
    color: var(--lose);
}

.stat-bar .fill.home { 
    background: linear-gradient(90deg, var(--primary), var(--primary-light)); 
    float: right; 
}

.stat-bar .fill.away { 
    background: linear-gradient(90deg, var(--lose), #f87171); 
    float: left; 
}

/* ---- Table ---- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 14px 12px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    background: var(--bg-card);
    transition: var(--transition);
}

.data-table tr:hover td {
    background: var(--bg-card-hover);
}

.data-table .result-win { 
    color: var(--win); 
    font-weight: 700; 
    background: rgba(16, 185, 129, 0.1) !important;
}

.data-table .result-draw { 
    color: var(--draw); 
    font-weight: 700; 
    background: rgba(245, 158, 11, 0.1) !important;
}

.data-table .result-lose { 
    color: var(--lose); 
    font-weight: 700; 
    background: rgba(239, 68, 68, 0.1) !important;
}

/* ---- Weather ---- */
.weather-box {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.weather-item {
    text-align: center;
    padding: 20px 28px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    min-width: 140px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.weather-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.weather-item .icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    display: block;
}

.weather-item .label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.weather-item .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

/* ---- Standings Table ---- */
.standings-group {
    margin-bottom: 28px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.standings-group h3 {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.standings-group h3::before {
    content: '⚽';
    font-size: 1.2rem;
}

/* ---- Handicap ---- */
.handicap-section {
    margin-bottom: 24px;
}

.handicap-section h4 {
    color: var(--text);
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.handicap-section h4::before {
    content: '📊';
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 12px 28px;
    border-radius: var(--radius-xl);
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--accent);
}

.toast.show { 
    opacity: 1; 
    transform: translateX(-50%) translateY(-10px);
}

/* ---- Empty ---- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* ---- Footer ---- */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    background: var(--bg-card);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .header h1 { 
        font-size: 1.5rem; 
        letter-spacing: 1px;
    }
    
    .header .subtitle {
        font-size: 0.8rem;
    }
    
    .nav-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .container { 
        padding: 16px; 
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar select,
    .filter-bar input {
        width: 100%;
    }
    
    .match-card .score { 
        font-size: 1.6rem; 
    }
    
    .match-card .score-box {
        min-width: 100px;
        padding: 8px;
    }
    
    .match-card .team-logo {
        width: 40px;
        height: 40px;
    }
    
    .detail-score { 
        font-size: 3rem; 
        letter-spacing: 4px;
    }
    
    .detail-teams { 
        gap: 20px; 
        flex-direction: column;
    }
    
    .detail-team img { 
        width: 64px; 
        height: 64px; 
    }
    
    .detail-team .name {
        font-size: 1.2rem;
    }
    
    .stats-grid { 
        grid-template-columns: 1fr 80px 1fr; 
        gap: 8px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        flex: 1;
        min-width: 100px;
    }
    
    .weather-box {
        gap: 10px;
    }
    
    .weather-item {
        min-width: 120px;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 16px 0;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .match-card {
        padding: 16px;
    }
    
    .match-card .match-info {
        gap: 12px;
    }
    
    .match-card .team-name {
        font-size: 0.95rem;
    }
    
    .detail-header {
        padding: 20px;
    }
    
    .detail-teams {
        gap: 16px;
    }
    
    .detail-score {
        font-size: 2.5rem;
    }
}