/* fab-buttons.css v2 —— 两个气泡按钮改独立悬浮
 * ★ 2026-11-02 修：v1 用 .agh-bo（0,1,0）被 board-optout.css 的同名规则压回 relative，
 *   实测 rect x=280 y=72（仍在行内）。v2 提到 html body .agh-bo（0,1,2）并后置引用。 */

/* ── ① 排行榜「⚙ 设置」 ── */
html body .agh-bo {
  position: fixed !important;
  right: 14px !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 96px) !important;
  top: auto !important;
  left: auto !important;
  z-index: 72 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  transform: none !important;
}

html body .agh-bo > .agh-bo-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(0, 0, 0, .10) !important;
  background: rgba(255, 255, 255, .88) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

html[data-theme="dark"] body .agh-bo > .agh-bo-btn {
  border-color: rgba(255, 255, 255, .16) !important;
  background: rgba(24, 28, 40, .86) !important;
  color: #e8ecf6;
}

html body .agh-bo > .agh-bo-panel {
  position: fixed !important;
  right: 14px !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 146px) !important;
  top: auto !important;
  left: auto !important;
  z-index: 73 !important;
  width: min(340px, calc(100vw - 28px)) !important;
  max-width: min(340px, calc(100vw - 28px)) !important;
  max-height: min(58vh, 420px) !important;
  overflow: auto !important;
  border-radius: 16px !important;
  border: 1px solid rgba(0, 0, 0, .10) !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  padding: 12px 14px !important;
  box-sizing: border-box !important;
}

html[data-theme="dark"] body .agh-bo > .agh-bo-panel {
  border-color: rgba(255, 255, 255, .14) !important;
  background: rgba(22, 26, 38, .97) !important;
  color: #e8ecf6;
}

/* ── ② 聊天「发通知」 ── */
html body .agh-set-btn.agh-bc-btn {
  position: fixed !important;
  right: 14px !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + max(186px, 23vh)) !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  z-index: 66 !important;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

html[data-theme="dark"] body .agh-set-btn.agh-bc-btn {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .42);
}

@media (max-width: 380px) {
  html body .agh-bo { right: 10px !important; bottom: calc(env(safe-area-inset-bottom, 0px) + 90px) !important; }
  html body .agh-bo > .agh-bo-panel { right: 10px !important; width: calc(100vw - 20px) !important; }
  html body .agh-set-btn.agh-bc-btn { right: 10px !important; bottom: calc(env(safe-area-inset-bottom, 0px) + max(180px, 23vh)) !important; }
}

@media (max-height: 480px) {
  html body .agh-set-btn.agh-bc-btn { bottom: calc(env(safe-area-inset-bottom, 0px) + max(120px, 23vh)) !important; }
}

/* ══ ④-a 收尾修正（2026-11-02） ══
 * 实测：.agh-bo-btn 被 rank-btn-row.css 固定成 54px（≤480px 断点），
 *      悬浮后「⚙ 设置」文字被裁；行内四按钮宽度也不一致（54/54/62/62）。
 * 做法：悬浮按钮宽度交还内容自适应；行内四个统一 62px（390 宽下 4×62+3×8=272，容器 332，富余）。
 */
html body .agh-bo > .agh-bo-btn {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 14px !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

/* 行内四按钮宽度/间距统一交给 rank-btn-row.css，本文件不再覆盖 */

/* ══ ④-b 弹层打开时隐藏悬浮按钮（2026-11-02 实测补） ══
 * 实测：举报弹层 .rp-glass.rr-glass 底边 722，悬浮设置按钮 708–748，
 *      弹层 z-index 9995 压在按钮之上，导致按钮下半截露在弹层外面。
 * 处理：弹层存在时直接隐藏；关闭后自动恢复（纯 CSS，无 JS 时序问题）。
 */
html body:has(.rp-glass.rr-glass) .agh-bo,
html body:has(.rp-glass.rr-glass) .agh-set-btn.agh-bc-btn {
  display: none !important;
}
