/* ========================================
   音乐播放器样式
   ======================================== */

/* 音乐按钮区域 - 玻璃态设计 */
#musicControls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    text-align: right;
}

#musicButton, #addMusicButton {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(234, 143, 157, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#musicButton:hover, #addMusicButton:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(234, 143, 157, 0.4);
}

#musicButton:active, #addMusicButton:active {
    transform: translateY(0);
}

/* 音乐播放器控制面板 */
.music-player-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 12px 48px rgba(234, 143, 157, 0.4),
                inset 0 0 20px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    z-index: 998;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.music-player-panel:hover {
    box-shadow: 0 16px 56px rgba(234, 143, 157, 0.5),
                inset 0 0 30px rgba(255, 255, 255, 0.15);
}

/* 当前播放歌曲信息 */
.current-track {
    margin-bottom: 20px;
}

.track-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 6px;
}

.track-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ff6b9d;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.track-status.paused::before {
    background: #888;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 音频可视化Canvas */
#audioVisualizer {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 16px;
}

/* 进度条 */
.progress-container {
    margin-bottom: 16px;
}

.progress-bar-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b9d 0%, #ff8fab 100%);
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* 控制按钮组 */
.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.control-btn.play-btn {
    width: 56px;
    height: 56px;
    font-size: 24px;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.9), rgba(255, 140, 180, 0.9));
}

.control-btn.play-btn:hover {
    background: linear-gradient(135deg, rgba(255, 107, 157, 1), rgba(255, 140, 180, 1));
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.5);
}

/* 音量控制 */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.volume-icon {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
}

.volume-slider {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: linear-gradient(90deg, #ff6b9d 0%, #ff8fab 100%);
    border-radius: 2px;
}

/* 播放列表样式优化 */
#playlist {
    position: fixed;
    top: 480px;
    right: 20px;
    width: 320px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 16px;
    border-radius: 20px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(234, 143, 157, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

#playlist::-webkit-scrollbar {
    width: 6px;
}

#playlist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#playlist::-webkit-scrollbar-thumb {
    background: rgba(234, 143, 157, 0.6);
    border-radius: 3px;
}

.playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 14px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-4px);
}

.playlist-item.playing {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.4), rgba(255, 140, 180, 0.3));
    box-shadow: 0 4px 16px rgba(234, 143, 157, 0.4);
}

.playlist-item-info {
    flex: 1;
    overflow: hidden;
}

.playlist-item-name {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.playlist-item-duration {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    margin-top: 2px;
}

.playlist-item button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    backdrop-filter: blur(5px);
    min-width: 32px;
}

.playlist-item button:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}
