/* ============================================================
   🎵 潮流音乐播放器 - 玻璃拟态 + 霓虹幻彩主题
   ============================================================ */

/* ========== CSS 变量（动态主题色） ========== */
:root {
    --theme-primary: #667eea;
    --theme-secondary: #764ba2;
    --theme-rgb: 102, 126, 234;
    --theme-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    --glass-bg: rgba(15, 15, 30, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --glass-blur: 20px;
    
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --neon-glow: 0 0 15px rgba(var(--theme-rgb), 0.4), 0 0 40px rgba(var(--theme-rgb), 0.15);
    --neon-glow-strong: 0 0 20px rgba(var(--theme-rgb), 0.6), 0 0 60px rgba(var(--theme-rgb), 0.25);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

/* ========== Reset & Base ========== */
.music-player-container *,
.player-toggle-btn * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== 迷你播放条（收起状态） ========== */
.player-toggle-btn {
    position: fixed;
    left: 24px;
    bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 60px;
    padding: 8px 16px 8px 8px;
    box-shadow: var(--glass-shadow), var(--neon-glow);
    z-index: 9998;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: toggleFloat 4s ease-in-out infinite;
}

.player-toggle-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--glass-shadow), var(--neon-glow-strong);
}

.player-toggle-btn.playing {
    border-color: rgba(var(--theme-rgb), 0.3);
}

@keyframes toggleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.player-toggle-btn.playing {
    animation: toggleFloat 3s ease-in-out infinite;
}

.toggle-cover-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
}

.toggle-cover-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    z-index: 1;
}

.toggle-cover {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    z-index: 2;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 120px;
}

.toggle-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toggle-artist {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toggle-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toggle-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.toggle-btn:hover {
    background: rgba(var(--theme-rgb), 0.25);
    transform: scale(1.1);
}

.toggle-btn.toggle-play {
    width: 36px;
    height: 36px;
    background: var(--theme-gradient);
    font-size: 15px;
    box-shadow: 0 2px 12px rgba(var(--theme-rgb), 0.35);
}

.toggle-btn.toggle-play:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 18px rgba(var(--theme-rgb), 0.5);
}

.toggle-expand {
    display: flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.toggle-expand:hover {
    background: rgba(var(--theme-rgb), 0.2);
    color: var(--text-primary);
}

.expand-icon {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.toggle-expand:hover .expand-icon {
    transform: translateX(-2px);
}

.expand-text {
    font-family: inherit;
}

/* ========== 完整播放器容器（展开状态） ========== */
.music-player-container {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background: radial-gradient(ellipse at 30% 40%, rgba(var(--theme-rgb), 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 60%, rgba(118, 75, 162, 0.06) 0%, transparent 60%),
                rgba(5, 5, 18, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: playerFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes playerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.player-container {
    display: flex;
    width: min(1100px, 94vw);
    height: min(680px, 88vh);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow), 0 0 60px rgba(var(--theme-rgb), 0.08);
    overflow: hidden;
    position: relative;
    animation: containerSlideIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes containerSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== 全屏模式 ========== */
.music-player-container.fullscreen .player-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
}

.music-player-container.fullscreen {
    background: rgba(5, 5, 18, 0.98);
}

/* ========== 粒子层 ========== */
.music-player-container .player-particle {
    pointer-events: none !important;
}

/* ========== 侧边栏 ========== */
.player-sidebar {
    width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid var(--glass-border);
    position: relative;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    z-index: 2;
}

.player-sidebar.collapsed {
    width: 0;
    min-width: 0;
    padding: 0;
    border-right: none;
}

/* 侧边栏展开按钮 */
.sidebar-expand-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 56px;
    border: none;
    border-radius: 0 12px 12px 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    border-left: none;
}

.sidebar-expand-btn:hover {
    background: rgba(var(--theme-rgb), 0.25);
    padding-right: 6px;
}

/* 侧边栏收起按钮 */
.sidebar-collapse-btn {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    border: none;
    border-radius: 0 10px 10px 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    border-left: none;
}

.sidebar-collapse-btn:hover {
    background: rgba(var(--theme-rgb), 0.2);
    color: var(--text-primary);
    right: -14px;
}

/* 侧边栏区域 */
.sidebar-section {
    padding: 14px 16px;
}

.sidebar-section.songs-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.song-count-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 12px;
}

.play-all-btn {
    margin-left: auto;
    border: none;
    background: var(--theme-gradient);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(var(--theme-rgb), 0.3);
    letter-spacing: 0.3px;
}

.play-all-btn:hover {
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 4px 16px rgba(var(--theme-rgb), 0.45);
}

.play-all-btn:active {
    transform: scale(0.96);
}

/* 歌单网格 */
.group-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
    transition: all 0.35s ease;
}

.group-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.group-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(var(--theme-rgb), 0.15);
    transform: translateY(-1px);
}

