/* [位置] H5前端源码/music-player/music-player.css */
/* ============================================
 * 文件说明：音乐播放器样式 music-player.css
 * 所属大模块：H5下单端模块
 * 所属子模块：music-player 极简黑胶唱片机
 * 文件核心功能：定义音乐播放器面板/遮罩/唱片旋转等全部样式
 * 对应业务场景：H5 端悬浮音乐播放器外观
 * ============================================ */

/* ============================================
   音乐播放器 - 极简风格
   ============================================ */

/* --- 遮罩 --- */
#music-panel-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9998; display: none;
    align-items: center; justify-content: center;
}
#music-panel-overlay.show {
    display: flex;
}

/* --- 播放面板 --- */
#music-panel {
    position: relative; width: 100%; max-width: 480px;
    background: linear-gradient(180deg, #2a3340 0%, #2d3a35 50%, #252f2a 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    /* 唱臂组件移到了唱片正上方，面板纵向变高；超高时内部滚动兜底（滚动条隐藏） */
    overflow-x: hidden; overflow-y: auto;
    scrollbar-width: none;
    display: flex; flex-direction: column;
    max-height: 90vh;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    opacity: 0; transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    contain: layout style;
    will-change: transform, opacity;
}
#music-panel::-webkit-scrollbar { width: 0; height: 0; display: none; }
#music-panel-overlay.show #music-panel,
#music-panel.show {
    opacity: 1; transform: scale(1);
}

/* 头部 */
#music-panel .mp-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px 0; position: relative; z-index: 5; flex-shrink: 0;
}
#music-panel .mp-header .mp-header-left {
    display: flex; gap: 8px; align-items: center;
}
#music-panel .mp-header .mp-header-right {
    display: flex; gap: 8px; align-items: center;
}
#music-panel .mp-header .mp-close,
#music-panel .mp-header .mp-lyrics-btn {
    width: 30px; height: 30px; border: none;
    background: rgba(255,255,255,0.08);
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.6); font-size: 14px;
    transition: opacity 0.15s; line-height: 1;
    flex-shrink: 0; padding: 0;
}
#music-panel .mp-header .mp-close:hover,
#music-panel .mp-header .mp-lyrics-btn:hover {
    opacity: 0.8;
}
#music-panel .mp-header .mp-lyrics-btn {
    font-size: 15px; font-weight: 600;
}
#music-panel .mp-header .mp-lyrics-btn.has-lyrics {
    color: #fff;
    background: rgba(255,255,255,0.15);
}


/* 音质指示灯 */
#music-panel .mp-header .mp-quality-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: background 0.3s;
    flex-shrink: 0;
}
#music-panel .mp-header .mp-quality-dot.active {
    background: #2ecc71;
}

/* ============================================================
   唱片区域
   ============================================================ */
#music-panel .record-wrap {
    position: relative; width: 320px; height: 320px;
    /* 顶部预留 84px：唱臂支点钉在唱片正上方 1.2R 处（含位图半幅），整体再上移 */
    margin: 84px auto 36px;
    flex-shrink: 0;
}
#music-panel .record-shadow {
    position: absolute; inset: -6px; border-radius: 50%;
    box-shadow:
        0 14px 48px rgba(0,0,0,0.55),
        0 0 0 1px rgba(255,255,255,0.03);
    pointer-events: none;
}

/* ============================================================
   唱臂（黑胶唱机物理模型 · 角度/坐标全部由 JS 运行时解算）
   ------------------------------------------------------------
   本文件只负责外观与层级，不再写死任何旋转角度与落点坐标：
     · 转轴 P 固定在唱片外侧、臂长 L 固定（TonearmController 写入 left/top）
     · 给定"唱针应处的半径 r"，解两圆交点 ⊙(唱片中心,r) ∩ ⊙(P,L) 得唱针
       坐标 T，唱臂转角 θ = atan2(T−P)；半径→角度一一映射，落点永不漂移
     · 抬起/落下 = 臂体在屏幕空间位移 + 轻微放大，投影(影子)留在唱片上不
       动并变淡 —— 两者分离产生真实"离盘高度"，不再靠改角度假装抬起
   ============================================================ */
