深色/浅色模式切换在操作系统设置与切换设置不匹配时产生混合结果

@media (prefers-color-scheme: dark) CSS styles in my theme components are ignored if the user’s OS system is set to light mode and the user selects dark mode in the sidebar toggle. I also get weirdness if the user’s OS system is set to dark yet they select light in the sidebar toggle. Everything looks as intended when the OS system and toggle match modes. Has anyone else run into this issue and figured out how to get their light/dark mode CSS tweaks to apply when the OS settings and sidebar toggle settings do not match?