/* ============================================================================
 * board-optout.css —— 排行榜设置面板样式
 * 与举报面板（.rr-hist）同族视觉，暗色主题跟随 html.dark
 * ⛔ 不加任何 background-color 到全局；只作用于 .agh-bo 容器内
 * ========================================================================== */

.agh-bo {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, .08);
}

html.dark .agh-bo,
.dark .agh-bo {
  border-top-color: rgba(255, 255, 255, .12);
}

.agh-bo-hd {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  opacity: .85;
}

.agh-bo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.agh-bo-txt {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.agh-bo-txt b {
  font-size: 13px;
  font-weight: 600;
}

.agh-bo-sub {
  font-size: 11.5px;
  line-height: 1.45;
  opacity: .62;
}

/* ---- 开关 ---- */
.agh-bo-sw {
  flex: 0 0 auto;
  position: relative;
  width: 46px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(120, 120, 128, .3);
  transition: background .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.agh-bo-sw.is-on {
  background: #34c759;
}

.agh-bo-sw[disabled] {
  cursor: not-allowed;
  opacity: .55;
}

.agh-bo-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .18s ease;
}

.agh-bo-sw.is-on .agh-bo-knob {
  transform: translateX(20px);
}

/* ---- 文案 ---- */
.agh-bo-err {
  margin-top: 8px;
  font-size: 12px;
  color: #d93025;
}

html.dark .agh-bo-err,
.dark .agh-bo-err {
  color: #ff6b5e;
}

.agh-bo-note {
  margin-top: 8px;
  font-size: 11.5px;
  opacity: .55;
}

/* ---- 窄屏 ---- */
@media (max-width: 420px) {
  .agh-bo-hd { font-size: 12.5px; }
  .agh-bo-txt b { font-size: 12.5px; }
  .agh-bo-sub { font-size: 11px; }
  .agh-bo-sw { width: 42px; height: 24px; }
  .agh-bo-knob { width: 18px; height: 18px; }
  .agh-bo-sw.is-on .agh-bo-knob { transform: translateX(18px); }
}


/* ── 2026-10-30 二次修：紧凑按钮 + 点击展开 ─────────────────────────────
 * 原来 .agh-bo 是 442 x 104 的大块，会把「我的排名」往下挤。
 * 现在：dayrow 里只放一个 ⚙ 按钮，点开才显示面板。
 */
.agh-bo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  margin-left: auto;
}

.agh-bo-btn {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 11px;
  border: 1px solid rgba(120, 120, 128, .26);
  border-radius: 999px;
  background: rgba(120, 120, 128, .08);
  color: inherit;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background .14s, border-color .14s;
}

.agh-bo-btn:hover,
.agh-bo-btn.is-open {
  background: rgba(120, 120, 128, .16);
  border-color: rgba(120, 120, 128, .42);
}

