/* 返回顶部（Back To Top）：全站统一右下角白色圆形按钮 + 向上箭头图标。 */
.aoyea-component-back-to-top {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 60;
  display: grid;
  width: 60px;
  height: 60px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 10px 24px rgb(0 0 0 / 35%);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease, visibility 240ms ease, background-color 240ms ease, box-shadow 240ms ease, bottom 300ms ease;
}

/* 滚动超过阈值后才出现；隐藏时同时不可点击、不进入键盘焦点顺序。 */
.aoyea-component-back-to-top.aoyea-component-back-to-top--visible {
  opacity: 1;
  visibility: visible;
}

/* Cookie 授权条显示时按钮上移避让，授权条关闭后平滑回到原位。 */
html.aoyea-cookie-consent-visible .aoyea-component-back-to-top {
  bottom: calc(32px + var(--aoyea-cookie-consent-height, 0px));
}

/* Hover / Focus 与站内 More 按钮一致：绿色底 + 白色箭头，不做位移。 */
.aoyea-component-back-to-top:hover,
.aoyea-component-back-to-top:focus-visible {
  background: var(--aoyea-color-brand);
  box-shadow: 0 12px 30px rgb(0 0 0 / 46%);
}

.aoyea-component-back-to-top .aoyea-back-to-top-icon {
  display: block;
  width: 18px;
  height: 18px;
  transition: filter 220ms ease;
}

.aoyea-component-back-to-top:hover .aoyea-back-to-top-icon,
.aoyea-component-back-to-top:focus-visible .aoyea-back-to-top-icon {
  filter: brightness(0) invert(1);
}

@media (max-width: 600px) {
  .aoyea-component-back-to-top {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
  }

  .aoyea-component-back-to-top .aoyea-back-to-top-icon {
    width: 16px;
    height: 16px;
  }

  html.aoyea-cookie-consent-visible .aoyea-component-back-to-top {
    bottom: calc(16px + var(--aoyea-cookie-consent-height, 0px));
  }
}

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