/* 全站悬浮工具条：返回主页 + 深色模式切换
   颜色变量做双重回退，主页（--line/--surface/--pink）和
   Edmund 解读页（--border/--panel/--accent）都能直接用 */
/* 放右下角：Edmund 解读页左栏是通栏 sticky 目录，放左边会挡住目录项 */
.site-tools {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* 页面自带「回到顶部」圆钮时，往上让开一个身位 */
.site-tools.has-to-top { bottom: 78px; }

.site-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line, var(--border, #e3e5e7));
  background: var(--surface, var(--panel, #ffffff));
  color: var(--text, #18191c);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(20, 20, 30, .12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: border-color .18s ease, color .18s ease, transform .18s ease;
}

.site-tool:hover,
.site-tool:focus-visible {
  border-color: var(--pink, var(--accent, #fb7299));
  color: var(--pink, var(--accent, #fb7299));
  transform: translateY(-1px);
  text-decoration: none;
}

/* 「返回主页」用粉色描边，滚到文章中段也能一眼看到 */
.site-tool-home {
  border-color: var(--pink, var(--accent, #fb7299));
  color: var(--pink, var(--accent, #fb7299));
  font-weight: 600;
}
.site-tool-home:hover,
.site-tool-home:focus-visible {
  background: var(--pink-soft, var(--soft, #ffeef4));
  color: var(--pink, var(--accent, #fb7299));
}

.site-tool svg { flex: none; display: block; }
.site-tool[hidden] { display: none; }

:root[data-theme="dark"] .site-tool {
  box-shadow: 0 6px 22px rgba(0, 0, 0, .42);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-tool {
    box-shadow: 0 6px 22px rgba(0, 0, 0, .42);
  }
}

@media (max-width: 640px) {
  .site-tools { right: 12px; bottom: 12px; gap: 6px; }
  .site-tools.has-to-top { bottom: 68px; }
  .site-tool { padding: 8px 12px; font-size: 12px; }
}

@media print {
  .site-tools { display: none; }
}
