/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #6366f1;
    --secondary: #ec4899;
    --accent: #22d3ee;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0a0a1a;
    --dark-light: #151530;
    --dark-lighter: #1e1e40;
    --text: #f1f5f9;
    --text-muted: #64748b;
    --gradient: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #22d3ee 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--dark);
    color: var(--text);
    min-height: 100vh;
    overflow: hidden;
}

#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ========== 屏幕切换 ========== */
.screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    animation: screenIn 0.4s ease;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes screenIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* ========== 主菜单 ========== */
.menu-container {
    text-align: center;
    padding: 40px;
}

.game-title {
    font-size: 96px;
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: 16px;
    letter-spacing: -2px;
}

.title-line {
    display: block;
    color: var(--text);
}

.title-line.gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.game-subtitle {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 50px;
    letter-spacing: 4px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 320px;
    margin: 0 auto 40px;
}

.menu-btn {
    padding: 18px 36px;
    background: var(--dark-lighter);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.menu-btn.primary {
    background: var(--gradient);
    border-color: transparent;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
}

.menu-btn.primary:hover {
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.5);
}

.menu-btn.small {
    padding: 10px 24px;
    font-size: 14px;
}

.menu-footer {
    color: var(--text-muted);
    font-size: 14px;
}

/* ========== 信息页面 ========== */
.info-container {
    max-width: 700px;
    width: 90%;
    padding: 40px;
    background: rgba(21, 21, 48, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    max-height: 90vh;
    overflow-y: auto;
}

.info-title {
    font-size: 36px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 30px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.howto-content {
    margin-bottom: 30px;
}

.howto-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 12px;
    background: var(--dark-lighter);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.howto-item:hover {
    transform: translateX(5px);
}

.howto-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.howto-text h4 {
    font-size: 18px;
    margin-bottom: 6px;
    color: var(--primary-light, #a5b4fc);
}

.howto-text p {
    color: var(--text-muted);
    line-height: 1.6;
}

.judge-perfect { color: var(--success); font-weight: 700; }
.judge-great { color: var(--accent); font-weight: 700; }
.judge-good { color: var(--warning); font-weight: 700; }
.judge-miss { color: var(--danger); font-weight: 700; }

/* ========== 天赋测试 ========== */
.talent-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.mini-test {
    padding: 24px;
    background: var(--dark-lighter);
    border-radius: 16px;
    text-align: center;
}

.mini-test h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.mini-test > p {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 14px;
}

.mini-cps {
    background: var(--dark);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.mini-cps:hover {
    border-color: var(--primary);
}

.mini-cps.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

.mini-cps-count {
    font-size: 48px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mini-cps-time {
    color: var(--accent);
    font-size: 18px;
    font-weight: 600;
}

.mini-reaction-box {
    background: var(--dark);
    border-radius: 12px;
    padding: 40px 20px;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    margin-bottom: 16px;
}

.mini-reaction-box.waiting {
    background: var(--warning);
    color: white;
}

.mini-reaction-box.go {
    background: var(--success);
    color: white;
}

.mini-reaction-box.too-early {
    background: var(--danger);
    color: white;
}

.mini-result {
    padding: 12px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    font-weight: 600;
    color: var(--primary-light, #a5b4fc);
}

/* ========== 选歌界面 ========== */
.song-container {
    max-width: 800px;
    width: 90%;
    padding: 30px;
}

.song-list {
    display: grid;
    gap: 16px;
    margin-bottom: 30px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.song-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: var(--dark-light);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.song-card:hover {
    transform: translateX(8px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.song-cover {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.song-info {
    flex: 1;
}

.song-info h3 {
    font-size: 20px;
    margin-bottom: 4px;
}

.song-info p {
    color: var(--text-muted);
    font-size: 14px;
}

.song-difficulty {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.difficulty-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.difficulty-easy { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.difficulty-normal { background: rgba(34, 211, 238, 0.2); color: var(--accent); }
.difficulty-hard { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.difficulty-expert { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.song-bpm {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== 游戏界面 ========== */
#game {
    flex-direction: column;
    padding: 0;
}

.game-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
    z-index: 100;
    background: linear-gradient(180deg, rgba(10, 10, 26, 0.9) 0%, transparent 100%);
}

.hud-left, .hud-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hud-score {
    display: flex;
    flex-direction: column;
}

.hud-label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.hud-value {
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hud-combo {
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.hud-combo.show {
    opacity: 1;
    transform: scale(1);
}

.hud-combo.pulse {
    animation: comboPulse 0.2s ease;
}

@keyframes comboPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.combo-num {
    font-size: 48px;
    font-weight: 900;
    line-height: 1;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.combo-label {
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 4px;
}

.hud-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-track {
    width: 150px;
    height: 8px;
    background: var(--dark-lighter);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 35px;
}

.pause-btn {
    width: 40px;
    height: 40px;
    background: var(--dark-lighter);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}

.pause-btn:hover {
    background: var(--primary);
}

/* 判定显示 */
.judge-display {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    pointer-events: none;
    font-size: 48px;
    font-weight: 900;
    text-shadow: 0 0 30px currentColor;
    opacity: 0;
}

.judge-display.show {
    animation: judgePop 0.5s ease-out;
}

@keyframes judgePop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}

.judge-display.perfect { color: var(--success); }
.judge-display.great { color: var(--accent); }
.judge-display.good { color: var(--warning); }
.judge-display.miss { color: var(--danger); }

/* 游戏轨道 */
.game-track {
    position: relative;
    width: 400px;
    height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.track-container {
    flex: 1;
    position: relative;
    display: flex;
    overflow: hidden;
}

.track-lane {
    flex: 1;
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.track-lane:nth-child(1) { background: linear-gradient(180deg, transparent 0%, rgba(99, 102, 241, 0.05) 100%); }
.track-lane:nth-child(2) { background: linear-gradient(180deg, transparent 0%, rgba(236, 72, 153, 0.05) 100%); }
.track-lane:nth-child(3) { background: linear-gradient(180deg, transparent 0%, rgba(34, 211, 238, 0.05) 100%); }
.track-lane:nth-child(4) { background: linear-gradient(180deg, transparent 0%, rgba(16, 185, 129, 0.05) 100%); }

.note {
    position: absolute;
    width: 80%;
    left: 10%;
    height: 24px;
    border-radius: 6px;
    transition: none;
}

.track-lane:nth-child(1) .note { background: linear-gradient(180deg, #818cf8, #6366f1); box-shadow: 0 0 20px rgba(99, 102, 241, 0.5); }
.track-lane:nth-child(2) .note { background: linear-gradient(180deg, #f472b6, #ec4899); box-shadow: 0 0 20px rgba(236, 72, 153, 0.5); }
.track-lane:nth-child(3) .note { background: linear-gradient(180deg, #67e8f9, #22d3ee); box-shadow: 0 0 20px rgba(34, 211, 238, 0.5); }
.track-lane:nth-child(4) .note { background: linear-gradient(180deg, #34d399, #10b981); box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }

.note.hit {
    animation: noteHit 0.2s ease-out forwards;
}

@keyframes noteHit {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* 判定线 */
.judge-line {
    position: absolute;
    bottom: 100px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    z-index: 10;
}

.judge-line-glow {
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 24px;
    background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

/* 按键区域 */
.key-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    display: flex;
}

.key {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    background: rgba(30, 30, 64, 0.5);
    transition: all 0.1s ease;
    position: relative;
}

.key::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.1s ease;
}

.key.active {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--primary);
}

.key.active::before {
    opacity: 1;
}

.key:nth-child(1).active { background: rgba(99, 102, 241, 0.3); }
.key:nth-child(2).active { background: rgba(236, 72, 153, 0.3); }
.key:nth-child(3).active { background: rgba(34, 211, 238, 0.3); }
.key:nth-child(4).active { background: rgba(16, 185, 129, 0.3); }

.key-label {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-muted);
}

.key.active .key-label {
    color: white;
}

/* 粒子效果 */
.particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    animation: particleFly 0.8s ease-out forwards;
    box-shadow: 0 0 10px currentColor;
}

@keyframes particleFly {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}

/* 打击光环 */
.hit-ring {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    border: 3px solid currentColor;
    animation: hitRingExpand 0.6s ease-out forwards;
    box-shadow: 0 0 20px currentColor, inset 0 0 20px currentColor;
}

@keyframes hitRingExpand {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(3); }
}

/* 打击闪光 */
.hit-flash {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, transparent 70%);
    animation: hitFlash 0.3s ease-out forwards;
}

@keyframes hitFlash {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
}

/* 键位按下光效 */
.key-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.05s;
}

.key-glow.active {
    opacity: 1;
    animation: keyGlowPulse 0.15s ease-out;
}

@keyframes keyGlowPulse {
    0% { opacity: 0.8; }
    100% { opacity: 0.3; }
}

.track-lane:nth-child(1) .key-glow { background: linear-gradient(180deg, transparent 0%, rgba(99, 102, 241, 0.6) 100%); }
.track-lane:nth-child(2) .key-glow { background: linear-gradient(180deg, transparent 0%, rgba(236, 72, 153, 0.6) 100%); }
.track-lane:nth-child(3) .key-glow { background: linear-gradient(180deg, transparent 0%, rgba(34, 211, 238, 0.6) 100%); }
.track-lane:nth-child(4) .key-glow { background: linear-gradient(180deg, transparent 0%, rgba(16, 185, 129, 0.6) 100%); }

/* 屏幕震动 */
.screen-shake {
    animation: screenShake 0.15s ease-out;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-3px, 2px); }
    50% { transform: translate(2px, -2px); }
    75% { transform: translate(-2px, -1px); }
}

/* 判定文字更华丽 */
.judge-display {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    pointer-events: none;
    font-size: 56px;
    font-weight: 900;
    text-shadow: 0 0 30px currentColor, 0 0 60px currentColor;
    opacity: 0;
    letter-spacing: 4px;
}

.judge-display.show {
    animation: judgePop 0.6s ease-out;
}

@keyframes judgePop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-10deg); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.4) rotate(3deg); }
    40% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(-50%, -100%) scale(0.9) rotate(0deg); }
}

/* 连击数字更华丽 */
.combo-display {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 45;
    pointer-events: none;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.combo-display.show {
    opacity: 1;
}

.combo-label {
    font-size: 18px;
    color: var(--text-muted);
    letter-spacing: 8px;
    margin-bottom: 4px;
}

#combo {
    font-size: 72px;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
    line-height: 1;
}

.combo-display.pulse #combo {
    animation: comboPulse 0.2s ease-out;
}

@keyframes comboPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* 高连击特效 */
.combo-display.hot #combo {
    filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.8)) drop-shadow(0 0 60px rgba(239, 68, 68, 0.4));
    animation: comboHot 0.5s ease-in-out infinite alternate;
}

@keyframes comboHot {
    0% { filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.6)); }
    100% { filter: drop-shadow(0 0 40px rgba(251, 191, 36, 0.9)); }
}

/* ========== 暂停菜单 ========== */
.pause-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.9);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.pause-menu.show {
    display: flex;
}

.pause-content {
    text-align: center;
    padding: 40px;
}

.pause-content h2 {
    font-size: 48px;
    margin-bottom: 30px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pause-content .menu-btn {
    display: block;
    width: 280px;
    margin: 0 auto 12px;
}

/* ========== 结算界面 ========== */
.result-container {
    text-align: center;
    padding: 20px 30px;
    max-width: 500px;
    width: 90%;
    max-height: 92vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.result-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 8px;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.result-rank {
    font-size: 100px;
    font-weight: 900;
    line-height: 1;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    animation: rankPop 0.8s ease;
}

@keyframes rankPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.result-score {
    margin-bottom: 16px;
}

.result-score-value {
    font-size: 40px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-score-label {
    font-size: 16px;
    color: var(--text-muted);
    margin-left: 8px;
}

.result-stats {
    background: var(--dark-light);
    border-radius: 16px;
    padding: 14px 18px;
    margin-bottom: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
}

.result-accuracy {
    display: flex;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--dark-lighter);
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.result-accuracy span:last-child {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-buttons .menu-btn {
    width: 100%;
}

/* ========== 玩家信息 ========== */
.player-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
    padding: 12px 20px;
    background: var(--dark-lighter);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.player-label {
    color: var(--text-muted);
    font-size: 14px;
}

.player-name-input {
    background: var(--dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    width: 120px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.player-name-input:focus {
    border-color: var(--primary);
}

.player-points {
    color: var(--accent);
    font-weight: 700;
    font-size: 15px;
}

/* ========== 积分显示 ========== */
.result-points {
    background: var(--dark-lighter);
    border-radius: 16px;
    padding: 14px 18px;
    margin-bottom: 12px;
}

.points-breakdown {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.points-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.points-item span:last-child {
    color: var(--text);
    font-weight: 600;
}

.points-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
}

.points-earned {
    color: var(--success);
    font-size: 24px;
    animation: pointsPop 0.5s ease;
}

@keyframes pointsPop {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* ========== 排行榜 ========== */
.leaderboard-container {
    max-width: 700px;
    width: 90%;
    padding: 30px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.leaderboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.tab-btn {
    padding: 10px 24px;
    background: var(--dark-lighter);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

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

.tab-btn.active {
    background: var(--gradient-2);
    color: white;
    border-color: transparent;
}

.leaderboard-content {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
}

.leaderboard-section {
    margin-bottom: 24px;
}

.leaderboard-section h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--primary-light, #a5b4fc);
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--dark-lighter);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.leaderboard-row:hover {
    transform: translateX(4px);
}

.leaderboard-row.top1 { background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), transparent); }
.leaderboard-row.top2 { background: linear-gradient(90deg, rgba(148, 163, 184, 0.2), transparent); }
.leaderboard-row.top3 { background: linear-gradient(90deg, rgba(217, 119, 6, 0.2), transparent); }

.rank-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}

.rank-badge.r1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.rank-badge.r2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; }
.rank-badge.r3 { background: linear-gradient(135deg, #d97706, #92400e); color: white; }
.rank-badge.normal { background: var(--dark); color: var(--text-muted); }

.rank-player {
    flex: 1;
    font-weight: 600;
}

.rank-player.you { color: var(--accent); }

.rank-score {
    font-weight: 800;
    color: var(--primary-light, #a5b4fc);
    font-size: 16px;
}

.rank-extra {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.empty-leaderboard {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-leaderboard .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.leaderboard-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .game-title { font-size: 56px; }
    .game-track { width: 100%; max-width: 400px; }
    .hud-value { font-size: 20px; }
    .combo-num { font-size: 36px; }
    .progress-track { width: 80px; }
    .talent-mini { grid-template-columns: 1fr; }
    .result-rank { font-size: 100px; }
}