#music-panel .tonearm {
    position: absolute; left: 0; top: 0; width: 0; height: 0;
    z-index: 10; pointer-events: none;
}
/* 启动未量测前 SVG 宽高=0（自然不可见），量测后由 TonearmController 写入 left/top/size 直接可见 */

/* 臂体 / 投影：两个同构图层，各自独立 transform，原点即转轴 */
#music-panel .tonearm-layer {
    position: absolute; left: 0; top: 0; width: 0; height: 0;
    transform-origin: 0 0;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
#music-panel .tonearm-art {
    position: absolute; left: 0; top: 0; display: block; overflow: visible;
    -webkit-user-drag: none; user-select: none; -webkit-user-select: none;
}

/* 投影：抬起时影子留在唱片表面（不随臂体上移）并变淡 —— 高度感来源 */
#music-panel .tonearm-shadow {
    filter: brightness(0) blur(3.5px);
    opacity: 0.42;
    transition: opacity 0.5s ease;
}
#music-panel .tonearm-shadow.raised { opacity: 0.22; }

/* 臂体：抬起时轻微提亮，强化"已离开唱片"的读数 */
#music-panel .tonearm-arm { transition: filter 0.5s ease; }
#music-panel .tonearm-arm.raised { filter: brightness(1.1) saturate(0.92); }

/* ============================================================
   黑胶唱片 - 真实唱片质感
   简洁分层：声槽(阿基米德螺旋线) → 底色3D弧度 → 标签凹陷 → 镜面光泽+彩虹衍射
   声槽外圈间距略宽、往内圈自然收窄，沟槽清晰可辨
   ============================================================ */
#music-panel .record {
    width: 100%; height: 100%; border-radius: 50%;
    /* ① 声槽：标准阿基米德螺旋线（外圈间距略宽、往内圈自然收窄）+ 深碳黑底色 */
    background:
        url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='320'%20height='320'%20viewBox='0%200%20320%20320'%3E%3Cg%20fill='none'%3E%3Cg%20transform='translate(0%200.5)'%20stroke='rgba(0,0,0,0.50)'%20stroke-width='1.0'%3E%3Ccircle%20cx='160'%20cy='160'%20r='158.2'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='154.3'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='150.5'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='146.8'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='143.2'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='139.6'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='136.2'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='132.8'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='129.6'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='126.4'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='123.4'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='120.4'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='117.5'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='114.7'/%3E%3C/g%3E%3Cg%20stroke='rgba(255,255,255,0.20)'%20stroke-width='0.8'%3E%3Ccircle%20cx='160'%20cy='160'%20r='158.2'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='154.3'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='150.5'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='146.8'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='143.2'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='139.6'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='136.2'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='132.8'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='129.6'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='126.4'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='123.4'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='120.4'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='117.5'/%3E%3Ccircle%20cx='160'%20cy='160'%20r='114.7'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat,
        radial-gradient(ellipse at 50% 48%, #2a2a26 0%, #1c1c19 22%, #11110f 55%, #090908 100%);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    /* 外缘立体收边 */
    box-shadow:
        inset 0 0 0 0.5px rgba(0,0,0,0.5),
        0 0 0 2.5px rgba(22,22,20,0.9),
        0 0 0 3px rgba(255,255,255,0.015);
    /* ============================================================
       唱片旋转：动画「常驻」在元素上，只用 animation-play-state 控制启停
       ------------------------------------------------------------
       之前把 animation 写在 .record.playing 上：暂停时移除 .playing 会把动画整个卸载，
       transform 立即回到 0deg —— 表现为“唱片不是停在原地，而是被重置”。
       现在动画始终存在，暂停只切 play-state：定格在当前角度，
       恢复播放从定格角度继续转（切歌也不再归零）。
       ============================================================ */
    animation: mp-disc-spin 20s linear infinite;
    animation-play-state: paused;
    will-change: transform;
}

