/* ========== 音乐播放器 ========== */

/* 底部播放器容器 - 桌面端左下角悬浮 */
.music-player {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 9999;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--item_bg_color, rgba(255, 255, 255, 0.78));
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 32px var(--back_filter_color, rgba(0, 0, 0, 0.12));
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
    border-radius: 16px;
    overflow: visible;
    width: 380px;
}

html[data-theme=Dark] .music-player {
    background: rgba(19, 20, 24, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.4);
}

/* 进度条包裹层 */
.player-progress-wrap {
    position: relative;
    width: 100%;
    padding: 0 14px;
}

.player-progress-top {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    position: relative;
    border-radius: 0 0 99px 99px;
    overflow: hidden;
    transition: height 0.15s ease;
    touch-action: none;
}

.player-progress-top:hover,
.player-progress-top.dragging {
    height: 5px;
}

.player-progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    width: 0%;
    transition: width 0.1s linear;
}

/* 时间提示气泡 */
.progress-tooltip {
    position: absolute;
    bottom: 8px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10003;
    letter-spacing: 0.3px;
}

.progress-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.78);
}

.player-progress-wrap:hover .progress-tooltip,
.player-progress-wrap.dragging .progress-tooltip {
    opacity: 1;
}

/* 主控制栏 */
.player-bar {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
}

/* 专辑封面 */
.player-cover {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    position: relative;
}

.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: coverSpin 12s linear infinite;
    animation-play-state: paused;
}

.player-cover.playing img {
    animation-play-state: running;
}

@keyframes coverSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 歌曲信息 */
.player-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.player-info-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 歌名链接 */
.player-song-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--main_text_color, #1a1a2e);
    text-decoration: none;
    cursor: pointer;
}

.player-song-name:hover {
    text-decoration: underline;
}

/* 歌手链接 */
.player-artist {
    font-size: 10px;
    color: var(--item_left_text_color, #888);
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    cursor: pointer;
}

.player-artist:hover {
    text-decoration: underline;
}

.player-artist::before {
    content: '·';
    margin-right: 3px;
    opacity: 0.5;
}

/* 时间显示 - 桌面端 */
.player-time-display {
    font-size: 10px;
    color: var(--item_left_text_color, #888);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 控制按钮区 */
.player-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.player-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.15s ease;
    color: var(--main_text_color, #333);
    padding: 0;
}

.player-btn:hover {
    background: rgba(100, 100, 100, 0.1);
    transform: scale(1.1);
}

.player-btn:active {
    transform: scale(0.95);
}

.player-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 播放按钮 - 白色 */
.player-btn.play-btn {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

html[data-theme=Dark] .player-btn.play-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
}

.player-btn.play-btn:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.12);
}

.player-btn.play-btn svg {
    width: 20px;
    height: 20px;
}

/* 音量控制 */
.player-volume-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.player-volume-slider {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) scaleY(0);
    transform-origin: bottom center;
    width: 32px;
    padding-top: 16px;
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 10002;
    pointer-events: none;
}

.player-volume-slider-inner {
    width: 100%;
    height: 110px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--item_bg_color, rgba(255, 255, 255, 0.92));
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--back_filter_color, rgba(0, 0, 0, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
}

html[data-theme=Dark] .player-volume-slider-inner {
    background: rgba(30, 32, 38, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-volume-wrap:hover .player-volume-slider,
.player-volume-slider.pinned {
    transform: translateX(-50%) scaleY(1);
    opacity: 1;
    pointer-events: auto;
}

.volume-track {
    width: 4px;
    height: 100%;
    background: rgba(150, 150, 150, 0.2);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.volume-fill {
    width: 100%;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.95));
    border-radius: 4px;
    position: absolute;
    bottom: 0;
    height: 80%;
    transition: height 0.1s linear;
}

.volume-fill::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

/* 歌词行 + 手机端时间 */
.player-lyric-row {
    padding: 0 14px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-lyric {
    flex: 1;
    font-size: 12px;
    color: var(--item_left_text_color, #999);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.player-lyric.has-text {
    color: rgba(255, 255, 255, 0.95);
}

html[data-theme=Dark] .player-lyric.has-text {
    color: rgba(255, 255, 255, 0.9);
}

/* 手机端时间 - 桌面端隐藏 */
.player-time-mobile {
    display: none;
    font-size: 10px;
    color: var(--item_left_text_color, #888);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

/* footer */
footer {
    margin-bottom: 0 !important;
}

/* ========== 移动端：全宽底栏 ========== */
@media (max-width: 800px) {
    .music-player {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .player-progress-wrap {
        padding: 0;
    }

    html[data-theme=Dark] .music-player {
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .player-bar {
        padding: 8px 12px;
        gap: 8px;
    }

    .player-cover {
        width: 38px;
        height: 38px;
    }

    .player-btn {
        width: 30px;
        height: 30px;
    }

    .player-btn.play-btn {
        width: 36px;
        height: 36px;
    }

    .player-song-name {
        font-size: 12px;
    }

    .player-controls {
        margin-left: auto;
    }

    .player-lyric {
        font-size: 11px;
    }

    .player-lyric-row {
        padding: 0 12px 8px;
    }

    .player-time-display {
        display: none;
    }

    .player-time-mobile {
        display: block;
    }

    footer {
        margin-bottom: 68px !important;
    }
}

@media (max-width: 480px) {
    .player-info {
        max-width: 100px;
    }
}