// ==UserScript== // @name B站科技蓝黑主题 (纯涂色最终版) // @namespace https://scriptcat.org/ // @version 6.0 // @description 只修改背景和文字颜色,绝对不碰任何布局,保证播放器安全、首页变黑 // @author You // @match https://www.bilibili.com/* // @grant none // @run-at document-start // ==/UserScript== (function() { 'use strict'; const style = document.createElement('style'); style.innerHTML = ` /* ================= 科技蓝黑主题变量 ================= */ :root { --tech-bg-main: #070b14; /* 最深的底色 */ --tech-bg-card: #101726; /* 卡片背景 */ --tech-blue: #00d2ff; /* 霓虹科技蓝 */ --tech-text-main: #e0e6ed; /* 主文字 */ --tech-text-sub: #8a9bb8; /* 次要文字 */ } /* ================= 1. 全局背景与文字 (只涂色) ================= */ /* 把B站各个大区块的底色全部强制变深,绝不加 overflow 或高度限制 */ html, body, #app, .bili-feed4, .bili-header, .bili-header__bar, .bili-header__channel, .header-channel, .bili-channel, .main-container { background-color: var(--tech-bg-main) !important; background-image: none !important; /* 干掉B站自带的白底渐变 */ color: var(--tech-text-main) !important; } /* 让顶部频道栏变成半透明深色 */ .bili-header__channel, .header-channel, .bili-channel { background: rgba(7, 11, 20, 0.9) !important; border-bottom: 1px solid rgba(0, 210, 255, 0.15) !important; } /* ================= 2. 文字与链接颜色 ================= */ .nav-link-item, .bili-header .nav-link, .channel-link, .bili-channel__item, a, a:visited { color: var(--tech-text-main) !important; } .nav-link-item:hover, .bili-header .nav-link:hover, .channel-link:hover, a:hover { color: var(--tech-blue) !important; text-shadow: 0 0 8px rgba(0, 210, 255, 0.4) !important; } /* ================= 3. 搜索框 ================= */ .nav-search-input, .search-input { background-color: var(--tech-bg-card) !important; border: 1px solid rgba(0, 210, 255, 0.2) !important; color: var(--tech-text-main) !important; } .search-button, .nav-search-btn { background: var(--tech-blue) !important; color: #fff !important; border: none !important; } /* ================= 4. 视频卡片 (只涂色,绝不改任何形状) ================= */ /* 强制卡片背景变暗,恢复原始宽度,不加 border 和 overflow */ .bili-video-card__wrap, .video-card__wrap, .bili-dyn-item, .bili-video-card { background-color: var(--tech-bg-card) !important; } .bili-video-card__info, .video-card__info { background-color: transparent !important; } .bili-video-card__info--tit, .video-card__info .title { color: var(--tech-text-main) !important; } .bili-video-card__info--tit:hover { color: var(--tech-blue) !important; } .bili-video-card__stats, .up-name { color: var(--tech-text-sub) !important; } /* ================= 5. 评论区 ================= */ .reply-item { background-color: var(--tech-bg-card) !important; border: none !important; /* 绝对不加强制边框,防止撑破 */ } .reply-content { color: var(--tech-text-main) !important; } .reply-item .user-name { color: var(--tech-blue) !important; } /* ================= 6. 滚动条 (6px) ================= */ ::-webkit-scrollbar { width: 6px !important; height: 6px !important; } ::-webkit-scrollbar-track { background: transparent !important; } ::-webkit-scrollbar-thumb { background: var(--tech-blue) !important; border-radius: 3px !important; } * { scrollbar-width: thin; scrollbar-color: var(--tech-blue) transparent; } /* ========================================================= ⚠️ 最高安全结界: 这里没有 #bilibili-player、.bpx-player- 的任何代码。 播放器内部 100% 原版,切换全屏/退出全屏绝对不会出现黑块! ========================================================= */ `; if (document.head) { document.head.appendChild(style); } else { document.documentElement.appendChild(style); } })();