/* ② 标签区凹陷环：封面嵌入唱片的物理凹陷 */
#music-panel .record::before {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, transparent 32%, rgba(0,0,0,0.4) 33%, rgba(0,0,0,0.2) 34%, rgba(0,0,0,0.05) 35.5%, transparent 37%);
    pointer-events: none; z-index: 0;
}

/* ③ 镜面光泽 + 彩虹棱镜衍射 */
#music-panel .record::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background:
        /* 主高光：左上角大面积柔光，模拟镜面反射 */
        radial-gradient(ellipse at 28% 22%,
            rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 10%, rgba(255,255,255,0.02) 25%, transparent 48%),
        /* 次高光：右下角微弱补光 */
        radial-gradient(ellipse at 72% 78%,
            rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 12%, transparent 35%),
        /* 彩虹衍射（上）：紫→蓝→青，沟槽对光线的棱镜色散 */
        radial-gradient(ellipse at 24% 16%,
            rgba(180,140,255,0.06) 0%, rgba(90,150,255,0.04) 8%, rgba(80,200,180,0.03) 18%, transparent 40%),
        /* 彩虹衍射（下）：橙→粉 */
        radial-gradient(ellipse at 68% 76%,
            rgba(255,175,90,0.04) 0%, rgba(255,120,150,0.03) 12%, transparent 35%);
    pointer-events: none; z-index: 0;
}

/* 播放中：仅把常驻动画改为 running，不重新挂载 animation（重挂载 = 角度归零） */
#music-panel .record.playing {
    animation-play-state: running;
}
@keyframes mp-disc-spin { to { transform: rotate(360deg); } }

/* ⑤ 封面（标签区）：嵌入唱片中心；直径压到最内圈声槽(114.7/160)消除外露黑胶圈 20261001 */
#music-panel .cover-box {
    width: 232px; height: 232px; border-radius: 50%;
    overflow: hidden;
    /* 嵌入感 */
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.5),
        inset 0 -1px 2px rgba(255,255,255,0.03),
        0 0 0 0.5px rgba(0,0,0,0.4),
        0 2px 10px rgba(0,0,0,0.3);
    z-index: 1; position: relative; background: #1a1a1a;
}
/* 封面光泽：标签纸塑料覆膜反光 */
#music-panel .cover-box::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background:
        radial-gradient(ellipse at 32% 28%,
            rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.05) 15%, transparent 48%),
        radial-gradient(ellipse at 65% 70%,
            rgba(255,255,255,0.04) 0%, transparent 32%);
    pointer-events: none; z-index: 2;
}
#music-panel .cover-box img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
#music-panel .cover-box .cover-placeholder {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 56px; height: 56px; color: rgba(255,255,255,0.25);
    pointer-events: none;
}
#music-panel .cover-box .cover-placeholder svg {
    width: 100%; height: 100%; display: block;
}

/* --- 歌曲信息 --- */
#music-panel .song-info {
    padding: 0 20px; margin-bottom: 14px; text-align: left;
    /* 歌曲信息与爱心按钮同行（爱心只作用于当前播放的这一首） */
    display: flex; align-items: center; gap: 10px;
}
#music-panel .song-info .song-main {
    flex: 1; min-width: 0;
}
#music-panel .song-name {
    font-size: 22px; font-weight: 700; letter-spacing: 0.3px;
    margin-bottom: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#music-panel .singer {
    font-size: 13px; color: rgba(255,255,255,0.5);
    letter-spacing: 0.2px;
}

/* --- 行内歌词 --- */
#music-panel .mp-lyrics-inline {
    max-height: 72px; min-height: 46px; margin: 0 20px 12px;
    overflow-y: auto; text-align: center;
    position: relative;
    scroll-behavior: smooth;
}
#music-panel .mp-lyrics-inline .lyric-cur {
    font-size: 15px; color: #fff;
    font-weight: 600; line-height: 24px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#music-panel .mp-lyrics-inline .lyric-cur.show {
    opacity: 1; transform: translateY(0);
}
#music-panel .mp-lyrics-inline .lyric-next {
    font-size: 13px; color: rgba(255,255,255,0.35);
    line-height: 22px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* --- 制作人员信息 --- */
