* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --success: #34a853;
    --danger: #ea4335;
    --warning: #fbbc04;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 72px;
    padding-bottom: 80px;
}

a { text-decoration: none; color: var(--primary); }
button { cursor: pointer; font-family: inherit; }

.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }

.loader {
    width: 48px; height: 48px;
    border: 4px solid var(--bg-secondary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--bg-primary);
    border-bottom: 1px solid #e8eaed;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
}

.nav-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 20px;
    color: var(--text-primary);
}
.nav-brand .logo { font-size: 28px; }
.nav-brand .brand-text {
    background: linear-gradient(135deg, var(--primary), #4285f4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    text-decoration: none;
    cursor: pointer;
}
.nav-link:hover { background: var(--bg-secondary); color: var(--text-primary); }
.nav-link.active { background: var(--primary-light); color: var(--primary); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-btn, .auth-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}
.lang-btn { background: var(--bg-secondary); color: var(--text-secondary); }
.lang-btn:hover { background: #e8eaed; }
.auth-btn { background: var(--primary); color: #fff; }
.auth-btn:hover { background: var(--primary-dark); }
.auth-btn.logged-in { background: var(--success); }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--bg-primary);
    border-top: 1px solid #e8eaed;
    padding: 8px 0 env(safe-area-inset-bottom, 8px);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.bottom-nav-item .icon { font-size: 22px; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 30%; right: 30%;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}

.page {
    display: block;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 28px; font-weight: 800; color: var(--text-primary); }
.page-header p { color: var(--text-secondary); font-size: 16px; margin-top: 4px; }

.card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8eaed;
}
.card-title { font-weight: 700; font-size: 16px; }

.match-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}
.match-card:hover { box-shadow: var(--shadow-hover); }

.match-status {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 8px;
}
.match-status.live { background: #fce8e6; color: var(--danger); animation: pulse 1.5s ease-in-out infinite; }
.match-status.upcoming { background: #e8f0fe; color: var(--primary); }
.match-status.ended { background: #e8eaed; color: var(--text-secondary); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 0;
}
.match-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 80px;
}
.match-team .team-name { font-weight: 600; font-size: 14px; text-align: center; }
.match-score { font-size: 28px; font-weight: 800; color: var(--text-primary); }

.match-odds {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 12px 0;
    border-top: 1px solid #e8eaed;
    margin-top: 8px;
}
.match-odds .odd-item { text-align: center; }
.match-odds .odd-item .odd-label { font-size: 11px; color: var(--text-secondary); }
.match-odds .odd-item .odd-value { font-size: 18px; font-weight: 700; color: var(--text-primary); }

.match-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #2d9248; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d33426; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--text-secondary); }

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8eaed;
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
    background: #fff;
}
.form-control:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px rgba(26,115,232,0.1); }
.form-control.error { border-color: var(--danger); }

.badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: #e6f4ea; color: var(--success); }
.badge-danger { background: #fce8e6; color: var(--danger); }
.badge-warning { background: #fef7e0; color: #e37400; }
.badge-info { background: #e8f0fe; color: var(--primary); }

.balance-display {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: var(--radius);
    color: #fff;
}
.balance-display .amount { font-size: 48px; font-weight: 800; }
.balance-display .label { font-size: 14px; opacity: 0.7; }

.modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-close { float: right; background: none; border: none; font-size: 24px; color: var(--text-secondary); cursor: pointer; }
.modal-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; }

.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.hidden-mobile { display: block; }
.hidden-desktop { display: none; }

@media (max-width: 768px) {
    body { padding-top: 64px; padding-bottom: 72px; }
    .navbar { height: 64px; padding: 0 16px; }
    .nav-brand .brand-text { font-size: 16px; }
    .nav-menu { display: none; position: fixed; top: 64px; left: 0; right: 0; background: var(--bg-primary); flex-direction: column; padding: 16px; border-bottom: 1px solid #e8eaed; }
    .nav-menu.open { display: flex; }
    .nav-link { padding: 12px 16px; width: 100%; }
    .mobile-menu-btn { display: block; }
    .bottom-nav { display: flex; }
    .hidden-mobile { display: none; }
    .hidden-desktop { display: block; }
    .page { padding: 16px; }
    .page-header h1 { font-size: 22px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .match-teams { flex-direction: column; gap: 8px; }
    .match-team { flex-direction: row; gap: 8px; min-width: auto; }
    .match-score { font-size: 24px; padding: 8px 0; }
    .match-odds { gap: 16px; flex-wrap: wrap; }
    .balance-display .amount { font-size: 36px; }
    .modal { padding: 20px; margin: 10px; }
}

/* ============ 比赛卡片新样式 ============ */
.match-card-new {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s;
}
.match-card-new:hover {
    transform: translateY(-2px);
}
.match-card-new .bg-pattern {
    position: absolute;
    right: -50px;
    top: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}
.match-card-new .match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 12px;
}
.match-card-new .match-header .status {
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.match-card-new .match-header .status.live {
    background: #ea4335;
    color: #fff;
    animation: pulse 1.5s ease-in-out infinite;
}
.match-card-new .match-header .status.upcoming {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.match-card-new .match-header .status.ended {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
}
.match-card-new .match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}
.match-card-new .match-team {
    display: flex;
    align-items: center;
    gap: 12px;
}
.match-card-new .match-team .flag {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.match-card-new .match-team .name {
    font-size: 16px;
    font-weight: 600;
}
.match-card-new .match-score {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    padding: 0 16px;
}
.match-card-new .match-score.vs {
    font-size: 18px;
    color: rgba(255,255,255,0.4);
}
.match-card-new .match-odds-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 12px 0 4px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 12px;
}
.match-card-new .match-odds-row .odd-item {
    text-align: center;
}
.match-card-new .match-odds-row .odd-item .odd-label {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}
.match-card-new .match-odds-row .odd-item .odd-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
