/* Theme Toggle Button — 右上角浮动按钮 */
#theme-toggle-btn {
  position: fixed;
  top: 1em;
  right: 1em;
  z-index: 9999;
  width: 2.4em;
  height: 2.4em;
  padding: 0;
  border: 1px solid var(--border-divider, #e0e0e0);
  border-radius: 50%;
  background: var(--bg-theme-toggle, rgba(255, 255, 255, 0.85));
  color: var(--text-theme-toggle, #222);
  cursor: pointer;
  font-size: 1.2em;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--shadow-theme-toggle, rgba(0, 0, 0, 0.15));
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#theme-toggle-btn:hover {
  background: var(--bg-theme-toggle-hover, rgba(255, 255, 255, 1));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-theme-toggle, rgba(0, 0, 0, 0.15));
}

#theme-toggle-btn:active {
  transform: translateY(0);
}

#theme-toggle-btn:focus {
  outline: 2px solid var(--link-hover, #0181eb);
  outline-offset: 2px;
}

#theme-toggle-btn .icon-sun,
#theme-toggle-btn .icon-moon {
  display: inline-block;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

/* 暗色模式下显示太阳（提示点击切到亮色） */
/* 亮色 + 系统亮色：显示月亮 */
html:not([data-theme="dark"]) #theme-toggle-btn .icon-sun { display: none; }
html[data-theme="dark"] #theme-toggle-btn .icon-moon { display: none; }

/* 移动端调整：避开顶栏遮挡 */
@media only screen and (max-width: 600px) {
  #theme-toggle-btn {
    top: 0.6em;
    right: 0.6em;
    width: 2.2em;
    height: 2.2em;
    font-size: 1.1em;
  }
}