#music-panel .mp-credits {
    margin: 0 20px 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    max-height: 80px;
    overflow-y: auto;
}
#music-panel .mp-credits-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}
#music-panel .mp-credit-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
}
#music-panel .mp-credit-label {
    color: rgba(255,255,255,0.35);
    white-space: nowrap;
}
#music-panel .mp-credit-value {
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
}
#music-panel .mp-credit-source {
    display: block;
    width: 100%;
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    margin-top: 2px;
    text-align: right;
}



/* --- 错误提示 --- */
#music-panel .mp-error {
    margin: 0 20px 8px; padding: 8px 14px;
    background: rgba(231,76,60,0.2); color: #f5a5a0;
    border-radius: 8px; font-size: 12px;
    text-align: center; border: 1px solid rgba(231,76,60,0.25);
}

/* --- 进度条 --- */
#music-panel .progress-wrap { padding: 0 20px; margin-bottom: 18px; position: relative; }
#music-panel .waveform-canvas {
    position: absolute; bottom: 28px; left: 20px; right: 20px;
    height: 40px; z-index: 0; pointer-events: none;
    opacity: 0.6; border-radius: 3px;
}
#music-panel .progress-bar {
    width: 100%; height: 3px; background: rgba(255,255,255,0.15);
    border-radius: 3px; position: relative; cursor: pointer;
    touch-action: none; z-index: 1;
}
#music-panel .progress-fill {
    height: 100%; width: 0%; background: #fff;
    border-radius: 3px; position: relative;
    transition: width 0.1s linear;
}
#music-panel .progress-dot {
    position: absolute; right: -5px; top: 50%; transform: translateY(-50%);
    width: 10px; height: 10px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform 0.1s;
    cursor: grab;
}
#music-panel .progress-bar:active .progress-dot,
#music-panel .progress-bar.dragging .progress-dot {
    transform: translateY(-50%) scale(1.3);
    cursor: grabbing;
}
#music-panel .time-row {
    display: flex; justify-content: space-between;
    font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 6px;
}

/* ============================================================
   控制按钮
   ============================================================ */
#music-panel .control-btns {
    display: flex; align-items: center; justify-content: center;
    gap: 32px; padding: 0 20px 16px;
}
#music-panel .control-btns .ctrl-btn {
    background: transparent; border: none; color: #fff;
    cursor: pointer; opacity: 0.7;
    transition: opacity 0.15s;
    display: flex; align-items: center; justify-content: center;
    padding: 0; line-height: 1; width: 36px; height: 36px;
    flex-shrink: 0;
}
#music-panel .control-btns .ctrl-btn:hover { opacity: 1; }
#music-panel .control-btns .ctrl-btn svg { width: 24px; height: 24px; display: block; }
#music-panel .control-btns .play-btn {
    width: 52px; height: 52px;
    margin-left: 8px; margin-right: 8px;
    opacity: 0.85;
}
#music-panel .control-btns .play-btn svg { width: 36px; height: 36px; }
#music-panel .control-btns .play-btn:hover { opacity: 1; }
#music-panel .control-btns .loop-btn.loop-active,
#music-panel .control-btns .loop-btn.loop-single,
#music-panel .control-btns .loop-btn.loop-shuffle { opacity: 1; }
#music-panel .control-btns .loop-btn.loop-single svg { color: #e74c3c; }
#music-panel .control-btns .loop-btn.loop-shuffle svg { color: #f39c12; }

/* ============================================================
   播放列表弹出层
   ============================================================ */
