/* ============================================================
   篮球比赛管理系统 - 前台样式（移动端优先，亮色主题）
   ============================================================ */

:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fff7ed;
    --navy: #1a2b4a;
    --navy-dark: #12203a;
    --bg: #f4f6fa;
    --card: #ffffff;
    --text: #2d3748;
    --text-light: #8a94a6;
    --border: #e8ecf3;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(20, 35, 66, .06);
    --shadow-lg: 0 8px 24px rgba(20, 35, 66, .1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部导航 ---------- */
.site-header {
    background: var(--navy);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-inner {
    display: flex;
    align-items: center;
    height: 56px;
    gap: 12px;
}

.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.logo-icon { font-size: 22px; }

.main-nav {
    display: none;
    gap: 4px;
    flex: 1;
    margin-left: 16px;
}
.main-nav a {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, .75);
    transition: all .2s;
}
.main-nav a:hover, .main-nav a.active { color: #fff; background: rgba(255, 255, 255, .12); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.user-chip { display: flex; align-items: center; gap: 6px; }
.avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: #fff;
}
.user-name { font-size: 13px; display: none; }

/* 汉堡菜单 */
.nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 36px; height: 36px; background: none; border: none; cursor: pointer; padding: 6px;
}
.nav-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 移动端展开导航 */
.main-nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--navy-dark);
    padding: 8px 16px 16px;
    gap: 2px;
    box-shadow: var(--shadow-lg);
}
.main-nav.mobile-open a { padding: 12px 14px; font-size: 15px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 14px; font-weight: 500;
    border: none; cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-outline-light { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn-outline-light:hover { background: rgba(255,255,255,.22); }
.btn-ghost { background: transparent; color: var(--text-light); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- 英雄区 ---------- */
.site-main { min-height: calc(100vh - 140px); padding: 20px 0 48px; }

.hero {
    background: linear-gradient(135deg, var(--navy) 0%, #2b4a7a 60%, #c2410c 130%);
    border-radius: var(--radius);
    padding: 48px 24px;
    color: #fff;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}
.hero h1 { font-size: 26px; margin-bottom: 8px; }
.hero p { color: rgba(255, 255, 255, .75); margin-bottom: 24px; font-size: 14px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 区块 ---------- */
.section { margin-bottom: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.more-link { font-size: 13px; color: var(--primary); }
.sub-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; padding-left: 10px; border-left: 3px solid var(--primary); }

.live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
    animation: pulse 1.2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .4; transform: scale(.8); }
}

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }

/* ---------- 比赛卡片 ---------- */
.match-list { display: flex; flex-direction: column; gap: 10px; }

.match-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
    border: 1px solid var(--border);
}
.match-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.match-card.live { border-left: 3px solid #ef4444; }
.match-card.finished { border-left: 3px solid var(--success); }

.match-status { text-align: center; margin-bottom: 6px; }

.match-teams, .match-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.team-name { font-weight: 600; flex: 1; text-align: center; font-size: 15px; }
.score, .score-cell .score {
    font-weight: 700; font-size: 18px; color: var(--primary);
    font-variant-numeric: tabular-nums;
}
.vs { color: var(--text-light); font-size: 13px; font-weight: 600; }

.match-meta {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 8px; font-size: 12px; color: var(--text-light); flex-wrap: wrap;
}

/* ---------- 徽章 ---------- */
.badge {
    display: inline-block; padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px; font-weight: 600;
    line-height: 1.6;
}
.badge-secondary { background: #eef1f6; color: #64748b; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-dark { background: #e2e8f0; color: #334155; }
.badge-info { background: #e0f2fe; color: #0284c7; }
.badge-image { background: #e0f2fe; color: #0284c7; }
.badge-video { background: #fae8ff; color: #a21caf; }

/* ---------- 表格 ---------- */
.table-wrap {
    background: var(--card);
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.data-table th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-size: 12px; font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfe; }
.strong { font-weight: 600; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.rank-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: #eef1f6; color: var(--text-light);
    font-size: 12px; font-weight: 700;
}
.rank-1 { background: #fef3c7; color: #d97706; }
.rank-2 { background: #e8ecf3; color: #64748b; }
.rank-3 { background: #fee9e0; color: #c2410c; }

.score-badge {
    display: inline-block; min-width: 30px; text-align: center;
    background: var(--primary); color: #fff;
    border-radius: 6px; padding: 2px 8px; font-weight: 700;
}
.top-row { background: #fffbf5; }

.number-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 26px; height: 26px; border-radius: 6px;
    background: var(--navy); color: #fff;
    font-size: 12px; font-weight: 700;
    padding: 0 4px;
}

/* ---------- 球队卡片 ---------- */
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.team-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px 12px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform .2s;
}
.team-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.team-logo {
    width: 52px; height: 52px; border-radius: 14px;
    margin: 0 auto 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px; font-weight: 700;
}
.team-card-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.team-card-meta { font-size: 12px; color: var(--text-light); }
.team-card-desc {
    font-size: 12px; color: var(--text-light);
    margin-top: 8px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 球队详情页 */
.team-header-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.team-header-inner { display: flex; align-items: center; gap: 16px; }
.team-logo-lg {
    width: 64px; height: 64px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 26px; font-weight: 700; flex-shrink: 0;
}
.team-page-name { font-size: 22px; }
.team-page-meta { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.team-page-desc { font-size: 13px; color: var(--text-light); margin-top: 8px; }
.stats-team-name { font-size: 15px; font-weight: 600; margin-bottom: 8px; padding-left: 10px; border-left: 3px solid var(--primary); }

/* ---------- 比分板 ---------- */
.scoreboard {
    background: linear-gradient(135deg, var(--navy) 0%, #22375e 100%);
    border-radius: var(--radius);
    padding: 24px 16px;
    color: #fff;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}
.scoreboard-status {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 13px; color: rgba(255,255,255,.7); margin-bottom: 18px; flex-wrap: wrap;
}
.scoreboard-main {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sb-team { flex: 1; text-align: center; }
.sb-team-name { font-size: 17px; font-weight: 700; }
.sb-sub { font-size: 12px; color: rgba(255,255,255,.5); margin-top: 4px; }
.sb-score { display: flex; align-items: center; gap: 8px; }
.sb-score span { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sb-colon { color: rgba(255,255,255,.4); font-size: 26px !important; }

.quick-record-bar {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.15);
}
.quick-record-tip { font-size: 13px; color: rgba(255,255,255,.75); }

/* ---------- 复盘 ---------- */
.review-box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    line-height: 1.8;
    white-space: pre-wrap;
    font-size: 14px;
}

/* ---------- 精彩瞬间 ---------- */
.highlight-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.highlight-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.highlight-thumb {
    width: 100%; aspect-ratio: 16/9; object-fit: cover;
    background: var(--navy);
}
.highlight-thumb.video-icon {
    display: flex; align-items: center; justify-content: center;
    font-size: 40px;
}
.highlight-video { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }
.highlight-info { padding: 10px 14px; }
.highlight-title { font-weight: 600; font-size: 14px; }
.highlight-meta { font-size: 12px; color: var(--text-light); margin-top: 3px; }

/* ---------- 筛选栏 ---------- */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 16px;
    background: var(--card);
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.form-control {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    min-width: 130px;
    flex: 1;
}
.form-control:focus { outline: none; border-color: var(--primary); }

/* ---------- 搜索页 ---------- */
.search-hero { margin-bottom: 20px; }
.search-box { display: flex; gap: 8px; }
.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
}
.search-box input:focus { outline: none; border-color: var(--primary); }
.search-scopes { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.radio-chip { cursor: pointer; }
.radio-chip input { display: none; }
.radio-chip span {
    display: inline-block; padding: 5px 14px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 999px; font-size: 13px;
}
.radio-chip input:checked + span {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
.search-summary { font-size: 14px; color: var(--text-light); margin-bottom: 16px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; justify-content: center; margin-top: 20px; flex-wrap: wrap; gap: 4px; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 6px;
    border-radius: 8px;
    font-size: 13px;
    background: var(--card); border: 1px solid var(--border);
    color: var(--text);
}
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.pagination .disabled { color: #cbd5e1; background: #f8fafc; }

/* ---------- 空状态 ---------- */
.empty-tip {
    text-align: center; color: var(--text-light);
    padding: 32px 16px; font-size: 14px;
    background: var(--card); border-radius: var(--radius);
    border: 1px dashed var(--border);
}

/* ---------- 认证页 ---------- */
.auth-body {
    background: linear-gradient(135deg, var(--navy) 0%, #2b4a7a 100%);
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.auth-wrap { width: 100%; max-width: 400px; }
.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 28px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.auth-logo { font-size: 44px; }
.auth-title { font-size: 20px; margin-top: 8px; }
.auth-sub { font-size: 13px; color: var(--text-light); margin-bottom: 24px; }
.auth-form { text-align: left; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.auth-form input {
    width: 100%; padding: 11px 14px;
    border: 1px solid var(--border); border-radius: 10px;
    font-size: 14px;
}
.auth-form input:focus { outline: none; border-color: var(--primary); }
.auth-foot { margin-top: 20px; font-size: 13px; color: var(--text-light); }
.auth-foot a { color: var(--primary); font-weight: 600; }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: 80px 0; }
.error-code { font-size: 72px; font-weight: 800; color: var(--primary); }
.error-msg { color: var(--text-light); margin: 12px 0 24px; }

/* ---------- 页脚 ---------- */
.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,.5);
    text-align: center;
    padding: 20px 0;
    font-size: 12px;
}

/* ---------- 平板 ---------- */
@media (min-width: 640px) {
    .hero h1 { font-size: 32px; }
    .highlight-grid { grid-template-columns: repeat(2, 1fr); }
    .team-grid { grid-template-columns: repeat(3, 1fr); }
    .user-name { display: inline; }
}

/* ---------- 桌面 ---------- */
@media (min-width: 900px) {
    .main-nav { display: flex; }
    .nav-toggle { display: none; }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .highlight-grid { grid-template-columns: repeat(3, 1fr); }
    .team-grid { grid-template-columns: repeat(4, 1fr); }
    .hero { padding: 64px 32px; }
    .hero h1 { font-size: 36px; }
}

/* ===================== 赛程日历视图 ===================== */
.view-toggle { display: flex; gap: 6px; }
.view-btn {
    padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
    background: #fff; border: 1px solid var(--border); color: var(--text-light);
    text-decoration: none; transition: all .2s;
}
.view-btn:hover { border-color: var(--primary); color: var(--primary); }
.view-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.cal-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-nav-btn {
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 8px; background: #fff;
    font-size: 18px; line-height: 1; color: var(--text); text-decoration: none; transition: all .2s;
}
.cal-nav-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cal-month-label { font-size: 18px; font-weight: 700; color: var(--navy); min-width: 110px; text-align: center; }
.cal-month-jumps { display: flex; gap: 6px; margin-left: 10px; }
.cal-jump {
    padding: 4px 10px; border-radius: 6px; font-size: 12px; color: var(--text-light);
    background: #f8fafc; border: 1px solid var(--border); text-decoration: none; transition: all .2s;
}
.cal-jump:hover { color: var(--primary); border-color: var(--primary); }
.cal-jump.current { background: var(--primary-light); color: var(--primary); border-color: var(--primary); font-weight: 600; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head {
    text-align: center; font-size: 13px; font-weight: 600; color: var(--text-light);
    padding: 6px 0; letter-spacing: .05em;
}
.cal-head.cal-weekend { color: var(--danger); }
.cal-cell {
    min-height: 96px; background: #fbfcfe; border: 1px solid var(--border); border-radius: 8px;
    padding: 6px; overflow: hidden; transition: all .15s;
}
.cal-cell.out { background: #f6f7f9; opacity: .5; }
.cal-cell.today { border-color: var(--primary); background: var(--primary-light); }
.cal-day { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cal-day-num { font-size: 13px; font-weight: 600; color: var(--text); }
.cal-cell.today .cal-day-num { color: var(--primary); }
.cal-today-tag {
    font-size: 11px; color: #fff; background: var(--primary);
    padding: 1px 6px; border-radius: 10px; font-weight: 500;
}
.cal-events { display: flex; flex-direction: column; gap: 4px; }
.cal-event {
    display: flex; flex-direction: column; gap: 1px; padding: 5px 7px; border-radius: 6px;
    background: #fff; border: 1px solid var(--border); border-left-width: 3px;
    text-decoration: none; transition: all .15s;
}
.cal-event:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.cal-event.scheduled { border-left-color: #94a3b8; }
.cal-event.live { border-left-color: var(--danger); background: #fef2f2; }
.cal-event.finished { border-left-color: var(--success); background: #f0fdf4; }
.cal-event.postponed, .cal-event.canceled { border-left-color: var(--text-light); opacity: .7; }
.cal-event-time { font-size: 11px; color: var(--text-light); }
.cal-event-title { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event-score { font-size: 11px; color: var(--text-light); font-weight: 600; }
.cal-event.live .cal-event-score { color: var(--danger); }
.cal-event.finished .cal-event-score { color: var(--success); }

.cal-legend { display: flex; gap: 16px; justify-content: flex-end; margin-top: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-light); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-live { background: var(--danger); }
.dot-finished { background: var(--success); }
.dot-scheduled { background: #94a3b8; }

@media (max-width: 768px) {
    .cal-cell { min-height: 64px; padding: 4px; }
    .cal-event-title { font-size: 11px; }
    .cal-event-score { display: none; }
    .cal-month-jumps { margin-left: 0; }
}

/* ===== 教练醒目展示 ===== */
.coach-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fdba74;
    border-left: 5px solid var(--team-color, #f97316);
}
.coach-bar-icon { font-size: 26px; line-height: 1; }
.coach-bar-label {
    font-size: 13px;
    font-weight: 700;
    color: #c2410c;
    letter-spacing: 2px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #ffedd5;
    border: 1px solid #fdba74;
    white-space: nowrap;
}
.coach-bar-names { font-size: 20px; font-weight: 800; color: #7c2d12; }
.team-card-coach { margin-top: 6px; }
.coach-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #c2410c;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 999px;
    padding: 3px 10px;
}
