115左侧栏

115网盘左侧栏自定义设置

// ==UserScript==
// @name         115左侧栏
// @version      1.0.7
// @namespace    https://sleazyfork.org/zh-CN/users/1461640-%E6%98%9F%E5%AE%BF%E8%80%81%E9%AD%94
// @author       星宿老魔
// @description  115网盘左侧栏自定义设置
// @match        *://115.com/*
// @match        *://life.115.com/*
// @exclude      *://115.com/web/lixian/master/video/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=115.com
// @license      MIT
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function(){"use strict";const n=[{id:"wangpan",title:"网盘",icon:"💾",
href:"https://115.com/?cid=0&offset=0&mode=wangpan",category:"quickIcon",defaultEnabled:true},{id:"upload",title:"最近上传",
icon:"⬆️",href:"//115.com/?tab=upload&mode=wangpan",dataNav:"upload",relTab:"upload",tabBtn:"wangpan",modeTab:"upload",
category:"quickIcon",defaultEnabled:true},{id:"star",title:"星标文件",icon:"⭐",
href:"//115.com/?tab=label&label_id=-1&show_label=1&mode=wangpan",dataNav:"star",relTab:"star",tabBtn:"wangpan",
modeData:"{tab:'label',label_id:-1,show_label:1}",category:"quickIcon",defaultEnabled:true},{id:"recyclebin",
title:"回收站",icon:"🗑️",href:"//115.com/?tab=rb&mode=wangpan",dataNav:"rb",relTab:"rb",modeTab:"rb",tabBtn:"wangpan",
category:"quickIcon",defaultEnabled:true},{id:"clouddownload",title:"云下载",icon:"☁️",
href:"//115.com/?tab=offline&mode=wangpan",dataNav:"offline",relTab:"offline",tabBtn:"wangpan",modeTab:"offline",
category:"quickIcon",defaultEnabled:false},{id:"receive",title:"最近接收",icon:"📥",
href:"//115.com/?tab=share_save_receive&mode=wangpan",dataNav:"share_save_receive",relTab:"share_save_receive",
tabBtn:"wangpan",modeTab:"share_save_receive",category:"quickIcon",defaultEnabled:false},{id:"tags",title:"文件标签",
icon:"🏷️",href:"javascript:;",dataNav:"label",relTab:"label",tabBtn:"wangpan",category:"quickIcon",defaultEnabled:false
},{id:"share",title:"链接分享",icon:"🔗",href:"//115.com/?mode=share_save",dataNav:"share_save",relTab:"share_save",
tabBtn:"share_save",category:"quickIcon",defaultEnabled:false}];const t={variables:{"--primary-color":"#2b85e4",
"--text-color":"#666","--hover-color":"#2b85e4","--icon-size":"20px","--spacing-sm":"3px","--spacing-md":"6px",
"--spacing-lg":"12px","--border-radius":"3px","--bg-overlay":"rgba(0,0,0,0.5)","--bg-panel":"#ffffff",
"--border-color":"#e0e0e0"},timeout:3e3};const e={leftSidebar:".container-leftside",
quickIconsContainer:"#js_sub_nav_scroller",navCeiling:".top-side .navigation-ceiling ul",quickIcons:".grid-item",
bottomSide:".bottom-side .navigation-ceiling ul",chatButton:"#js_left_notice"};const i={
enabledFunctions:"115_enabled_functions",settingsVersion:"115_settings_version"};class Config{static getFunctionItems(){
return[...n]}static getFunctionItem(t){return n.find(n=>n.id===t)}static getStyleConfig(){return t}
static getSelectors(){return e}static getStorageKeys(){return i}static getDefaultEnabledIds(){
return n.filter(n=>n.defaultEnabled).map(n=>n.id)}}class SettingsManager{constructor(){this.settingsVersion="1.0.0"
;this.enabledFunctionIds=new Set;this.loadSettings()}static getInstance(){
if(!SettingsManager.instance)SettingsManager.instance=new SettingsManager;return SettingsManager.instance}
loadSettings(){try{const n=localStorage.getItem(i.enabledFunctions);if(n){const t=JSON.parse(n)
;if(Array.isArray(t))this.enabledFunctionIds=new Set(t)
}else this.enabledFunctionIds=new Set(Config.getDefaultEnabledIds());void 0;this.saveSettings()}catch(n){void 0
;this.enabledFunctionIds=new Set(Config.getDefaultEnabledIds());this.saveSettings()}}saveSettings(){try{
const n=Array.from(this.enabledFunctionIds);localStorage.setItem(i.enabledFunctions,JSON.stringify(n))
;localStorage.setItem(i.settingsVersion,this.settingsVersion);void 0}catch(n){void 0}}isFunctionEnabled(n){
return this.enabledFunctionIds.has(n)}enableFunction(n){this.enabledFunctionIds.add(n);this.saveSettings()}
disableFunction(n){this.enabledFunctionIds.delete(n);this.saveSettings()}toggleFunction(n){
if(this.isFunctionEnabled(n)){this.disableFunction(n);return false}else{this.enableFunction(n);return true}}
getEnabledFunctionIds(){return Array.from(this.enabledFunctionIds)}getEnabledFunctions(){
const n=Config.getFunctionItems();return n.filter(n=>this.isFunctionEnabled(n.id))}setFunctions(n){
this.enabledFunctionIds=new Set(n);this.saveSettings()}resetToDefault(){
this.enabledFunctionIds=new Set(Config.getDefaultEnabledIds());this.saveSettings()}getAllFunctionsInOrder(){
return Config.getFunctionItems()}getSettingsInfo(){const n=Config.getFunctionItems()
;const t=this.getEnabledFunctionIds();return{version:this.settingsVersion,totalFunctions:n.length,enabledCount:t.length,
disabledCount:n.length-t.length,quickIconEnabled:t.length}}exportSettings(){const settings={
version:this.settingsVersion,timestamp:Date.now(),enabledFunctions:this.getEnabledFunctionIds()}
;return JSON.stringify(settings,null,2)}importSettings(n){try{const settings=JSON.parse(n)
;if(settings.enabledFunctions&&Array.isArray(settings.enabledFunctions)){this.setFunctions(settings.enabledFunctions)
;void 0;return true}}catch(t){void 0}return false}}function waitForElement(n,t=5e3){return new Promise((e,i)=>{
const a=document.querySelector(n);if(a){e(a);return}const observer=new MutationObserver(()=>{
const t=document.querySelector(n);if(t){observer.disconnect();e(t)}});observer.observe(document.body,{childList:true,
subtree:true});setTimeout(()=>{observer.disconnect();i(new Error(`Element ${n} not found within ${t}ms`))},t)})}
function createElement(n,t={},e){const i=document.createElement(n);Object.assign(i,t);if(e)i.textContent=e;return i}
class SettingsPanel{constructor(n){this.settingsManager=n;this.isOpen=false;this.overlay=null}open(){
if(this.isOpen)return;this.createPanel();this.isOpen=true;void 0}close(){if(!this.isOpen||!this.overlay)return
;this.overlay.remove();this.overlay=null;this.isOpen=false;void 0}toggle(){if(this.isOpen)this.close();else this.open()}
createPanel(){this.overlay=createElement("div",{className:"settings-overlay"});const n=createElement("div",{
className:"settings-panel"});const t=this.createHeader();const e=this.createContent();const i=this.createFooter()
;n.appendChild(t);n.appendChild(e);n.appendChild(i);this.injectStyles();this.overlay.addEventListener("click",n=>{
if(n.target===this.overlay)this.close()});this.overlay.appendChild(n);document.body.appendChild(this.overlay)}
createHeader(){const n=createElement("div",{className:"panel-header"});const t=createElement("h3",{},"115左侧栏设置")
;const e=createElement("button",{className:"close-btn",title:"关闭"},"×");e.addEventListener("click",()=>this.close())
;n.appendChild(t);n.appendChild(e);return n}createContent(){const n=createElement("div",{className:"panel-content"})
;const t=createElement("table",{className:"function-table"});const e=this.getSortedFunctions()
;for(let i=0;i<e.length;i+=2){const n=createElement("tr",{className:"function-row"});const a=createElement("td",{
className:"function-cell"});const o=this.createFunctionItem(e[i]);a.appendChild(o);n.appendChild(a)
;const s=createElement("td",{className:"function-cell"});if(e[i+1]){const n=this.createFunctionItem(e[i+1])
;s.appendChild(n)}else s.style.visibility="hidden";n.appendChild(s);t.appendChild(n)}n.appendChild(t);return n}
getSortedFunctions(){const n=this.settingsManager.getAllFunctionsInOrder()
;const t=n.filter(n=>"quickIcon"===n.category&&"wangpan"!==n.id);const e=["receive","upload","recyclebin"];const i=[]
;const a=[];t.forEach(n=>{if(e.includes(n.id))i.push(n);else a.push(n)});i.sort((n,t)=>{const i=e.indexOf(n.id)
;const a=e.indexOf(t.id);return i-a});return[...a,...i]}createFunctionItem(n){const t=createElement("div",{
className:"function-item"});const e=createElement("label",{className:"function-label",htmlFor:`func-${n.id}`})
;const i=createElement("i",{},n.icon);const a=createElement("span",{className:"function-text"},n.title);e.appendChild(i)
;e.appendChild(a);const o=createElement("input",{type:"checkbox",className:"function-checkbox",id:`func-${n.id}`,
checked:this.settingsManager.isFunctionEnabled(n.id),onchange:()=>{
if(o.checked)this.settingsManager.enableFunction(n.id);else this.settingsManager.disableFunction(n.id)
;window.dispatchEvent(new CustomEvent("115-settings-changed"));void 0}});t.appendChild(e);t.appendChild(o);return t}
createFooter(){const n=createElement("div",{className:"panel-footer"});const t=createElement("button",{
className:"btn btn-secondary",onclick:()=>{if(confirm("确定要重置所有设置吗?")){this.settingsManager.resetToDefault();this.close()
;setTimeout(()=>this.open(),100);void 0}}},"重置");const e=createElement("button",{className:"btn btn-primary",
onclick:()=>this.close()},"确定");n.appendChild(t);n.appendChild(e);return n}injectStyles(){
const n="settings-panel-styles";if(document.getElementById(n))return;const t=createElement("style",{id:n})
;t.textContent=this.generateSettingsPanelCSS();document.head.appendChild(t)}generateSettingsPanelCSS(){
const n=Object.entries(t.variables).map(([n,t])=>`${n}: ${t}`).join("; ")
;return`\n      :root { ${n}; }\n      \n      .settings-overlay { \n        position: fixed; \n        top: 0; \n        left: 0; \n        width: 100%; \n        height: 100%; \n        background: var(--bg-overlay); \n        z-index: 10000; \n      } \n      \n      .settings-panel { \n        position: absolute; \n        top: 50%; \n        left: 50%; \n        transform: translate(-50%, -50%); \n        background: #ffffff; \n        border-radius: 12px; \n        box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08); \n        width: fit-content; \n        min-width: 500px;\n        max-width: 560px;\n        max-height: 85vh; \n        overflow: hidden; \n        display: flex; \n        flex-direction: column; \n        border: 1px solid rgba(0,0,0,0.05);\n      } \n      \n      .panel-header { \n        display: flex; \n        justify-content: space-between; \n        align-items: center; \n        padding: 18px 24px; \n        border-bottom: 1px solid var(--border-color); \n        background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);\n      } \n      \n      .panel-header h3 { \n        margin: 0; \n        color: var(--text-color); \n        font-size: 18px;\n        font-weight: 600;\n        letter-spacing: 0.3px;\n      } \n      \n      .close-btn { \n        background: none; \n        border: none; \n        font-size: 22px; \n        cursor: pointer; \n        color: #666; \n        padding: 0; \n        width: 32px; \n        height: 32px; \n        display: flex; \n        align-items: center; \n        justify-content: center; \n        border-radius: 4px;\n        transition: all 0.2s ease;\n      } \n      \n      .close-btn:hover { \n        color: #333; \n        background: rgba(0,0,0,0.1);\n      } \n      \n      .panel-content { \n        flex: 1; \n        overflow-y: auto; \n        padding: 24px; \n        background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);\n      } \n      \n      .function-group { \n        margin-bottom: var(--spacing-lg); \n      } \n      \n      .group-title { \n        margin: 0 0 var(--spacing-md) 0; \n        color: var(--text-color); \n        font-size: 16px; \n        border-bottom: 1px solid var(--border-color); \n        padding-bottom: var(--spacing-sm); \n      } \n      \n      .function-table { \n        width: 100%;\n        border-collapse: separate;\n        border-spacing: 10px 8px;\n        margin: 0;\n        table-layout: fixed;\n      }\n      \n      .function-row {\n        /* 表格行样式 */\n      }\n      \n      .function-row:last-child .function-item {\n        /* 最后一行的特殊样式 */\n      }\n      \n      .function-cell {\n        width: 50%;\n        vertical-align: top;\n        padding: 0;\n        position: relative;\n      } \n      \n      .function-item { \n        display: flex; \n        align-items: center; \n        justify-content: space-between;\n        padding: 12px 16px; \n        border: 1px solid #e1e5e9; \n        border-radius: 8px; \n        user-select: none;\n        min-height: 44px;\n        white-space: nowrap;\n        width: 100%;\n        box-sizing: border-box;\n        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n        background: linear-gradient(145deg, #ffffff 0%, #fefefe 100%);\n        position: relative;\n      }\n      \n      .function-label {\n        display: flex;\n        align-items: center;\n        gap: 8px;\n        cursor: pointer;\n        flex: 1;\n        margin-right: 12px;\n        overflow: hidden;\n      }\n      \n      .function-label i {\n        font-size: 17px;\n        color: #007acc;\n        width: 22px;\n        text-align: center;\n        flex-shrink: 0;\n        line-height: 1;\n        filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));\n      }\n      \n      .function-text {\n        font-size: 14px;\n        color: #333;\n        white-space: nowrap;\n        overflow: hidden;\n        text-overflow: ellipsis;\n        font-weight: 500;\n        line-height: 1.4;\n      }\n      \n      .function-checkbox {\n        flex-shrink: 0;\n        width: 18px;\n        height: 18px;\n        cursor: pointer;\n        margin: 0;\n        accent-color: #007acc;\n        border-radius: 3px;\n      } \n      \n      .function-item:hover { \n        background: linear-gradient(145deg, #f8f9fa 0%, #f0f2f5 100%);\n        border-color: #007acc;\n        box-shadow: 0 4px 12px rgba(0, 122, 204, 0.15);\n        transform: translateY(-1px);\n      }\n      \n      .function-item:active {\n        transform: translateY(0);\n        box-shadow: 0 2px 6px rgba(0, 122, 204, 0.1);\n      } \n      \n      \n      \n      .panel-footer { \n        display: flex; \n        justify-content: flex-end; \n        gap: 12px; \n        padding: 16px 24px; \n        border-top: 1px solid var(--border-color); \n        background: #f8f9fa;\n      } \n      \n      .btn { \n        padding: 10px 18px; \n        border: none; \n        border-radius: 6px; \n        cursor: pointer; \n        font-size: 14px; \n        font-weight: 500;\n        transition: all 0.2s ease;\n        min-width: 72px;\n      } \n      \n      .btn-primary { \n        background: linear-gradient(135deg, #007acc 0%, #005c99 100%); \n        color: white; \n        box-shadow: 0 2px 6px rgba(0, 122, 204, 0.3);\n      } \n      \n      .btn-secondary { \n        background: #f5f5f5; \n        color: #666; \n        border: 1px solid #ddd;\n      } \n      \n      .btn:hover { \n        transform: translateY(-1px);\n      }\n      \n      .btn-primary:hover {\n        box-shadow: 0 4px 12px rgba(0, 122, 204, 0.4);\n      }\n      \n      .btn-secondary:hover {\n        background: #eeeeee;\n        border-color: #ccc;\n      }\n    `.trim()
}}class SidebarManager{constructor(){this.isInitialized=false;this.settingsButton=null
;this.settingsManager=SettingsManager.getInstance();this.settingsPanel=new SettingsPanel(this.settingsManager)}
async init(){if(this.isInitialized)return;try{await this.waitForElements();this.hideOriginalNavItems()
;this.createSettingsButton();this.renderEnabledFunctions();this.setupSelectionStateManagement()
;this.setupEventListeners();this.applyStyles();this.isInitialized=true;void 0}catch(n){void 0}}async waitForElements(){
await Promise.all([waitForElement(e.leftSidebar,t.timeout),waitForElement(e.bottomSide,t.timeout)])}
hideOriginalNavItems(){const n=document.querySelector(e.leftSidebar);if(n){
const t=n.querySelector('li[mode_btn="wangpan"]');const e=n.querySelector('li[mode_btn="home"]')
;const i=n.querySelector('li[mode_btn="vip"]');const a=n.querySelector('li[mode_btn="add"]');if(t)t.style.display="none"
;if(e)e.style.display="none";if(i)i.style.display="none";if(a)a.style.display="none"}
const t=document.querySelector(e.bottomSide);if(t){const n=t.querySelector("#js_left_notice")
;const e=t.querySelector("#js_feedback_main");const i=t.querySelector('a[onclick*="CommonHeader.showClientDownLoad"]')
;if(n)n.parentElement.style.display="none";if(e)e.parentElement.style.display="none"
;if(i)i.parentElement.style.display="none"}void 0}createNavButton(config){const n=createElement("li",{
className:"custom-nav-item"});const t=createElement("a",{href:config.href||"javascript:;",
className:`custom-nav-btn ${config.className||""}`,
innerHTML:`<i class="custom-icon">${config.icon}</i><span>${config.title}</span>`,onclick:config.onClick})
;n.appendChild(t);return n}createSettingsButton(){const n=document.querySelector(e.bottomSide);if(!n)return
;const t=this.createNavButton({icon:"⚙️",title:"设置",onClick:()=>this.openSettings(),className:"settings-btn"})
;n.appendChild(t);this.settingsButton=t.querySelector("a");void 0}getSortedEnabledFunctions(){
const n=this.settingsManager.getEnabledFunctions().filter(n=>"wangpan"!==n.id);const t=["receive","upload","recyclebin"]
;const e=[];const i=[];n.forEach(n=>{if(t.includes(n.id))e.push(n);else i.push(n)});e.sort((n,e)=>{
const i=t.indexOf(n.id);const a=t.indexOf(e.id);return i-a});return[...i,...e]}renderEnabledFunctions(){
const n=document.querySelector(e.navCeiling);if(!n)return;const t=n.querySelectorAll(".custom-nav-item")
;t.forEach(n=>n.remove());const i=this.getSortedEnabledFunctions()
;const a=Config.getFunctionItems().find(n=>"wangpan"===n.id);if(a){const t=this.createNavItem(a);if(t)n.appendChild(t)}
i.forEach(t=>{const e=this.createNavItem(t);if(e)n.appendChild(e)});void 0}openSettings(){this.settingsPanel.open()}
setupSelectionStateManagement(){this.initializeCustomNavSelection();this.monitorNavigationChanges()}
initializeCustomNavSelection(){setTimeout(()=>{this.updateSelectionState()},100)}monitorNavigationChanges(){
let n=window.location.href;const checkUrlChange=()=>{if(window.location.href!==n){n=window.location.href
;this.updateSelectionState()}};const observer=new MutationObserver(()=>{checkUrlChange()})
;observer.observe(document.body,{childList:true,subtree:true});setInterval(checkUrlChange,1e3)}updateSelectionState(){
this.clearAllSelections();this.setCurrentSelectionByUrl()}clearAllSelections(){
const n=document.querySelectorAll(".container-leftside .custom-nav-item");n.forEach(n=>n.classList.remove("current"))}
setCurrentSelectionByUrl(){const n=window.location.href;const params=new URLSearchParams(window.location.search)
;const t=params.get("mode");const e=params.get("tab")
;if("wangpan"===t||n.includes("115.com/?"))if(e)this.setSelectionByDataNav(e);else this.setStorageAsSelected()}
setSelectionByDataNav(n){const t=document.querySelector(e.navCeiling);if(t){const e=t.querySelector(`[data-nav="${n}"]`)
;if(e){const n=e.closest(".custom-nav-item");if(n)n.classList.add("current")}}}setStorageAsSelected(){
const n=document.querySelector(e.navCeiling);if(n){
const t=n.querySelector('.custom-nav-item a[href*="mode=wangpan"]:not([href*="tab="])');if(t){
const n=t.closest(".custom-nav-item");if(n)n.classList.add("current")}}}setupEventListeners(){
window.addEventListener("115-settings-changed",()=>{this.renderEnabledFunctions();this.updateSelectionState();void 0})}
createNavItem(n){const t=createElement("li",{className:"custom-nav-item"});const e=createElement("a",{href:n.href,
target:n.target||"",className:"custom-nav-btn"});if(n.dataNav)e.setAttribute("data-nav",n.dataNav)
;if(n.relTab)e.setAttribute("rel_tab",n.relTab);if(n.tabBtn)e.setAttribute("tab_btn",n.tabBtn)
;if(n.modeTab)e.setAttribute("mode-tab",n.modeTab);if(n.modeData)e.setAttribute("mode-data",n.modeData)
;e.innerHTML=`<i class="custom-icon">${n.icon}</i><span>${n.title}</span>`;this.addClickHandler(e,n);t.appendChild(e)
;return t}addClickHandler(n,t){n.addEventListener("click",i=>{this.clearAllSelections()
;const a=n.closest(".custom-nav-item");if(a)a.classList.add("current");if("wangpan"===t.id)return;if(t.dataNav){
i.preventDefault();const n=document.querySelector(e.quickIconsContainer);if(n){
const e=n.querySelector(`[data-nav="${t.dataNav}"]`);if(e){e.click();return}}
if(t.href&&"javascript:;"!==t.href)window.location.href=t.href;return}})}applyStyles(){const n="115-sidebar-styles"
;if(document.getElementById(n))return;const t=createElement("style",{id:n});t.textContent=this.generateCSS()
;document.head.appendChild(t)}generateCSS(){
return[this.generateCSSVariables(),this.generateNavigationStyles(),this.generateIconStyles(),this.generateStateStyles(),this.generateSettingsStyles()].join("\n\n")
}generateCSSVariables(){const n=Object.entries(t.variables).map(([n,t])=>`${n}: ${t}`).join(";\n    ")
;return`:root {\n    ${n};\n  }`}generateNavigationStyles(){
return`\n      /* 统一的导航容器样式 */\n      .container-leftside .top-side .navigation-ceiling ul {\n        display: flex !important;\n        flex-direction: column !important;\n        align-items: center !important;\n        justify-content: flex-start !important;\n        margin: 0 !important;\n        padding: 8px 0 15px 0 !important;\n        min-height: auto !important;\n      }\n\n      .container-leftside .bottom-side .navigation-ceiling ul {\n        display: flex !important;\n        flex-direction: column !important;\n        align-items: center !important;\n        padding: 0 !important;\n      }\n\n      /* 统一的导航项容器样式 */\n      .container-leftside .custom-nav-item {\n        width: auto !important;\n        min-width: 60px !important;\n        text-align: center !important;\n        margin: 0 0 12px 0 !important;\n        list-style: none !important;\n        position: relative !important;\n      }\n\n      /* 统一的导航按钮样式 */\n      .container-leftside .custom-nav-btn {\n        display: flex !important;\n        flex-direction: column !important;\n        align-items: center !important;\n        justify-content: center !important;\n        text-decoration: none !important;\n        color: var(--text-color) !important;\n        padding: 8px 10px !important;\n        border-radius: var(--border-radius) !important;\n        transition: all 0.2s ease !important;\n        min-height: 50px !important;\n        box-sizing: border-box !important;\n        background: none !important;\n        border: none !important;\n        cursor: pointer !important;\n      }\n\n`.trim()
}generateIconStyles(){
return`\n      /* 统一的图标样式 */\n      .container-leftside .custom-nav-btn i {\n        font-size: 20px !important;\n        margin-bottom: 4px !important;\n        font-style: normal !important;\n        line-height: 1 !important;\n        display: block !important;\n        height: 24px !important;\n        width: auto !important;\n        font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif !important;\n      }\n\n      /* 统一的文字样式 */\n      .container-leftside .custom-nav-btn span {\n        font-size: 11px !important;\n        line-height: 1.2 !important;\n        white-space: nowrap !important;\n        color: inherit !important;\n        font-weight: normal !important;\n        margin-top: 1px !important;\n      }\n\n      /* 自定义图标字体样式 */\n      .custom-icon {\n        font-style: normal !important;\n        font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif !important;\n        display: inline-block !important;\n      }`.trim()
}generateStateStyles(){
return`\n      /* 统一的悬停状态 */\n      .container-leftside .custom-nav-btn:hover {\n        color: var(--hover-color) !important;\n        background: rgba(43, 133, 228, 0.1) !important;\n        transform: translateY(-1px) !important;\n      }\n\n      /* 统一的选中状态 */\n      .container-leftside .custom-nav-item.current .custom-nav-btn {\n        color: var(--hover-color) !important;\n        background: rgba(43, 133, 228, 0.15) !important;\n        box-shadow: 0 2px 4px rgba(43, 133, 228, 0.2) !important;\n      }\n\n      /* 选中状态的悬停效果 */\n      .container-leftside .custom-nav-item.current .custom-nav-btn:hover {\n        background: rgba(43, 133, 228, 0.2) !important;\n        transform: none !important;\n      }\n\n      /* 按钮激活状态 */\n      .container-leftside .custom-nav-btn:active {\n        transform: translateY(0) !important;\n        background: rgba(43, 133, 228, 0.2) !important;\n      }`.trim()
}generateSettingsStyles(){
return`\n      /* 通用样式 */\n      .custom-nav-item {\n        list-style: none !important;\n      }\n\n      /* 确保不影响原生布局 */\n      .container-leftside .top-side .navigation-ceiling,\n      .container-leftside .bottom-side .navigation-ceiling {\n        position: relative !important;\n      }`.trim()
}refresh(){this.renderEnabledFunctions()}destroy(){if(this.settingsButton)this.settingsButton.remove()
;const n=document.getElementById("115-sidebar-styles");if(n)n.remove();this.isInitialized=false}}class App{
constructor(){this.sidebarManager=new SidebarManager;this.settingsManager=SettingsManager.getInstance()}async init(){
try{void 0;void 0;await this.sidebarManager.init();this.showStartupInfo();void 0}catch(n){void 0;this.showErrorInfo(n)}}
showStartupInfo(){const n=this.settingsManager.getSettingsInfo();void 0}showErrorInfo(n){void 0}refresh(){
this.sidebarManager.refresh();void 0}getSettingsManager(){return this.settingsManager}getSidebarManager(){
return this.sidebarManager}exportSettings(){return this.settingsManager.exportSettings()}importSettings(n){
const t=this.settingsManager.importSettings(n);if(t)this.refresh();return t}destroy(){this.sidebarManager.destroy()
;void 0}}const injectPreHideStyles=()=>{const n="115-pre-hide-styles";if(document.getElementById(n))return
;const t=document.createElement("style");t.id=n
;t.textContent=`\n    /* 预隐藏原生按钮,防止闪现 */\n    .container-leftside .top-side .navigation-ceiling ul li[mode_btn="wangpan"],\n    .container-leftside .top-side .navigation-ceiling ul li[mode_btn="home"],\n    .container-leftside .top-side .navigation-ceiling ul li[mode_btn="vip"], \n    .container-leftside .top-side .navigation-ceiling ul li[mode_btn="add"],\n    .container-leftside .bottom-side .navigation-ceiling ul li:has(#js_left_notice),\n    .container-leftside .bottom-side .navigation-ceiling ul li:has(#js_feedback_main),\n    .container-leftside .bottom-side .navigation-ceiling ul li:has(a[onclick*="CommonHeader.showClientDownLoad"]) {\n      display: none !important;\n      opacity: 0 !important;\n      visibility: hidden !important;\n    }\n  `.trim()
;(document.head||document.documentElement).appendChild(t);void 0};injectPreHideStyles();const a=new App
;if("loading"===document.readyState)document.addEventListener("DOMContentLoaded",()=>a.init());else a.init()
;window.__115_sidebar__=a;window.__115_sidebar_settings__={show:()=>a.getSidebarManager().openSettings?.(),
export:()=>a.exportSettings(),import:n=>a.importSettings(n),refresh:()=>a.refresh(),
info:()=>a.getSettingsManager().getSettingsInfo()};void 0;void 0;void 0;void 0;void 0;void 0})();