theme') : null;
        const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)");

        function applyTheme(theme) {
            if (theme === 'dark') {
                document.documentElement.setAttribute('data-theme', 'dark');
                localStorage.setItem('theme', 'dark');
                if(themeToggleButton) themeToggleButton.textContent = '切换亮色';
            } else {
                document.documentElement.setAttribute('data-theme', 'light');
          