// ==UserScript== // @name 智读宝 (SmartReader) V7.8 // @namespace http://tampermonkey.net/ // @version 7.8 // @description 深度加固删除主题、重置插件、实时变色逻辑,确保按钮100%可用 // @author Gemini // @match *://*/* // @grant none // @downloadURL https://update.greasyfork.icu/scripts/570088/%E6%99%BA%E8%AF%BB%E5%AE%9D%20%28SmartReader%29%20V78.user.js // @updateURL https://update.greasyfork.icu/scripts/570088/%E6%99%BA%E8%AF%BB%E5%AE%9D%20%28SmartReader%29%20V78.meta.js // ==/UserScript== (function() { 'use strict'; const STORAGE_KEY = 'gm_read_master_v7_8'; const defaultThemes = { 'pureDark': { name: '极黑模式', bg: '#000000', text: '#cccccc', link: '#3daee9' }, 'softDark': { name: '深灰模式', bg: '#1a1a1b', text: '#d7dadc', link: '#4fbcff' }, 'green': { name: '森林护眼', bg: '#c7edcc', text: '#004010', link: '#0066cc' }, 'paper': { name: '复古羊皮', bg: '#f4ecd8', text: '#5b4636', link: '#b85c00' } }; let config = JSON.parse(localStorage.getItem(STORAGE_KEY)) || { active: false, currentThemeKey: 'softDark', fontSize: 20, imgSize: 80, customThemes: {} }; const styleTag = document.createElement('style'); styleTag.id = 'gm-read-v7-style'; document.head.appendChild(styleTag); function getTheme(key) { return defaultThemes[key] || config.customThemes[key] || defaultThemes['softDark']; } function updateStyles() { if (!config.active) { styleTag.innerHTML = ''; return; } const c = getTheme(config.currentThemeKey); styleTag.innerHTML = ` html, body { background-color: ${c.bg} !important; } body *:not(#rm-panel):not(#rm-panel *):not(#rm-mini-gear):not(button):not(i):not([class*="icon"]):not(a) { background-color: transparent !important; color: ${c.text} !important; font-size: ${config.fontSize}px !important; line-height: 1.8 !important; } body a:not(#rm-panel *) { color: ${c.link} !important; font-size: ${config.fontSize}px !important; text-decoration: underline !important; } img:not(#rm-panel *) { display: block !important; margin: 20px auto !important; width: ${config.imgSize}% !important; max-width: ${config.imgSize}% !important; height: auto !important; object-fit: contain !important; } header, footer, aside, nav, .ads, .sidebar { display: none !important; } `; } const panel = document.createElement('div'); panel.id = 'rm-panel'; panel.style = ` position: fixed; top: 60px; right: 20px; z-index: 2147483647; background: #ffffff; border: 1px solid #ddd; padding: 15px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); font-family: sans-serif; width: 250px; color: #333; font-size: 13px; display: none; `; const miniGear = document.createElement('div'); miniGear.id = 'rm-mini-gear'; miniGear.innerHTML = '⚙️'; miniGear.style = ` position: fixed; top: 80px; right: 20px; z-index: 2147483647; cursor: pointer; font-size: 26px; width: 45px; height: 45px; background: rgba(0, 0, 0, 0.7); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(0,0,0,0.4); `; function renderUI() { const current = getTheme(config.currentThemeKey); const isCustom = !!config.customThemes[config.currentThemeKey]; panel.innerHTML = `