/* BGM全局播放器样式 */
.music-player {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, var(--wood-light, #8b5a2b), var(--wood-dark, #4a2c17));
    border: 4px solid var(--gold, #ffd700);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 15px 25px;
    z-index: 100;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.5);
    min-width: 400px;
    max-width: 90vw;
    font-family: 'VT323', monospace;
}
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.player-title {
    color: var(--gold, #ffd700);
    font-size: 1.1rem;
    text-shadow: 1px 1px 0 #000;
}
.player-toggle {
    background: none;
    border: none;
    color: var(--gold, #ffd700);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}
.player-toggle:hover {
    color: #fff;
}

.player-body {
    display: flex;
    align-items: center;
    gap: 15px;
}
.player-controls {
    display: flex;
    gap: 8px;
}
.player-library {
    position: relative;
    min-width: 132px;
}
.player-library::after {
    content: "▾";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-52%);
    color: var(--gold, #ffd700);
    font-size: 0.9rem;
    pointer-events: none;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}
.player-library select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 36px;
    padding: 0 28px 0 12px;
    border-radius: 999px;
    border: 2px solid var(--gold-dark, #b8860b);
    background: linear-gradient(180deg, rgba(32, 18, 10, 0.92) 0%, rgba(20, 11, 6, 0.92) 100%);
    color: var(--gold, #ffd700);
    font-family: 'VT323', monospace;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 1px 1px 0 rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.player-library select:hover {
    border-color: var(--gold, #ffd700);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2), 1px 1px 0 rgba(0, 0, 0, 0.35);
}
.player-library select:focus {
    outline: none;
    border-color: var(--gold, #ffd700);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.28), 1px 1px 0 rgba(0, 0, 0, 0.35);
}
.player-library select:active {
    transform: translateY(1px);
}
.player-library select option {
    background: #1d1008;
    color: #f7d77a;
}
.player-btn {
    background: linear-gradient(to bottom, var(--gold, #ffd700), var(--gold-dark, #b8860b));
    border: 2px solid var(--wood-dark, #4a2c17);
    color: var(--wood-dark, #4a2c17);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.1s;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
.player-btn:hover {
    transform: scale(1.1);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}
.player-btn:active {
    transform: scale(0.95);
    box-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}
.player-btn.play-btn {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
}

.song-info {
    flex: 1;
    min-width: 0;
}
.song-name {
    color: #fff;
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 1px 1px 0 #000;
}
.song-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}
.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(0,0,0,0.4);
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--gold, #ffd700), #fff);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s;
}
.song-time {
    color: var(--gold, #ffd700);
    font-size: 0.9rem;
    min-width: 80px;
    text-align: right;
}

.player-mode {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mode-btn {
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--gold-dark, #b8860b);
    color: var(--gold, #ffd700);
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 0.85rem;
    transition: all 0.1s;
}
.mode-btn:hover, .mode-btn.active {
    background: var(--gold, #ffd700);
    color: var(--wood-dark, #4a2c17);
}

/* 歌曲列表面板 */
.playlist-panel {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(74,44,23,0.98) 0%, rgba(26,15,5,0.98) 100%);
    border: 4px solid var(--gold, #ffd700);
    border-radius: 15px;
    padding: 20px;
    z-index: 99;
    min-width: 350px;
    max-width: 90vw;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    font-family: 'VT323', monospace;
}
.playlist-panel.show {
    display: block;
    animation: slideUp 0.2s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.playlist-header {
    color: var(--gold, #ffd700);
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gold-dark, #b8860b);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.playlist-close {
    background: none;
    border: none;
    color: var(--gold, #ffd700);
    font-size: 1.3rem;
    cursor: pointer;
}
.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 5px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.1s;
    color: #ccc;
}
.playlist-item:hover {
    background: rgba(255,215,0,0.15);
    color: #fff;
}
.playlist-item.playing {
    background: rgba(255,215,0,0.25);
    color: var(--gold, #ffd700);
    border: 1px solid var(--gold-dark, #b8860b);
}
.playlist-item .track-num {
    color: var(--gold-dark, #b8860b);
    font-size: 0.9rem;
    min-width: 25px;
}
.playlist-item .track-name {
    flex: 1;
    font-size: 1.1rem;
}
.playlist-item .track-playing {
    color: var(--gold, #ffd700);
    font-size: 0.9rem;
}

/* 播放器折叠状态 */
.music-player.collapsed .player-body {
    display: none;
}
.music-player.collapsed {
    min-width: auto;
    padding: 10px 20px;
}

@media (max-width: 500px) {
    .music-player {
        min-width: calc(100% - 40px);
        padding: 12px 15px;
    }
    .player-library {
        min-width: 104px;
    }
    .player-library select {
        font-size: 0.85rem;
    }
    .player-mode {
        display: none;
    }
    .song-name {
        font-size: 1rem;
    }
}