.agh-bo-panel {
  /* ★ 2026-11-02【站长：设置超出排名了，修】
   *
   * ⛔ 原来 panel 是 position:absolute，参照 .agh-bo 定位。
   *   但 2026-10-30 我把 .agh-bo-btn 改成 fixed、同时把 .agh-bo 压成
   *   `position:static; height:0; margin:0; padding:0`
   *   ⇒ **父容器不再是定位参照物** ⇒ panel 逃到文档流外面
   *   实测：.agh-bo-panel 0x1 @ (155,188) position=static ← absolute 失效
   *
   * ★ 修法：panel 也用 fixed，直接以视口定位，和按钮同一套坐标。
   *         投影锚点 = 按钮位置（right:24px / top:92px + 按钮高度 28 + 6px 间距）
   */
  position: fixed;
  top: 126px;          /* 按钮 top 92 + 高度 28 + 6px 间距 */
  right: 24px;         /* 与按钮右缘对齐 */
  z-index: 41;         /* 比按钮(40)高一层，避免被按钮盖住 */
  width: min(300px, calc(100vw - 32px));
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(120, 120, 128, .22);
  background: var(--ag-fill-solid, #fff);
  box-shadow: 0 12px 32px rgba(9, 14, 28, .24);
  box-sizing: border-box;
}

html.dark .agh-bo-panel,
.dark .agh-bo-panel {
  background: #1b2130;
  border-color: rgba(255, 255, 255, .12);
}

.agh-bo-panel[hidden] {
  display: none !important;
}

/* ★ 2026-11-02【站长：设置按钮禁止超出右边框】
 * 原来这里是 width: calc(100vw - 28px); right: **-4px**;
 * 负值直接把面板顶出右边框 ⇒ 整页右滑
 * ⇒ 整段删除，由文件末尾的强化规则统一控制
 */


/* ── 2026-10-30 修：面板文字对比度 ──────────────────────────────────────
 * 截图实测：面板展开后是白底 + 浅灰字，几乎看不清。
 * 原因：.agh-bo-sub / .agh-bo-note 用了 rgba(...) 的低透明度灰。
 * 修法：面板内文字统一用实色，并跟随暗色主题反转。
 */
.agh-bo-panel .agh-bo-hd {
  color: #111827;
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 7px;
}

.agh-bo-panel .agh-bo-txt {
  color: #111827;
}

.agh-bo-panel .agh-bo-txt b {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}

.agh-bo-panel .agh-bo-sub {
  display: block;
  margin-top: 3px;
  color: #5b6473;
  font-size: 11.5px;
  line-height: 1.55;
}

.agh-bo-panel .agh-bo-note {
  margin-top: 7px;
  color: #5b6473;
  font-size: 11.5px;
}

.agh-bo-panel .agh-bo-err {
  margin-top: 6px;
  color: #b42318;
  font-size: 11.5px;
}

html.dark .agh-bo-panel .agh-bo-hd,
html.dark .agh-bo-panel .agh-bo-txt,
html.dark .agh-bo-panel .agh-bo-txt b,
.dark .agh-bo-panel .agh-bo-hd,
.dark .agh-bo-panel .agh-bo-txt,
.dark .agh-bo-panel .agh-bo-txt b {
  color: #e8eefc;
}

html.dark .agh-bo-panel .agh-bo-sub,
html.dark .agh-bo-panel .agh-bo-note,
.dark .agh-bo-panel .agh-bo-sub,
.dark .agh-bo-panel .agh-bo-note {
  color: #9aa6ba;
}


/* ══════════════════════════════════════════════════════════════════════════
 * ★★ 2026-10-29【站长指令】设置按钮改悬浮式
 * ----------------------------------------------------------------------------
 * ## 站长原话（逐字）
 * ```
 *   「排行榜的那个设置不参与排行的设置按钮改成悬浮式的，
 *    悬浮在那个 1 分钟更新的下面那块空白区域，不允许占用底层的空间」
 * ```
 *
 * ## 实测坐标（__probe4 探测页真值）
 * ```
 *   .rankv2-beta（「1分钟更新」）  1108,56   71x23
 *   .agh-bo-btn（「⚙ 设置」）      1109,165  61x20
 *   ⇒ 按钮已在 beta 下方，但它在文档流里，占着 20px 高度
 * ```
 *
 * ## 修法
 * ```
 *   position: fixed   ← 完全脱离文档流（满足「不占用底层空间」）
 *   right: 24px       ← 与「1分钟更新」右缘对齐（1108+71=1179，视口 1216，右边距 37）
 *   top:  92px        ← 「1分钟更新」底边 56+23=79，取 92 留 13px 呼吸
 *   z-index: 40       ← 高于卡片内容，低于浮层（9968+）
 * ```
 * ## ⛔ 三条纪律
 * ```
 *   ① 不改颜色/文案/圆角/字号（用户只要求改位置方式）
 *   ② 小屏（≤480px）右移量收小，避免贴边
 *   ③ 极矮屏（max-height:420px）上移，避免压住底部 tabbar
 * ```
 * ══════════════════════════════════════════════════════════════════════════ */

.agh-bo-btn {
  /* ★★★ 2026-11-02【站长：两个对调！】
   * 设置按钮 → **贴在背面（文档流）**，跟页面划走
   * 我的排名 → **跟随窗口固定**
   *
   * ★ 原件就是文档流（L132 无 position 属性）
   * ★ 2026-10-30 我擅自改成 fixed ⇒ 现在改回来
   */
  position: static !important;
  right: auto !important;
  top: auto !important;
  left: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
}

/* 父容器也不再占位（原来是文档流里的一个 div） */
.agh-bo {
  /* ★ 恢复定位参照（面板用 absolute 相对它） */
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
  margin-top: 0 !important;
  padding: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

@media (max-width: 480px) {
  .agh-bo-btn {
    right: 12px !important;
    top: 84px !important;
  }
  .agh-bo-panel {
    top: 118px;        /* 84 + 28 + 6 */
    right: 12px;
    width: calc(100vw - 24px);
    max-width: 320px;
  }
}

@media (max-height: 420px) {
  .agh-bo-btn {
    top: 74px !important;
  }
  .agh-bo-panel {
    top: 108px;        /* 74 + 28 + 6 */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
}


/* ============================================================================
 * board-optout.css 尾部加固 —— 站长 2026-11-02
 * ----------------------------------------------------------------------------
 * ## 站长原话（逐字）
 * ```
 *   「排行榜的"设置"按钮禁止超出右边边框，要不然整个页面都右滑了，bug设计」
 * ```
 *
 * ## ⛔ 当前文件里的两个隐患
 * ```css
 *   L191  @media (max-width: 420px) {
 *           .agh-bo-panel { width: calc(100vw - 28px); right: **-4px**; }
 *         }                                       ↑ 负值 = 直接顶出右边框
 *
 *   L308  @media (max-width: 480px) {
 *           .agh-bo-panel { right: 12px; width: calc(100vw - 24px); max-width: 320px; }
 *         }                                       ↑ 12 + (100vw-24) = 100vw-12 < 100vw ✓
 *   ```
 *   ⇒ L308 恰好覆盖了 L191（480 > 420），当前**恰好**没爆
 *   ⇒ 但 L191 是**定时炸弹**：CSS 顺序/断点一变就会让整页右滑 4px
 *
 * ## ★ 真正会咬人的地方：`100vw` 含滚动条宽度
 * ```
 *   面板展开 ⇒ 页面可能出现纵向滚动条（约 15px）
 *   ⇒ 此时 100vw 仍然按**不含滚动条**的宽度算
 *   ⇒ width: calc(100vw - 24px) + right: 12px
 *      = (可用宽 + 15) - 24 + 12 = 可用宽 + 3  ⇒ **超出 3px** ⇒ 整页右滑
 *
 *   ★ 正确做法：用 100% 而不是 100vw 做宽度上限，
 *     并额外用 max-width 卡死；再加 left 兜底防止左侧越界
 * ```
 *
 * ## ⛔ 三条纪律
 * ```
 *   ① 面板的右边界永远 ≤ 视口宽（留 8px 呼吸）
 *   ② ⛔ 不用负的 right/left
 *   ③ 宽度用 min() 三重钳制：像素上限 / 视口百分比 / 左侧留白
 * ```
 * ========================================================================== */

/* ── 兜底 1：⛔ 禁止任何 agh-bo 元素把页面撑宽 ─────────────────────────── */
html,
body {
  /* ⛔ 不是隐藏问题，是禁止横向滚动 —— 有任何元素超出都不会让页面右滑 */
  overflow-x: hidden;
}

/* ── 兜底 2：面板宽度三重钳制（覆盖 L191 的 right:-4px 和 L308 的 100vw）── */
.agh-bo-panel {
  /* ⛔ 负 right 一律归零 */
  right: 8px;
  left: auto;
  /* ★ 三重上限：① 300px ② 视口减两侧留白 ③ 不超过父级可用宽 */
  width: min(300px, calc(100% - 16px));
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  /* ⛔ 绝不参与横向溢出 */
  overflow-x: hidden;
}

/* ── 兜底 3：窄屏（≤480px）显式重写，⛔ 不再用 100vw ─────────────────── */
@media (max-width: 480px) {
  .agh-bo-panel {
    right: 8px;
    left: auto;
    width: calc(100vw - 16px);
    max-width: 320px;
    box-sizing: border-box;
  }
}

/* ── 兜底 4：极窄屏（≤360px）更紧一点 ─────────────────────────────────── */
@media (max-width: 360px) {
  .agh-bo-panel {
    right: 6px;
    width: calc(100vw - 12px);
    max-width: none;
  }
}

/* ── 兜底 5：矮屏时面板可滚动，⛔ 不撑高页面 ─────────────────────────── */
@media (max-height: 480px) {
  .agh-bo-panel {
    max-height: calc(100vh - 130px);
    overflow-y: auto;
  }
}
