深色模式 by Rove24

Rove Coulson
2026-03-23T15:11:53Z

极致纯净，只精准修改背景和文字颜色。

# 🌓 深色模式 / Dark Mode (Ultra-Pure)

厌倦了那些导致网页布局错乱、破坏原生交互的深色模式插件？本脚本采用全新思路，只精准修改背景和文字颜色，绝不干扰网页原有逻辑。彻底解决因粗暴反色导致的网页内容丢失问题！

Tired of dark mode extensions that break webpage layouts or interfere with native interactions? This script takes a completely new approach: it precisely modifies only background and text colors without disrupting the original logic of the webpage. Say goodbye to missing content caused by crude color inversion!

---

### ✨ 核心亮点 / Core Features

* **🌟 极致纯净 (Ultra-Pure)**
**[中文]** 不修改 DOM 结构，不添加多余的 Class 类名，完美融入原网页，防止被网站原生脚本误伤。
**[EN]** No DOM structure manipulation, no injected CSS classes. Completely avoids conflicts with native site scripts.
* **🎨 精准色彩映射 (Precise Color Mapping)**
**[中文]** 利用亮度算法（Luminance），只把刺眼的纯白/浅灰背景变暗，把极黑的文字变亮。完美保留彩色文本、图片和视频的原始色彩！
**[EN]** Uses luminance algorithms to darken only blinding white backgrounds and brighten extremely dark text. Original colors of images, videos, and colored text are perfectly preserved!
* **⚡ 无感性能优化 (Zero Performance Impact)**
**[中文]** 采用异步分批调度（`requestIdleCallback`），再多元素的复杂网页也不会卡顿，丝滑如初。
**[EN]** Utilizes asynchronous batch processing to ensure smooth scrolling and zero lag, even on DOM-heavy sites.
* **👻 深入穿透 (Shadow DOM Support)**
**[中文]** 完美支持 Web Components 和 Shadow DOM 内嵌元素的深色转换。
**[EN]** Deeply penetrates and fully supports Web Components and Shadow DOM.

---

### 🚀 如何使用 / How to Use

**[中文]** 默认仅在少部分测试网站开启。如果你想对当前网页开启深色模式，只需点击浏览器右上角的 **脚本管理器图标（如 Tampermonkey）**，在菜单中点击 **`🌓 启用/停用深色模式`** 即可为当前网站单独切换状态，设置会自动保存。

**[EN]**
By default, it is only enabled on a few specific sites. To enable dark mode for your current website, simply click your **Script Manager icon (e.g., Tampermonkey)**, and click **`🌓 Enable/Disable Dark Mode`** in the menu to toggle the state for the specific domain. Your preferences are saved automatically.

---

### ⚠️ 已知局限 / Known Limitations

**[中文]** 为了保证不破坏原生 DOM 结构，脚本使用了内联的 `!important` 来覆盖颜色。这可能会导致网页上部分元素的**鼠标悬停高亮（`:hover`）效果失效**。另外，极少数使用超低透明度（Alpha通道）的遮罩层可能会被错误地识别和提亮。

**[EN]** To avoid breaking the DOM, the script uses inline `!important` styles. This may cause some CSS **`:hover` effects to stop working** (e.g., buttons might not highlight when hovered). Additionally, elements using very low opacity (Alpha channel) masks might have their luminance calculated incorrectly.

***