// ==UserScript== // @name Bing Latte // @namespace custom-light-theme // @version 1.2.0 // @description Bing搜索浅色主题 // @tag bing 网页美化 // @author deran // @grant GM_addStyle // @run-at document-start // @license MIT // @match *://*.bing.com/search* // ==/UserScript== (function () { 'use strict'; /* ========== 色值定义(与截图一一对应) ========== */ const theme = { bg: '#eff1f5', // Background 页面背景 text: '#4c4f69', // Text 正文文字 selection: '#acb0be',// Selection 选中文本高亮 link: '#1e66f5', // 链接色(柔和蓝,保持辨识度) border: '#dce0e8', // 边框色(浅灰过渡) inputBg: '#ffffff', // 输入框背景(纯白提升交互区辨识度) }; /* ========== 核心样式注入 ========== */ GM_addStyle(` /* 1. 全局背景覆盖:替换所有容器底色,不影响媒体元素 */ html, body, div, section, article, aside, nav, header, footer, main, form, fieldset, legend, table, tr, td, th, ul, ol, li, blockquote, pre, code, figure, figcaption { background-color: ${theme.bg} !important; background-image: none !important; } /* 2. 文本颜色统一:覆盖正文、标题、普通文本 */ html, body, p, span, label, legend, caption, h1, h2, h3, h4, h5, h6, li, dd, dt, blockquote, cite, table, tr, td, th, thead, tbody { color: ${theme.text} !important; } /* 3. 文本选中高亮 */ ::selection { background-color: ${theme.selection} !important; color: ${theme.text} !important; } ::-moz-selection { background-color: ${theme.selection} !important; color: ${theme.text} !important; } /* 4. 链接颜色:保持可识别性,适配浅色主题 */ a, a:link, a:visited { color: ${theme.link} !important; text-decoration: none; } a:hover, a:active { text-decoration: underline; } /* 5. 表单元素适配 */ input, textarea, select, button { background-color: ${theme.inputBg} !important; color: ${theme.text} !important; border: 1px solid ${theme.border} !important; outline: none; } input:focus, textarea:focus, select:focus { border-color: ${theme.link} !important; } /* 6. 边框柔和化 */ div, section, article, aside, nav, header, footer, table, tr, td, th, input, textarea, select, button, ul, ol, li, pre, code, blockquote { border-color: ${theme.border} !important; } /* 7. 媒体元素保护:图片、视频、图标保留原生色彩 */ img, video, svg, canvas, emoji, picture, source, [class*="icon"], [class*="logo"], [style*="background-image"] { background-color: transparent !important; filter: none !important; } `); })();