/* player.css - 全局音乐播放器（水平居中版本） */
.global-music-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    border-radius: 60px;
    padding: 8px 16px 8px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

[data-theme="dark"] .global-music-player {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.global-music-player:hover {
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

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

.player-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4285f4, #7bed9f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(66, 133, 244, 0); }
    100% { box-shadow: 0 0 0 0 rgba(66, 133, 244, 0); }
}

.player-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.player-info {
    display: flex;
    flex-direction: column;
    max-width: 180px;
}

.player-song-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .player-song-title {
    color: #f0f0f0;
}

.player-song-artist {
    font-size: 0.7rem;
    color: #999;
}

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

.player-control-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #666;
}

[data-theme="dark"] .player-control-btn {
    color: #aaa;
}

.player-control-btn:hover {
    background: rgba(66, 133, 244, 0.15);
    transform: scale(1.05);
}

.player-control-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.player-play-btn svg {
    width: 22px;
    height: 22px;
}

.player-volume-slider {
    width: 60px;
    height: 3px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

[data-theme="dark"] .player-volume-slider {
    background: #444;
}

.player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4285f4;
    cursor: pointer;
}

.player-expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #666;
}

.player-expand-btn:hover {
    background: rgba(66, 133, 244, 0.15);
}

/* 展开的播放器面板 - 水平居中 */
.player-expanded {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 10000;
}

[data-theme="dark"] .player-expanded {
    background: rgba(30, 30, 30, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
}

/* 响应式：小屏幕时展开面板宽度调整 */
@media (max-width: 500px) {
    .player-expanded {
        width: 320px;
        bottom: 70px;
    }
}

@media (max-width: 380px) {
    .player-expanded {
        width: 280px;
        bottom: 70px;
    }
    
    .player-minimized {
        gap: 8px;
    }
    
    .player-info {
        max-width: 100px;
    }
    
    .player-controls {
        gap: 4px;
    }
}

.player-expanded-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .player-expanded-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.player-expanded-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #4285f4;
}

.player-expanded-header button {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.player-expanded-header button:hover {
    color: #4285f4;
}

.player-expanded-cover {
    text-align: center;
    margin-bottom: 20px;
}

.player-expanded-cover svg {
    width: 80px;
    height: 80px;
    stroke: #4285f4;
}

.player-expanded-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .player-expanded-title {
    color: #f0f0f0;
}

.player-expanded-artist {
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 20px;
}

.player-progress-container {
    margin: 15px 0;
}

.player-progress-bar {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

[data-theme="dark"] .player-progress-bar {
    background: #444;
}

.player-progress-filled {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4285f4, #7bed9f);
    border-radius: 4px;
    position: relative;
}

.player-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #999;
    margin-top: 8px;
}

.player-expanded-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.player-expanded-controls button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #666;
}

.player-expanded-controls button:hover {
    background: rgba(66, 133, 244, 0.15);
    transform: scale(1.05);
}

.player-expanded-controls button svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.player-expanded-play svg {
    width: 32px;
    height: 32px;
}

.player-volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .player-volume-control {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.player-volume-control svg {
    width: 16px;
    height: 16px;
    stroke: #999;
}

.player-volume-control input {
    flex: 1;
    height: 3px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

[data-theme="dark"] .player-volume-control input {
    background: #444;
}

.player-volume-control input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4285f4;
    cursor: pointer;
}

.player-playlist {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 10px;
}

[data-theme="dark"] .player-playlist {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* 自定义滚动条样式 */
.player-playlist::-webkit-scrollbar {
    width: 4px;
    display: block;
}

.player-playlist::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.player-playlist::-webkit-scrollbar-thumb {
    background: rgba(66, 133, 244, 0.3);
    border-radius: 4px;
}

.player-playlist::-webkit-scrollbar-thumb:hover {
    background: rgba(66, 133, 244, 0.5);
}

.playlist-item {
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item:hover {
    background: rgba(66, 133, 244, 0.1);
}

.playlist-item.active {
    background: rgba(66, 133, 244, 0.15);
    color: #4285f4;
    font-weight: 500;
}

[data-theme="dark"] .playlist-item {
    color: #aaa;
}

[data-theme="dark"] .playlist-item.active {
    background: rgba(66, 133, 244, 0.2);
    color: #7bed9f;
}

/* 移动端适配 - 播放器在底部居中 */
@media (max-width: 768px) {
    .global-music-player {
        bottom: 10px;
        padding: 6px 12px;
    }
    
    .player-info {
        max-width: 120px;
    }
    
    .player-song-title {
        font-size: 0.75rem;
    }
    
    .player-expanded {
        bottom: 70px;
        width: 300px;
    }
}

/* 播放器隐藏状态 */
.global-music-player.hidden {
    display: none;
}