/* ============================================================================
 * 滚动悬浮按钮（顶部 / 底部）
 *
 * 位置固定：只靠 right/bottom 定位，不写 left/top，
 * 也不响应拖拽。这样无论窗口多大、滚动到哪，它都在同一个角落。
 * ==========================================================================*/

.lg-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  border-radius: 22px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .22);
  transition: opacity .18s ease;
  opacity: .95;
  user-select: none;
}

/* 鼠标不动一会儿后变淡，但不隐藏、仍可点 */
.lg-fab.is-idle { opacity: .38; }
.lg-fab.is-idle:hover { opacity: .95; }

/* 没有可滚动内容时彻底隐藏 */
.lg-fab.is-hidden {
  display: none;
}

.lg-fab-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
}
.lg-fab-btn:hover:not(.is-off) { background: var(--head-hover); }
.lg-fab-btn:active:not(.is-off) { transform: scale(.95); }

/* 到顶 / 到底：变灰、不可点 */
.lg-fab-btn.is-off {
  opacity: .3;
  cursor: default;
}

.lg-fab-ico {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  min-width: 14px;
  text-align: center;
}

/* 窄屏：只留箭头，省地方 */
@media (max-width: 720px) {
  .lg-fab { right: 12px; bottom: 16px; padding: 4px; }
  .lg-fab-txt { display: none; }
  .lg-fab-btn { min-width: 32px; padding: 0; justify-content: center; }
}
