/* 音乐播放器样式 */
.music-player {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    transition: all 0.3s ease;
}

.player-toggle {
    background-color: #333;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50% 0 0 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
}

.player-container {
    width: 0;
    height: 180px;
    background: rgba(255, 255, 255, 0.95);
    position: absolute;
    right: 30px;
    top: 0;
    overflow: hidden;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: width 0.3s ease;
    position: relative;
}

.music-player.expanded .player-container {
    width: 280px;
}

.player-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(8px);
    z-index: 1;
    opacity: 0.3;
}

.player-controls {
    position: relative;
    z-index: 2;
    padding: 12px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.album-art {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
    align-self: flex-start;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.album-art .music-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #333;
    display: none;
}

.album-art img[src=""], .album-art img[alt="专辑封面"]:not([src]) {
    display: none;
}

.album-art img[src=""]:after, .album-art img[alt="专辑封面"]:not([src]):after {
    content: '';
    display: block;
}

.album-art img[src=""] + .music-icon, .album-art img[alt="专辑封面"]:not([src]) + .music-icon {
    display: block;
}

.album-art.playing {
    animation: rotate 10s linear infinite;
}

.song-info {
    text-align: left;
    margin: 8px 0;
    color: #333;
}

.song-info h3 {
    margin: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.song-info p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.player-buttons {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.player-buttons button {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s ease;
}

.player-buttons button:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.progress-container {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 5px;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #333;
}

.lyrics-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 999;
}

.lyrics-container.show {
    transform: translateY(0);
}

.lyrics-content {
    text-align: center;
    line-height: 1.4;
    padding: 0 20px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

.lyrics-content span {
    transition: all 0.3s ease;
}

.lyrics-content .current-line {
    color: #ff5e5e;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 94, 94, 0.7);
}

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

/* 修复图片加载失败时的显示 */
.album-art img[src=""] {
    display: none;
}

.album-art img:not([src]), .album-art img[src=""] {
    display: none;
}

.album-art:not(:has(img[src])) .music-icon, 
.album-art img[src=""] ~ .music-icon {
    display: block;
}