#music-panel .playlist-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, #2d3a35 0%, #212b26 100%);
    z-index: 20; display: none; flex-direction: column;
    border-radius: 16px; overflow: hidden;
}
#music-panel .playlist-overlay.show { display: flex; }
#music-panel .playlist-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
#music-panel .playlist-header .pl-title {
    font-size: 16px; font-weight: 600; color: #fff;
}
#music-panel .playlist-header .pl-close {
    width: 28px; height: 28px; border: none;
    background: rgba(255,255,255,0.1); border-radius: 50%;
    cursor: pointer; color: rgba(255,255,255,0.6); font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.15s;
}
#music-panel .playlist-header .pl-close:hover { opacity: 0.8; }
#music-panel .playlist-header .pl-fav-link {
    margin-left: auto;
    border: none; background: transparent;
    color: rgba(255,255,255,0.55);
    font-size: 12px; cursor: pointer; padding: 4px 2px;
    transition: color 0.15s;
    white-space: nowrap;
}
#music-panel .playlist-header .pl-fav-link:hover { color: #ff5c8a; }
#music-panel .mp-playlist {
    flex: 1; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#music-panel .mp-playlist .mp-pl-item {
    display: flex; align-items: center; padding: 12px 20px;
    cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.1s; font-size: 13px;
    color: rgba(255,255,255,0.5);
}
#music-panel .mp-playlist .mp-pl-item:hover { background: rgba(255,255,255,0.05); }
#music-panel .mp-playlist .mp-pl-item.active {
    color: #fff; background: rgba(255,255,255,0.1);
}
#music-panel .mp-playlist .mp-pl-item .mp-pl-num {
    width: 28px; color: rgba(255,255,255,0.3); font-size: 12px; flex-shrink: 0;
}
#music-panel .mp-playlist .mp-pl-item.active .mp-pl-num { color: rgba(255,255,255,0.6); }
#music-panel .mp-playlist .mp-pl-item .mp-pl-name {
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#music-panel .mp-playlist .mp-pl-item .mp-pl-dur {
    font-size: 11px; color: rgba(255,255,255,0.3); margin-left: 10px; flex-shrink: 0;
}
#music-panel .mp-playlist .mp-pl-item.failed {
    color: rgba(255,255,255,0.15) !important;
    text-decoration: line-through; pointer-events: none;
}
#music-panel .mp-playlist .mp-pl-item.failed .mp-pl-num,
#music-panel .mp-playlist .mp-pl-item.failed .mp-pl-dur { color: rgba(255,255,255,0.1) !important; }

/* ============================================================
   迷你悬浮播放器 - 彩色渐变
   ============================================================ */
#music-mini-player {
    position: fixed; bottom: 80px; right: 20px;
    z-index: 9999; width: 56px; height: 56px;
    border-radius: 50%;
    cursor: grab;
    user-select: none; -webkit-tap-highlight-color: transparent;
    touch-action: none;
    background: linear-gradient(135deg, #ff0080, #ff8c00, #40e0d0, #8a2be2, #ff0080);
    background-size: 400% 400%;
    animation: mp-color-shift 4s ease infinite;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
@keyframes mp-color-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
#music-mini-player:active { cursor: grabbing; }
#music-mini-player:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}
#music-mini-player.pulse-anim {
    animation: mp-pulse 0.6s ease 2;
}
@keyframes mp-pulse {
    0% { transform: scale(1); box-shadow: 0 4px 16px rgba(0,0,0,0.35); }
    50% { transform: scale(1.2); box-shadow: 0 0 25px rgba(255,128,0,0.6); }
    100% { transform: scale(1); box-shadow: 0 4px 16px rgba(0,0,0,0.35); }
}

#music-mini-player .mp-mini-icon {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    z-index: 1;
    opacity: 0.85;
    transition: opacity 0.15s;
}
#music-mini-player:hover .mp-mini-icon { opacity: 1; }
#music-mini-player .mp-mini-icon svg {
    width: 100%; height: 100%; display: block;
}

/* 播放时旋转 */
#music-mini-player.playing .mp-mini-icon {
    animation: mp-mini-spin 3s linear infinite;
}
@keyframes mp-mini-spin { to { transform: rotate(360deg); } }

/* 迷你按钮提示 */
#music-mini-tooltip {
    position: fixed; z-index: 9999;
    background: rgba(30,30,30,0.9); color: #eee;
    padding: 5px 12px; border-radius: 6px;
    font-size: 11px; white-space: nowrap; max-width: 180px;
    overflow: hidden; text-overflow: ellipsis;
    pointer-events: none; opacity: 0; transition: opacity 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#music-mini-tooltip.show { opacity: 1; }

