/* ===== 音乐播放器 - 浮动式 ===== */
.music-player {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ===== 迷你模式：左下角圆形按钮 ===== */
.player-mini {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,107,157,0.95), rgba(198,54,158,0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255,255,255,0.35);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25), 0 0 0 3px rgba(255,255,255,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.player-mini:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3), 0 0 0 4px rgba(255,255,255,0.15);
}
.player-mini .mini-cover {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.4;
}
.player-mini .mini-icon {
    position: relative;
    z-index: 2;
}
.player-mini.playing::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    border-top-color: transparent;
    animation: spin 2s linear infinite;
}
.player-mini .mini-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid #fff;
    z-index: 3;
    display: none;
}

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

/* ===== 展开面板 ===== */
.player-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    width: 360px;
    background: rgba(20, 20, 35, 0.92);
    backdrop-filter: blur(30px) saturate(1.5);
    -webkit-backdrop-filter: blur(30px) saturate(1.5);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: none;
    animation: panelIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.player-panel.show { display: block; }

@keyframes panelIn {
    from { opacity: 0; transform: translateY(15px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 面板头部 */
.panel-header {
    padding: 20px 20px 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.panel-cover {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff6b9d, #c6369e);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}
.panel-cover.playing { animation: coverSpin 8s linear infinite; }
@keyframes coverSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.panel-info {
    flex: 1;
    min-width: 0;
}
.panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.panel-artist {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
}
.panel-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.panel-close:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* 进度条 */
.panel-progress {
    padding: 12px 20px 8px;
}
.progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.progress-bar:hover { height: 6px; }
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b9d, #c6369e);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}
.progress-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.2s;
}
.progress-bar:hover .progress-fill::after { opacity: 1; }
.progress-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.45);
    margin-top: 5px;
}

/* KTV 歌词区 */
.panel-lyrics {
    height: 140px;
    overflow: hidden;
    position: relative;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent);
}
.lyric-lines {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.lyric-line {
    text-align: center;
    font-size: 0.85rem;
    line-height: 2.2;
    color: rgba(255, 255, 255, 0.35);
    transition: all 0.3s;
    min-height: 1.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}
.lyric-line.active {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    transform: scale(1.05);
    letter-spacing: 0.5px;
}
.lyric-line.prev, .lyric-line.next {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.78rem;
}

/* KTV 逐字变色 */
.lyric-line .word {
    position: relative;
    display: inline-block;
    color: rgba(255,255,255,0.35);
    transition: color 0.05s;
}
.lyric-line.active .word { color: rgba(255,255,255,0.85); }
.lyric-line.active .word.sung {
    background: linear-gradient(90deg, #ff6b9d, #c6369e, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: wordGlow 0.3s ease;
}
@keyframes wordGlow {
    0% { filter: brightness(1.5) drop-shadow(0 0 8px rgba(255,107,157,0.8)); }
    100% { filter: brightness(1); }
}

/* 段落式歌词（无LRC时） */
.lyric-text-full {
    font-size: 0.78rem;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.6);
    max-height: 140px;
    overflow-y: auto;
    padding: 5px 10px;
    text-align: left;
}
.lyric-text-full .lyric-tag {
    color: #ff6b9d;
    font-weight: 600;
    margin-top: 8px;
    display: block;
    font-size: 0.75rem;
}
.lyric-text-full::-webkit-scrollbar { width: 4px; }
.lyric-text-full::-webkit-scrollbar-track { background: transparent; }
.lyric-text-full::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* 控制按钮 */
.panel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 8px 20px 15px;
}
.ctrl-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 1rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.ctrl-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.ctrl-btn.play-btn {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #ff6b9d, #c6369e);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}
.ctrl-btn.play-btn:hover { transform: scale(1.08); }
.ctrl-btn.active { color: #ff6b9d; }

/* 播放列表 */
.panel-playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    transition: color 0.2s;
}
.panel-playlist-header:hover { color: #fff; }
.panel-playlist-header .playlist-title { display: flex; align-items: center; gap: 8px; }
.playlist-count {
    background: rgba(255,255,255,0.1);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
}

.playlist-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    border-top: 1px solid transparent;
}
.playlist-body.open {
    max-height: 220px;
    overflow-y: auto;
    border-top-color: rgba(255,255,255,0.06);
}
.playlist-body::-webkit-scrollbar { width: 4px; }
.playlist-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.playlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.playlist-item:hover { background: rgba(255,255,255,0.06); }
.playlist-item.current {
    background: rgba(255, 107, 157, 0.15);
}
.playlist-item .pl-index {
    width: 20px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    text-align: center;
}
.playlist-item.current .pl-index { color: #ff6b9d; }
.playlist-item .pl-title {
    flex: 1;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.playlist-item.current .pl-title {
    color: #ff6b9d;
    font-weight: 600;
}
.playlist-item .pl-time {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
}

/* ===== 移动端 ===== */
@media (max-width: 600px) {
    .music-player {
        bottom: 15px;
        left: 15px;
    }
    .player-mini {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    .player-panel {
        width: calc(100vw - 30px);
        max-width: 380px;
        bottom: calc(100% + 10px);
    }
    .panel-lyrics { height: 120px; }
    .lyric-line { font-size: 0.8rem; line-height: 2; }
    .lyric-line.active { font-size: 0.95rem; }
}
