/** * 极简悬浮音乐播放器 - JavaScript * @FlyingIceyyds | www.无名.top */ /* 内置 EQ 预设 */ const EQ_PRESETS = [ { id: 'treble', name: '高音增强', gains: [-3, -2, -1, 0, 0.5, 1.5, 3, 4, 5, 5] }, { id: 'bass', name: '低音增强', gains: [5, 4, 3, 1.5, 0, -1, -1.5, -2, -2.5, -3] }, { id: 'loudness', name: '响度', gains: [4.5, 3.5, 2, 0, -1, 0.5, 2, 3, 3.5, 4] }, { id: 'rock', name: '摇滚 (Rock)', gains: [3.5, 2.5, -1, -1, -1.5, -0.5, 0, 2, 4, 5] }, { id: 'jazz', name: '爵士 (Jazz)', gains: [3, 2, 1, 0.5, 0, -1, 1, 2, 3, 2.5] }, { id: 'pop', name: '流行 (Pop)', gains: [4, 3, 1, 0, 0.5, 1.5, 2.5, 3.5, 4, 4.5] }, { id: 'classical', name: '古典 (Classical)', gains: [1, 0.5, 0, 0, -0.5, 0, 1, 2, 2.5, 3] }, { id: 'metal', name: '金属 (Metal)', gains: [7, 5, 3, 0, -2, 0, 1, 4, 6, 7] }, { id: 'acoustic', name: '原声/民谣 (Acoustic)', gains: [3, 2, 1, 0.5, 0, 0.5, 1.5, 2.5, 3, 2] }, { id: 'hiphop', name: '嘻哈 (HipHop)', gains: [8, 6, 4, 2, 0, -1, 1, 2, 3, 3] }, { id: 'electronic', name: '电子 (Electronic)', gains: [6, 4, 1, -1, -2, 0, 2, 4, 5, 5.5] } ]; !function(){if(document.getElementById("dynamic-music-style"))return;const e=document.createElement("style");e.id="dynamic-music-style",e.textContent='\n .music,.music *,.expand-panel,.expand-panel *,.music-context-menu,.music-context-menu *,.music-toggle-btn,.music-toggle-btn *{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;}\n .music button:focus,.music button:active,.music [role="button"]:focus,.music [role="button"]:active,.expand-panel button:focus,.expand-panel button:active,.expand-panel [role="button"]:focus,.expand-panel [role="button"]:active,.music-context-menu button:focus,.music-context-menu button:active,.music-context-menu [role="button"]:focus,.music-context-menu [role="button"]:active{outline:none;}\n .music-box{width:50px;height:50px;overflow:hidden;border-radius:50px;background:rgba(255,255,255,0.25);box-shadow:0 8px 32px 0 rgba(31,38,135,0.37);backdrop-filter:blur(10px) saturate(180%);-webkit-backdrop-filter:blur(10px) saturate(180%);position:relative;flex-shrink:0;}\n .music{box-sizing:content-box;position:fixed;bottom:45px;left:20px;width:50px;height:50px;background:rgba(255,255,255,0.35);/*box-shadow:0px 0px 0px 1px rgba(80,80,80,0.5);*/box-shadow:0 4px 6px rgba(0, 0, 0, 0.1);border-radius:50px;overflow:hidden;backdrop-filter:blur(30px) saturate(200%);-webkit-backdrop-filter:blur(30px) saturate(200%);border:3px solid rgba(255,255,255,0.8);transition:width 0.5s,background 0.4s,bottom 0.45s cubic-bezier(.4,0,.2,1);display:flex;align-items:center;z-index:999;}\n .music:hover{width:280px;background:rgba(255,255,255,0.8);box-shadow:0 8px 32px 0 rgba(31,38,135,0.37);}\n .music-img{width:50px;height:50px;transition:transform 0.4s linear;}\n .play-btn{-webkit-tap-highlight-color:transparent;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:28px;height:28px;background:rgba(70, 70, 70, 0.2);border-radius:50%;display:none;align-items:center;justify-content:center;cursor:pointer;}\n .music-info{display:none;flex-direction:row;align-items:center;height:50px;margin-left:16px;width:206px;overflow:hidden;}\n .music-box:hover .play-btn{display:flex!important;}\n .music:hover .music-info{display:flex;}\n .music-box .note-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:35px;height:35px;display:none;pointer-events:none;z-index:2;}\n .music-box.show-note .note-icon{display:block;}\n .info-texts{display:flex;flex-direction:column;justify-content:center;flex:1;min-width:0;}\n .song-title{font-size:16px;font-weight:bold;color:#16b597;line-height:1.2;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-align:center;position:relative;}\n .song-title.scrolling{text-align:left;}\n .song-title.scrolling .song-title-inner{display:inline-block;padding-right:50px;animation:song-title-scroll var(--song-title-duration,8s) linear infinite;}\n @keyframes song-title-scroll{0%{transform:translateX(0);}100%{transform:translateX(-50%);}}\n .song-lyric{font-size:13px;color:#FF9A3D;line-height:22px;font-weight:bold;height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;}\n .song-lyric-anim{display:inline-block;opacity:0;transform:translateY(10px);animation:lyric-fade-move 0.5s cubic-bezier(.4,0,.2,1) forwards;}\n @keyframes lyric-fade-move{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);}}\n .expand-btn{-webkit-tap-highlight-color:transparent;margin-left:13px;background:#16b597;color:#fff;border:none;border-radius:16px;padding:6px 9px;cursor:pointer;font-size:13px;height:32px;display:flex;align-items:center;justify-content:center;transition:background 0.2s,transform 0.3s;}\n .expand-btn:hover{background:#199988;}\n .expand-btn.active{transform:rotate(180deg);}\n .music.panel-open{bottom:var(--music-panel-bottom,150px)!important;transition:left 0.8s cubic-bezier(.4,0,.2,1),bottom 0.45s cubic-bezier(.4,0,.2,1),width 0.5s,background 0.4s;}\n .expand-panel{position:fixed;bottom:20px;left:20px;width:50px;height:0;opacity:0;overflow:hidden;background:rgba(255,255,255,0.80);backdrop-filter:blur(18px) saturate(200%);-webkit-backdrop-filter:blur(18px) saturate(200%);border:3px solid rgba(255,255,255,0.9);border-radius:30px 30px 30px 30px;box-shadow:0 8px 32px 0 rgba(31,38,135,0.37);z-index:998;transition:width 0.45s cubic-bezier(.4,0,.2,1),height 0.45s cubic-bezier(.4,0,.2,1),opacity 0.35s;display:flex;flex-direction:column;box-sizing:border-box;padding:0;}\n .expand-panel.open{width:287px;height:var(--expand-panel-height,200px);opacity:1;padding:55px 6px 7px;}\n .ep-lyrics{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;overflow:hidden;min-height:0;position:relative;--ep-lyric-scroll-duration:320ms;}\n .ep-lyrics.overlay-open .ep-lyric-line,.ep-lyrics.overlay-open .ep-lyric-trans{display:none;}\n .ep-lyric-line{width:100%;text-align:center;/*white-space:nowrap;overflow:hidden;*/text-overflow:ellipsis;transition:all 0.4s cubic-bezier(.4,0,.2,1);padding:2px 0;will-change:transform,opacity;}\n .ep-lyric-line.prev,.ep-lyric-line.next{font-size:12px;color:rgba(100,100,100,0.55);font-weight:normal;}\n .ep-lyric-line.current{font-size:16px;color:#16b597;font-weight:bold;transform:scale(1.05);}\n .ep-lyric-line.selected{font-size:16px;color:#333;font-weight:600;transform:scale(1.04);}\n .ep-lyric-trans{width:100%;text-align:center;font-size:11px;color:rgba(120,120,120,0.6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 0 2px;transition:opacity 0.3s;will-change:transform,opacity;}\n .ep-lyric-trans.current-trans{color:#555;font-weight:600;}\n .ep-lyric-trans.selected-trans{color:#333;font-weight:600;}\n .ep-lyric-line.center-focus-bg,.ep-lyric-trans.center-focus-bg{/*border-radius:8px;*/transition:background 0.18s ease,color 0.2s ease;}\n .ep-lyrics.ep-hovering .ep-lyric-line.center-focus-bg,.ep-lyrics.ep-hovering .ep-lyric-trans.center-focus-bg{background:#99999925;}\n .ep-lyrics.ep-scroll-up .ep-lyric-line,.ep-lyrics.ep-scroll-up .ep-lyric-trans{animation:ep-lyrics-scroll-up var(--ep-lyric-scroll-duration) cubic-bezier(.22,.61,.36,1);}\n .ep-lyrics.ep-scroll-down .ep-lyric-line,.ep-lyrics.ep-scroll-down .ep-lyric-trans{animation:ep-lyrics-scroll-down var(--ep-lyric-scroll-duration) cubic-bezier(.22,.61,.36,1);}\n .ep-lyrics.ep-scroll-fast{--ep-lyric-scroll-duration:140ms;}\n @keyframes ep-lyrics-scroll-up{from{transform:translateY(16px);opacity:.35;}to{transform:translateY(0);opacity:1;}}\n @keyframes ep-lyrics-scroll-down{from{transform:translateY(-16px);opacity:.35;}to{transform:translateY(0);opacity:1;}}\n .ep-controls{display:flex;align-items:center;gap:1px;margin-top:6px;width:100%;padding:0 3px;}\n .ep-ctrl-btn{background:none;border:none;cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background 0.2s;flex-shrink:0;}\n .ep-ctrl-btn:hover{background:rgba(22,181,151,0.13);}\n .ep-ctrl-btn svg{width:22px;height:22px;}\n .ep-progress-wrap{flex:1;display:flex;align-items:center;gap:6px;min-width:0;}\n .ep-progress-bar{flex:1;height:4px;background:rgba(0,0,0,0.10);border-radius:2px;cursor:pointer;position:relative;overflow:hidden;}\n .ep-progress-fill{height:100%;background:linear-gradient(90deg,#16b597,#13d4a7);border-radius:2px;width:0%;transition:width 0.2s linear;}\n .ep-time{font-size:10px;color:#888;min-width:32px;text-align:center;flex-shrink:0;user-select:none;}\n .ep-list-btn{background:none;border:none;cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background 0.2s;flex-shrink:0;}\n .ep-list-btn:hover{background:rgba(22,181,151,0.13);}\n .ep-list-btn svg{width:20px;height:20px;}\n .ep-playlist{position:absolute;top:0;left:0;right:0;bottom:0;/*background:rgba(255,255,255,0.3);backdrop-filter:blur(100px);*/border-radius:23px;z-index:10;display:flex;flex-direction:column;opacity:0;pointer-events:none;transform:translateY(12px);transition:opacity 0.3s,transform 0.3s;margin-top:8px;}\n .ep-playlist.show{opacity:1;pointer-events:auto;transform:translateY(0);}\n .ep-playlist-header{display:flex;align-items:center;justify-content:space-between;padding:3px 19px;font-size:14px;font-weight:bold;color:#16b597;margin-top:5px;}\n .ep-playlist-close{background:none;border:none;cursor:pointer;font-size:18px;color:#999;padding:2px 6px;border-radius:50%;transition:background 0.2s;}\n .ep-playlist-close:hover{background:rgba(0,0,0,0.06);}\n .ep-playlist-list{flex:1;overflow-y:auto;padding:0 10px 0;overscroll-behavior:contain;}\n .ep-playlist-list::-webkit-scrollbar{width:3px;}\n .ep-playlist-list::-webkit-scrollbar-thumb{background:#16b597;border-radius:3px;}\n .ep-playlist-item{padding:8px 10px;border-radius:8px;cursor:pointer;font-size:13px;color:#444;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background 0.2s;margin-bottom:2px;display:flex;align-items:center;gap:8px;}\n .ep-playlist-item:hover{background:rgba(22,181,151,0.10);}\n .ep-playlist-item.active{color:#16b597;font-weight:bold;background:rgba(22,181,151,0.08);}\n .ep-playlist-item .ep-item-icon{width:16px;height:16px;flex-shrink:0;display:flex;align-items:center;justify-content:center;}\n .ep-playlist-item .ep-item-icon svg{width:16px;height:16px;}\n .ep-playlist-item .ep-item-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;}\n .ep-playlist-item.folder-item{color:#16b597;font-weight:500;}\n .ep-playlist-item.folder-item:hover{background:rgba(22,181,151,0.15);}\n .ep-playlist-back{padding:6px 10px;border-radius:8px;cursor:pointer;font-size:12px;color:#888;display:flex;align-items:center;gap:6px;margin-bottom:4px;transition:background 0.2s;}\n .ep-playlist-back:hover{background:rgba(0,0,0,0.06);color:#666;}\n .ep-playlist-back svg{width:14px;height:14px;flex-shrink:0;}\n .ep-playlist-back .back-text{flex-shrink:0;}\n .ep-playlist-back .back-path{flex:1;min-width:0;text-align:right;color:#aaa;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}\n .ep-eq{position:absolute;top:0;left:0;right:0;bottom:0;/*background:rgba(255,255,255,0.1);backdrop-filter:blur(100px);*/border-radius:23px;z-index:10;display:flex;flex-direction:column;opacity:0;pointer-events:none;transform:translateY(12px);transition:opacity 0.3s,transform 0.3s;margin-top:8px;}\n .ep-eq.show{opacity:1;pointer-events:auto;transform:translateY(0);}\n .ep-eq-header{display:flex;align-items:center;justify-content:space-between;padding:3px 19px;font-size:14px;font-weight:bold;color:#16b597;margin-top:5px;}\n .ep-eq-close{background:none;border:none;cursor:pointer;font-size:18px;color:#999;padding:2px 6px;border-radius:50%;transition:background 0.2s;}\n .ep-eq-close:hover{background:rgba(0,0,0,0.06);}\n .ep-eq-bands{flex:1;overflow:auto;padding:2px 10px 2px 10px;display:grid;grid-template-columns:repeat(5,1fr);gap:5px;overscroll-behavior:contain;}\n .ep-eq-bands::-webkit-scrollbar{display: none;}\n .ep-eq-band{background:rgba(255,255,255,0.20);border-radius:12px;padding:0 8px;display:flex;flex-direction:column;align-items:center;gap:35px;font-family:none;}\n .ep-eq-label{font-size:11px;color:#16b597;font-weight:700;}\n .ep-eq-value{font-size:10px;color:#666;}\n .ep-eq-slider{width:300%;transform:rotate(270deg);}\n .ep-eq-footer{padding:6px 10px 10px;display:flex;align-items:center;justify-content:space-between;gap:8px;}\n .ep-eq-presets{display:flex;align-items:center;gap:6px;flex:1;min-width:0;}\n .ep-eq-preset-btn{background:rgba(22,181,151,0.12);color:#16b597;border:none;border-radius:13px;padding:6px 10px;cursor:pointer;font-size:12px;white-space:nowrap;}\n .ep-eq-preset-btn:hover{background:rgba(22,181,151,0.18);}\n .ep-eq-preset-btn.danger{background:rgba(244,67,54,0.12);color:#f44336;}\n .ep-eq-preset-btn.danger:hover{background:rgba(244,67,54,0.18);}\n .ep-eq-preset-select{height:28px;max-width:120px;min-width:0;border-radius:10px;border:1px solid #16b597;background:rgba(255,255,255,0);font-size:12px;color:#16b597;outline:none;cursor:pointer;appearance:none;-webkit-appearance:none;-moz-appearance:none;text-align:center;padding:0 5px;}\n .ep-eq-preset-select:hover{border-color:#0e8f75;background:rgba(255,255,255,0.35);}\n .ep-eq-preset-select:focus{border-color:#16b597;box-shadow:0 0 0 3px rgba(22,181,151,0.2);}\n .ep-eq-preset-select option{background:white;color:#16b597;font-size:12px;}\n .ep-eq-preset-select option:checked{background:#16b597;color:white;}\n .ep-eq-preset-select optgroup{color:#FF9A3D;}\n .ep-eq-reset{background:#16b597;color:#fff;border:none;border-radius:13px;padding:6px 10px;cursor:pointer;font-size:12px;}\n .ep-eq-reset:hover{background:#199988;}\n @keyframes img-rotate{0%{transform:rotate(0);}100%{transform:rotate(360deg);}}\n @keyframes img-rotate-reset{from{transform:rotate(var(--img-rotate-angle,0deg));}to{transform:rotate(0deg);}}\n @media (max-width:600px){.expand-panel{left:-340px;width:50px;transition:left 0.8s cubic-bezier(.4,0,.2,1),width 0.45s cubic-bezier(.4,0,.2,1),height 0.45s cubic-bezier(.4,0,.2,1),opacity 0.35s;}.expand-panel.open{width:50px;}.expand-panel.mobile-show{left:55px!important;width:256px;}.music{bottom:72px;left:-340px;width:50px;min-width:50px;transition:left 0.8s cubic-bezier(.4,0,.2,1),width 1s,bottom 0.45s cubic-bezier(.4,0,.2,1);z-index:9999;background:rgba(255,255,255,0.8);-webkit-box-shadow:0px 0px 0px 1px rgba(80,80,80,0.5);border-radius:50px;overflow:hidden;backdrop-filter:blur(18px) saturate(180%);-webkit-backdrop-filter:blur(18px) saturate(180%);border:3px solid rgba(255,255,255,0.18);box-shadow:0 8px 32px 0 rgba(31,38,135,0.37);}\n .music.expanded{left:55px!important;}\n .music-info{display:flex!important;width:177px!important;}\n .play-btn,.music-toggle-btn{display:flex!important;}}\n .music-toggle-btn{-webkit-tap-highlight-color:transparent;position:fixed;left:10px;bottom:80px;width:36px;height:36px;background:rgba(255,255,255,0.85);border-radius:50%;box-shadow:0 2px 8px rgba(0,0,0,0.15);align-items:center;justify-content:center;cursor:pointer;z-index:10000;display:none;border:none;border:2px rgb(255 255 255 / 90%) solid;backdrop-filter:blur(20px) saturate(300%);-webkit-backdrop-filter:blur(20px) saturate(300%);}\n .music-toggle-btn svg{width:18px;height:18px;}\n .lock-btn{-webkit-tap-highlight-color:transparent;position:absolute;left:0;transform:translateX(-50%);width:25px;height:25px;/*background:rgba(0,0,0,0.45);*/background:rgb(200 200 200 / 45%);border:none;border-radius:50%;cursor:pointer;color:#fff;font-size:14px;align-items:center;justify-content:center;transition:left 0.3s ease;z-index:1;display:none;box-shadow:inset 0px 0px 15px 1px rgb(161 161 161/50%);overflow:hidden;}\n .lock-btn svg{width:16px;height:16px;}\n .music:hover .lock-btn{display:flex;top:1px;left:65px;}\n @media (min-width:601px){.lock-btn{align-items:center;justify-content:center;}\n .music.locked{width:280px!important;background:rgba(255,255,255,0.55);backdrop-filter:blur(18px) saturate(500%);-webkit-backdrop-filter:blur(18px) saturate(500%);border:3px solid rgba(255,255,255,0.18);box-shadow:0 8px 32px 0 rgba(31,38,135,0.37);}\n .music.locked .music-info{display:flex;}\n .music.hover-active{box-shadow:0 8px 32px 0 rgba(31,38,135,0.37);}\n .music.hover-active .music-info{display:flex;}}\n .next-icon{width:18px;height:18px;}\n .music-context-menu{position:fixed;left:0;top:0;min-width:180px;padding:8px;background:rgba(255,255,255,0.92);backdrop-filter:blur(18px) saturate(180%);-webkit-backdrop-filter:blur(18px) saturate(180%);border:2px solid rgba(255,255,255,0.85);border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,0.18);z-index:10001;opacity:0;transform:scale(0.98) translateY(6px);pointer-events:none;transition:opacity 0.15s ease,transform 0.15s ease;}\n .music-context-menu.show{opacity:1;transform:scale(1) translateY(0);pointer-events:auto;}\n .music-context-menu .mcm-item{position:relative;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border-radius:10px;font-size:13px;color:#333;cursor:pointer;user-select:none;}\n .music-context-menu .mcm-item:hover{background:rgba(22,181,151,0.13);}\n .music-context-menu .mcm-item.mcm-disabled{opacity:0.55;cursor:not-allowed;}\n .music-context-menu .mcm-item.mcm-disabled:hover{background:transparent;}\n .music-context-menu .mcm-sep{height:1px;background:rgba(0,0,0,0.08);margin:6px 6px;}\n .music-context-menu .mcm-right{color:#16b597;font-weight:700;font-size:12px;}\n .music-context-menu .mcm-submenu{position:absolute;bottom:0;left:100%;min-width:170px;padding:8px;background:rgba(255,255,255,0.92);backdrop-filter:blur(18px) saturate(180%);-webkit-backdrop-filter:blur(18px) saturate(180%);border:2px solid rgba(255,255,255,0.85);border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,0.18);opacity:0;transform:translateX(6px) scale(0.98);pointer-events:none;transition:opacity 0.15s ease,transform 0.15s ease;}\n .music-context-menu.submenu-left .mcm-submenu{left:auto;right:100%;transform:translateX(-6px) scale(0.98);}\n .music-context-menu .mcm-item.mcm-submenu-host:hover .mcm-submenu{opacity:1;transform:translateX(0) scale(1);pointer-events:auto;}\n .music-context-menu.submenu-left .mcm-item.mcm-submenu-host:hover .mcm-submenu{transform:translateX(0) scale(1);}\n .music-context-menu .mcm-submenu:hover{opacity:1;transform:translateX(0) scale(1);pointer-events:auto;}\n .music-context-menu .mcm-submenu.show{opacity:1;transform:translateX(0) scale(1);pointer-events:auto;}\n .music-context-menu.submenu-left .mcm-submenu.show{transform:translateX(0) scale(1);}\n .music-context-menu .mcm-check{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:5px;border:2px solid rgba(22,181,151,0.45);}\n .music-context-menu .mcm-check.on{background:#16b597;border-color:#16b597;}\n .music-context-menu .mcm-check.on::after{content:\'\';display:block;width:8px;height:4px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg);margin-top:-1px;}\n .music-context-menu .mcm-mode-icon{margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;color:#16b597;}\n .music-context-menu .mcm-mode-icon svg{width:16px;height:16px;display:block;}\n .music, .music *, .expand-panel, .expand-panel *, .music-context-menu, .music-context-menu *{user-select:none;-webkit-user-select:none;}\n .music-info, .music-info *, .ep-lyrics, .ep-lyrics *{cursor:default;}\n .play-btn, .expand-btn, .lock-btn, .ep-ctrl-btn, .ep-list-btn, .ep-playlist-close, .ep-playlist-item, .music-toggle-btn{cursor:pointer;}\n .ep-eq-slider{width:300%;transform:rotate(270deg);-webkit-appearance:none;appearance:none;background:transparent;cursor:pointer;outline:none;height:4px;margin:10px 0;}\n .ep-eq-slider::-webkit-slider-runnable-track{width:100%;/*height:4px;*/background:#f0f0f0;border-radius:5px;box-shadow:inset 0 1px 3px rgba(0,0,0,0.1);}\n .ep-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:14px;height:14px;background: #16b597;border-radius:50%;box-shadow:0 2px 6px rgba(22,181,151,0.4);transition:transform 0.1s ease,box-shadow 0.1s ease;}\n .ep-eq-slider:focus::-webkit-slider-thumb{box-shadow: 0 0 0 4px rgba(22,181,151,0.2);}\n .ep-eq-slider::-moz-range-track{width:100%;height:4px;background:#d0d0d0;border-radius:2px;box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);}\n .ep-eq-slider::-moz-range-progress{height:4px;background:#16b597;border-radius:2px;}\n .ep-eq-slider::-moz-range-thumb{width:14px;height:14px;background:#16b597;border:none;border-radius:50%;box-shadow:0 2px 6px rgba(22,181,151,0.4);transition:transform 0.1s ease,box-shadow 0.1s ease;}\n .ep-eq-slider:focus::-moz-range-thumb{box-shadow:0 0 0 4px rgba(22,181,151,0.2);}\n .ep-eq-slider::-ms-track{width:100%;height:4px;background:transparent;border-color:transparent;color:transparent;}\n .ep-eq-slider::-ms-fill-lower{background:#16b597;border-radius:2px;}\n .ep-eq-slider::-ms-fill-upper{background:#d0d0d0;border-radius:2px;}\n .ep-eq-slider::-ms-thumb{width:14px;height:14px;background:#16b597;border:none;border-radius:50%;box-shadow:0 2px 6px rgba(22,181,151,0.4);margin-top:0;}\n .ep-eq-slider:focus::-ms-thumb{box-shadow:0 0 0 4px rgba(22,181,151,0.2);}\n .is-mobile-device .expand-panel{left:-340px;width:50px;transition:left 0.8s cubic-bezier(.4,0,.2,1),width 0.45s cubic-bezier(.4,0,.2,1),height 0.45s cubic-bezier(.4,0,.2,1),opacity 0.35s;}\n .is-mobile-device .expand-panel.open{width:50px;}\n .is-mobile-device .expand-panel.mobile-show{left:55px!important;width:256px;}\n .is-mobile-device .music{bottom:72px;left:-340px;width:50px;min-width:50px;transition:left 0.8s cubic-bezier(.4,0,.2,1),width 1s,bottom 0.45s cubic-bezier(.4,0,.2,1);z-index:9999;background:rgba(255,255,255,0.8);-webkit-box-shadow:0px 0px 0px 1px rgba(80,80,80,0.5);border-radius:50px;overflow:hidden;backdrop-filter:blur(18px) saturate(180%);-webkit-backdrop-filter:blur(18px) saturate(180%);border:3px solid rgba(255,255,255,0.18);box-shadow:0 8px 32px 0 rgba(31,38,135,0.37);}\n .is-mobile-device .music.expanded{left:55px!important;}\n .is-mobile-device .music-info{display:flex!important;width:177px!important;}\n .is-mobile-device .play-btn,.is-mobile-device .music-toggle-btn{display:flex!important;}\n .is-mobile-device .music:hover{width:50px;min-width:50px;background:rgba(255,255,255,0.8);}\n .is-mobile-device .music:hover .music-info{width:177px!important;}\n .is-mobile-device .music:hover .lock-btn{display:none;}\n .ep-tooltip{position:fixed;left:0;top:0;z-index:10002;display:block;max-width:260px;padding:7px 10px;border-radius:12px;background:rgba(255,255,255,0.92);backdrop-filter:blur(18px) saturate(180%);-webkit-backdrop-filter:blur(18px) saturate(180%);border:2px solid rgba(255,255,255,0.85);box-shadow:0 12px 40px rgba(0,0,0,0.14);font-size:12px;color:#333;line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;transform:translateY(6px) scale(0.98);transition:opacity 0.12s ease,transform 0.12s ease;}\n .ep-tooltip.show{opacity:1;transform:translateY(0) scale(1);}\n .ep-tooltip::after{content:\'\';position:absolute;left:50%;top:100%;transform:translateX(-50%);width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-top:8px solid rgba(255,255,255,0.92);filter:drop-shadow(0 2px 2px rgba(0,0,0,0.08));}\n .ep-tooltip.place-bottom::after{top:auto;bottom:100%;border-top:none;border-bottom:8px solid rgba(255,255,255,0.92);}\n ',document.head.appendChild(e)}(),function(){if(document.getElementById("dynamic-music-player"))return;const e=document.createElement("div");e.innerHTML='\n \x3c!-- 音乐播放器 by MyBlog.top --\x3e\n \n
\n
\n 音乐播放器封面图\n
\n \n \n \n \n \n \n \n \n
\n \n
\n
\n
加载中...
\n
Loading...
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n \n
\n
\n
均衡器 | Equalizer
\n
\n \n
\n
\n
播放列表 | Playlist
\n
\n
\n
\n
\n \n
\n 0:00\n
\n 0:00\n
\n \n \n
\n
\n \n ',document.body.appendChild(e)}();const DEFAULT_COVER_DATA_URL="data:image/svg+xml;base64,"+btoa(''),MUSIC_PLAYER_CONFIG=(()=>{const e=window&&window.MUSIC_PLAYER_CONFIG?window.MUSIC_PLAYER_CONFIG:{};return{musicDir:"string"==typeof e.musicDir?e.musicDir:"./music/",files:Array.isArray(e.files)?e.files:[],playlists:Array.isArray(e.playlists)?e.playlists:[],playFilesFirst:!0===e.playFilesFirst,loopCurrentList:!0===e.loopCurrentList,jsmediatagsPath:"string"==typeof e.jsmediatagsPath?e.jsmediatagsPath:"./jsmediatags/dist/jsmediatags.min.js",defaultCover:"string"==typeof e.defaultCover?e.defaultCover:DEFAULT_COVER_DATA_URL,autoLoadEqPreset:!0===e.autoLoadEqPreset,autoLoadEqPresetId:"string"==typeof e.autoLoadEqPresetId?e.autoLoadEqPresetId:""}})(),PLAYLIST_MUSIC_ICON='',PLAYLIST_FOLDER_ICON='',PLAYLIST_BACK_ICON='';function ensureTrailingSlash(e){return e?e.endsWith("/")?e:e+"/":"./"}function getFileStem(e){const t=(e||"").split("/").pop(),n=t.lastIndexOf(".");return n>0?t.slice(0,n):t}function toAbsoluteUrl(e){try{return new URL(e,window.location.href).href}catch{return e}}function _readU32LE(e,t){return(e.getUint8(t)|e.getUint8(t+1)<<8|e.getUint8(t+2)<<16|e.getUint8(t+3)<<24)>>>0}function _readU24BE(e,t){return e.getUint8(t)<<16|e.getUint8(t+1)<<8|e.getUint8(t+2)}function _parseFlacVorbisComments(e){const t=new DataView(e);if(t.byteLength<8)return null;if("fLaC"!==String.fromCharCode(t.getUint8(0),t.getUint8(1),t.getUint8(2),t.getUint8(3)))return null;let n=4;const i="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):null;for(;n+4<=t.byteLength;){const r=t.getUint8(n),o=!!(128&r),s=127&r,a=_readU24BE(t,n+1);if(n+=4,n+a>t.byteLength)return null;if(4===s){let r=n;if(r+4>n+a)break;if(r+=4+_readU32LE(t,r),r+4>n+a)break;const o=_readU32LE(t,r);r+=4;const s={};for(let l=0;ln+a);l++){const o=_readU32LE(t,r);if(r+=4,r+o>n+a)break;const l=new Uint8Array(e,r,o),c=i?i.decode(l):String.fromCharCode.apply(null,Array.from(l)),d=c.indexOf("=");if(d>0){const e=c.slice(0,d).trim(),t=c.slice(d+1);e&&(s[e.toLowerCase()]=t)}r+=o}return s}if(n+=a,o)break}return null}function _loadFlacVorbisCommentsFromUrl(e){return fetch(e).then(e=>{if(!e.ok)throw new Error("fetch failed");return e.arrayBuffer()}).then(_parseFlacVorbisComments)}function loadJsMediaTags(){return window.jsmediatags?Promise.resolve(window.jsmediatags):new Promise((e,t)=>{const n=document.querySelector('script[data-jsmediatags="1"]');if(n)return n.addEventListener("load",()=>e(window.jsmediatags)),void n.addEventListener("error",t);const i=document.createElement("script");i.src=MUSIC_PLAYER_CONFIG.jsmediatagsPath,i.async=!0,i.defer=!0,i.dataset.jsmediatags="1",i.addEventListener("load",()=>e(window.jsmediatags)),i.addEventListener("error",()=>t(new Error("Failed to load jsmediatags"))),document.head.appendChild(i)})}function pictureToObjectUrl(e){if(!e||!e.data||!e.format)return null;const t=String(e.format).replace(/\0/g,"").trim(),n=new Uint8Array(e.data),i=new Blob([n],{type:t||"application/octet-stream"});return URL.createObjectURL(i)}console.log("Music player init:",MUSIC_PLAYER_CONFIG);const playlists=(MUSIC_PLAYER_CONFIG.playlists||[]).map((e,t)=>({id:e.id||"playlist_"+t,name:e.name||"歌单 "+(t+1),files:Array.isArray(e.files)?e.files:[]})),songs=(()=>{const e=ensureTrailingSlash(MUSIC_PLAYER_CONFIG.musicDir),t=MUSIC_PLAYER_CONFIG.files||[],n=MUSIC_PLAYER_CONFIG.playFilesFirst,i=new Set;for(const e of playlists)for(const t of e.files)i.add(t);const r=t.filter(e=>!i.has(e)),o=(t,n)=>{const i=e+t;return{title:getFileStem(t),cover:MUSIC_PLAYER_CONFIG.defaultCover,src:i,_encodedSrc:encodeURI(i),lyric:"",_metaLoaded:!1,_metaLoading:!1,_coverObjectUrl:null,_file:t,_playlistId:n}},s=[];if(n){for(const e of r)s.push(o(e,null));for(const e of playlists)for(const t of e.files)s.push(o(t,e.id))}else{for(const e of playlists)for(const t of e.files)s.push(o(t,e.id));for(const e of r)s.push(o(e,null))}return s})();let currentLoopContext=null,loopContextActive=!1;function loadSongMeta(e){const t=songs[e];!t||t._metaLoaded||t._metaLoading||(t._metaLoading=!0,loadJsMediaTags().then(n=>{let i=toAbsoluteUrl(t._encodedSrc||encodeURI(t.src));try{const e=i.includes("?")?"&":"?";i=i+e+"mmp_nocache="+Date.now()}catch{}console.log("Reading tags from:",i);try{n.read(i,{onSuccess:function(n){const r=n&&n.tags?n.tags:{};console.log("Tags loaded:",t.src,Object.keys(r)),r.title&&(t.title=r.title);{const n=_extractLyricsFromTags(r);if(n)t.lyric=n;else{String(t._file||t.src||"").toLowerCase().endsWith(".flac")&&_loadFlacVorbisCommentsFromUrl(i).then(n=>{if(!n||t.lyric)return;const i=_extractLyricsFromTags(n);"string"==typeof i&&i.trim()&&(t.lyric=i,e===current&&(lyricArr=parseLyric(t.lyric),lyricIndex=0,updateLyric(0,!0)))}).catch(()=>{})}}if(r.picture){const e=pictureToObjectUrl(r.picture);e&&(t._coverObjectUrl&&URL.revokeObjectURL(t._coverObjectUrl),t._coverObjectUrl=e,t.cover=e)}else console.warn("No picture tag found:",t.src);t._metaLoaded=!0,t._metaLoading=!1,e===current&&(setSongTitleText(t.title||"加载中..."),musicImg.src=t.cover||MUSIC_PLAYER_CONFIG.defaultCover,t.lyric&&(lyricArr=parseLyric(t.lyric),lyricIndex=0,updateLyric(0,!0)))},onError:function(e){console.error("Tags load failed:",t.src,e),t._metaLoaded=!0,t._metaLoading=!1}})}catch(e){console.error("jsmediatags.read threw:",t.src,e),t._metaLoaded=!0,t._metaLoading=!1}}).catch(()=>{t._metaLoaded=!0,t._metaLoading=!1}))}function _normalizeLyricsValue(e){if(!e)return"";if("string"==typeof e)return e;if(Array.isArray(e)){for(const t of e){const e=_normalizeLyricsValue(t);if(e&&e.trim())return e}return""}if("object"==typeof e){if("string"==typeof e.text)return e.text;if("string"==typeof e.lyrics)return e.lyrics;if("string"==typeof e.value)return e.value}return""}function _extractLyricsFromTags(e){if(!e)return"";const t=["lyrics","unsyncedlyrics","lrc","lyric","syncedlyrics"];for(const n of t){const t=_normalizeLyricsValue(e[n]);if(t&&t.trim())return t}for(const n of t){const t=_normalizeLyricsValue(e[String(n).toUpperCase()]);if(t&&t.trim())return t}return""}function stopLyricInertia(){lyricInertiaTimer&&(cancelAnimationFrame(lyricInertiaTimer),lyricInertiaTimer=null)}function applyLyricScrollDelta(e){if(!lyricArr.length)return!1;lyricTouchLineDelta+=e;let t=0;for(;lyricTouchLineDelta>=18;)t-=1,lyricTouchLineDelta-=18;for(;lyricTouchLineDelta<=-18;)t+=1,lyricTouchLineDelta+=18;if(!t)return!1;const n=Math.max(0,Math.min(lyricArr.length-1,lyricViewIndex+t));if(n===lyricViewIndex)return!1;const i=n>lyricViewIndex?"up":n{if(t*=.92,Math.abs(t)<.35)return stopLyricInertia(),void(lyricHovering&&(epLyrics.classList.add("ep-hovering"),scrollLyricViewTo(lyricViewIndex,{fast:!0}),armLyricBrowseIdleReset()));applyLyricScrollDelta(t)&&armLyricBrowseIdleReset(),lyricInertiaTimer=requestAnimationFrame(n)};lyricInertiaTimer=requestAnimationFrame(n)}const music=document.querySelector(".music"),playBtn=document.querySelector(".play-btn"),musicImg=document.querySelector(".music-img"),songTitle=document.querySelector(".song-title"),songLyric=document.querySelector(".song-lyric"),expandBtn=document.querySelector(".expand-btn"),audio=document.getElementById("audio"),musicBox=document.querySelector(".music-box"),noteIcon=document.querySelector(".note-icon"),musicToggleBtn=document.querySelector(".music-toggle-btn");if(audio)try{audio.crossOrigin="anonymous",audio.setAttribute("crossorigin","anonymous")}catch{}const lockBtn=document.querySelector(".lock-btn"),expandPanel=document.getElementById("expand-panel"),epLyrics=document.getElementById("ep-lyrics"),epLyricPrev=document.getElementById("ep-lyric-prev"),epTransPrev=document.getElementById("ep-trans-prev"),epLyricCur=document.getElementById("ep-lyric-cur"),epTransCur=document.getElementById("ep-trans-cur"),epLyricNext=document.getElementById("ep-lyric-next"),epTransNext=document.getElementById("ep-trans-next"),epPrevBtn=document.getElementById("ep-prev-btn"),epNextBtn=document.getElementById("ep-next-btn"),epProgressBar=document.getElementById("ep-progress-bar"),epProgressFill=document.getElementById("ep-progress-fill"),epTimeCur=document.getElementById("ep-time-cur"),epTimeDur=document.getElementById("ep-time-dur"),epListBtn=document.getElementById("ep-list-btn"),epPlaylist=document.getElementById("ep-playlist"),epPlaylistClose=document.getElementById("ep-playlist-close"),epPlaylistList=document.getElementById("ep-playlist-list"),epEq=document.getElementById("ep-eq"),epEqClose=document.getElementById("ep-eq-close"),epEqBands=document.getElementById("ep-eq-bands"),epEqPresetSelect=document.getElementById("ep-eq-preset-select"),epEqPresetLoad=document.getElementById("ep-eq-preset-load"),epEqPresetSave=document.getElementById("ep-eq-preset-save"),epEqReset=document.getElementById("ep-eq-reset");let currentPlaylistView=null,current=0,playing=!1,lyricArr=[],lyricIndex=0,isLocked=!1,mobileExpanded=!1,audioLoadedIndex=null,panelOpen=!1,hasTranslation=!1,translationEnabled=!0,playMode="list",_songTitleScrollTimer=null;function updateSongTitleScroll(){_songTitleScrollTimer&&(clearTimeout(_songTitleScrollTimer),_songTitleScrollTimer=null),_songTitleScrollTimer=setTimeout(()=>{_songTitleScrollTimer=null,songTitle.classList.remove("scrolling");const e="string"==typeof songTitle.dataset.baseText?songTitle.dataset.baseText:songTitle.textContent||"";if(songTitle.textContent=e,e&&songTitle.scrollWidth>songTitle.clientWidth){const t=Math.max(4,.4*e.length);songTitle.style.setProperty("--song-title-duration",t+"s"),songTitle.innerHTML="";const n=document.createElement("span");n.className="song-title-inner",n.textContent=e+"     "+e+"     ",songTitle.appendChild(n),songTitle.classList.add("scrolling")}},350)}function setSongTitleText(e){const t="string"==typeof e?e:String(e||"");songTitle.classList.remove("scrolling"),songTitle.dataset.baseText=t,songTitle.textContent=t,updateSongTitleScroll()}let _epTooltipEl=null,_epTooltipTarget=null,_epTooltipRestoreTitle="";function _getOrCreateEPTooltip(){if(_epTooltipEl)return _epTooltipEl;const e=document.createElement("div");return e.className="ep-tooltip",e.setAttribute("role","tooltip"),e.style.left="-9999px",e.style.top="-9999px",document.body.appendChild(e),_epTooltipEl=e,window.addEventListener("scroll",()=>hideEPTooltip(),!0),window.addEventListener("resize",()=>hideEPTooltip(),!0),document.addEventListener("mousedown",()=>hideEPTooltip(),!0),e}function _positionEPTooltipForTarget(e){const t=_epTooltipEl;if(!t||!e)return;const n=e.getBoundingClientRect(),i=10;t.classList.remove("place-bottom"),t.style.left="-9999px",t.style.top="-9999px";const r=t.getBoundingClientRect(),o=window.innerWidth||document.documentElement.clientWidth||0,s=window.innerHeight||document.documentElement.clientHeight||0;let a=n.left+n.width/2-r.width/2;a=Math.max(i,Math.min(o-i-r.width,a));let l=n.top-r.height-10,c=!1;ls-i&&(l=Math.max(i,Math.min(s-i-r.height,l)))),c&&t.classList.add("place-bottom"),t.style.left=Math.round(a)+"px",t.style.top=Math.round(l)+"px"}function showEPTooltip(e,t){if(!e)return;if("function"==typeof isMobile&&isMobile())return;const n=_getOrCreateEPTooltip(),i=String(t||"").trim();if(i){if(_epTooltipTarget!==e){_epTooltipTarget=e,_epTooltipRestoreTitle="string"==typeof e.title?e.title:"";try{e.title=""}catch{}}n.textContent=i,n.classList.add("show"),_positionEPTooltipForTarget(e)}}function hideEPTooltip(){if(_epTooltipEl&&_epTooltipEl.classList.remove("show"),_epTooltipTarget)try{_epTooltipTarget.title=_epTooltipRestoreTitle||_epTooltipTarget.title}catch{}_epTooltipTarget=null,_epTooltipRestoreTitle=""}function bindEPTooltip(e,t){if(!e)return;const n=()=>hideEPTooltip();e.addEventListener("mouseenter",()=>{const n="function"==typeof t?t():String(t||"");showEPTooltip(e,n)}),e.addEventListener("mouseleave",n),e.addEventListener("blur",n)}bindEPTooltip(playBtn,()=>void 0!==isAudioLoading&&isAudioLoading?"加载中":audio&&audio.paused?"播放":"暂停"),bindEPTooltip(expandBtn,()=>panelOpen?"收起歌词":"展开歌词"),bindEPTooltip(epPrevBtn,()=>"上一曲"),bindEPTooltip(epNextBtn,()=>"下一曲"),bindEPTooltip(epListBtn,()=>epPlaylist&&epPlaylist.classList.contains("show")?"关闭播放列表":"播放列表"),bindEPTooltip(lockBtn,()=>isLocked?"解锁播放器":"锁定播放器"),bindEPTooltip(epPlaylistClose,()=>"关闭播放列表"),bindEPTooltip(epEqClose,()=>"关闭 EQ 面板"),bindEPTooltip(epEqPresetSelect,()=>"选择 EQ 预设"),bindEPTooltip(epEqPresetLoad,()=>"加载预设"),bindEPTooltip(epEqPresetSave,()=>{const e=epEqPresetSave&&(epEqPresetSave.textContent||epEqPresetSave.innerText)?epEqPresetSave.textContent||epEqPresetSave.innerText:"",t=String(e||"").trim();return t?"删除"===t?"删除当前自定义预设":"保存当前 EQ 配置":"保存/删除预设"}),bindEPTooltip(epEqReset,()=>"重置均衡器");let _audioCtx=null,_mediaElSource=null,_eqFilters=null;const _eqFreqs=[31,62,125,250,500,1e3,2e3,4e3,8e3,16e3];let _eqGains=new Array(_eqFreqs.length).fill(0);function _formatEqFreqLabel(e){if(!e||!isFinite(e))return"";if(e>=1e3){const t=e/1e3;return(t%1==0?String(t):t.toFixed(1))+"k"}return String(e)}function initAudioEQ(){if(_audioCtx&&_mediaElSource&&_eqFilters)return;const e=window.AudioContext||window.webkitAudioContext;if(e){if(_audioCtx||(_audioCtx=new e),!_mediaElSource)try{_mediaElSource=_audioCtx.createMediaElementSource(audio)}catch{return}if(!_eqFilters){_eqFilters=_eqFreqs.map((e,t)=>{const n=_audioCtx.createBiquadFilter();return n.type="peaking",n.frequency.value=e,n.Q.value=1,n.gain.value=_eqGains[t]||0,n});let e=_mediaElSource;for(const t of _eqFilters)e.connect(t),e=t;e.connect(_audioCtx.destination)}}}function setEQBandGain(e,t){const n=Number(e);if(!Number.isFinite(n)||n<0||n>=_eqFreqs.length)return;const i=Math.max(-12,Math.min(12,Number(t)||0));_eqGains[n]=i,_eqFilters&&_eqFilters[n]&&(_eqFilters[n].gain.value=i)}function resetEQ(){for(let e=0;e<_eqFreqs.length;e++)setEQBandGain(e,0);syncEQPanelValues()}function buildEQPanel(){if(epEqBands&&"1"!==epEqBands.dataset.built){epEqBands.dataset.built="1",epEqBands.innerHTML="";for(let e=0;e<_eqFreqs.length;e++){const t=document.createElement("div");t.className="ep-eq-band",t.innerHTML=`\n
${_formatEqFreqLabel(_eqFreqs[e])}
\n \n
0
\n `;const n=t.querySelector(".ep-eq-slider"),i=t.querySelector(".ep-eq-value");n&&n.addEventListener("input",()=>{const e=Number(n.dataset.band),t=Number(n.value);i&&(i.textContent=(t>0?"+":"")+String(t)),initAudioEQ(),_audioCtx&&"suspended"===_audioCtx.state&&_audioCtx.resume().catch(()=>{}),setEQBandGain(e,t)}),epEqBands.appendChild(t)}syncEQPanelValues()}}function syncEQPanelValues(){if(!epEqBands)return;epEqBands.querySelectorAll(".ep-eq-slider").forEach(e=>{const t=Number(e.dataset.band),n=_eqGains[t]||0;e.value=String(n);const i=epEqBands.querySelector(`[data-band-value="${t}"]`);i&&(i.textContent=(n>0?"+":"")+String(n))})}function openEQPanel(){buildEQPanel(),panelOpen||togglePanel(),epPlaylist&&epPlaylist.classList.remove("show"),epEq&&epEq.classList.add("show"),_collapsedOverlayState="eq",updatePanelLayout()}function closeEQPanel(){epEq&&epEq.classList.remove("show"),"eq"===_collapsedOverlayState&&(_collapsedOverlayState=null),updatePanelLayout()}let desktopHoverHandlers={mouseenter:null,mouseleave:null,boxMouseenter:null,boxMouseleave:null},lockBtnHandler=null,_panelOpenBeforeLeave=!1,_hoverAnimTimer=null,_mobileToggleAnimating=!1,_wasMobile=null,_resizeAnimTimer=null,_expandClickGuard=!1,_collapsedOverlayState=null,lyricSeekTimer=null,lyricSeekAnimating=!1,lyricViewIndex=0,lyricViewTimer=null,lyricHovering=!1;function rememberCollapsedOverlayState(){const e=!(!epPlaylist||!epPlaylist.classList.contains("show"));_collapsedOverlayState=epEq&&epEq.classList.contains("show")?"eq":e?"playlist":null}function restoreCollapsedOverlayState(){_collapsedOverlayState&&("eq"===_collapsedOverlayState?(epPlaylist&&epPlaylist.classList.remove("show"),epEq&&epEq.classList.add("show")):"playlist"===_collapsedOverlayState&&(epEq&&epEq.classList.remove("show"),epPlaylist&&epPlaylist.classList.add("show")))}let lyricWheelDelta=0,lyricWheelVelocity=0,lyricWheelLastTs=0,lyricWheelStopTimer=null,lyricTouchY=null,lyricTouchLineDelta=0,lyricTouchVelocity=0,lyricTouchLastTs=0,lyricInertiaTimer=null,lyricBrowseIdleTimer=null,hoveredPlaylistIndex=-1;function clearLyricBrowseIdleTimer(){lyricBrowseIdleTimer&&(clearTimeout(lyricBrowseIdleTimer),lyricBrowseIdleTimer=null)}function armLyricBrowseIdleReset(){clearLyricBrowseIdleTimer(),lyricHovering&&lyricArr.length&&lyricViewIndex!==lyricIndex&&(lyricBrowseIdleTimer=setTimeout(()=>{lyricHovering&&(lyricHovering=!1,lyricWheelDelta=0,lyricWheelVelocity=0,lyricWheelLastTs=0,lyricWheelStopTimer&&(clearTimeout(lyricWheelStopTimer),lyricWheelStopTimer=null),lyricTouchY=null,lyricTouchLineDelta=0,lyricTouchVelocity=0,lyricTouchLastTs=0,epLyrics&&epLyrics.classList.remove("ep-hovering"),scrollLyricViewTo(lyricIndex,{fast:!0}))},5e3))}function parseLyric(e){if(!e)return[];const t=[],n=/\[(\d+):(\d+\.\d+)\](.*)/g;let i;for(;null!==(i=n.exec(e));)t.push({time:60*parseInt(i[1])+parseFloat(i[2]),text:i[3].trim()||"🎶"});hasTranslation=!1;const r=[];for(let e=0;e>1;lyricArr[t].time<=e?(r=t,n=t+1):i=t-1}if(r!==lyricIndex||t){const e=lyricIndex;lyricIndex=r,renderMiniLyric(r),lyricHovering?updateExpandedLyrics(lyricViewIndex,{direction:"none",fast:!1}):(lyricViewIndex=r,updateExpandedLyrics(lyricViewIndex,{direction:r>e?"up":r0?lyricArr[e-1]:null,r=lyricArr[e],o=e>1;lyricArr[r].time<=e?(i=r,t=r+1):n=r-1}return i}function fastScrollLyricsTo(e){if(!lyricArr.length)return;if(e=Math.max(0,Math.min(lyricArr.length-1,e)),lyricSeekTimer&&(clearInterval(lyricSeekTimer),lyricSeekTimer=null),e===lyricIndex)return lyricSeekAnimating=!1,lyricViewIndex=lyricIndex,void updateExpandedLyrics(lyricViewIndex,{direction:"none",fast:!0});const t=lyricIndex,n=Math.abs(e-t),i=Math.min(900,Math.max(220,120+26*n));let r=t;const o=performance.now();lyricSeekAnimating=!0,lyricSeekTimer=setInterval(()=>{const n=performance.now()-o,s=Math.min(1,n/i),a=(l=s,1-Math.pow(1-l,3));var l;let c=t+Math.round((e-t)*a);if(c=Math.max(0,Math.min(lyricArr.length-1,c)),c!==r){const e=c>r;lyricIndex=c,lyricViewIndex=lyricIndex,r=c,renderMiniLyric(lyricIndex),updateExpandedLyrics(lyricViewIndex,{direction:e?"up":"down",fast:!0})}(s>=1||lyricIndex===e)&&(lyricIndex=e,lyricViewIndex=lyricIndex,renderMiniLyric(lyricIndex),updateExpandedLyrics(lyricViewIndex,{direction:e>t?"up":"down",fast:!0}),clearInterval(lyricSeekTimer),lyricSeekTimer=null,lyricSeekAnimating=!1)},16)}function setImgRotate(e){e?"img-rotate 2s linear infinite"!==musicImg.style.animation&&(musicImg.style.animation="img-rotate 2s linear infinite"):"none"!==musicImg.style.animation&&(musicImg.style.animation="img-rotate-reset 0.4s linear 1",musicImg.addEventListener("animationend",function e(){musicImg.style.animation="none",musicImg.style.transform="rotate(0deg)",musicImg.removeEventListener("animationend",e)}))}function setPlayBtn(e,t){if(playBtn.innerHTML="",t){const e=document.createElement("span");if(e.style.display="inline-block",e.style.width="22px",e.style.height="22px",e.style.border="3px solid #fff",e.style.borderTop="3px solid #16b597",e.style.borderRadius="50%",e.style.animation="spin-loader 1s linear infinite",playBtn.style.background="rgba(126, 126, 126, 0.3)",playBtn.style.width="50px",playBtn.style.height="50px",playBtn.appendChild(e),!document.getElementById("music-loader-style")){const e=document.createElement("style");e.id="music-loader-style",e.textContent="\n @keyframes spin-loader {\n 0% { transform: rotate(0);}\n 100% { transform: rotate(360deg);}\n }",document.head.appendChild(e)}return}if(e){const e=document.createElement("span");e.style.display="block",e.style.width="0",e.style.height="0",e.style.borderLeft="12px solid #fff",e.style.borderTop="8px solid transparent",e.style.borderBottom="8px solid transparent",playBtn.style.background="",playBtn.appendChild(e)}else for(let e=0;e<2;e++){const e=document.createElement("span");e.style.display="inline-block",e.style.width="4px",e.style.height="16px",e.style.background="#fff",e.style.margin="0 2px",e.style.borderRadius="2px",playBtn.style.background="",playBtn.appendChild(e)}}function setSong(e){if(lyricSeekTimer&&(clearInterval(lyricSeekTimer),lyricSeekTimer=null),lyricSeekAnimating=!1,lyricHovering=!1,lyricWheelDelta=0,lyricWheelVelocity=0,lyricWheelLastTs=0,lyricWheelStopTimer&&(clearTimeout(lyricWheelStopTimer),lyricWheelStopTimer=null),lyricTouchY=null,lyricTouchLineDelta=0,lyricTouchVelocity=0,lyricTouchLastTs=0,stopLyricInertia(),epLyrics&&epLyrics.classList.remove("ep-hovering"),!songs.length)return current=0,setSongTitleText("未配置音乐"),musicImg.src=MUSIC_PLAYER_CONFIG.defaultCover,audio.removeAttribute("src"),audio.load(),lyricArr=[],lyricIndex=0,lyricViewIndex=0,songLyric.textContent="...",setImgRotate(!1),setPlayBtn(!0,!1),playing=!1,void(audioLoadedIndex=null);current=e;const t=songs[current];setSongTitleText(t&&t.title?t.title:"加载中..."),musicImg.src=t&&t.cover?t.cover:MUSIC_PLAYER_CONFIG.defaultCover,audio.removeAttribute("src"),audio.load(),lyricArr=parseLyric(t?t.lyric:""),lyricIndex=0,lyricViewIndex=0,updateLyric(0,!0),setImgRotate(!1),setPlayBtn(!0,!1),playing=!1,audioLoadedIndex=null,loadSongMeta(current)}function isMobile(){return window.innerWidth<=600||/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|Tablet/i.test(navigator.userAgent)||navigator.maxTouchPoints>1&&/Macintosh/i.test(navigator.userAgent)}function updateMobileDeviceClass(){document.documentElement.classList.toggle("is-mobile-device",isMobile())}function setMobileMusicUI(){updateMobileDeviceClass(),["mouseenter","mouseleave"].forEach(e=>{desktopHoverHandlers[e]&&(music.removeEventListener(e,desktopHoverHandlers[e]),desktopHoverHandlers[e]=null)}),["boxMouseenter","boxMouseleave"].forEach(e=>{desktopHoverHandlers[e]&&(musicBox.removeEventListener("boxMouseenter"===e?"mouseenter":"mouseleave",desktopHoverHandlers[e]),desktopHoverHandlers[e]=null)}),desktopHoverHandlers.panelEnter&&(expandPanel.removeEventListener("mouseenter",desktopHoverHandlers.panelEnter),desktopHoverHandlers.panelEnter=null),desktopHoverHandlers.panelLeave&&(expandPanel.removeEventListener("mouseleave",desktopHoverHandlers.panelLeave),desktopHoverHandlers.panelLeave=null),_hoverAnimTimer&&(clearTimeout(_hoverAnimTimer),_hoverAnimTimer=null),_panelOpenBeforeLeave=!1,lockBtnHandler&&(lockBtn.removeEventListener("click",lockBtnHandler),lockBtnHandler=null),isMobile()?(music.classList.remove("expanded"),musicToggleBtn.style.display="flex",document.querySelector(".music-info").style.display="flex",playBtn.style.display="flex",setToggleBtnIcon(!1),showNoteIcon(!1),lockBtn.style.display="none",mobileExpanded?(music.classList.add("expanded"),setToggleBtnIcon(!0)):(music.classList.remove("expanded"),setToggleBtnIcon(!1))):(music.classList.remove("expanded"),musicToggleBtn.style.display="none",document.querySelector(".music-info").style.display="",playBtn.style.display="",mobileExpanded=!1,desktopHoverHandlers.mouseenter=function(){_hoverAnimTimer&&(clearTimeout(_hoverAnimTimer),_hoverAnimTimer=null),isLocked||(music.style.width="280px",music.style.background="rgba(255,255,255,0.8)",music.classList.add("hover-active")),showNoteIcon(!musicBox.matches(":hover")),panelOpen&&!expandPanel.classList.contains("open")&&(restoreCollapsedOverlayState(),expandPanel.classList.add("open"),music.classList.add("panel-open"),expandBtn.classList.add("active"),expandBtn.title="收起歌词",updatePanelLayout(),updateLyric(audio.currentTime||0,!0)),updateSongTitleScroll()},desktopHoverHandlers.mouseleave=function(){_hoverAnimTimer&&(clearTimeout(_hoverAnimTimer),_hoverAnimTimer=null),setTimeout(_checkPlayerAreaLeave,30)},desktopHoverHandlers.boxMouseenter=()=>{playBtn.style.display="flex",showNoteIcon(!1),updateSongTitleScroll()},desktopHoverHandlers.boxMouseleave=()=>{playBtn.style.display="none",setTimeout(()=>{music.matches(":hover")||showNoteIcon(!0)},10)},desktopHoverHandlers.panelEnter=function(){_hoverAnimTimer&&(clearTimeout(_hoverAnimTimer),_hoverAnimTimer=null),isLocked||(music.style.width="280px",music.style.background="rgba(255,255,255,0.8)",music.classList.add("hover-active")),showNoteIcon(!musicBox.matches(":hover")),updateSongTitleScroll()},desktopHoverHandlers.panelLeave=function(){_hoverAnimTimer&&(clearTimeout(_hoverAnimTimer),_hoverAnimTimer=null),setTimeout(_checkPlayerAreaLeave,30)},music.addEventListener("mouseenter",desktopHoverHandlers.mouseenter),music.addEventListener("mouseleave",desktopHoverHandlers.mouseleave),musicBox.addEventListener("mouseenter",desktopHoverHandlers.boxMouseenter),musicBox.addEventListener("mouseleave",desktopHoverHandlers.boxMouseleave),expandPanel.addEventListener("mouseenter",desktopHoverHandlers.panelEnter),expandPanel.addEventListener("mouseleave",desktopHoverHandlers.panelLeave),showNoteIcon(!0),playBtn.style.display="none",lockBtn.style.display="",lockBtnHandler=function(e){e.stopPropagation(),isLocked=!isLocked,isLocked?(music.classList.add("locked"),lockBtn.innerHTML='',lockBtn.title="解锁播放器",showNoteIcon(!1)):(music.classList.remove("locked"),lockBtn.innerHTML='',lockBtn.title="锁定播放器",music.matches(":hover")||(music.style.width="50px",music.style.background="rgba(255,255,255,0.35)"),showNoteIcon(!0))},lockBtn.addEventListener("click",lockBtnHandler)),updateMobilePanelVisibility()}function scrollLyricViewTo(e){if(!lyricArr.length)return;if(e=Math.max(0,Math.min(lyricArr.length-1,e)),lyricViewTimer&&(clearInterval(lyricViewTimer),lyricViewTimer=null),e===lyricViewIndex)return void updateExpandedLyrics(lyricViewIndex,{direction:"none",fast:!0});const t=lyricViewIndex,n=Math.abs(e-t),i=Math.min(900,Math.max(260,150+24*n));let r=t;const o=performance.now();lyricViewTimer=setInterval(()=>{const n=Math.min(1,(performance.now()-o)/i),s=(a=n,1-Math.pow(1-a,3));var a;let l=t+Math.round((e-t)*s);if(l=Math.max(0,Math.min(lyricArr.length-1,l)),l!==r){const e=l>r?"up":"down";lyricViewIndex=l,r=l,updateExpandedLyrics(lyricViewIndex,{direction:e,fast:!0})}(n>=1||lyricViewIndex===e)&&(lyricViewIndex=e,updateExpandedLyrics(lyricViewIndex,{direction:e>=t?"up":"down",fast:!0}),clearInterval(lyricViewTimer),lyricViewTimer=null)},16)}function setToggleBtnIcon(e){const t=musicToggleBtn.querySelector(".toggle-icon");t&&(e?(t.setAttribute("viewBox","0 0 24 24"),t.innerHTML='',musicToggleBtn.title="收回播放器",music.style.width="250px",lockBtn.style.display="none",console.log("MyBlog.top:音乐播放器展开")):(t.setAttribute("viewBox","0 0 24 24"),t.innerHTML='',musicToggleBtn.title="展开播放器",music.style.width="",lockBtn.style.display=""))}function showNoteIcon(e){isLocked&&music.matches(":hover")?musicBox.classList.remove("show-note"):e?musicBox.classList.add("show-note"):musicBox.classList.remove("show-note")}function copyTextToClipboard(e){if("string"!=typeof e&&(e=String(e||"")),!e)return Promise.resolve(!1);if(navigator.clipboard&&"function"==typeof navigator.clipboard.writeText)return navigator.clipboard.writeText(e).then(()=>!0).catch(()=>!1);try{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.left="-9999px",t.style.top="0",document.body.appendChild(t),t.select();const n=document.execCommand("copy");return document.body.removeChild(t),Promise.resolve(!!n)}catch{return Promise.resolve(!1)}}function getCurrentLyricCopyText(){if(!lyricArr.length)return"";let e=lyricIndex;if(Number.isFinite(lyricViewIndex)&&lyricViewIndex>=0&&lyricViewIndexi&&(s=Math.max(8,i-o.width-8)),a+o.height+8>r&&(a=Math.max(8,r-o.height-8)),s<8&&(s=8),a<8&&(a=8),e.style.left=s+"px",e.style.top=a+"px"}function updateContextMenuSubmenuPlacement(e){const t=e.querySelector(".mcm-submenu-host"),n=e.querySelector("#mcm-mode-submenu");if(!t||!n)return;if(e.classList.remove("submenu-left"),n.style.maxHeight="",n.style.overflowY="",isMobile())return void e.classList.add("submenu-left");const i=t.getBoundingClientRect();n.style.left="100%",n.style.right="",n.style.bottom="0";const r=n.getBoundingClientRect(),o=Math.max(1,window.innerWidth),s=r.width+16,a=i.right+s>o,l=i.left-s<0;a&&!l?e.classList.add("submenu-left"):a&&l&&(n.style.maxWidth=Math.max(120,o-32)+"px",n.style.overflowX="hidden")}function closeContextMenu(){const e=document.getElementById("music-context-menu");if(!e)return;e.classList.remove("show");const t=e.querySelector("#mcm-mode-submenu");t&&t.classList.remove("show")}function syncContextMenuState(e){const t=e.querySelector("#mcm-mode-label");t&&(t.textContent=getPlayModeLabel(playMode));const n=e.querySelector("#mcm-trans-check");n&&(n.className="mcm-check"+(translationEnabled?" on":""));const i=/Mac|iPhone|iPad|iPod/i.test(navigator.platform||navigator.userAgent||"")?"Cmd+Option":"Ctrl+Alt",r=e.querySelector("#mcm-sc-copy-title"),o=e.querySelector("#mcm-sc-copy-lyric"),s=e.querySelector("#mcm-sc-prev"),a=e.querySelector("#mcm-sc-next");r&&(r.textContent=i+"+C"),o&&(o.textContent=i+"+L"),s&&(s.textContent=i+"+←"),a&&(a.textContent=i+"+→");const l=e.querySelector('[data-action="copyLyric"]'),c=getCurrentLyricCopyText();l&&l.classList.toggle("mcm-disabled",!c)}function openContextMenu(e,t,n){const i=createMusicContextMenu();if(syncContextMenuState(i),positionContextMenu(i,e,t),updateContextMenuSubmenuPlacement(i),"touch"===n){const e=i.querySelector("#mcm-mode-submenu");e&&e.classList.remove("show")}}function isEventInsidePlayer(e){return!!e&&!(!e.closest||!(e.closest("#dynamic-music-player")||e.closest("#expand-panel")||e.closest(".music-toggle-btn")||e.closest("#music-context-menu")))}desktopHoverHandlers.mouseenter=function(){_expandClickGuard||isLocked||isMobile()||music.classList.contains("panel-open")||expandPanel.classList.contains("open")||expandPanel.classList.contains("mobile-show")||music.matches(":hover")||expandPanel.matches(":hover")||(restoreCollapsedOverlayState(),expandPanel.classList.add("open"),music.classList.add("panel-open"),expandBtn.classList.add("active"),expandBtn.title="收起歌词",updatePanelLayout(),updateLyric(audio.currentTime||0,!0),music.style.width="",music.style.background="",music.classList.add("hover-active"),showNoteIcon(!1),updateSongTitleScroll())},desktopHoverHandlers.boxMouseenter=()=>{playBtn.style.display="flex",showNoteIcon(!1),updateSongTitleScroll()},desktopHoverHandlers.panelEnter=function(){_hoverAnimTimer&&(clearTimeout(_hoverAnimTimer),_hoverAnimTimer=null),isLocked||(music.style.width="280px",music.style.background="rgba(255,255,255,0.8)",music.classList.add("hover-active")),showNoteIcon(!musicBox.matches(":hover")),updateSongTitleScroll()},epLyrics.addEventListener("mouseenter",()=>{epLyrics.classList.add("ep-hovering"),updateExpandedLyrics(lyricViewIndex,{direction:"none",fast:!1})}),epLyrics.addEventListener("mouseleave",()=>{const e=document.getElementById("music-context-menu");e&&e.classList.contains("show")&&e.matches(":hover")||(clearLyricBrowseIdleTimer(),stopLyricInertia(),lyricHovering=!1,lyricWheelDelta=0,lyricWheelVelocity=0,lyricWheelLastTs=0,lyricWheelStopTimer&&(clearTimeout(lyricWheelStopTimer),lyricWheelStopTimer=null),lyricTouchY=null,lyricTouchLineDelta=0,lyricTouchVelocity=0,lyricTouchLastTs=0,epLyrics.classList.remove("ep-hovering"),scrollLyricViewTo(lyricIndex,{fast:!0}))}),epLyrics.addEventListener("wheel",e=>{if(!lyricArr.length)return;e.preventDefault(),stopLyricInertia(),lyricHovering=!0,epLyrics.classList.remove("ep-hovering");const t=performance.now(),n=Math.max(1,t-lyricWheelLastTs);if(lyricWheelDelta+=e.deltaY,lyricWheelVelocity=e.deltaY/n*16,lyricWheelLastTs=t,Math.abs(lyricWheelDelta)>=40){const e=lyricWheelDelta>0?1:-1;lyricWheelDelta=0;const t=Math.max(0,Math.min(lyricArr.length-1,lyricViewIndex+e));if(t!==lyricViewIndex){const e=t>lyricViewIndex?"up":"down";lyricViewIndex=t,updateExpandedLyrics(lyricViewIndex,{direction:e,fast:!0}),armLyricBrowseIdleReset()}}lyricWheelStopTimer&&clearTimeout(lyricWheelStopTimer),lyricWheelStopTimer=setTimeout(()=>{lyricWheelStopTimer=null,lyricWheelDelta=0,lyricHovering&&lyricArr.length&&(epLyrics.classList.add("ep-hovering"),scrollLyricViewTo(lyricViewIndex,{fast:!0}),armLyricBrowseIdleReset(),lyricWheelVelocity=0,lyricWheelLastTs=0)},150)},{passive:!1}),epLyrics.addEventListener("touchstart",e=>{lyricArr.length&&e.touches&&e.touches.length&&(stopLyricInertia(),lyricTouchY=e.touches[0].clientY,lyricTouchLineDelta=0,lyricTouchVelocity=0,lyricTouchLastTs=0,epLyrics.classList.remove("ep-hovering"))},{passive:!1}),epLyrics.addEventListener("touchmove",e=>{if(!lyricArr.length||null==lyricTouchY||!e.touches||!e.touches.length)return;e.preventDefault();const t=e.touches[0].clientY,n=t-lyricTouchY;if(Math.abs(n)<2)return;lyricHovering=!0,lyricTouchY=t;const i=performance.now(),r=Math.max(1,i-lyricTouchLastTs);lyricTouchVelocity=n/r*16,lyricTouchLastTs=i,applyLyricScrollDelta(n)&&armLyricBrowseIdleReset()},{passive:!1}),epLyrics.addEventListener("touchend",()=>{if(lyricTouchLineDelta=0,lyricTouchY=null,!lyricArr.length)return;const e=lyricTouchVelocity;lyricTouchVelocity=0,lyricTouchLastTs=0,lyricHovering&&(Math.abs(e)>1.2?startLyricInertia(e):(epLyrics.classList.add("ep-hovering"),scrollLyricViewTo(lyricViewIndex,{fast:!0}),armLyricBrowseIdleReset()))}),epLyrics.addEventListener("click",e=>{if(!lyricArr.length)return;const t=e.target.closest("[data-lyric-idx]");if(!t)return;const n=Number(t.dataset.lyricIdx);if(!(!Number.isFinite(n)||n<0||n>=lyricArr.length)){if(n===lyricViewIndex){const e=lyricArr[n];return void(e&&Number.isFinite(e.time)&&(clearLyricBrowseIdleTimer(),lyricHovering=!1,audio.currentTime=e.time,lyricIndex=n,lyricViewIndex=n,renderMiniLyric(n),updateExpandedLyrics(lyricViewIndex,{direction:"none",fast:!0}),audio.duration&&isFinite(audio.duration)&&(epProgressFill.style.width=audio.currentTime/audio.duration*100+"%",epTimeCur.textContent=formatTime(audio.currentTime))))}lyricHovering=!0,scrollLyricViewTo(n,{fast:!0}),armLyricBrowseIdleReset()}}),musicToggleBtn.addEventListener("click",function(e){e.stopPropagation(),_mobileToggleAnimating||(music.classList.contains("expanded")?isMobile()&&panelOpen&&expandPanel.classList.contains("open")?(_mobileToggleAnimating=!0,rememberCollapsedOverlayState(),expandPanel.classList.remove("open"),music.classList.remove("panel-open"),expandBtn.classList.remove("active"),expandBtn.title="展开歌词",epPlaylist&&epPlaylist.classList.remove("show"),epEq&&epEq.classList.remove("show"),setTimeout(function(){music.classList.remove("expanded"),setToggleBtnIcon(!1),mobileExpanded=!1,updateMobilePanelVisibility(),_mobileToggleAnimating=!1},200)):(panelOpen&&rememberCollapsedOverlayState(),music.classList.remove("expanded"),setToggleBtnIcon(!1),isMobile()&&(mobileExpanded=!1),updateMobilePanelVisibility()):(music.classList.add("expanded"),setToggleBtnIcon(!0),isMobile()?(mobileExpanded=!0,updateMobilePanelVisibility(),panelOpen&&(_mobileToggleAnimating=!0,setTimeout(function(){expandPanel.classList.add("open"),music.classList.add("panel-open"),expandBtn.classList.add("active"),expandBtn.title="收起歌词",restoreCollapsedOverlayState(),updatePanelLayout(),updateLyric(audio.currentTime||0,!0),audio.duration&&isFinite(audio.duration)&&(epTimeCur.textContent=formatTime(audio.currentTime),epTimeDur.textContent=formatTime(audio.duration),epProgressFill.style.width=audio.currentTime/audio.duration*100+"%"),_mobileToggleAnimating=!1},600))):(updateMobilePanelVisibility(),panelOpen&&(restoreCollapsedOverlayState(),updatePanelLayout()))))}),setMobileMusicUI(),_wasMobile=isMobile(),window.addEventListener("resize",function(){if(_resizeAnimTimer)return;const e=isMobile(),t=_wasMobile!==e;return t&&!_wasMobile&&e&&isLocked&&panelOpen&&expandPanel.classList.contains("open")?(expandPanel.classList.remove("open"),music.classList.remove("panel-open"),expandBtn.classList.remove("active"),void(_resizeAnimTimer=setTimeout(function(){_resizeAnimTimer=null,_wasMobile=isMobile(),isMobile()?setMobileMusicUI():(expandPanel.classList.add("open"),music.classList.add("panel-open"),expandBtn.classList.add("active"),expandBtn.title="收起歌词",updatePanelLayout())},300))):t&&_wasMobile&&!e&&isLocked&&panelOpen?(expandPanel.classList.remove("open"),music.classList.remove("panel-open"),expandBtn.classList.remove("active"),setMobileMusicUI(),_wasMobile=e,void(_resizeAnimTimer=setTimeout(function(){_resizeAnimTimer=null,!isMobile()&&isLocked&&panelOpen&&(expandPanel.classList.add("open"),music.classList.add("panel-open"),expandBtn.classList.add("active"),expandBtn.title="收起歌词",updatePanelLayout(),updateLyric(audio.currentTime||0,!0))},200))):(setMobileMusicUI(),e&&mobileExpanded?(music.classList.add("expanded"),setToggleBtnIcon(!0)):e&&(music.classList.remove("expanded"),setToggleBtnIcon(!1)),void(_wasMobile=e))});let _playerLongPressTimer=null,_playerLongPressStart=null;function setupPlayerContextMenuEvents(){const e=createMusicContextMenu(),t=t=>{if(t){if("copyTitle"===t){let e=current;epPlaylist&&epPlaylist.classList.contains("show")&&Number.isFinite(hoveredPlaylistIndex)&&hoveredPlaylistIndex>=0&&hoveredPlaylistIndexcloseContextMenu())}if("copyLyric"===t){return void copyTextToClipboard(getCurrentLyricCopyText()).finally(()=>closeContextMenu())}if("prev"!==t){if("next"!==t){if("eq"===t){if(closeContextMenu(),_expandClickGuard)return;return panelOpen||(_expandClickGuard=!0,setTimeout(function(){_expandClickGuard=!1},1e3)),void openEQPanel()}if("toggleTranslation"===t)return translationEnabled=!translationEnabled,closeContextMenu(),updateLyric(audio.currentTime||0,!0),void updatePanelLayout();if("mode"===t){const t=e.querySelector("#mcm-mode-submenu");return void(t&&(updateContextMenuSubmenuPlacement(e),t.classList.toggle("show")))}return t.startsWith("mode:")?(playMode=t.split(":")[1]||"list",syncContextMenuState(e),void closeContextMenu()):void 0}if(closeContextMenu(),!songs.length)return;playSongByIndex((current+1)%songs.length)}else{if(closeContextMenu(),!songs.length)return;playSongByIndex((current-1+songs.length)%songs.length)}}};e.addEventListener("click",e=>{const n=e.target.closest(".mcm-item");if(!n)return;const i=n.dataset.action;i&&(n.classList.contains("mcm-disabled")||t(i))}),document.addEventListener("mousedown",e=>{const t=document.getElementById("music-context-menu");t&&t.classList.contains("show")&&(e.target&&e.target.closest&&e.target.closest("#music-context-menu")||closeContextMenu())},!0),document.addEventListener("scroll",()=>{closeContextMenu()},!0),document.addEventListener("keydown",e=>{if("Escape"===e.key&&closeContextMenu(),(e=>{if(!e)return!1;const t=(e.tagName||"").toLowerCase();return"input"===t||"textarea"===t||"select"===t||!!e.isContentEditable})(e.target))return;if(!(/Mac|iPhone|iPad|iPod/i.test(navigator.platform||navigator.userAgent||"")?e.metaKey&&e.altKey:e.ctrlKey&&e.altKey))return;const n=e.code||"";return"KeyC"===n?(e.preventDefault(),void t("copyTitle")):"KeyL"===n?(e.preventDefault(),void t("copyLyric")):"ArrowLeft"===n?(e.preventDefault(),void t("prev")):"ArrowRight"===n?(e.preventDefault(),void t("next")):void 0},!0),document.addEventListener("contextmenu",e=>{isEventInsidePlayer(e.target)&&(e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),openContextMenu(e.clientX,e.clientY,"mouse"))},!0);const n=()=>{_playerLongPressTimer&&clearTimeout(_playerLongPressTimer),_playerLongPressTimer=null,_playerLongPressStart=null};document.addEventListener("touchstart",e=>{isEventInsidePlayer(e.target)&&e.touches&&e.touches.length&&(_playerLongPressStart={x:e.touches[0].clientX,y:e.touches[0].clientY},_playerLongPressTimer&&clearTimeout(_playerLongPressTimer),_playerLongPressTimer=setTimeout(()=>{openContextMenu(_playerLongPressStart.x,_playerLongPressStart.y,"touch")},550))},{passive:!0,capture:!0}),document.addEventListener("touchmove",e=>{if(!_playerLongPressStart||!e.touches||!e.touches.length)return;const t=e.touches[0].clientX-_playerLongPressStart.x,n=e.touches[0].clientY-_playerLongPressStart.y;Math.hypot(t,n)>10&&(_playerLongPressTimer&&clearTimeout(_playerLongPressTimer),_playerLongPressTimer=null)},{passive:!0,capture:!0}),document.addEventListener("touchend",n,{passive:!0,capture:!0}),document.addEventListener("touchcancel",n,{passive:!0,capture:!0})}let isAudioLoading=!1,canRotate=!1;function getLoopContextSongs(){if(!MUSIC_PLAYER_CONFIG.loopCurrentList||!loopContextActive||void 0===currentLoopContext)return null;const e=songs.map((e,t)=>({song:e,idx:t})).filter(e=>e.song._playlistId===currentLoopContext);return e.length>0?e:null}function getNextSongIndex(){if(!songs.length)return 0;const e=getLoopContextSongs();if(e){const t=e.findIndex(e=>e.idx===current);if(-1!==t){if("shuffle"===playMode){if(e.length<=1)return current;let n=t;for(let i=0;i<8&&n===t;i++)n=Math.floor(Math.random()*e.length);return n===t&&(n=(t+1)%e.length),e[n].idx}return e[(t+1)%e.length].idx}}if("shuffle"===playMode){if(songs.length<=1)return current;let e=current;for(let t=0;t<8&&e===current;t++)e=Math.floor(Math.random()*songs.length);return e===current&&(e=(current+1)%songs.length),e}return(current+1)%songs.length}function getPrevSongIndex(){if(!songs.length)return 0;const e=getLoopContextSongs();if(e){const t=e.findIndex(e=>e.idx===current);if(-1!==t){if("shuffle"===playMode){if(e.length<=1)return current;let n=t;for(let i=0;i<8&&n===t;i++)n=Math.floor(Math.random()*e.length);return n===t&&(n=(t-1+e.length)%e.length),e[n].idx}return e[(t-1+e.length)%e.length].idx}}if("shuffle"===playMode){if(songs.length<=1)return current;let e=current;for(let t=0;t<8&&e===current;t++)e=Math.floor(Math.random()*songs.length);return e===current&&(e=(current-1+songs.length)%songs.length),e}return(current-1+songs.length)%songs.length}function formatTime(e){if(!e||!isFinite(e))return"0:00";const t=Math.floor(e/60),n=Math.floor(e%60);return t+":"+(n<10?"0":"")+n}function playSongByIndex(e,t=!0,n=!1){setSong(e);const i=songs[current];t&&MUSIC_PLAYER_CONFIG.loopCurrentList&&(currentLoopContext=i._playlistId,n&&(loopContextActive=!0)),audio.src=toAbsoluteUrl(i._encodedSrc||encodeURI(i.src)),audioLoadedIndex=current,setPlayBtn(!0,!0),canRotate=!1,audio.load(),audio.play(),updatePlaylistActive()}function togglePanel(){panelOpen=!panelOpen,panelOpen?(expandPanel.classList.add("open"),music.classList.add("panel-open"),expandBtn.classList.add("active"),expandBtn.title="收起歌词",updatePanelLayout(),updateMobilePanelVisibility(),updateLyric(audio.currentTime||0,!0),audio.duration&&isFinite(audio.duration)&&(epTimeCur.textContent=formatTime(audio.currentTime),epTimeDur.textContent=formatTime(audio.duration),epProgressFill.style.width=audio.currentTime/audio.duration*100+"%")):(expandPanel.classList.remove("open"),music.classList.remove("panel-open"),expandBtn.classList.remove("active"),expandBtn.title="展开歌词",epPlaylist.classList.remove("show"),epEq&&epEq.classList.remove("show"),updatePanelLayout(),updateMobilePanelVisibility())}function updatePlaylistActive(){epPlaylistList.querySelectorAll(".ep-playlist-item[data-song-index]").forEach(e=>{const t=Number(e.dataset.songIndex);e.classList.toggle("active",t===current)})}function getPlaylistById(e){return playlists.find(t=>t.id===e)||null}function getSongsInPlaylist(e){if(!e)return[];return getPlaylistById(e)?songs.filter(t=>t._playlistId===e):[]}function getSongsWithoutPlaylist(){return songs.filter(e=>!e._playlistId)}function navigateToPlaylist(e){currentPlaylistView=e,renderPlaylist()}function navigateBackFromPlaylist(){currentPlaylistView=null,renderPlaylist()}function renderPlaylist(){if(epPlaylistList.innerHTML="",currentPlaylistView){const e=getPlaylistById(currentPlaylistView),t=document.createElement("div");t.className="ep-playlist-back",t.innerHTML=PLAYLIST_BACK_ICON+'返回上级'+(e?''+e.name+"":""),t.addEventListener("click",e=>{e.stopPropagation(),navigateBackFromPlaylist()}),epPlaylistList.appendChild(t);getSongsInPlaylist(currentPlaylistView).forEach(e=>{const t=songs.indexOf(e),n=document.createElement("div");n.className="ep-playlist-item"+(t===current?" active":""),n.dataset.songIndex=String(t),n.dataset.index=String(t);const i=document.createElement("span");i.className="ep-item-icon",i.innerHTML=PLAYLIST_MUSIC_ICON;const r=document.createElement("span");r.className="ep-item-text",r.textContent=e.title||getFileStem(e.src),n.appendChild(i),n.appendChild(r),n.addEventListener("click",e=>{e.stopPropagation(),playSongByIndex(t,!0,!0),epPlaylist.classList.remove("show"),"playlist"===_collapsedOverlayState&&(_collapsedOverlayState=null),updatePanelLayout()}),epPlaylistList.appendChild(n)})}else{playlists.forEach(e=>{const t=document.createElement("div");t.className="ep-playlist-item folder-item",t.dataset.playlistId=e.id;const n=document.createElement("span");n.className="ep-item-icon",n.innerHTML=PLAYLIST_FOLDER_ICON;const i=document.createElement("span");i.className="ep-item-text";const r=getSongsInPlaylist(e.id).length;i.textContent=e.name+" ("+r+")",t.appendChild(n),t.appendChild(i),t.addEventListener("click",t=>{t.stopPropagation(),navigateToPlaylist(e.id)}),epPlaylistList.appendChild(t)});getSongsWithoutPlaylist().forEach(e=>{const t=songs.indexOf(e),n=document.createElement("div");n.className="ep-playlist-item"+(t===current?" active":""),n.dataset.songIndex=String(t),n.dataset.index=String(t);const i=document.createElement("span");i.className="ep-item-icon",i.innerHTML=PLAYLIST_MUSIC_ICON;const r=document.createElement("span");r.className="ep-item-text",r.textContent=e.title||getFileStem(e.src),n.appendChild(i),n.appendChild(r),n.addEventListener("click",e=>{e.stopPropagation(),playSongByIndex(t,!0,!0),epPlaylist.classList.remove("show"),"playlist"===_collapsedOverlayState&&(_collapsedOverlayState=null),updatePanelLayout()}),epPlaylistList.appendChild(n)})}}if(audio.addEventListener("waiting",()=>{isAudioLoading=!0,canRotate=!1,setPlayBtn(!0,!0),setImgRotate(!1)}),audio.addEventListener("canplay",()=>{isAudioLoading=!1,canRotate=!0,setPlayBtn(audio.paused,!1),playing&&setImgRotate(!0)}),audio.addEventListener("canplaythrough",()=>{isAudioLoading=!1,canRotate=!0,setPlayBtn(audio.paused,!1),playing&&setImgRotate(!0)}),audio.addEventListener("loadeddata",()=>{isAudioLoading=!1,canRotate=!0,setPlayBtn(audio.paused,!1),playing&&setImgRotate(!0)}),playBtn.addEventListener("click",e=>{if(e.stopPropagation(),!isAudioLoading&&songs.length){if(initAudioEQ(),_audioCtx&&"suspended"===_audioCtx.state&&_audioCtx.resume().catch(()=>{}),!audio.src||audioLoadedIndex!==current){const e=songs[current];return audio.src=toAbsoluteUrl(e._encodedSrc||encodeURI(e.src)),audioLoadedIndex=current,setPlayBtn(!0,!0),audio.load(),void audio.play()}playing?audio.pause():audio.play()}}),audio.addEventListener("play",()=>{playing=!0,setPlayBtn(!1,!1),canRotate&&setImgRotate(!0)}),audio.addEventListener("pause",()=>{playing=!1,setPlayBtn(!0,isAudioLoading);const e=window.getComputedStyle(musicImg).transform;let t=0;if(e&&"none"!==e){const n=e.split("(")[1].split(")")[0].split(","),i=parseFloat(n[0]),r=parseFloat(n[1]);t=Math.round(Math.atan2(r,i)*(180/Math.PI)),t<0&&(t+=360)}musicImg.style.setProperty("--img-rotate-angle",t+"deg"),setImgRotate(!1)}),audio.addEventListener("timeupdate",()=>{if(updateLyric(audio.currentTime),panelOpen&&audio.duration&&isFinite(audio.duration)){const e=audio.currentTime/audio.duration*100;epProgressFill.style.width=e+"%",epTimeCur.textContent=formatTime(audio.currentTime),epTimeDur.textContent=formatTime(audio.duration)}}),audio.addEventListener("ended",()=>{songs.length&&playSongByIndex("single"!==playMode?getNextSongIndex():current,!1)}),expandBtn.addEventListener("click",e=>{e.stopPropagation(),panelOpen||(_expandClickGuard=!0,setTimeout(function(){_expandClickGuard=!1},1e3)),togglePanel()}),epPrevBtn.addEventListener("click",e=>{e.stopPropagation(),songs.length&&playSongByIndex(getPrevSongIndex(),!1)}),epNextBtn.addEventListener("click",e=>{e.stopPropagation(),songs.length&&playSongByIndex(getNextSongIndex(),!1)}),epProgressBar.addEventListener("click",e=>{if(!audio.duration||!isFinite(audio.duration))return;const t=epProgressBar.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width)),i=n*audio.duration;fastScrollLyricsTo(findLyricIndexByTime(i)),audio.currentTime=i,epProgressFill.style.width=100*n+"%",epTimeCur.textContent=formatTime(audio.currentTime)}),epListBtn.addEventListener("click",e=>{e.stopPropagation();if(epPlaylist&&epPlaylist.classList.contains("show"))return epPlaylist.classList.remove("show"),"playlist"===_collapsedOverlayState&&(_collapsedOverlayState=null),void updatePanelLayout();renderPlaylist(),epEq&&epEq.classList.remove("show"),epPlaylist.classList.add("show"),_collapsedOverlayState="playlist",updatePanelLayout()}),epPlaylistClose.addEventListener("click",e=>{e.stopPropagation(),epPlaylist.classList.remove("show"),currentPlaylistView=null,"playlist"===_collapsedOverlayState&&(_collapsedOverlayState=null),updatePanelLayout()}),epPlaylistList.addEventListener("mousemove",e=>{const t=e.target.closest(".ep-playlist-item");if(!t||!epPlaylistList.contains(t))return void(hoveredPlaylistIndex=-1);const n=Number(t.dataset.index);hoveredPlaylistIndex=Number.isFinite(n)?n:-1}),epPlaylistList.addEventListener("mouseleave",()=>{const e=document.getElementById("music-context-menu");e&&e.classList.contains("show")||(hoveredPlaylistIndex=-1)}),epPlaylist){const e=e=>{e&&"function"==typeof e.stopPropagation&&e.stopPropagation()},t=t=>{e(t),t.preventDefault(),epPlaylistList&&(epPlaylistList.scrollTop+=t.deltaY)};epPlaylist.addEventListener("wheel",t,{passive:!1}),epPlaylist.addEventListener("touchstart",e,{passive:!0}),epPlaylist.addEventListener("touchmove",e,{passive:!0}),epPlaylist.addEventListener("touchend",e,{passive:!0})}if(epEq){const e=e=>{e&&"function"==typeof e.stopPropagation&&e.stopPropagation()},t=t=>{e(t);const n=t&&t.target&&t.target.closest?t.target.closest(".ep-eq-slider"):null;if(n){t.preventDefault();const e=Number(n.step)||.5,i=Number(n.min),r=Number(n.max),o=Number(n.value)||0,s=t.deltaY<0?1:-1,a=Math.max(i,Math.min(r,o+s*e));return void(a!==o&&(n.value=String(a),n.dispatchEvent(new Event("input",{bubbles:!0}))))}t.preventDefault(),epEqBands&&(epEqBands.scrollTop+=t.deltaY)};epEq.addEventListener("wheel",t,{passive:!1}),epEq.addEventListener("touchstart",e,{passive:!0}),epEq.addEventListener("touchmove",e,{passive:!0}),epEq.addEventListener("touchend",e,{passive:!0})}epEqClose&&epEqClose.addEventListener("click",e=>{e.stopPropagation(),closeEQPanel()}),epEqReset&&epEqReset.addEventListener("click",e=>{e.stopPropagation(),initAudioEQ(),_audioCtx&&"suspended"===_audioCtx.state&&_audioCtx.resume().catch(()=>{}),resetEQ()});const EQ_USER_PRESET_COOKIE_KEY="ep_eq_user_presets_v1";let _eqUserPresets=[];function _getCookie(e){const t=String(e||"");if(!t)return"";const n=String(document.cookie||"").split(";");for(const e of n){const n=e.trim();if(n&&n.startsWith(t+"="))return n.slice(t.length+1)}return""}function _setCookie(e,t,n){const i=String(e||""),r=String(t??"");if(!i)return;let o="";const s=Number(n);if(Number.isFinite(s)&&s>0){const e=new Date;e.setTime(e.getTime()+24*s*60*60*1e3),o="; expires="+e.toUTCString()}document.cookie=i+"="+r+o+"; path=/"}function loadUserEQPresetsFromCookie(){try{const e=_getCookie("ep_eq_user_presets_v1");if(!e)return _eqUserPresets=[],_eqUserPresets;const t=decodeURIComponent(e),n=JSON.parse(t);if(!Array.isArray(n))return _eqUserPresets=[],_eqUserPresets;_eqUserPresets=n.filter(e=>e&&"string"==typeof e.id&&"string"==typeof e.name&&Array.isArray(e.gains))}catch{_eqUserPresets=[]}return _eqUserPresets}function saveUserEQPresetsToCookie(){try{const e=JSON.stringify(_eqUserPresets||[]);_setCookie("ep_eq_user_presets_v1",encodeURIComponent(e),365)}catch{}}function _normalizeEQGains(e){const t=new Array(_eqFreqs.length).fill(0);for(let n=0;n<_eqFreqs.length;n++){const i=Array.isArray(e)?e[n]:0,r=Number(i);t[n]=Number.isFinite(r)?Math.max(-12,Math.min(12,Math.round(2*r)/2)):0}return t}function _getEQPresetById(e){const t=String(e||"").trim();if(!t)return null;if(t.startsWith("d:")){const e=t.slice(2);return EQ_PRESETS.find(t=>t&&t.id===e)||null}if(t.startsWith("u:")){const e=t.slice(2);return(_eqUserPresets||[]).find(t=>t&&t.id===e)||null}return EQ_PRESETS.find(e=>e&&e.id===t)||(_eqUserPresets||[]).find(e=>e&&e.id===t)||null}function applyEQPresetById(e){const t=_getEQPresetById(e);if(t&&Array.isArray(t.gains)){initAudioEQ(),_audioCtx&&"suspended"===_audioCtx.state&&_audioCtx.resume().catch(()=>{});for(let e=0;e<_eqFreqs.length;e++){const n=t.gains[e];setEQBandGain(e,Number.isFinite(Number(n))?Number(n):0)}syncEQPanelValues()}}function _buildEQPresetSelectOptions(e){if(!epEqPresetSelect)return;epEqPresetSelect.innerHTML="";const t=document.createElement("optgroup");t.label="内置预设";for(const e of EQ_PRESETS){if(!e||!e.id)continue;const n=document.createElement("option");n.value="d:"+e.id,n.textContent=e.name||e.id,t.appendChild(n)}epEqPresetSelect.appendChild(t);const n=document.createElement("optgroup");n.label="保存的预设";const i=Array.isArray(_eqUserPresets)?_eqUserPresets:[];if(i.length)for(const e of i){if(!e||!e.id)continue;const t=document.createElement("option");t.value="u:"+e.id,t.textContent=e.name||e.id,n.appendChild(t)}else{const e=document.createElement("option");e.value="__no_user__",e.textContent="(无)",e.disabled=!0,n.appendChild(e)}epEqPresetSelect.appendChild(n),e&&(epEqPresetSelect.value=e),epEqPresetSelect.value&&"__no_user__"!==epEqPresetSelect.value||(epEqPresetSelect.value="d:treble")}function _isUserPresetValue(e){return String(e||"").startsWith("u:")}function updateEQPresetSaveButtonState(){if(!epEqPresetSelect||!epEqPresetSave)return;_isUserPresetValue(epEqPresetSelect.value)?(epEqPresetSave.textContent="删除",epEqPresetSave.title="删除预设",epEqPresetSave.classList.add("danger")):(epEqPresetSave.textContent="保存",epEqPresetSave.title="保存预设",epEqPresetSave.classList.remove("danger"))}function initEQPresetUI(){epEqPresetSelect&&epEqPresetLoad&&epEqPresetSave&&"1"!==epEqPresetSelect.dataset.inited&&(epEqPresetSelect.dataset.inited="1",loadUserEQPresetsFromCookie(),_buildEQPresetSelectOptions("d:treble"),updateEQPresetSaveButtonState(),epEqPresetSelect.addEventListener("change",()=>{updateEQPresetSaveButtonState()}),epEqPresetLoad.addEventListener("click",e=>{e.stopPropagation(),applyEQPresetById(epEqPresetSelect.value)}),epEqPresetSave.addEventListener("click",e=>{e.stopPropagation();const t=epEqPresetSelect.value;if(_isUserPresetValue(t)){const e=_getEQPresetById(t),n=e?e.name||e.id:"";if(!e)return;if(!confirm("确认删除 EQ 预设:"+n+" ?"))return;const i=String(e.id||"");return _eqUserPresets=(_eqUserPresets||[]).filter(e=>e&&e.id!==i),saveUserEQPresetsToCookie(),_buildEQPresetSelectOptions("d:treble"),void updateEQPresetSaveButtonState()}const n=prompt("使用 Cookie 保存自定义 EQ 调节预设。\n请输入预设名称:","EQ 预设");if(null==n)return;const i=String(n).trim();if(!i)return;const r=(_eqUserPresets||[]).find(e=>e&&String(e.name||"").trim()===i);if(r){if(!confirm("已存在同名预设:"+i+",是否覆盖?"))return;r.gains=_normalizeEQGains(_eqGains)}else{const e={id:"u"+Date.now().toString(36)+Math.random().toString(36).slice(2,6),name:i,gains:_normalizeEQGains(_eqGains)};_eqUserPresets=Array.isArray(_eqUserPresets)?_eqUserPresets:[],_eqUserPresets.push(e)}saveUserEQPresetsToCookie();const o=(_eqUserPresets||[]).find(e=>e&&String(e.name||"").trim()===i);_buildEQPresetSelectOptions(o?"u:"+o.id:"d:treble"),updateEQPresetSaveButtonState()}))}function _coerceEQPresetSelectValue(e){const t=String(e||"").trim();return t?t.startsWith("d:")||t.startsWith("u:")?t:EQ_PRESETS.some(e=>e&&e.id===t)?"d:"+t:(_eqUserPresets||[]).some(e=>e&&e.id===t)?"u:"+t:t:""}function autoLoadEQPresetFromConfig(){const e=MUSIC_PLAYER_CONFIG||{};if(!0!==e.autoLoadEqPreset)return;const t=String(e.autoLoadEqPresetId||"").trim();if(!t)return;if(!_getEQPresetById(t))return;const n=_coerceEQPresetSelectValue(t);epEqPresetSelect&&n&&(epEqPresetSelect.value=n,updateEQPresetSaveButtonState()),applyEQPresetById(n||t)}setSong(0),setupPlayerContextMenuEvents(),initEQPresetUI(),autoLoadEQPresetFromConfig();