:root {
    --bg: #0F0F1A;
    --bg-light: #1A1A2E;
    --bg-card: #16213E;
    --accent-cyan: #06B6D4;
    --accent-purple: #A855F7;
    --accent-pink: #EC4899;
    --accent-gold: #FBBF24;
    --text: #E2E8F0;
    --text-dim: #94A3B8;
}

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

html { scroll-behavior: smooth; }

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

/* ===== 星空背景 ===== */
.stars-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle var(--dur) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ===== 频谱背景 ===== */
.spectrum-bg {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    pointer-events: none;
    z-index: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 0 5%;
    opacity: 0.15;
}

.spec-bar {
    width: 3%;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 4px 4px 0 0;
    transition: height 0.15s ease;
}

/* ===== 头部 ===== */
header {
    text-align: center;
    padding: 70px 20px 30px;
    position: relative;
    z-index: 1;
}

.logo {
    font-size: clamp(2.8rem, 7vw, 4.5rem);
    font-weight: 900;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.beat {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: beatPulse 1.5s infinite ease-in-out;
}

.beat:nth-child(1) { animation-delay: 0s; }
.beat:nth-child(2) { animation-delay: 0.15s; }
.beat:nth-child(3) { animation-delay: 0.3s; }
.beat:nth-child(4) { animation-delay: 0.45s; }

@keyframes beatPulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.08); opacity: 1; }
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-top: 10px;
    letter-spacing: 2px;
}

/* ===== 主内容 ===== */
main {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

section h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text);
}

/* ===== 唱片机 ===== */
.turntable {
    padding: 30px 0 50px;
    text-align: center;
}

.record-player {
    width: 280px;
    height: 280px;
    margin: 0 auto 20px;
    position: relative;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.record {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a, #333, #1a1a1a, #333);
    position: relative;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    animation: spin 3s linear infinite paused;
}

.record.playing {
    animation-play-state: running;
}

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

.grooves {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        transparent 2px,
        rgba(255,255,255,0.03) 2px,
        rgba(255,255,255,0.03) 3px
    );
}

.label {
    position: absolute;
    inset: 35%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.label-hole {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--bg);
    border-radius: 50%;
}

.label span {
    position: relative;
    z-index: 1;
}

/* 唱臂 */
.tonearm {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 60px;
    height: 100px;
    transform-origin: top right;
    transform: rotate(-30deg);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tonearm.playing {
    transform: rotate(8deg);
}

.arm {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 90px;
    background: linear-gradient(180deg, #C0C0C0, #808080);
    border-radius: 2px;
    transform-origin: top center;
    transform: rotate(25deg);
}

.head {
    position: absolute;
    bottom: 0;
    left: 18px;
    width: 14px;
    height: 20px;
    background: #444;
    border-radius: 3px;
}

.controls-player {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
}

.btn-play {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--accent-cyan);
    background: transparent;
    color: var(--accent-cyan);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-play:hover {
    background: var(--accent-cyan);
    color: var(--bg);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.btn-prev, .btn-next {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: var(--text-dim);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-prev:hover, .btn-next:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.controls-player {
    display: flex;
    gap: 12px;
    align-items: center;
}

.now-playing {
    color: var(--text-dim);
    font-size: 0.95rem;
    min-height: 1.4em;
    margin-top: 8px;
}

.track-list {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.track-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--bg-card);
    color: var(--text-dim);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.track-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--text);
}

.track-btn.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

/* ===== 波形展示 ===== */
.wave-section {
    padding: 30px 0;
}

.wave-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    height: 100px;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.wave-bar {
    width: 8px;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 4px;
    transition: height 0.12s ease;
    min-height: 4px;
}

/* ===== 音符雨 ===== */
.note-rain-section {
    padding: 40px 0;
    text-align: center;
}

.note-stage {
    height: 200px;
    background: linear-gradient(180deg, rgba(6,182,212,0.05) 0%, rgba(168,85,247,0.05) 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(6,182,212,0.1);
}

.note-particle {
    position: absolute;
    font-size: 1.4rem;
    animation: noteFloat linear forwards;
    pointer-events: none;
}

@keyframes noteFloat {
    0% { transform: translateY(220px) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-20px) rotate(var(--rot)); opacity: 0; }
}

.btn-chime {
    padding: 14px 36px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: #fff;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
    transition: all 0.3s;
    font-family: inherit;
}

.btn-chime:hover {
    transform: translateY(-3px);
    filter: brightness(1.15);
}

.btn-chime:active {
    transform: scale(0.97);
}

/* ===== 节拍垫 ===== */
.drum-pad-section {
    padding: 30px 0 70px;
}

.drum-pad-section h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.key-hint {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 400;
    background: var(--bg-card);
    padding: 4px 12px;
    border-radius: 20px;
}

.pad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.pad {
    aspect-ratio: 1;
    background: var(--bg-card);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid rgba(255,255,255,0.05);
    user-select: none;
}

.pad span {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.pad small {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.pad:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.pad.active {
    transform: scale(0.93);
    box-shadow: 0 0 30px var(--glow-color, var(--accent-cyan));
    border-color: var(--glow-color, var(--accent-cyan));
}

.pad.active span,
.pad.active small {
    color: #fff;
}

/* ===== 音符涟漪 ===== */
.sound-ripple {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: soundRipple 0.7s ease-out forwards;
}

@keyframes soundRipple {
    0% { width: 10px; height: 10px; opacity: 0.8; }
    100% { width: 120px; height: 120px; opacity: 0; }
}

/* ===== 页脚 ===== */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
    .record-player {
        width: 240px;
        height: 240px;
    }
    .record {
        width: 160px;
        height: 160px;
    }
    .pad-grid {
        gap: 8px;
    }
    .pad {
        border-radius: 12px;
    }
}
