/* ============================================================
   style.css - 田径赛事展示系统 完整美化版
   ============================================================ */

/* ============================================================
   1. CSS Variables - 主题色彩
   ============================================================ */
:root {
    /* 主色调 - 田径赛道红/蓝 */
    --primary: #e11d48;
    --primary-dark: #be123c;
    --primary-light: #fb7185;
    --primary-gradient: linear-gradient(135deg, #e11d48, #7c3aed);
    --secondary: #7c3aed;
    --secondary-light: #a78bfa;
    
    /* 赛道绿 */
    --track-green: #22c55e;
    --track-green-light: #86efac;
    
    /* 中性色 */
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* 边框和阴影 */
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 40px rgba(225, 29, 72, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    
    /* 状态颜色 */
    --gold: #f59e0b;
    --silver: #94a3b8;
    --bronze: #d97706;
    
    /* 过渡 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   2. 全局重置
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow-x: hidden;
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    padding-bottom: 80px;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   3. 滚动条美化
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ============================================================
   4. 顶部导航
   ============================================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    height: 56px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

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

.app-header h1 {
    font-size: 18px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.back-btn,
.refresh-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover,
.refresh-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
}

.back-btn {
    display: none;
}

/* ============================================================
   5. 底部导航
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 env(safe-area-inset-bottom, 8px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-family: inherit;
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 2px;
    transition: var(--transition);
}

.nav-item span {
    font-size: 10px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 0 0 4px 4px;
}

.nav-item:hover {
    color: var(--primary);
}

/* ============================================================
   6. 页面容器
   ============================================================ */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 16px 20px;
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   7. 卡片组件
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* ============================================================
   8. 赛事卡片
   ============================================================ */
.event-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 0 4px 4px 0;
}

.event-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.event-card .title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-card .meta {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.event-card .meta i {
    width: 16px;
    color: var(--primary-light);
}

.event-card .tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ============================================================
   9. 状态标签
   ============================================================ */
.tag {
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.tag-primary {
    background: #fef3c7;
    color: #92400e;
}

.tag-success {
    background: #dbeafe;
    color: #1e40af;
}

.tag-danger {
    background: #fee2e2;
    color: #991b1b;
}

.tag-gray {
    background: #f1f5f9;
    color: #475569;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-0 { background: #fef3c7; color: #92400e; }
.status-1 { background: #dbeafe; color: #1e40af; }
.status-2 { background: #d1d5db; color: #374151; }

/* 赛事列表状态标签 - 玻璃浅灰度背景 */
/* 状态徽章 */
/* 注意：不可使用 backdrop-filter —— 与 sticky 吸顶组合会触发 Chromium 合成器
   间歇性渲染故障（内容空白/闪烁），图层随数据量增大后必现 */
.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.status-tag.status-pending {
    background: rgba(254, 243, 199, 0.6);
    color: #92400e;
}

.status-tag.status-active {
    background: rgba(219, 234, 254, 0.6);
    color: #1e40af;
}

.status-tag.status-ended {
    background: rgba(209, 213, 219, 0.5);
    color: #374151;
}

.status-tag.status-unknown {
    background: rgba(241, 245, 249, 0.6);
    color: #475569;
}

/* ============================================================
   10. 赛程列表
   ============================================================ */
.session-group {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.session-header {
    padding: 14px 18px;
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.session-header .count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 12px;
    border-radius: 12px;
}

.discipline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.discipline-item:last-child {
    border-bottom: none;
}

.discipline-item:hover {
    background: var(--bg);
    padding-left: 22px;
}

.discipline-item .info .name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.discipline-item .info .sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.discipline-item .right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.discipline-item .right .time {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================================
   11. 成绩页面
   ============================================================ */
.result-header {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.result-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.result-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 成绩表格 */
.result-table-wrap {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.result-table thead {
    background: var(--bg);
}

.result-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.result-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.result-table tbody tr:last-child td {
    border-bottom: none;
}

.result-table tbody tr:hover {
    background: var(--bg);
}

/* PB/SB 徽章 */
.badge-pb {
    background: #dbeafe;
    color: #2563eb;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 4px;
}

.badge-sb {
    background: #dcfce7;
    color: #15803d;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 4px;
}

/* ============================================================
   12. 奖牌榜
   ============================================================ */
.rank-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.rank-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}

.rank-item .r-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
    background: var(--bg);
    flex-shrink: 0;
}

.rank-item .r-num.top1 {
    background: linear-gradient(135deg, #fef3c7, #f59e0b);
    color: #92400e;
}

.rank-item .r-num.top2 {
    background: linear-gradient(135deg, #f1f5f9, #94a3b8);
    color: #475569;
}

.rank-item .r-num.top3 {
    background: linear-gradient(135deg, #fef3c7, #d97706);
    color: #78350f;
}

.rank-item .r-team {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    padding: 0 14px;
    color: var(--text-primary);
}

.rank-item .r-medals {
    display: flex;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
}

.rank-item .r-medals .g { color: var(--gold); }
.rank-item .r-medals .s { color: var(--silver); }
.rank-item .r-medals .b { color: var(--bronze); }

/* ============================================================
   13. 空状态
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    opacity: 0.3;
    display: block;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
    font-weight: 500;
}

/* ============================================================
   14. 加载遮罩
   ============================================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* ============================================================
   15. 滤镜按钮
   ============================================================ */
.filter-bar {
    display: flex;
    gap: 6px;
    padding: 4px 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
}

.filter-btn {
    padding: 6px 18px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary-gradient);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(225, 29, 72, 0.3);
}

/* ============================================================
   16. 响应式
   ============================================================ */
@media (max-width: 480px) {
    .app-header h1 {
        font-size: 16px;
    }
    
    .event-card .title {
        font-size: 15px;
    }
    
    .event-card .meta {
        font-size: 13px;
        gap: 8px 14px;
    }
    
    .result-header-title {
        font-size: 16px;
    }
    
    .rank-item {
        padding: 10px 12px;
    }
    
    .rank-item .r-team {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .rank-item .r-medals {
        font-size: 12px;
        gap: 8px;
    }
    
    .result-table {
        font-size: 13px;
    }
    
    .result-table th,
    .result-table td {
        padding: 8px 10px;
    }
}

/* ============================================================
   17. 筛选标签（赛程页）
   ============================================================ */
.filter-tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg);
    color: var(--text-secondary);
    margin-right: 6px;
    margin-bottom: 4px;
}

.filter-tag.active {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   18. 分组按钮（成绩页）
   ============================================================ */
.group-btn {
    padding: 4px 14px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    flex-shrink: 0;
}

.group-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.group-btn.active {
    background: var(--primary-gradient);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 12px rgba(225, 29, 72, 0.3);
}

/* ============================================================
   19. 标签页（成绩页）
   ============================================================ */
.result-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.result-tab {
    padding: 7px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
}

.result-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.4);
}

.result-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.result-tab i {
    margin-right: 4px;
}

/* ============================================================
   玻璃态状态标签
   ============================================================ */
/* ============================================================
   玻璃态状态标签（优化版）
   ============================================================ */

/* 大号玻璃态标签（用于赛事详情页头部） */
.status-tag.status-ended-glass {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.status-tag.status-ended-glass .status-icon {
    font-size: 14px;
}

/* ✅ 小号玻璃态标签（用于项目列表）- 字体放大到14px */
.status-tag.status-ended-glass-sm {
    display: inline-flex;
    align-items: center;
    padding: 3px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

/* 玻璃态标签悬停效果 */
.status-tag.status-ended-glass:hover,
.status-tag.status-ended-glass-sm:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ============================================================
   20. 奖牌总榜页面
   ============================================================ */
.medals-summary-card {
    background: linear-gradient(135deg, #fff 0%, #fef3f2 100%);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(225, 29, 72, 0.08);
    position: relative;
    overflow: hidden;
}

.medals-summary-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 100px;
    height: 100px;
    background: var(--primary-gradient);
    opacity: 0.08;
    border-radius: 50%;
}

.medals-summary-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.medals-summary-title i {
    color: var(--primary);
}

.medals-stats {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.medals-stat {
    text-align: center;
    flex: 1;
}

.medals-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.medals-icon.gold {
    background: linear-gradient(135deg, #fef3c7, #fbbf24);
    color: #92400e;
}

.medals-icon.silver {
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
    color: #475569;
}

.medals-icon.bronze {
    background: linear-gradient(135deg, #fef3c7, #f59e0b);
    color: #78350f;
}

.medals-icon.team {
    background: linear-gradient(135deg, #fef3c7, #e11d48);
    color: white;
}

.medals-count {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.medals-count.gold { color: var(--gold); }
.medals-count.silver { color: var(--silver); }
.medals-count.bronze { color: var(--bronze); }

.medals-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

.medals-rank-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
}

.medals-header-rank {
    width: 38px;
    flex-shrink: 0;
    text-align: center;
}

.medals-header-team {
    flex: 1;
    min-width: 0;
}

.medals-header-counts {
    display: flex;
    gap: 8px;
}

.medals-header-badge {
    width: 36px;
    height: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.medals-header-badge.gold {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.medals-header-badge.silver {
    background: rgba(148, 163, 184, 0.18);
    color: #475569;
}

.medals-header-badge.bronze {
    background: rgba(217, 119, 6, 0.12);
    color: #92400e;
}

.medals-header-badge.total {
    background: rgba(124, 58, 237, 0.12);
    color: #5b21b6;
    width: 44px;
}

.medals-rank-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.medals-rank-item {
    background: white;
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.medals-rank-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.medals-rank-item.top-1 {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.medals-rank-item.top-2 {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: rgba(148, 163, 184, 0.3);
}

.medals-rank-item.top-3 {
    background: linear-gradient(135deg, #fffbeb 0%, #fed7aa 100%);
    border-color: rgba(217, 119, 6, 0.3);
}

.medals-rank-num {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: var(--text-muted);
    background: var(--bg);
    flex-shrink: 0;
}

.medals-rank-item.top-1 .medals-rank-num {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    font-size: 18px;
}

.medals-rank-item.top-2 .medals-rank-num {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    color: white;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.4);
    font-size: 16px;
}

.medals-rank-item.top-3 .medals-rank-num {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
    font-size: 16px;
}

.medals-team-info {
    flex: 1;
    min-width: 0;
}

.medals-team-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.medals-team-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.medals-counts {
    display: flex;
    gap: 8px;
}

.medals-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.medals-badge.gold {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.medals-badge.silver {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
}

.medals-badge.bronze {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    color: #78350f;
}

.medals-badge.total {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #5b21b6;
    width: 44px;
}

.medals-total-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.medals-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.medals-section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.medals-notes {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
    padding: 0 4px;
}

/* ============================================================
   21. 单位总分页面
   ============================================================ */
.score-summary-card {
    background: linear-gradient(135deg, #fff 0%, #f5f3ff 100%);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(124, 58, 237, 0.08);
    position: relative;
    overflow: hidden;
}

.score-summary-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #7c3aed, #e11d48);
    opacity: 0.08;
    border-radius: 50%;
}

.score-summary-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-summary-title i {
    color: var(--secondary);
}

.score-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.score-stat-item {
    background: white;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border);
}

.score-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.score-stat-value.purple {
    color: var(--secondary);
}

.score-stat-value.orange {
    color: #f97316;
}

.score-stat-value.green {
    color: #22c55e;
}

.score-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.score-list-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.score-header-rank {
    width: 42px;
    flex-shrink: 0;
    text-align: center;
}

.score-header-team {
    flex: 1;
    min-width: 0;
}

.score-header-total {
    width: 80px;
    text-align: right;
}

.score-rank-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.score-rank-item {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.score-rank-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.score-rank-item.top-1 {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.score-rank-item.top-2 {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: rgba(148, 163, 184, 0.3);
}

.score-rank-item.top-3 {
    background: linear-gradient(135deg, #fffbeb 0%, #fed7aa 100%);
    border-color: rgba(217, 119, 6, 0.3);
}

.score-rank-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.score-rank-num {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: var(--text-muted);
    background: var(--bg);
    flex-shrink: 0;
}

.score-rank-item.top-1 .score-rank-num {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    font-size: 20px;
}

.score-rank-item.top-2 .score-rank-num {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    color: white;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.4);
    font-size: 18px;
}

.score-rank-item.top-3 .score-rank-num {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
    font-size: 18px;
}

.score-team-info {
    flex: 1;
    min-width: 0;
}

.score-team-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.score-team-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.score-display {
    text-align: right;
}

.score-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

.score-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    font-weight: 500;
}

.score-progress-section {
    margin-top: 12px;
}

.score-progress-bar-container {
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.score-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.score-rank-item.top-1 .score-progress-bar {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.score-rank-item.top-2 .score-progress-bar {
    background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}

.score-rank-item.top-3 .score-progress-bar {
    background: linear-gradient(90deg, #d97706, #f59e0b);
}

.score-rank-item:not(.top-1):not(.top-2):not(.top-3) .score-progress-bar {
    background: var(--primary-gradient);
}

.score-progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.score-breakdown {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.score-breakdown-item {
    flex: 1;
    text-align: center;
}

.score-breakdown-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}

.score-breakdown-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.score-rules-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.score-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.score-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.score-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.score-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.score-legend-dot.gold { background: var(--gold); }
.score-legend-dot.silver { background: var(--silver); }
.score-legend-dot.bronze { background: var(--bronze); }

.score-notes {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
    padding: 0 4px;
}

/* ============================================================
   22. 响应式 - 奖牌榜和总分榜
   ============================================================ */
@media (max-width: 480px) {
    .medals-stats {
        gap: 6px;
    }

    .medals-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .medals-count {
        font-size: 18px;
    }

    .medals-rank-item {
        padding: 12px 14px;
        gap: 10px;
    }

    .medals-team-name {
        font-size: 14px;
    }

    .medals-header-badge {
        width: 32px;
    }

    .medals-badge {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .score-stats-grid {
        gap: 8px;
    }

    .score-stat-value {
        font-size: 20px;
    }

    .score-rank-item {
        padding: 14px;
    }

    .score-team-name {
        font-size: 14px;
    }

    .score-value {
        font-size: 22px;
    }
}

/* ============================================================
   赛事日历卡片：隐藏横向滚动条
   ============================================================ */
.event-date-strip ::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}