// ==UserScript== // @name 知乎移动版 // @namespace github.com/Labolasya // @version 2025.06.06.01 // @description 使桌面版更接近移动风格 // @author Labolasya // @license MIT // @grant GM_addStyle // @run-at document-start // @match *://*.zhihu.com/* // @match *://*.www.zhihu.com/* // @downloadURL none // ==/UserScript== (function() { let css = ` .AppHeader { min-width: initial; } .AppHeader > .AppHeader-inner { min-width: initial; width: initial; } .AppHeader > .AppHeader-inner [aria-label="知乎"], .AppHeader > .AppHeader-inner .AppHeader-Tabs, .SearchBar-askButton, .AppHeader-userInfo > div:has(a[href="https://www.zhihu.com/creator"]) { display: none; } .Topstory-container { width: initial; } .Topstory-container > :not(.Topstory-mainColumn) { display: none; } .Topstory-container > .Topstory-mainColumn { width: 100%; padding: 0 10px; box-sizing: border-box; } /* 精简底部操作按钮 */ .ContentItem-actions button:not(:has(.Zi--Comment, .Zi--TriangleUp)) { font-size: 0; } .ContentItem-actions button:not(:has(.Zi--Comment, .Zi--TriangleUp)) span { font-size: initial; } /* 进一步压缩页面边距 */ body { padding: 0; margin: 0; } /* 移动端字体建议加大一点 */ html { font-size: 16px; } /* 可选:让页面滚动更像移动端 */ html, body { overflow-x: hidden; overscroll-behavior-y: contain; } `; if (typeof GM_addStyle !== "undefined") { GM_addStyle(css); } else { const styleNode = document.createElement("style"); styleNode.appendChild(document.createTextNode(css)); (document.querySelector("head") || document.documentElement).appendChild(styleNode); } })();