/* ==========================================================================
   公共滚动控件 / Shared scroll jump
   --------------------------------------------------------------------------
   只要有滚动余量，右下角固定显示「回到顶部 / 滚动到底部」，大屏小屏同一套尺寸与配色。
   由 common.js 公共注入，所有页面共用；页面本身不可滚动时自动隐藏。
   ========================================================================== */

.scroll-jump {
  position: fixed;
  z-index: 25;
  right: 14px;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  display: none;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.scroll-jump.is-visible { display: flex; }

.scroll-jump-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #ff8a21;
  border-radius: 50%;
  color: #b0610c;
  background: #fff;
  box-shadow: 0 5px 14px rgba(255, 138, 33, .28);
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease, transform .18s ease;
}

.scroll-jump-btn svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scroll-jump-btn:hover,
.scroll-jump-btn:focus-visible {
  border-color: #ff7a2f;
  color: #9f5e00;
  background: #fff6e8;
  box-shadow: 0 9px 20px rgba(255, 138, 33, .4);
  transform: translateY(-1px);
}

.scroll-jump-btn:focus-visible { outline: 2px solid #ffb95c; outline-offset: 2px; }

.scroll-jump-btn:disabled {
  opacity: .34;
  color: #9aa3ad;
  border-color: #ebeef2;
  background: #fff;
  box-shadow: 0 3px 10px rgba(20, 32, 48, .07);
  transform: none;
  cursor: default;
  pointer-events: none;
}

/* 侧边栏抽屉展开时让位，避免压在抽屉上 */
body:has(.sidebar.open) .scroll-jump { display: none; }

/* 小屏把控件再抬高一点，避开浏览器底栏与手势区 */
@media (max-width: 760px) {
  .scroll-jump { bottom: calc(126px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-jump-btn { transition: none; }
  .scroll-jump-btn:hover,
  .scroll-jump-btn:focus-visible { transform: none; }
}