// function getTheme() {
// if(window.matchMedia && window.matchMedia("(prefers-color-scheme:dark)").matches) {
// return "dark";
// } else {
// return "light";
// }
// }
// alert(getTheme() )
// // 创建媒体查询对象
// var darkModeQuery = window.matchMedia('(prefers-color-scheme: dark)');
// // 定义回调函数
// function handleColorModeChange(event) {
// if (event.matches) {
// // 暗黑模式
// alert('暗黑模式')
// console.log('暗黑模式');
// } else {
// // 亮色模式
// alert('亮色模式')
// console.log('亮色模式');
// }
// }
// // 添加事件监听器
// darkModeQuery.addEventListener('change', handleColorModeChange);
// // 初始状态下的处理
// handleColorModeChange(darkModeQuery);