.group-card.active {
    background: rgba(var(--theme-rgb), 0.12);
    border-color: rgba(var(--theme-rgb), 0.3);
    box-shadow: inset 0 0 20px rgba(var(--theme-rgb), 0.05);
}

.group-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.group-card.disabled:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: none;
    border-color: transparent;
}

.group-card-cover {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(var(--theme-rgb), 0.2), rgba(118, 75, 162, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.group-card-icon {
    font-size: 16px;
    color: var(--text-secondary);
}

.group-lock-icon {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 10px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.group-card-info {
    min-width: 0;
    flex: 1;
}

.group-card-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-card-count {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* 搜索 */
.songs-search {
    margin-bottom: 8px;
    position: relative;
}

.songs-search::before {
    content: '🔍';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.5;
    pointer-events: none;
}

.songs-search-input {
    width: 100%;
    padding: 8px 12px 8px 30px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.songs-search-input:focus {
    border-color: rgba(var(--theme-rgb), 0.4);
    box-shadow: 0 0 12px rgba(var(--theme-rgb), 0.15);
    background: rgba(0, 0, 0, 0.45);
}

.songs-search-input::placeholder {
    color: var(--text-muted);
}

/* 歌曲列表 */
.songs-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    contain: layout style;
}

.song-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: none;
    border: 1px solid transparent;
    position: relative;
    content-visibility: auto;
    contain: layout style;
}

.song-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.05);
    transform: translateX(3px);
}

.song-item.active {
    background: rgba(var(--theme-rgb), 0.10);
    border-color: rgba(var(--theme-rgb), 0.2);
    box-shadow: inset 3px 0 0 rgba(var(--theme-rgb), 0.6);
}

.song-item-cover-wrap {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(var(--theme-rgb), 0.15), rgba(118, 75, 162, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.song-item-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-item-cover-icon {
    font-size: 16px;
    color: var(--text-secondary);
}

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

.song-item-title {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
}

.song-item.active .song-item-title {
    color: #fff;
    background: var(--theme-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.song-item-artist {
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.song-item-playcount {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.song-item-status {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.playing-indicator {
    display: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--theme-primary);
    box-shadow: 0 0 8px rgba(var(--theme-rgb), 0.6);
    animation: indicatorPulse 1.2s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: 0.5; }
}

/* 播放中图标（均衡器条） */
.song-item-playing {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.equalizer-bar {
    width: 3px;
    background: var(--theme-gradient);
    border-radius: 2px;
    animation: equalizerAnim 0.6s ease-in-out infinite alternate;
}

.song-item-playing .equalizer-bar:nth-child(1) {
    height: 8px;
    animation-delay: 0s;
}

.song-item-playing .equalizer-bar:nth-child(2) {
    height: 14px;
    animation-delay: 0.15s;
}

.song-item-playing .equalizer-bar:nth-child(3) {
    height: 10px;
    animation-delay: 0.3s;
}

@keyframes equalizerAnim {
    0% { transform: scaleY(0.4); }
    100% { transform: scaleY(1); }
}

/* ========== 自定义滚动条 ========== */
.songs-list::-webkit-scrollbar,
.group-grid::-webkit-scrollbar,
.lyrics-scroll::-webkit-scrollbar {
    width: 4px;
}

.songs-list::-webkit-scrollbar-track,
.group-grid::-webkit-scrollbar-track,
.lyrics-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.songs-list::-webkit-scrollbar-thumb,
.group-grid::-webkit-scrollbar-thumb,
.lyrics-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.songs-list::-webkit-scrollbar-thumb:hover,
.group-grid::-webkit-scrollbar-thumb:hover,
.lyrics-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--theme-rgb), 0.3);
}

/* ========== 右侧主播放区域 ========== */
.player-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 32px 20px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* ========== 顶部控制栏 ========== */
.player-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-shrink: 0;
}

/* 音量控制 */
.player-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-icon {
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
}

.volume-icon:hover {
    transform: scale(1.15);
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: height 0.2s;
}

.volume-slider:hover {
    height: 6px;
}

.volume-fill {
    height: 100%;
    background: var(--theme-gradient);
    border-radius: 4px;
    transition: width 0.1s ease;
    position: relative;
}

.volume-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(var(--theme-rgb), 0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.volume-slider:hover .volume-fill::after {
    opacity: 1;
}

/* 顶部操作按钮 */
.player-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-fullscreen-btn,
.player-close-btn {
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.player-fullscreen-btn:hover,
.player-close-btn:hover {
    background: rgba(var(--theme-rgb), 0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.player-close-btn {
    background: rgba(255, 70, 70, 0.1);
    color: rgba(255, 100, 100, 0.8);
}

.player-close-btn:hover {
    background: rgba(255, 70, 70, 0.25);
    color: #ff6b6b;
}

/* ========== 频谱可视化器 ========== */
.player-visualizer {
    height: 70px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.player-visualizer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(var(--theme-rgb), 0.03), transparent);
    pointer-events: none;
    z-index: 1;
}

#visualizerCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
}

/* 振幅脉冲画布（覆盖层） */
.amp-pulse-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* ========== 封面区域（圆形进度环 + 黑胶） ========== */
.player-cover-section {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 8px;
    position: relative;
}

.player-cover-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    will-change: transform;
}

/* 封面背景模糊层 */
.player-cover-bg {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.5);
    opacity: 0.4;
    transform: scale(1.1);
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

/* 圆形进度环（SVG） */
.progress-ring {
    position: absolute;
    width: 216px;
    height: 216px;
    z-index: 3;
    pointer-events: none;
    transform: rotate(-90deg);
}

.progress-ring svg {
    width: 100%;
    height: 100%;
}

.progress-ring-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 4;
}

.progress-ring-circle {
    fill: none;
    stroke: var(--theme-primary);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(var(--theme-rgb), 0.4));
}

/* 黑胶唱片 */
.vinyl-disc {
    position: absolute;
    width: 176px;
    height: 176px;
    border-radius: 50%;
    background: radial-gradient(circle at center,
        #1a1a2e 0%,
        #16213e 25%,
        #0f0f23 50%,
        #111 75%,
        #0a0a0a 100%
    );
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        inset 0 0 30px rgba(0,0,0,0.8),
        0 8px 30px rgba(0,0,0,0.6);
}

.vinyl-disc.playing {
    animation: spinVinyl 3s linear infinite;
}

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

/* 黑胶纹路 */
.grooves {
    position: absolute;
    width: 88%;
    height: 88%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.02),
        inset 0 0 0 6px rgba(255,255,255,0.01),
        inset 0 0 0 12px rgba(255,255,255,0.01),
        inset 0 0 0 20px rgba(255,255,255,0.01),
        inset 0 0 0 30px rgba(255,255,255,0.008);
}

.vinyl-label {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--theme-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 0 20px rgba(var(--theme-rgb), 0.3);
    position: relative;
    z-index: 2;
}

/* 封面图片 */
.player-cover {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.player-cover-wrapper:hover .player-cover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.player-cover-placeholder {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(var(--theme-rgb), 0.3), rgba(118, 75, 162, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-size: 36px;
    color: rgba(255,255,255,0.5);
}

/* ========== 内容右侧 ========== */
.player-content-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

/* 歌曲信息 */
.player-song-info {
    text-align: center;
    flex-shrink: 0;
}

.player-song-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
    background: var(--theme-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.player-song-artist {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.player-song-source {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ========== 歌词区域 ========== */
.player-lyrics-section {
    flex: 1;
    min-height: 0;
    position: relative;
}

.lyrics-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 4px 0;
    scroll-behavior: smooth;
}

.lyrics-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}

.lyrics-line {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
    white-space: pre-wrap;
    word-break: break-word;
}

.lyrics-line.active {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 20px rgba(var(--theme-rgb), 0.5);
    transform: scale(1.05);
}

.lyrics-line.lyrics-empty {
    font-size: 14px;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ========== 进度条 ========== */
.player-progress-section {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 8px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--theme-gradient);
    border-radius: 4px;
    position: relative;
    box-shadow: 0 0 10px rgba(var(--theme-rgb), 0.3);
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px rgba(var(--theme-rgb), 0.5), 0 0 25px rgba(var(--theme-rgb), 0.2);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

.progress-handle {
    display: none;
}

.progress-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.time-current {
    color: var(--text-secondary);
}

.time-separator {
    opacity: 0.3;
}

/* ========== 播放控制 ========== */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
    padding-top: 6px;
}

.control-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.control-btn:hover {
    background: rgba(var(--theme-rgb), 0.2);
    color: var(--text-primary);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.92);
}

.control-play {
    width: 48px;
    height: 48px;
    background: var(--theme-gradient);
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 16px rgba(var(--theme-rgb), 0.35);
}

.control-play:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(var(--theme-rgb), 0.5);
}

.control-play:active {
    transform: scale(0.95);
}

/* 版权说明 */
.player-copyright {
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.4;
    flex-shrink: 0;
    padding-top: 4px;
    line-height: 1.4;
}

/* ========== 权限提示遮罩 ========== */
.permission-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.permission-dialog {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    text-align: center;
    max-width: 360px;
    box-shadow: var(--glass-shadow), 0 0 40px rgba(var(--theme-rgb), 0.1);
    animation: dialogBounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dialogBounceIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.permission-icon {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
}

.permission-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.permission-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    line-height: 1.5;
}

.permission-tip {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.permission-close-btn {
    border: none;
    background: var(--theme-gradient);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 30px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(var(--theme-rgb), 0.35);
    font-family: inherit;
}

.permission-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(var(--theme-rgb), 0.5);
}

.permission-close-btn:active {
    transform: scale(0.96);
}

/* ========== 响应式 ========== */

/* 平板 */
@media (max-width: 900px) {
    .player-container {
        width: 96vw;
        height: 92vh;
        border-radius: var(--radius-md);
    }

    .player-sidebar {
        width: 240px;
        min-width: 240px;
    }

    .player-main {
        padding: 18px 20px 16px;
    }

    .player-cover-wrapper {
        width: 160px;
        height: 160px;
    }

    .progress-ring {
        width: 176px;
        height: 176px;
    }

    .vinyl-disc {
        width: 140px;
        height: 140px;
    }

    .player-cover,
    .player-cover-placeholder {
        width: 104px;
        height: 104px;
    }

    .vinyl-label {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .player-song-title {
        font-size: 17px;
    }

    .player-visualizer {
        height: 54px;
    }
}

/* 手机 */
@media (max-width: 640px) {
    .player-container {
        flex-direction: column;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
    }

    .player-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 35%;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .player-sidebar.collapsed {
        max-height: 0;
    }

    .sidebar-collapse-btn,
    .sidebar-expand-btn {
        display: none !important;
    }

    .group-grid {
        max-height: 100px;
    }

    .player-main {
        padding: 12px 16px 14px;
        overflow-y: auto;
    }

    .player-top-bar {
        margin-bottom: 8px;
    }

    .player-visualizer {
        height: 40px;
        margin-bottom: 6px;
    }

    .player-cover-section {
        margin-bottom: 4px;
    }

    .player-cover-wrapper {
        width: 120px;
        height: 120px;
    }

    .progress-ring {
        width: 134px;
        height: 134px;
    }

    .vinyl-disc {
        width: 106px;
        height: 106px;
    }

    .player-cover,
    .player-cover-placeholder {
        width: 78px;
        height: 78px;
    }

    .vinyl-label {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .player-song-title {
        font-size: 15px;
    }

    .player-song-artist {
        font-size: 12px;
    }

    .lyrics-line {
        font-size: 12px;
    }

    .lyrics-line.active {
        font-size: 14px;
    }

    .control-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .control-play {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }

    .player-toggle-btn {
        left: 12px;
        bottom: 20px;
        padding: 6px 12px 6px 6px;
        gap: 8px;
    }

    .toggle-cover-wrap {
        width: 36px;
        height: 36px;
    }

    .toggle-info {
        max-width: 80px;
    }

    .toggle-title {
        font-size: 12px;
    }

    .toggle-artist {
        font-size: 10px;
    }

    .toggle-controls {
        gap: 2px;
    }

    .toggle-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .toggle-btn.toggle-play {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .volume-slider {
        width: 54px;
    }

    .player-fullscreen-btn {
        display: none;
    }

    .player-close-btn {
        font-size: 11px;
        padding: 5px 12px;
    }

    .group-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }

    .group-card {
        padding: 6px;
    }

    .group-card-cover {
        width: 30px;
        height: 30px;
    }

    .group-card-name {
        font-size: 10px;
    }

    .group-card-count {
        font-size: 9px;
    }
}

/* 超小屏 */
@media (max-width: 380px) {
    .player-main {
        padding: 8px 10px 10px;
    }

    .player-cover-wrapper {
        width: 100px;
        height: 100px;
    }

    .progress-ring {
        width: 112px;
        height: 112px;
    }

    .vinyl-disc {
        width: 88px;
        height: 88px;
    }

    .player-cover,
    .player-cover-placeholder {
        width: 64px;
        height: 64px;
    }

    .group-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========== 浮动音符动画 ========== */
.floating-notes-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.floating-note {
    position: absolute;
    bottom: -30px;
    opacity: 0;
    animation: floatUp linear forwards;
    pointer-events: none;
    user-select: none;
    font-family: "Arial", "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
    will-change: transform, opacity;
    text-shadow: 0 0 20px rgba(var(--theme-rgb), 0.5);
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg) scale(0.3);
    }
    10% {
        opacity: 0.8;
    }
    25% {
        transform: translateY(-60px) rotate(12deg) scale(1.1);
    }
    50% {
        transform: translateY(-130px) rotate(-8deg) scale(0.9);
        opacity: 0.6;
    }
    75% {
        transform: translateY(-200px) rotate(15deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-280px) rotate(-20deg) scale(0.4);
    }
}

/* ========== 封面脉冲光晕效果 ========== */
.cover-glow-active .player-cover-bg {
    animation: coverPulse 2s ease-in-out infinite !important;
}

@keyframes coverPulse {
    0%, 100% {
        opacity: 0.35;
        transform: scale(1.1);
        filter: blur(40px) brightness(0.5);
    }
    50% {
        opacity: 0.65;
        transform: scale(1.25);
        filter: blur(30px) brightness(0.8);
    }
}

.cover-glow-active .player-cover-wrapper::after {
    content: '';
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--theme-rgb), 0.2), transparent 70%);
    animation: glowRingPulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 4;
}