/* ============================================================
   桌面端 (>= 769px)
   ============================================================ */
@media (min-width: 769px) {
    #music-panel {
        max-width: 480px;
    }
    #music-panel .record-wrap {
        width: 320px; height: 320px;
    }
    #music-panel .cover-box {
        width: 232px; height: 232px;
    }
}

/* ============================================================
   移动端 (<= 768px)
   ============================================================ */
@media (max-width: 768px) {
    #music-panel {
        width: 94vw; max-width: 100%; border-radius: 14px;
    }
    #music-panel .record-wrap {
        width: 260px; height: 260px;
        /* 移动端同构缩放：顶部预留 ≈0.49R，容纳正上方唱臂支点与停放位 */
        margin: 64px auto 28px;
    }
    #music-panel .cover-box {
        width: 188px; height: 188px;
    }
    #music-panel .cover-box .cover-placeholder {
        width: 48px; height: 48px;
    }
    #music-panel .song-name { font-size: 18px; }
    #music-panel .singer { font-size: 12px; }

    /* 唱臂无需在这里覆写尺寸：TonearmController 按 .record-wrap 实测尺寸
       等比解算（转轴距离/臂长/纹路半径/抬升高度全部以唱片半径 R 为单位），
       移动端 260px 唱片与桌面端 320px 唱片自动同构，不再有第二套魔数。 */

    #music-panel .control-btns { gap: 24px; padding: 0 14px 12px; }
    #music-panel .control-btns .ctrl-btn { width: 30px; height: 30px; }
    #music-panel .control-btns .ctrl-btn svg { width: 20px; height: 20px; }
    #music-panel .control-btns .play-btn { width: 46px; height: 46px; margin-left: 6px; margin-right: 6px; }
    #music-panel .control-btns .play-btn svg { width: 30px; height: 30px; }

    #music-panel .progress-wrap { padding: 0 16px; margin-bottom: 14px; }
    #music-panel .song-info { padding: 0 16px; }
    #music-panel .mp-lyrics-inline { margin: 0 16px 10px; max-height: 64px; min-height: 42px; }
    #music-panel .mp-lyrics-inline .lyric-cur { font-size: 14px; line-height: 22px; }
    #music-panel .mp-lyrics-inline .lyric-next { font-size: 12px; line-height: 20px; }
    #music-panel .mp-credits { margin: 0 16px 8px; max-height: 60px; }
    #music-panel .mp-credit-item { font-size: 10px; }

    

    #music-mini-player { bottom: 90px; right: 14px; width: 48px; height: 48px; }
    #music-mini-player .mp-mini-icon { width: 26px; height: 26px; }
}

/* ============================================================
   覆盖灵动岛 pointer-events 限制，使其可点击
   原 Vue 组件设置了 pointer-events: none，阻止点击事件触发
   使用多级选择器覆盖 Vue scoped [data-v-xxx] 属性选择器
   ============================================================ */
.dynamic-island,
.dynamic-island.active,
.dynamic-island.inactive,
[class*="dynamic-island"],
[class*="dynamic-island"][class*="active"],
[class*="dynamic-island"][class*="inactive"],
div[class*="dynamic-island"] {
    pointer-events: auto !important;
    /* GPU加速：将灵动岛提升到独立合成层，避免重绘时影响其他元素 */
    will-change: transform;
    /* ⚠ 不要加 contain: layout！
       contain: layout 会让本元素成为其 fixed 后代的包含块，
       连带劫持灵动岛自身的 fixed 定位基准，导致岛被挤到视口右下角并被裁切。
       这里的隔离布局收益远小于它造成的定位错乱，故移除。 */
}

