
/* 基础主题变量（不覆盖主题现有样式，仅提供挂钩） */
:root {
  --ms-transition: 0.3s ease;
}

html[data-theme="dark"], body[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"], body[data-theme="light"] {
  color-scheme: light;
}

/* 过渡动画（全站轻微淡入） */
html {
  transition: background-color var(--ms-transition), color var(--ms-transition);
}

/* 浮动按钮样式：右上角，不遮挡导航 */
.ms-theme-toggle {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 9999;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .15s ease, background-color .2s ease;
}
html[data-theme="light"] .ms-theme-toggle {
  background: rgba(0,0,0,0.06);
}
.ms-theme-toggle:hover { transform: scale(1.06); }

.ms-theme-toggle .ms-icon {
  font-size: 18px;
  line-height: 1;
  user-select: none;
}

/* 不强制页面颜色，仅作为示例/兜底：若主题没设置背景时 */
html[data-theme="dark"] body {
  background-color: #0f0f10;
  color: #e6e6e6;
}
html[data-theme="light"] body {
  background-color: #ffffff;
  color: #111111;
}

/* 兼容某些主题容器的过渡 */
body, .site, .container, .wrap, .content, .main, .app {
  transition: background-color var(--ms-transition), color var(--ms-transition), border-color var(--ms-transition);
}