@keyframes glowRingPulse {
    0%, 100% {
        transform: scale(0.95);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* ========== 黑胶唱片光影反射 ========== */
.vinyl-reflection {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        transparent 25%, 
        rgba(255,255,255,0.06) 35%, 
        rgba(255,255,255,0.12) 42%, 
        rgba(255,255,255,0.06) 48%, 
        transparent 55%
    );
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.vinyl-disc.playing .vinyl-reflection {
    opacity: 1;
    animation: reflectionRotate 4s linear infinite;
}

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

/* 唱片边缘发光环 */
.vinyl-glow-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    pointer-events: none;
    z-index: 6;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.vinyl-disc.playing .vinyl-glow-ring {
    opacity: 1;
    border-image: var(--theme-gradient);
    border-image-slice: 1;
    animation: glowRingSpin 3s linear infinite;
    box-shadow: 0 0 15px rgba(var(--theme-rgb), 0.3), inset 0 0 15px rgba(var(--theme-rgb), 0.15);
}

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

/* ========== 径向可视化 Canvas（唱片周围） ========== */
#radialVisualizer {
    position: absolute;
    width: 240px;
    height: 240px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#radialVisualizer.active {
    opacity: 1;
}

@media (max-width: 900px) {
    #radialVisualizer {
        width: 196px;
        height: 196px;
    }
}

@media (max-width: 640px) {
    #radialVisualizer {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 380px) {
    #radialVisualizer {
        width: 126px;
        height: 126px;
    }
}

/* ========== 滚动时暂停所有装饰性动画（防卡顿） ========== */
.music-player-container.scrolling .vinyl-disc.playing {
    animation: none !important;
}
.music-player-container.scrolling .player-cover-bg {
    animation: none !important;
}
.music-player-container.scrolling .player-cover-wrapper::after {
    animation: none !important;
}
.music-player-container.scrolling .vinyl-disc.playing .vinyl-reflection {
    animation: none !important;
}
.music-player-container.scrolling .vinyl-disc.playing .vinyl-glow-ring {
    animation: none !important;
}
.music-player-container.scrolling .floating-note {
    animation-play-state: paused !important;
}
.music-player-container.scrolling .equalizer-bar {
    animation: none !important;
}
.music-player-container.scrolling .playing-indicator {
    animation: none !important;
}
.music-player-container.scrolling .song-item:hover {
    transform: none !important;
    transition: none !important;
}
