$('.main-header').addClass(color);
        localStorage.setItem("navColor", color);
    }

    $(function () {
        // 处理深色模式
        var darkThemeSwitch = localStorage.getItem("darkThemeSwitch");
        if (darkThemeSwitch && darkThemeSwitch == "true") {
            $("#darkThemeSwitch").prop("checked", true);
            toggleDarkTheme();
        }

        // 处理固定页眉
        var navFixSwitch = localStorage.getItem("navFixSwitch");
        if (navFixSwitch && navF