/* 音乐播放器样式 */
.music-player {
    position: fixed;
    z-index: 9999;
    left: 30px;
    bottom: 30px;
    display: flex;
    align-items: center;
    width: 375px;
    background: var(--mp-bg, rgba(25, 25, 35, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 19px;
    padding: 11px 19px;
    box-shadow: var(--mp-shadow, 0 8px 23px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.05),
                0 0 15px rgba(255, 117, 140, 0.3));
    transition:
        width 0.6s cubic-bezier(0.34, 1.2, 0.64, 1),
        padding 0.7s cubic-bezier(0.34, 1.2, 0.64, 1),
        box-shadow 0.7s cubic-bezier(0.34, 1.2, 0.64, 1),
        transform 0.7s cubic-bezier(0.34, 1.2, 0.64, 1),
        background 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
    transform: scale(1);
    min-height: 83px;
}

/* 跑马灯效果容器 */
.music-player::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 22px;
    background: linear-gradient(45deg, 
        var(--marquee-color-1, #ff758c), 
        var(--marquee-color-2, #ff7eb3), 
        var(--marquee-color-3, #759dff), 
        var(--marquee-color-4, #7eb3ff),
        var(--marquee-color-1, #ff758c));
    background-size: 400% 400%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: marqueeMove 3s ease-in-out infinite;
}

/* 播放时显示跑马灯 */
.music-player.playing::before {
    opacity: 1;
}

/* 播放时的轻微脉冲效果 */
.music-player.playing {
    animation: subtlePulse 3s ease-in-out infinite;
}

/* 深色模式下的跑马灯透明度 */
.dark-mode .music-player.playing::before {
    opacity: 0.5;
}

/* 浅色模式下的跑马灯透明度 */
.light-mode .music-player.playing::before {
    opacity: 0.7;
}

/* 深色模式跑马灯颜色 */
.dark-mode .music-player {
    --marquee-color-1: #ff758c;
    --marquee-color-2: #ff7eb3;
    --marquee-color-3: #759dff;
    --marquee-color-4: #7eb3ff;
}

/* 浅色模式跑马灯颜色（稍微柔和一些） */
.light-mode .music-player {
    --marquee-color-1: #ff9fb5;
    --marquee-color-2: #ffa7cc;
    --marquee-color-3: #8fb6ff;
    --marquee-color-4: #a7ccff;
}

/* 跑马灯动画 */
@keyframes marqueeMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 轻微脉冲动画 */
@keyframes subtlePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.005);
    }
    100% {
        transform: scale(1);
    }
}

/* 收缩状态下的跑马灯效果 */
.music-player.collapsed.playing::before {
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 22px;
    opacity: 0.5;
    animation: marqueeMove 4s ease-in-out infinite;
}

/* 收缩状态下的脉冲效果 */
.music-player.collapsed.playing {
    animation: subtlePulse 4s ease-in-out infinite;
}

/* 确保跑马灯不影响播放器的转换动画 */
.music-player::before {
    pointer-events: none;
}

/* 深色模式 */
.dark-mode .music-player {
    --mp-bg: rgba(25, 25, 35, 0.95);
    --mp-shadow: 0 8px 23px rgba(0, 0, 0, 0.4),
                 0 0 0 1px rgba(255, 255, 255, 0.05),
                 0 0 15px rgba(255, 117, 140, 0.3);
    --marquee-color-1: #ff758c;
    --marquee-color-2: #ff7eb3;
    --marquee-color-3: #759dff;
    --marquee-color-4: #7eb3ff;
}


/* 浅色模式 */
.light-mode .music-player {
    --mp-bg: rgba(255, 255, 255, 0.95);
    --mp-shadow: 0 8px 23px rgba(0, 0, 0, 0.08),
                 0 0 0 1px rgba(0, 0, 0, 0.05),
                 0 0 15px rgba(255, 117, 140, 0.12);
    --marquee-color-1: #ff9fb5;
    --marquee-color-2: #ffa7cc;
    --marquee-color-3: #8fb6ff;
    --marquee-color-4: #a7ccff;
}

/* 收缩状态 */
.music-player.collapsed {
    width: 83px;
    padding: 11px;
    transform: scale(0.98);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* 动画与页面一致 */
.music-player,
.music-player.collapsed {
    transition:
        width 0.6s cubic-bezier(0.34, 1.2, 0.64, 1),
        padding 0.7s cubic-bezier(0.34, 1.2, 0.64, 1),
        box-shadow 0.7s cubic-bezier(0.34, 1.2, 0.64, 1),
        transform 0.7s cubic-bezier(0.34, 1.2, 0.64, 1),
        background 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.player-content {
    display: flex;
    align-items: center;
    transition:
        opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
        height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 1;
    width: 100%;
    height: auto;
    overflow: visible;
}

.music-player.collapsed .player-content {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
    transition:
        opacity 0.5s cubic-bezier(0.34, 1, 1, 1),
        width 0.6s cubic-bezier(0.5, 1, 1, 1),
        height 0.6s cubic-bezier(0.5, 1, 1, 1);
}

.music-player.collapsed .vinyl-container {
    margin-right: 0;
    transform: scale(1.02);
}

.music-player:not(.collapsed) {
    transform: scale(1);
}

.vinyl-container {
    position: relative;
    margin-right: 15px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.vinyl {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #0f0f15, #2a2a3a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 11px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    animation: rotate 20s linear infinite;
    animation-play-state: paused;
    transition: all 0.3s ease;
}

.vinyl:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 117, 140, 0.5);
}

.vinyl.playing {
    animation-play-state: running;
}

.vinyl::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-radial-gradient(circle at center, #0f0f15 0%, #0f0f15 5%, transparent 5%, transparent 10%);
    border-radius: 50%;
}

.vinyl-center {
    width: 15px;
    height: 15px;
    background: linear-gradient(45deg, #ff758c, #ff7eb3);
    border-radius: 50%;
    z-index: 2;
    position: relative;
    box-shadow: 0 0 8px rgba(255, 117, 140, 0.7);
}

.vinyl-hole {
    width: 6px;
    height: 6px;
    background: #0f0f15;
    border-radius: 50%;
    position: absolute;
    z-index: 3;
}

.tonearm {
    position: absolute;
    width: 26px;
    height: 2px;
    background: linear-gradient(to right, #888, #ddd);
    border-radius: 2px;
    top: 11px;
    right: -8px;
    transform: rotate(-30deg);
    transform-origin: left center;
    z-index: 1;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    transition: all 0.5s ease;
}

.music-player.collapsed .tonearm {
    transform: rotate(-45deg);
}

.tonearm::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #444;
    border-radius: 50%;
    left: -4px;
    top: -3px;
}

.tonearm::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 11px;
    background: #222;
    border-radius: 2px;
    right: -3px;
    top: -4px;
    transform: rotate(15deg);
}

.song-info {
    margin-right: 15px;
    text-align: left;
    min-width: 135px;
}

.song-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--song-title-color, #f5f5f7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 135px;
}

/* 深色模式歌曲标题 */
.dark-mode .song-title {
    --song-title-color: #f5f5f7;
}

/* 浅色模式歌曲标题 */
.light-mode .song-title {
    --song-title-color: #222;
}

.song-artist {
    font-size: 0.64rem;
    color: var(--song-artist-color, #a0a0a0);
    font-weight: 300;
}

/* 深色模式歌手名 */
.dark-mode .song-artist {
    --song-artist-color: #a0a0a0;
}

/* 浅色模式歌手名 */
.light-mode .song-artist {
    --song-artist-color: #666;
}

.progress-container {
    width: 100%;
    height: 3px;
    background: var(--progress-bg, rgba(255, 255, 255, 0.1));
    border-radius: 2px;
    margin: 6px 0;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

/* 深色模式进度条背景 */
.dark-mode .progress-container {
    --progress-bg: rgba(255, 255, 255, 0.1);
}

/* 浅色模式进度条背景 */
.light-mode .progress-container {
    --progress-bg: rgba(25, 25, 35, 0.1);
}

.progress {
    height: 100%;
    background: linear-gradient(to right, #ff7eb3, #ff758c);
    border-radius: 2px;
    width: 0%;
    position: relative;
    transition: width 0.1s linear;
}

.progress::after {
    content: '';
    position: absolute;
    width: 9px;
    height: 9px;
    background: white;
    border-radius: 50%;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 0 4px rgba(255, 117, 140, 0.8);
}

.progress-container:hover .progress::after {
    opacity: 1;
}

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

.control-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    background: var(--control-bg, rgba(255, 255, 255, 0.1));
    color: var(--control-color, #f5f5f7);
}

/* 深色模式控制按钮 */
.dark-mode .control-btn {
    --control-bg: rgba(255, 255, 255, 0.1);
    --control-color: #f5f5f7;
}

/* 浅色模式控制按钮 */
.light-mode .control-btn {
    --control-bg: rgba(25, 25, 35, 0.12);
    --control-color: #222;
}

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

/* 深色模式悬停效果 */
.dark-mode .control-btn:hover {
    --control-hover-bg: rgba(255, 255, 255, 0.2);
}

/* 浅色模式悬停效果 */
.light-mode .control-btn:hover {
    --control-hover-bg: rgba(25, 25, 35, 0.18);
}

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

.play-btn {
    width: 34px;
    height: 34px;
    background: var(--play-bg, linear-gradient(135deg, #ff7eb3, #ff758c)) !important;
    color: var(--play-color, #fff) !important;
    box-shadow: var(--play-shadow, 0 0 11px rgba(255, 117, 140, 0.5));
}

/* 深色模式播放按钮 */
.dark-mode .play-btn {
    --play-bg: linear-gradient(135deg, #ff7eb3, #ff758c);
    --play-color: #fff;
    --play-shadow: 0 0 11px rgba(255, 117, 140, 0.5);
}

/* 浅色模式播放按钮 */
.light-mode .play-btn {
    --play-bg: linear-gradient(135deg, #222, #444);
    --play-color: #fff;
    --play-shadow: 0 0 11px rgba(25, 25, 35, 0.12);
}

.play-btn:hover {
    box-shadow: var(--play-hover-shadow, 0 0 15px rgba(255, 117, 140, 0.7));
}

/* 深色模式播放按钮悬停 */
.dark-mode .play-btn:hover {
    --play-hover-shadow: 0 0 15px rgba(255, 117, 140, 0.7);
}

/* 浅色模式播放按钮悬停 */
.light-mode .play-btn:hover {
    background: linear-gradient(135deg, #444, #222) !important;
    --play-hover-shadow: 0 0 15px rgba(25, 25, 35, 0.18);
}

.time {
    display: flex;
    justify-content: space-between;
    font-size: 0.56rem;
    color: var(--time-color, #a0a0a0);
    margin-top: 2px;
}

/* 深色模式时间显示 */
.dark-mode .time {
    --time-color: #a0a0a0;
}

/* 浅色模式时间显示 */
.light-mode .time {
    --time-color: #666;
}

.usage-tip {
    position: fixed;
    left: 120px;
    bottom: 38px;
    background: var(--tip-bg, rgba(255, 255, 255, 0.15));
    backdrop-filter: blur(10px);
    padding: 6px 11px;
    border-radius: 11px;
    font-size: 0.64rem;
    color: var(--tip-color, #f5f5f7);
    animation: fadeInOut 3s ease-in-out;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
}

/* 深色模式提示 */
.dark-mode .usage-tip {
    --tip-bg: rgba(255, 255, 255, 0.15);
    --tip-color: #f5f5f7;
}

/* 浅色模式提示 */
.light-mode .usage-tip {
    --tip-bg: rgba(25, 25, 35, 0.15);
    --tip-color: #222;
}


.usage-tip.show {
    opacity: 1;
}

.playlist-popup {
    position: absolute;
    left: 0;
    bottom: 100%;
    min-width: 165px;
    background: var(--playlist-bg, rgba(25,25,35,0.98));
    border-radius: 11px;
    box-shadow: var(--playlist-shadow, 0 6px 18px rgba(0,0,0,0.3));
    padding: 11px 15px;
    z-index: 10;
    display: none;
    animation: fadeIn 0.3s;
    margin-bottom: 14px;
}
.dark-mode .playlist-popup {
    --playlist-bg: rgba(25,25,35,0.98);
    --playlist-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
.light-mode .playlist-popup {
    --playlist-bg: rgba(255,255,255,0.98);
    --playlist-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.playlist-popup.show {
    display: block;
}

.playlist-popup ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.playlist-popup li {
    padding: 6px 0;
    color: var(--playlist-li-color, #f5f5f7);
    cursor: pointer;
    border-bottom: 1px solid var(--playlist-li-border, rgba(255,255,255,0.07));
    transition: background 0.2s;
    font-size: 0.8rem;
}
.light-mode .playlist-popup li {
    --playlist-li-color: #222;
    --playlist-li-border: rgba(0,0,0,0.07);
}

.playlist-popup li:last-child {
    border-bottom: none;
}

.playlist-popup li:hover {
    background: rgba(255,117,140,0.08);
    color: #ff7eb3;
}

/* 二级菜单样式 */
.playlist-header {
    padding: 8px 0 12px 0;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--playlist-header-color, #ff7eb3);
    border-bottom: 1px solid var(--playlist-li-border, rgba(255,255,255,0.1));
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.light-mode .playlist-header {
    --playlist-header-color: #ff758c;
}

.back-btn {
    background: none;
    border: none;
    color: var(--playlist-li-color, #f5f5f7);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.back-btn:hover {
    background: rgba(255,117,140,0.15);
    color: #ff7eb3;
}

.playlist-menu, .track-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.playlist-item, .track-menu li {
    padding: 8px 4px;
    color: var(--playlist-li-color, #f5f5f7);
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.playlist-item:hover, .track-menu li:hover {
    background: rgba(255,117,140,0.12);
    color: #ff7eb3;
    transform: translateX(2px);
}

.playlist-item i {
    width: 14px;
    font-size: 0.75rem;
    color: #ff758c;
}

.playlist-item small {
    margin-left: auto;
    opacity: 0.7;
    font-size: 0.7rem;
}

.track-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.track-title {
    font-size: 0.8rem;
    font-weight: 500;
}

.track-artist {
    font-size: 0.7rem;
    opacity: 0.8;
}

.track-menu li.active {
    background: rgba(255,117,140,0.15);
    color: #ff7eb3;
}

.track-menu li.active .track-title {
    color: #ff7eb3;
}

.track-menu li i {
    width: 14px;
    font-size: 0.75rem;
    color: #ff758c;
}

/* 扩大弹窗以适应新布局 */
.playlist-popup {
    min-width: 200px;
    max-width: 250px;
    max-height: 300px;
    overflow-y: auto;
}

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

.playlist-popup::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.playlist-popup::-webkit-scrollbar-thumb {
    background: rgba(255, 117, 140, 0.3);
    border-radius: 2px;
}

.playlist-popup::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 117, 140, 0.5);
}

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

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(10px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px);}
    to { opacity: 1; transform: translateY(0);}
}

@media (max-width: 768px) {
    .music-player {
        width: calc(100% - 30px);
        left: 15px;
        bottom: 15px;
    }
    
    .music-player.collapsed {
        width: 68px;
    }
    
    .usage-tip {
        left: 50%;
        transform: translateX(-50%);
        bottom: 90px;
        text-align: center;
        width: 80%;
    }
}

/* ========== Dark 模式音乐播放器暗金效果 ========== */

html[data-theme="dark"] .dark-mode .music-player {
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 20, 0.95));
    border: 2px solid rgba(212, 175, 55, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(212, 175, 55, 0.1),
        inset 0 1px 0 rgba(212, 175, 55, 0.2);
}

html[data-theme="dark"] .dark-mode .song-title {
    color: #d4af37;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

html[data-theme="dark"] .dark-mode .progress {
    background: linear-gradient(90deg, #d4af37, #ffd700, #b8860b);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

html[data-theme="dark"] .dark-mode .progress-container {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

html[data-theme="dark"] .dark-mode .control-btn:hover {
    background: linear-gradient(45deg, rgba(212, 175, 55, 0.1), rgba(255, 215, 0, 0.1));
    border-color: #d4af37;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

html[data-theme="dark"] .dark-mode .play-btn {
    border: 2px solid rgba(212, 175, 55, 0.4);
}

html[data-theme="dark"] .dark-mode .play-btn:hover {
    background: linear-gradient(45deg, #d4af37, #b8860b);
    box-shadow: 
        0 0 20px rgba(212, 175, 55, 0.4),
        inset 0 1px 0 rgba(255, 215, 0, 0.3);
}
