/* ============================================================================
 * rank-btn-row.css —— 排行榜五个按钮排成规整一小行（站长 2026-11-02）
 * ----------------------------------------------------------------------------
 * ## 站长原话（逐字）
 * ```
 *   「把排行榜的奖品举报设置三个按钮做成一样大小的，
 *     然后和今天，昨天两个按钮做平齐，中间间隔一致。
 *     让他们有规律的排成一小行。」
 * ```
 *
 * ## ★ 实测演进
 * ```
 *   改前：  今天171/30/50  昨天171/30/50  奖品168/30/60  举报168/30/60  设置172/28/61
 *           间隔 52/50/66/100   宽度 50/50/60/60/61   高度 30/30/30/30/28
 *
 *   第一版（纯CSS）：失败 —— 设置按钮在 dayrow 内部，CSS 排不过去
 *   第二版（JS注入样式）：失败 —— CSP "style-src 'self'" 拒绝内联 style
 *   第三版（CSS文件+JS移DOM）：高度✓ top✓，但间距[2,9,6,6] 宽度[56,56,62,62,56]
 *
 *   本版：修间距 + 修宽度
 * ```
 *
 * ## ★ 间距为什么是 [2, 9, 6, 6]
 * ```
 *   今天↔昨天 = **2px**   ← .rankday 内部，我没设 gap（bundle 默认 2px）
 *   昨天↔奖品 = **9px**   ← dayrow(容器) 与 prizerow(容器) 之间 = margin-left:8 + 1
 *   奖品↔举报 = 6px       ← prizerow 内部 gap:6px（≤480px 断点）
 *   举报↔设置 = 6px       ← 同上（设置已移入 prizerow）
 *
 *   ⇒ 三个不同的间距来源，必须统一到一个值
 * ```
 *
 * ## ★ 宽度为什么是 [56,56,62,62,56]
 * ```
 *   min-width:56px（≤480px 断点）起作用了，但「奖品/举报」因为
 *   emoji + 2字 + padding 撑到了 62px
 *   ⇒ min-width 只是**下限**，内容更宽就按内容走
 *   ⇒ 改用**固定 width**（五个都 62px），内容用 padding 自适应
 * ```
 *
 * ## ⛔ 最终纪律
 * ```
 *   ① 五个按钮 width 固定同一值（不靠 min-width）
 *   ② 所有间距统一 8px（一处 gap + 一处 margin 对齐）
 *   ③ .rankday 内部也要设 gap:8px
 * ```
 * ========================================================================== */

/* ══ ① head 变成 flex 容器，两行拆平 ═══════════════════════════════════════ */
.rankv2-head {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
}

.rankv2-top,
.rankv2-sub {
  flex: 1 1 100% !important;
  width: 100% !important;
}

/* ══ ② 两个兄弟容器并排，间距统一 8px ═════════════════════════════════════
 * ★ 关键：dayrow 与 prizerow 之间的间距**只用 margin-left 一处**，
 *   且必须等于 gap 的值（8px），这样五段间距完全一致。
 */
.rankv2-dayrow {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;              /* ⛔ 间距全交给内部 .rankday 的 gap */
  margin-top: 9px !important;
  width: auto !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
}

/* ★ 今天/昨天 的容器：内部的 gap 决定第一段间距 */
.rankv2-dayrow .rankday {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;            /* ← 与其它间距一致 */
  margin: 0 !important;
  padding: 0 !important;
}

.rankv2-prizerow {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;            /* ← 奖品↔举报↔设置 */
  height: auto !important;
  min-height: 0 !important;
  /* ★ 两个容器之间的间距：8px（与 gap 同值）*/
  margin: 9px 0 0 8px !important;
  padding: 0 !important;
  overflow: visible !important;
  flex: 0 0 auto !important;
  z-index: auto !important;
  box-sizing: border-box !important;
}

/* ══ ③ 五个按钮：固定同宽同高 ═════════════════════════════════════════════
 * ★ 用 width 而不是 min-width —— min-width 只是下限，内容更宽就撑开了
 */
