﻿ :root {
     --bg-page: #f8f9fc;
     --bg-card: #ffffff;
     --bg-card-hover: #f0f2f5;
     --bg-header: #ffffff;
     --bg-secondary: #f0f2f5;
     --text-primary: #1a1a2e;
     --text-secondary: #6a6a80;
     --text-muted: #9a9ab0;
     --accent-blue: #4a7dff;
     --accent-cyan: #0ea5e9;
     --accent-purple: #8b5cf6;
     --accent-green: #10b981;
     --accent-orange: #f59e0b;
     --accent-red: #ef4444;
     --accent-pink: #ec4899;
     --gold: #ffd700;
     --gold-bg: #fff8e1;
     --silver: #9e9e9e;
     --silver-bg: #f5f5f5;
     --bronze: #cd7f32;
     --bronze-bg: #fff3e0;
     --border-card: #e8eaee;
     --border-subtle: #eef0f4;
     --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
     --shadow-card: 0 2px 12px rgba(0,0,0,0.06);
     --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
     --radius-sm: 8px;
     --radius-md: 12px;
     --radius-lg: 16px;
     --radius-xl: 20px;
     --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
     --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
     --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
 }
 
 *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
 
 html { scroll-behavior: smooth; }
 
 body {
     font-family: var(--font-sans);
     background: var(--bg-page);
     color: var(--text-primary);
     min-height: 100vh;
     line-height: 1.6;
 }
 
 /* ===== 头部 ===== */
 .header {
     background: var(--bg-header);
     border-bottom: 1px solid var(--border-card);
     padding: 28px 24px 20px;
     text-align: center;
     position: sticky;
     top: 0;
     z-index: 100;
     box-shadow: var(--shadow-sm);
 }
 .header h1 { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; }
 .header p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 2px; }
 
 .header-actions {
     position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
     display: flex; gap: 8px;
 }
 .header-actions a {
     color: var(--text-muted); text-decoration: none; font-size: 0.82rem;
     padding: 6px 14px; border: 1px solid var(--border-card);
     border-radius: var(--radius-sm); transition: var(--transition); background: var(--bg-card);
 }
 .header-actions a:hover { color: var(--accent-blue); border-color: var(--accent-blue); box-shadow: 0 2px 8px rgba(74,125,255,0.12); }
 
 /* ===== 统计概览 ===== */
 .stats-bar {
     display: flex; justify-content: center; gap: 32px;
     padding: 14px 24px; background: var(--bg-card);
     border-bottom: 1px solid var(--border-card); flex-wrap: wrap; box-shadow: var(--shadow-sm);
 }
 .stat-item { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 0.82rem; }
 .stat-item .stat-value { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
 
 /* ===== 容器 ===== */
 .container { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
 
 /* ===== Tab 切换 ===== */
 .tab-bar {
     display: flex; justify-content: center; gap: 2px; margin-bottom: 24px;
     background: var(--bg-secondary); border-radius: var(--radius-md); padding: 3px;
     max-width: 420px; margin-left: auto; margin-right: auto; border: 1px solid var(--border-subtle);
 }
 .tab-btn {
     flex: 1; padding: 10px 20px; border: none; background: transparent;
     color: var(--text-secondary); font-size: 0.88rem; font-weight: 500;
     border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition);
     font-family: var(--font-sans);
 }
 .tab-btn:hover { color: var(--text-primary); background: rgba(0,0,0,0.03); }
 .tab-btn.active {
     background: var(--bg-card); color: var(--accent-blue);
     box-shadow: 0 1px 4px rgba(0,0,0,0.08); font-weight: 600;
 }
 
 /* ===== 排行榜面板 ===== */
 .leaderboard-panel { display: none; animation: fadeIn 0.3s ease; }
 .leaderboard-panel.active { display: block; }
 @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
 
 .rank-list { display: flex; flex-direction: column; gap: 6px; }
 
 /* ===== 排名条目 ===== */
 .rank-item {
     display: flex; align-items: center; gap: 14px;
     padding: 13px 18px; background: var(--bg-card);
     border: 1px solid var(--border-card); border-radius: var(--radius-md);
     transition: var(--transition); box-shadow: var(--shadow-sm);
 }
 .rank-item:hover { background: var(--bg-card-hover); border-color: #d0d4dc; box-shadow: var(--shadow-card); }
 
 .rank-item.top-1 {
     border-left: 4px solid var(--gold);
     background: linear-gradient(to right, var(--gold-bg), var(--bg-card) 60%);
 }
 .rank-item.top-1:hover { background: linear-gradient(to right, #fff3cc, var(--bg-card-hover) 60%); }
 .rank-item.top-2 {
     border-left: 4px solid var(--silver);
     background: linear-gradient(to right, var(--silver-bg), var(--bg-card) 60%);
 }
 .rank-item.top-2:hover { background: linear-gradient(to right, #ececec, var(--bg-card-hover) 60%); }
 .rank-item.top-3 {
     border-left: 4px solid var(--bronze);
     background: linear-gradient(to right, var(--bronze-bg), var(--bg-card) 60%);
 }
 .rank-item.top-3:hover { background: linear-gradient(to right, #ffe8cc, var(--bg-card-hover) 60%); }
 
 .rank-item.top-1 .rank-name { color: #b8860b; }
 .rank-item.top-2 .rank-name { color: #616161; }
 .rank-item.top-3 .rank-name { color: #8d5520; }
 
 /* ===== 名称区域 ===== */
 .rank-info {
     flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
 }
 .rank-name {
     font-size: 0.95rem; font-weight: 600; color: var(--text-primary);
     white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
 }
 .rank-sub { font-size: 0.78rem; color: var(--text-muted); }
 
 /* ===== 徽章图片 ===== */
 .badge-img {
     width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
     flex-shrink: 0; border: 2px solid var(--border-card);
     transition: var(--transition); display: inline-block; vertical-align: middle;
 }
 .badge-img:hover { border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(74,125,255,0.15); }
 .badge-img-missing { opacity: 0.6; border: 2px dashed #d0d4dc; }
 
 /* ===== 积分 ===== */
 .rank-points {
     font-size: 1rem; font-weight: 700; color: var(--accent-blue);
     font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0;
 }
 .rank-points::after { content: ' 能量'; font-size: 0.65rem; font-weight: 400; color: var(--text-muted); margin-left: 1px; }
 .rank-item.top-1 .rank-points { color: #b8860b; }
 .rank-item.top-2 .rank-points { color: #757575; }
 .rank-item.top-3 .rank-points { color: #cd7f32; }
 
 /* ===== 空状态 ===== */
 .empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
 .empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
 .empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }
 .empty-state p { font-size: 0.88rem; }
 
 /* ===== 页脚 ===== */
 .footer { text-align: center; padding: 20px; color: var(--text-muted); font-size: 0.78rem; border-top: 1px solid var(--border-subtle); margin-top: 40px; }
 
 /* ===== 加载动画 ===== */
 .rank-item { animation: slideIn 0.35s ease backwards; }
 @keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
 .rank-item:nth-child(1) { animation-delay: 0.00s; }
 .rank-item:nth-child(2) { animation-delay: 0.03s; }
 .rank-item:nth-child(3) { animation-delay: 0.06s; }
 .rank-item:nth-child(4) { animation-delay: 0.09s; }
 .rank-item:nth-child(5) { animation-delay: 0.12s; }
 .rank-item:nth-child(6) { animation-delay: 0.15s; }
 .rank-item:nth-child(7) { animation-delay: 0.18s; }
 .rank-item:nth-child(8) { animation-delay: 0.21s; }
 .rank-item:nth-child(9) { animation-delay: 0.24s; }
 .rank-item:nth-child(10) { animation-delay: 0.27s; }
 
 
/* ===== 排名奖牌 ===== */
.rank-medal {
    flex-shrink: 0;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.medal-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    position: relative;
    transition: transform 0.2s ease;
}
.rank-item:hover .medal-circle {
    transform: scale(1.08);
}
.medal-gold {
    background: linear-gradient(135deg, #ffd700 0%, #f5a623 100%);
    color: #7c5300;
    box-shadow: 0 2px 8px rgba(255,215,0,0.35);
}
.medal-gold::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 6px;
    width: 10px;
    height: 4px;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
}
.medal-silver {
    background: linear-gradient(135deg, #e8e8e8 0%, #b0b0b0 100%);
    color: #555;
    box-shadow: 0 2px 8px rgba(192,192,192,0.3);
}
.medal-silver::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 6px;
    width: 10px;
    height: 4px;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
}
.medal-bronze {
    background: linear-gradient(135deg, #e8a06a 0%, #cd7f32 100%);
    color: #4a2800;
    box-shadow: 0 2px 8px rgba(205,127,50,0.3);
}
.medal-bronze::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 6px;
    width: 10px;
    height: 4px;
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
}
.rank-num {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    width: 28px;
    text-align: center;
}
/* ===== 响应式 ===== */
 @media (max-width: 768px) {
     .header { padding: 18px 16px 14px; }
     .header h1 { font-size: 1.35rem; }
     .header-actions { position: static; transform: none; justify-content: center; margin-top: 10px; }
     .container { padding: 14px 10px; }
     .rank-item { padding: 11px 13px; gap: 10px; }
     .rank-name { font-size: 0.88rem; }
     .rank-points { font-size: 0.88rem; }
     .badge-img { width: 28px; height: 28px; }
     .stats-bar { gap: 14px; padding: 10px 14px; }
     .tab-bar { max-width: 100%; margin-left: 10px; margin-right: 10px; }
 }
 @media (max-width: 480px) {
     .header h1 { font-size: 1.1rem; }
     .rank-item { padding: 10px 11px; gap: 8px; }
     .rank-points { font-size: 0.8rem; }
     .stat-item { font-size: 0.75rem; }
     .badge-img { width: 24px; height: 24px; }
 }