/* ============================================================
   灵动岛位置加固：强制固定在屏幕【顶部居中】
   ------------------------------------------------------------
   组件 dynamic-island.vue 本身已写 top:16px; left:50%;
   transform:translateX(-50%)，本应就在顶部。这里用 !important 兜底，
   防止任何后加载的样式把位置改跑。

   ⚠ 关键：只改垂直方向（top/bottom），绝不动 left 与 transform。
   组件的水平居中依赖 translateX(-50%)，且展开/收起动画复用同一个
   transform（translateX(-50%) scale(0/1)）——一旦覆盖 left 或 transform，
   岛会偏出屏幕（曾实测 margin:auto 居中与 translateX(-50%) 叠加，
   导致 390px 屏偏左 95.5px 且动画失效）。
   ============================================================ */
.dynamic-island,
.dynamic-island.active,
.dynamic-island.inactive,
[class*="dynamic-island"],
[class*="dynamic-island"][class*="active"],
[class*="dynamic-island"][class*="inactive"],
div[class*="dynamic-island"] {
    position: fixed !important;
    /* 刘海屏安全区 + 12px 空隙；不支持 env() 时回退 12px */
    top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
    /* 关键：清掉任何 bottom 定位，否则与 top 同时生效会把元素拉伸变形 */
    bottom: auto !important;
    /* 水平居中沿用组件自身的 left:50% + translateX(-50%)，此处不覆盖 */
    max-width: 80vw !important;
    /* 浮在页面内容之上 */
    z-index: 100000 !important;
}
/* ============================================================
   收藏（对标酷狗音乐：每首歌收藏状态独立，互不联动）
   - 面板爱心按钮：作用于当前播放曲目
   - 播放列表行内爱心 + 收藏总数：逐行独立，点击不触发播放
   - 我的收藏入口：面板右上角 + 播放列表头部
   ============================================================ */
#music-panel .song-info .mp-fav-btn {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 4px;
    height: 32px; padding: 0 12px;
    border: none; border-radius: 16px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    cursor: pointer; font-size: 13px; line-height: 1;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}
#music-panel .song-info .mp-fav-btn:active { transform: scale(0.94); }
#music-panel .song-info .mp-fav-btn .mp-fav-icon { font-size: 15px; line-height: 1; display: inline-block; }
#music-panel .song-info .mp-fav-btn .mp-fav-icon::before { content: '\2661'; }
#music-panel .song-info .mp-fav-btn .mp-fav-num {
    font-size: 12px; font-variant-numeric: tabular-nums;
    color: rgba(255,255,255,0.5);
}
#music-panel .song-info .mp-fav-btn.on {
    color: #ff5c8a; background: rgba(255,92,138,0.16);
}
#music-panel .song-info .mp-fav-btn.on .mp-fav-icon::before { content: '\2665'; }
#music-panel .song-info .mp-fav-btn.on .mp-fav-num { color: rgba(255,92,138,0.85); }
/* 点亮/熄灭时爱心跳动一次（不写静止隐藏态，避免动画被跳过后元素不可见） */
#music-panel .song-info .mp-fav-btn.on .mp-fav-icon { animation: mp-fav-pop 0.42s ease-out; }
@keyframes mp-fav-pop {
    0% { transform: scale(0.6); }
    55% { transform: scale(1.32); }
    100% { transform: scale(1); }
}

/* 面板右上角「我的收藏」入口（与歌词按钮同风格） */
#music-panel .mp-header .mp-fav-list-btn {
    width: 30px; height: 30px; border: none;
    background: rgba(255,255,255,0.08);
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.55); font-size: 14px; line-height: 1;
    transition: opacity 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
#music-panel .mp-header .mp-fav-list-btn:hover { opacity: 0.85; color: #ff5c8a; }

/* 播放列表行内：收藏总数 + 爱心（每行独立） */
#music-panel .mp-playlist .mp-pl-item .mp-pl-count {
    font-size: 11px; color: rgba(255,255,255,0.3);
    margin-left: 8px; flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