.rankday-b,
.rankv2-dayrow .rankday > *,
.rankv2-prizebtn,
.agh-bo-btn {
  box-sizing: border-box !important;
  width: 62px !important;          /* ★ 固定宽度，五个一模一样 */
  min-width: 62px !important;
  max-width: 62px !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  padding: 0 4px !important;       /* 固定宽度后内边距收小，内容居中 */
  font-size: 12px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}

/* ⛔ 取消 bundle 的 105px 让位 + -36px 上移 */
.rankv2-prizebtn,
.rankv2-prizerow > .rankv2-prizebtn,
.rankv2-prizerow > .rankv2-prizebtn:not(:first-child) {
  margin-left: 0 !important;
  margin-top: 0 !important;
}

/* ══ ④ 「设置」容器 ═══════════════════════════════════════════════════════ */
.agh-bo {
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
  position: relative !important;
  overflow: visible !important;
}

/* ══ ⑤ 窄屏：整体等比缩小 ═════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .rankv2-dayrow .rankday { gap: 6px !important; }
  .rankv2-prizerow { gap: 6px !important; margin-left: 6px !important; }
  .rankday-b,
  .rankv2-dayrow .rankday > *,
  .rankv2-prizebtn,
  .agh-bo-btn {
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    font-size: 11.5px !important;
  }
}

@media (max-width: 360px) {
  .rankv2-dayrow .rankday { gap: 5px !important; }
  .rankv2-prizerow { gap: 5px !important; margin-left: 5px !important; }
  .rankday-b,
  .rankv2-dayrow .rankday > *,
  .rankv2-prizebtn,
  .agh-bo-btn {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    font-size: 11px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * ⑥ 首页自检四按钮：⛔ 不受上面 @media 里 54px 强制宽度限制
 * ---------------------------------------------------------------------------
 * ## ⛔ 反馈 3b9a5532（逐字）
 * ```
 *   「手机网页端中，"自检""连通性检测""解析数据""拦截检测"等文案
 *     在圆框内显示较拥挤，建议适当放宽圆框尺寸或增加内边距，以提升可读性。」
 * ```
 * ## ★ 真因（bundle + 本文件共同造成）
 * ```
 *   bundle:  <div class="rankday" role="tablist" aria-label="首页自检工具">
 *              <button class="rankday-b"> 自检 </button>
 *              <button class="rankday-b"> 连通性检测 </button>   ← 5 个字
 *              <button class="rankday-b"> 解析数据 </button>
 *              <button class="rankday-b"> 拦截检测 </button>
 *            </div>
 *   本文件 @media (max-width:480px) 把 **所有** .rankday-b 强制成
 *     width:54px / height:28px / font-size:11.5px
 *   ⇒ 「连通性检测」5 字 × 11.5px ≈ 57.5px > 54px ⇒ **文字被挤压** ✓
 * ```
 * ## ★ 为什么要按容器限定（⛔ 不能全局放开）
 * ```
 *   .rankday-b 还被排行榜的「今天 / 昨天」使用（容器 .rankv2-dayrow > .rankday）
 *   那两个是 2 个字，54px 正好；全局放开会让排行榜按钮变形
 *   ⇒ 只对 .rpv-selfrow .rankday（首页自检工具）放开 ✓
 * ```
 * ## ★ 特异性说明
 * ```
 *   .rpv-selfrow .rankday .rankday-b  = (0,3,0)
 *   @media 里的 .rankday-b            = (0,1,0)
 *   双方都有 !important ⇒ 按特异性，本段赢 ✓（与 dark-contrast.css 同一套手法）
 * ```
 * ========================================================================= */

.rpv-selfrow .rankday {
  flex-wrap: wrap !important;   /* ★ 极窄屏换行，⛔ 不挤压 */
  justify-content: center !important;
}

.rpv-selfrow .rankday .rankday-b,
.rpv-selfrow .rankday > .rankday-b {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  padding: 5px 12px !important;   /* ★ 左右内边距从 8px 提到 12px */
  font-size: 12px !important;
  white-space: nowrap !important; /* ★ 文案不折行 */
}

@media (max-width: 480px) {
  .rpv-selfrow .rankday {
    gap: 5px !important;
  }
  .rpv-selfrow .rankday .rankday-b,
  .rpv-selfrow .rankday > .rankday-b {
    padding: 5px 11px !important;
    font-size: 11.5px !important;
  }
}
