/* ==========================================================================
   明暗模式（影院光影双主题）· 切换按钮 + 过渡 + 护眼细节
   ========================================================================== */

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

body { transition: background-color .28s ease, color .28s ease; }

.be-theme-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--be-border);
  border-radius: 999px;
  background: var(--be-surface);
  color: var(--be-fg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.be-theme-toggle:hover { border-color: var(--be-primary); color: var(--be-primary); }
.be-theme-ico { font-size: 14px; line-height: 1; }
.be-theme-txt { white-space: nowrap; }

/* 正文阅读区在深色下降低纯白对比，减轻夜间刺眼 */
html[data-theme="dark"] .be-content { color: color-mix(in srgb, var(--be-fg) 92%, var(--be-muted)); }
html[data-theme="dark"] img { filter: brightness(.92) contrast(1.02); }

/* 选中文字与滚动条跟随主题 */
::selection { background: color-mix(in srgb, var(--be-primary) 22%, transparent); }
html[data-theme="dark"] ::selection { background: color-mix(in srgb, var(--be-primary) 34%, transparent); }
html[data-theme="dark"] { scrollbar-color: var(--be-border) var(--be-bg); }

@media (prefers-reduced-motion: reduce) {
  body, .be-theme-toggle { transition: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  .be-theme-toggle { height: 32px; padding: 0 9px; }
  .be-theme-txt { display: none; }
}
