/* 全站共用的悬浮返回顶部按钮，样式独立于各页面。 */
.rd-back-to-top {
  position: fixed;
  right: clamp(16px, 2vw, 28px);
  bottom: clamp(18px, 2vw, 28px);
  z-index: 80;
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  background: #111111;
  color: #ffffff;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.rd-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.rd-back-to-top:hover {
  background: #303030;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
}

.rd-back-to-top:focus-visible {
  outline: 3px solid rgba(17, 17, 17, 0.3);
  outline-offset: 4px;
}

.rd-back-to-top svg {
  display: block;
  width: 21px;
  height: 21px;
}

@media (max-width: 640px) {
  .rd-back-to-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rd-back-to-top {
    transition: none;
  }
}