#music-panel .mp-playlist .mp-pl-item .mp-pl-fav {
    display: inline-block;
    width: 24px; flex-shrink: 0;
    margin-left: 4px; text-align: center;
    font-size: 13px; line-height: 1;
    color: rgba(255,255,255,0.22);
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}
#music-panel .mp-playlist .mp-pl-item .mp-pl-fav::before { content: '\2661'; }
#music-panel .mp-playlist .mp-pl-item .mp-pl-fav.on { color: #ff5c8a; }
#music-panel .mp-playlist .mp-pl-item .mp-pl-fav.on::before { content: '\2665'; }
#music-panel .mp-playlist .mp-pl-item .mp-pl-fav:active { transform: scale(1.3); }
#music-panel .mp-playlist .mp-pl-item.active .mp-pl-count { color: rgba(255,255,255,0.5); }
#music-panel .mp-playlist .mp-pl-item.failed .mp-pl-count,
#music-panel .mp-playlist .mp-pl-item.failed .mp-pl-fav { color: rgba(255,255,255,0.1) !important; }

@media (max-width: 768px) {
    #music-panel .song-info .mp-fav-btn { height: 28px; padding: 0 10px; font-size: 12px; }
    #music-panel .song-info .mp-fav-btn .mp-fav-num { font-size: 11px; }
    #music-panel .mp-playlist .mp-pl-item .mp-pl-count { margin-left: 6px; }
    #music-panel .mp-playlist .mp-pl-item .mp-pl-fav { width: 22px; }
}

/* ============================================================
   外部播放器入口（三套互斥模板）
   - 模板一 灵动岛：由 Vue 组件 components/dynamic-island 渲染（见 dynamic-island.vue）
   - 模板二 圆形音符悬浮按钮：#mp-entry-bubble（支持页面范围内自由拖拽）
   - 模板三 公告栏式播放器：  #mp-entry-notice（左唱片动态专辑封面 + 右音符按钮）
     位置：首页公告栏（.notice-bar）正下方的一整行，与公告栏同列同宽、随页面滚动；
           由 pages/index/index.vue 的 .mp-entry-notice-host 宿主承载，无宿主页面不渲染。
   三套模板严格互斥，同一时刻只会存在其中一套入口 DOM。
   模板一/二为浮层（z-index低于面板遮罩9998，面板打开时被自然覆盖）；
   模板三在页面流内（z-index 不参与浮层竞争，面板遮罩同样覆盖它）。
   ============================================================ */

#mp-entry-bubble {
    position: fixed;
    right: 14px;
    top: 62%;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#mp-entry-bubble:active { cursor: grabbing; }
#mp-entry-bubble.dragging { transition: none; cursor: grabbing; }
#mp-entry-bubble:not(.dragging):hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42);
}
#mp-entry-bubble svg {
    width: 28px;
    height: 28px;
    display: block;
    transition: transform 0.2s;
}
#mp-entry-bubble.playing svg { animation: mp-entry-spin 3s linear infinite; }
@keyframes mp-entry-spin { to { transform: rotate(360deg); } }

#mp-entry-notice {
    /* 流内布局：宿主 .mp-entry-notice-host 已提供与公告栏一致的水平内边距，
       这里铺满宿主内容宽即可与公告栏同宽；随页面滚动，始终贴在公告栏正下方 */
    position: relative;
    width: 100%;
    height: 40px;
    margin-top: 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}
#mp-entry-notice .mp-entry-disc {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 35% 30%, #3a3a3a 0%, #111 70%);
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.35);
}
#mp-entry-notice .mp-entry-disc img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}
#mp-entry-notice .mp-entry-disc-ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
#mp-entry-notice .mp-entry-disc-ph svg { width: 100%; height: 100%; }
#mp-entry-notice .mp-entry-disc.has-cover .mp-entry-disc-ph { display: none; }
#mp-entry-notice.playing .mp-entry-disc img { animation: mp-entry-discspin 9s linear infinite; }
@keyframes mp-entry-discspin { to { transform: rotate(360deg); } }
#mp-entry-notice .mp-entry-txt {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#mp-entry-notice .mp-entry-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#mp-entry-notice .mp-entry-btn svg { width: 17px; height: 17px; display: block; }

@media (max-width: 768px) {
    #mp-entry-bubble { right: 14px; width: 48px; height: 48px; }
    #mp-entry-bubble svg { width: 24px; height: 24px; }
}
