恢复知乎文章UI旧页面

1. 这个脚本去掉了右侧作者卡片信息 2. 重新把文章恢复居中 3. 还原之前的体验

// ==UserScript==
// @name         恢复知乎文章UI旧页面
// @namespace    http://tampermonkey.net/
// @version      2025-04-16
// @description  1. 这个脚本去掉了右侧作者卡片信息 2. 重新把文章恢复居中 3. 还原之前的体验
// @author       breezeblow
// @license      MIT
// @match        https://zhuanlan.zhihu.com/p/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=zhihu.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    var userPanelDiv = document.querySelector('.Post-Row-Content-right');
    if (userPanelDiv) {
        userPanelDiv.remove();
    };


     // 修改 .Post-Row-Content 的内联样式,将 justify-content 改为 center
    function updatePostRowContentStyle(node) {
        // 如果传入特定节点,则只操作该节点下的 .Post-Row-Content,否则操作整个文档
        const elements = node
            ? node.querySelectorAll('.Post-Row-Content')
            : document.querySelectorAll('.Post-Row-Content');
        elements.forEach(el => {
            // 直接修改内联样式,设置 !important
            el.style.setProperty('justify-content', 'center', 'important');
        });
    }

    // 修改页面背景颜色为 #ffffff
    function updateBodyBackground() {
        document.body.style.setProperty('background-color', '#ffffff');
        document.documentElement.style.setProperty('background-color', '#ffffff');
    }


     updatePostRowContentStyle();
     updateBodyBackground();

})();