/* 置顶箭头样式 —— 白底 / 黑箭头 / 灰外圈，静止侧滑隐藏 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  color: #111111;
  border: 1.5px solid #c8d0d8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  /* 初始向右完全移出视口，实现“侧面隐藏” */
  transform: translateX(calc(100% + 2rem));
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease,
    visibility 0.35s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  z-index: 999;
}

/* 滚动后：滑入视口 */
.back-to-top.visible {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

/* 悬停：外圈变深灰、阴影略强，箭头保持黑色 */
.back-to-top:hover {
  background: #ffffff;
  border-color: #9aa6b2;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  transform: translateX(0) translateY(-3px);
}

.back-to-top:active {
  transform: translateX(0) scale(0.94);
}

@media (max-width: 768px) {
  .back-to-top {
    width: 42px;
    height: 42px;
    bottom: 1.2rem;
    right: 1.2rem;
    transform: translateX(calc(100% + 1.2rem));
  }
  .back-to-top svg {
    width: 20px;
    height: 20px;
  }
}
