function ciy_chgtheme(val) {
    if (val)
        document.documentElement.classList.remove('dark-theme');
    else
        document.documentElement.classList.add('dark-theme');
}

if (localStorage && localStorage.getItem('theme') == 'dark') {
    ciy_chgtheme(false);
} else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
    ciy_chgtheme(false);
}
