/* ===== 音乐页面基础 ===== */
.music-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== 音频可视化背景 ===== */
#visualizer-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.3;
}

/* ===== 顶部导航 ===== */
.music-nav {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: linear-gradient(to bottom, rgba(10,10,15,0.9), transparent);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
}

.back-btn:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
    transform: translateX(-3px);
}

.music-nav-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.music-nav-actions {
    display: flex;
    gap: 10px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* ===== 弹窗 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 90%;
    max-width: 420px;
    animation: scaleIn 0.3s ease;
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.modal-content input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.modal-content input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-content input::placeholder {
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
}

.modal-btn.secondary {
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.modal-btn.secondary:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== 主播放器区域 ===== */
.music-main {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ===== 左侧：唱片 ===== */
.player-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.vinyl-container {
    position: relative;
    width: 320px;
    height: 320px;
}

.vinyl {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(145deg, #1a1a2e, #0f0f1a);
    position: relative;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.6),
        inset 0 0 0 2px rgba(255,255,255,0.05),
        inset 0 0 0 4px rgba(0,0,0,0.3);
    animation: vinyl-spin 3s linear infinite;
    animation-play-state: paused;
}

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

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

.vinyl-grooves {
    position: absolute;
    inset: 20px;
    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
    );
}

.vinyl-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.vinyl-label img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder {
    width: 60px;
    height: 60px;
    color: var(--text-muted);
    opacity: 0.5;
}

.cover-placeholder svg {
    width: 100%;
    height: 100%;
}

.vinyl-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid rgba(255,255,255,0.1);
    z-index: 2;
}

.vinyl-shadow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0,0,0,0.4), transparent);
    filter: blur(10px);
}

/* 小频谱 */
#visualizer-mini {
    border-radius: 12px;
    opacity: 0.6;
}

/* ===== 右侧：信息控制 ===== */
.player-right {
    flex: 1;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.song-info {
    text-align: center;
}

.song-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(135deg, #f0f0f5, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.song-artist {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ===== 歌词区域 ===== */
.lyrics-container {
    position: relative;
    height: 200px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lyrics-wrapper {
    height: 100%;
    overflow-y: auto;
    padding: 80px 20px;
    text-align: center;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.lyrics-wrapper::-webkit-scrollbar {
    display: none;
}

.lyrics-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
}

.lyrics-placeholder p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.lyrics-placeholder span {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.lyric-line {
    padding: 10px 0;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all 0.4s ease;
    line-height: 1.6;
    opacity: 0.5;
}

.lyric-line.active {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 1;
    text-shadow: 0 0 20px var(--accent-glow);
}

.lyric-line.passed {
    opacity: 0.3;
}

.lyrics-overlay {
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
    z-index: 2;
}

.lyrics-overlay.top {
    top: 0;
    background: linear-gradient(to bottom, var(--bg-secondary), transparent);
}

.lyrics-overlay.bottom {
    bottom: 0;
    background: linear-gradient(to top, var(--bg-secondary), transparent);
}

/* ===== 进度条 ===== */
.progress-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    position: relative;
    height: 6px;
    background: var(--bg-glass);
    border-radius: 3px;
    cursor: pointer;
    overflow: visible;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
    opacity: 0;
    transition: opacity 0.2s, left 0.1s linear;
    cursor: grab;
}

.progress-bar:hover .progress-thumb {
    opacity: 1;
}

.progress-bar:hover .progress-fill {
    filter: brightness(1.3);
}

/* ===== 控制按钮 ===== */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.ctrl-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.ctrl-btn:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: scale(1.1);
}

.ctrl-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.play-btn {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border: none;
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px var(--accent-glow);
}

/* ===== 音量 ===== */
.volume-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
}

.volume-section svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.volume-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-glass);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 70%;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    border-radius: 2px;
    transition: width 0.1s;
}

/* ===== 播放列表 ===== */
.playlist-panel {
    position: relative;
    z-index: 5;
    margin: 0 auto 30px;
    width: 90%;
    max-width: 800px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: fade-in-up 0.8s ease-out 0.3s both;
}

.playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.playlist-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.playlist-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.playlist-body {
    max-height: 240px;
    overflow-y: auto;
}

.playlist-body::-webkit-scrollbar {
    width: 4px;
}

.playlist-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.playlist-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.playlist-empty p {
    font-size: 1rem;
    margin-bottom: 6px;
}

.playlist-empty span {
    font-size: 0.8rem;
    opacity: 0.6;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.playlist-item:hover {
    background: var(--bg-glass-hover);
}

.playlist-item.active {
    background: linear-gradient(90deg, rgba(99,102,241,0.1), transparent);
    border-left: 3px solid var(--accent);
}

.playlist-item-number {
    width: 24px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.playlist-item.active .playlist-item-number {
    color: var(--accent);
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.playlist-item-artist {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.playlist-item-duration {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.playlist-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.playlist-item:hover .playlist-item-remove {
    opacity: 1;
}

.playlist-item-remove:hover {
    background: rgba(244,63,94,0.2);
    color: #f43f5e;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .music-main {
        flex-direction: column;
        gap: 32px;
        padding: 20px;
    }

    .vinyl-container {
        width: 240px;
        height: 240px;
    }

    .vinyl-label {
        width: 100px;
        height: 100px;
    }

    .player-right {
        max-width: 100%;
        width: 100%;
    }

    .song-title {
        font-size: 1.4rem;
    }

    .lyrics-container {
        height: 160px;
    }

    .music-nav {
        padding: 12px 16px;
    }

    .music-nav-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .vinyl-container {
        width: 200px;
        height: 200px;
    }

    .controls {
        gap: 14px;
    }

    .ctrl-btn {
        width: 40px;
        height: 40px;
    }

    .play-btn {
        width: 56px;
        height: 56px;
    }
}
