/* DeepSWE 排行榜 — 颜色完全继承 fluid 主题变量，明暗自适应 */
:root {
  --ds-ink: var(--text-color, #172033);
  --ds-muted: var(--sec-text-color, #667085);
  --ds-line: var(--line-color, #e5e7eb);
  --ds-bg: transparent;
  --ds-surface: var(--board-bg-color, #ffffff);
  --ds-soft: var(--inlinecode-bg-color, #eef1f6);
  --ds-grid-line: color-mix(in srgb, var(--ds-line) 55%, transparent);
  --ds-glow: color-mix(in srgb, var(--post-link-color) 10%, transparent);
  --ds-accent: var(--post-link-color, #2f6bff);
  --ds-accent2: var(--post-link-color, #6f96ff);
  --ds-good: var(--post-link-color, #12b886);
  --ds-warn: #e8833a;
  --ds-gold: #f5b301;
  --ds-silver: #aeb8c9;
  --ds-bronze: #e08a4e;
}
.ds-wrap { max-width: 1080px; margin: 0 auto; padding: 40px 20px 64px; }
.ds-head { margin-bottom: 6px; }
.ds-back { display: inline-block; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--ds-muted); text-decoration: none; }
.ds-back:hover { color: var(--ds-accent); }
.ds-head h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.25; letter-spacing: .2px; color: var(--ds-ink); }
.ds-lead { margin: 0; color: var(--ds-muted); }
.ds-meta { color: var(--ds-muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0 18px; padding: 10px 14px; border: 1px solid var(--ds-line); border-radius: 12px; background: var(--ds-glow); }
.ds-meta b { color: var(--ds-ink); font-weight: 700; }
.ds-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.seek { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--ds-line); background: var(--ds-surface); color: var(--ds-ink); font-size: 13.5px; }
.seek option { background: var(--ds-surface); color: var(--ds-ink); }
.seek:focus { outline: 2px solid var(--ds-glow); border-color: var(--ds-accent); }
#refreshBtn { padding: 7px 16px; border-radius: 9px; border: 1px solid transparent; background: var(--ds-accent); color: #fff; cursor: pointer; font-size: 13.5px; font-weight: 600; }
#refreshBtn:hover { filter: brightness(1.08); }
#refreshBtn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.status { font-size: 12.5px; color: var(--ds-muted); }

/* 地区归属配色：认不出品牌图标的厂商靠它上色（.origin 长标签、.bm-org 首字徽标都挂这批类）。
   P1-6 对比度：纯色在深色主题下不足 4.5:1（#7b3ff2、#c0392b 尤甚）。
   这里用 color-mix 把品牌色与主题文字色 (--ds-ink) 混合 —— 明亮主题混向深墨、
   深色主题混向浅字，两种模式下文字对比度都自动 ≥ 4.5:1。 */
.origin { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.5; vertical-align: 1px; white-space: nowrap; }
.origin-cn { color: color-mix(in srgb, #c0392b 58%, var(--ds-ink)); background: rgba(214, 69, 65, .14); border: 1px solid color-mix(in srgb, #c0392b 46%, transparent); }
.origin-us { color: color-mix(in srgb, #2f6bff 62%, var(--ds-ink)); background: rgba(47, 107, 255, .13); border: 1px solid color-mix(in srgb, #2f6bff 46%, transparent); }
.origin-eu { color: color-mix(in srgb, #7b3ff2 62%, var(--ds-ink)); background: rgba(123, 63, 242, .14); border: 1px solid color-mix(in srgb, #7b3ff2 46%, transparent); }
.origin-kr { color: color-mix(in srgb, #0a8f8d 62%, var(--ds-ink)); background: rgba(10, 162, 160, .14); border: 1px solid color-mix(in srgb, #0a8f8d 46%, transparent); }
.origin-intl, .origin-unk { color: var(--ds-muted); background: var(--ds-soft); border: 1px solid var(--ds-line); }
/* 详情页的归属徽标摆在模型名之前、与名字同一行（与首页同口径，2026-10-01 老板要求全站一致）。
   首页那批徽标住在 flex 容器里靠 gap 对齐，这里住在文本流里，得自己给间距和基线偏移。 */
.model .origin, .bName .origin, .tName .origin, .nname .origin, .pName .origin, .reModel .origin { vertical-align: 2px; }
.model .bm-org, .bName .bm-org, .tName .bm-org, .nname .bm-org, .pName .bm-org, .reModel .bm-org { margin-right: 6px; vertical-align: -4px; }
@media (max-width: 720px) { .origin { margin-right: 4px; padding: 0 6px; font-size: 10px; } }
.ds-spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--ds-soft); border-top-color: var(--ds-accent); border-radius: 50%; vertical-align: -2px; animation: dsSpin .8s linear infinite; }
@keyframes dsSpin { to { transform: rotate(360deg); } }
.num { font-variant-numeric: tabular-nums; }
.ds-loading { padding: 44px; text-align: center; color: var(--ds-muted); }
/* 加载失败 / 数据源未就绪 / 无数据 三态（P1-2）：明确文案 + 重试 + 健康页入口 */
.ds-state { border: 1px dashed color-mix(in srgb, var(--ds-warn) 55%, var(--ds-line)); border-radius: 12px; padding: 26px 20px; text-align: center; background: color-mix(in srgb, var(--ds-warn) 7%, transparent); margin-bottom: 14px; }
.ds-state-msg { font-weight: 700; color: var(--ds-ink); word-break: break-word; }
.ds-state-hint { margin-top: 6px; font-size: 12.5px; color: var(--ds-muted); }
.ds-state-actions { margin-top: 14px; display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.ds-retry { padding: 7px 18px; border-radius: 9px; border: 1px solid transparent; background: var(--ds-accent); color: #fff; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.ds-retry:hover { filter: brightness(1.08); }
.ds-health { font-size: 13px; color: var(--ds-accent); text-decoration: none; font-weight: 600; }
.ds-health:hover { text-decoration: underline; }
/* 数据陈旧提示（P1-4） */
.ds-stale { color: var(--ds-warn); font-weight: 700; }
.ds-app { border: 1px solid var(--ds-line); border-radius: 16px; padding: 18px; background: var(--ds-glow); }
.ds-progress { height: 4px; border-radius: 2px; background: var(--ds-soft); overflow: hidden; position: relative; max-width: 420px; }
.ds-progress::after { content: ""; position: absolute; top: 0; left: -40%; width: 40%; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--ds-accent), var(--ds-accent2)); animation: dsFlow 1.3s linear infinite; }
@keyframes dsFlow { to { left: 110%; } }
.ds-err { color: var(--ds-warn); }

/* 1) 经典表格
   P0-1（2026-09-25 UE 审核）：原 overflow:hidden 在 320/360px 窄屏直接裁掉右侧指标列，
   改为横向滚动容器；列多时给表格 min-width 保证每列可读，滚动可达全部列。 */
.swipeHint { display: none; }
.tableCard { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--ds-line); border-radius: 14px; background: var(--ds-surface); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.tableCard:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl.tblWide { min-width: 620px; }
.tbl thead th { position: sticky; top: 0; background: var(--ds-surface); text-align: left; padding: 12px 14px; font-size: 12px; color: var(--ds-muted); font-weight: 600; border-bottom: 1px solid var(--ds-line); letter-spacing: .3px; white-space: nowrap; }
.tbl tbody td { padding: 11px 14px; border-bottom: 1px solid var(--ds-grid-line); font-size: 14px; vertical-align: middle; color: var(--ds-ink); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--ds-glow); }
.rank { font-weight: 700; color: var(--ds-muted); width: 52px; }
.medal { display: inline-flex; width: 24px; height: 24px; border-radius: 8px; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #3a2500; }
.medal.gold { background: linear-gradient(135deg, #fdebb3, var(--ds-gold)); }
.medal.silver { background: linear-gradient(135deg, #f1f4f9, var(--ds-silver)); }
.medal.bronze { background: linear-gradient(135deg, #f6d9bf, var(--ds-bronze)); }
.model { font-weight: 700; color: var(--ds-ink); }
.model small { display: block; color: var(--ds-muted); font-weight: 500; font-size: 12px; }
.barWrap { background: var(--ds-soft); border-radius: 6px; height: 8px; width: 120px; overflow: hidden; }
.bar { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--ds-accent), var(--ds-accent2)); }
.bar.top1 { background: linear-gradient(90deg, #f0bd31, var(--ds-gold)); }
.bar.top2 { background: linear-gradient(90deg, #b9c4d6, #dde3ec); }
.bar.top3 { background: linear-gradient(90deg, #dd9056, var(--ds-bronze)); }
.costHigh { color: var(--ds-warn); }
/* 未提供指标占位：与真实 0 区分（P0-2），hover 给出说明 */
.na { color: var(--ds-muted); cursor: help; letter-spacing: 1px; }

/* 2) 横向条形榜 */
.view-bars { display: flex; flex-direction: column; gap: 10px; }
.barRow { display: grid; grid-template-columns: 34px minmax(120px, 200px) 1fr auto; gap: 14px; align-items: center; padding: 10px 16px; border: 1px solid var(--ds-line); border-radius: 12px; background: var(--ds-surface); }
.barRow:hover { border-color: var(--ds-accent); }
.bDot { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.bDot.n1 { background: linear-gradient(135deg, #fdebb3, var(--ds-gold)); color: #3a2500; }
.bDot.n2 { background: linear-gradient(135deg, #f1f4f9, var(--ds-silver)); color: #2d3646; }
.bDot.n3 { background: linear-gradient(135deg, #f6d9bf, var(--ds-bronze)); color: #3a2500; }
.bDot.other { background: var(--ds-soft); color: var(--ds-muted); }
.bName { font-weight: 700; color: var(--ds-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bName small { display: block; color: var(--ds-muted); font-weight: 500; font-size: 11px; }
.bTrack { height: 14px; border-radius: 8px; background: var(--ds-soft); overflow: hidden; }
.bFill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--ds-accent), var(--ds-good)); transition: width .6s ease; }
.bFill.t1 { background: linear-gradient(90deg, #f0bd31, var(--ds-gold)); }
.bFill.t2 { background: linear-gradient(90deg, #b9c4d6, #dde3ec); }
.bFill.t3 { background: linear-gradient(90deg, #dd9056, var(--ds-bronze)); }
.bVal { min-width: 58px; text-align: right; font-weight: 700; color: var(--ds-ink); }

/* 3) 领奖台 */
.podiumCard { overflow: hidden; border: 1px solid var(--ds-line); border-radius: 16px; background: var(--ds-surface); padding: 22px; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; max-width: 820px; margin: 0 auto 18px; }
.pod { position: relative; text-align: center; border-radius: 16px; padding: 20px 14px 18px; border: 1px solid var(--ds-line); background: var(--ds-surface); display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ds-ink); }
.pod small.label { order: 0; font-size: 12px; font-weight: 800; letter-spacing: 2px; padding: 3px 12px; border-radius: 999px; color: #fff; }
.pod .pRank { order: 0; font-size: 26px; font-weight: 900; line-height: 1; }
.pod .pName { order: 0; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pod .pPct { order: 0; font-size: 24px; font-weight: 800; }
.pod .pSub { order: 0; font-size: 11px; color: var(--ds-muted); }
.pod.gold { background: linear-gradient(180deg, #fffdf2, #fdf0c9); border-color: var(--ds-gold); color: #6b5200; box-shadow: 0 10px 26px rgba(245,179,1,.20); transform: translateY(-6px); }
.pod.silver { background: linear-gradient(180deg, #f4f7fb, #e4e9f0); border-color: #cfd7e3; color: #3a4555; }
.pod.bronze { background: linear-gradient(180deg, #fdf0e3, #f2d6b8); border-color: #e6b483; color: #6b3a17; }
.pod.gold small.label { background: var(--ds-gold); }
.pod.silver small.label { background: #9aa7bd; }
.pod.bronze small.label { background: #d98e55; }
.restList { border-top: 1px solid var(--ds-line); }
.reRow { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 12px; align-items: center; padding: 9px 8px; color: var(--ds-ink); }
.reRow + .reRow { border-top: 1px solid var(--ds-grid-line); }
.reRank { color: var(--ds-muted); font-weight: 700; }
.reModel { font-weight: 600; }
.reModel small { display: block; color: var(--ds-muted); font-size: 11px; }

/* 4) 卡片磁贴 */
.view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(198px, 1fr)); gap: 14px; }
.tile { position: relative; border: 1px solid var(--ds-line); border-radius: 16px; background: var(--ds-surface); padding: 16px; color: var(--ds-ink); transition: transform .12s ease, border-color .12s ease; }
.tile:hover { transform: translateY(-2px); border-color: var(--ds-accent); }
.tile .gTop { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tile .tRank { width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.tile .tRank.n1 { background: linear-gradient(135deg, #fdebb3, var(--ds-gold)); color: #3a2500; }
.tile .tRank.n2 { background: linear-gradient(135deg, #f1f4f9, var(--ds-silver)); color: #2d3646; }
.tile .tRank.n3 { background: linear-gradient(135deg, #f6d9bf, var(--ds-bronze)); color: #3a2500; }
.tile .tRank.other { background: var(--ds-soft); color: var(--ds-muted); }
.tile .tName { font-weight: 700; font-size: 14px; line-height: 1.25; }
.tile .tName small { display: block; color: var(--ds-muted); font-size: 11px; font-weight: 500; }
.tile .tRingWrap { display: flex; align-items: center; gap: 14px; }
.ring { --p: 0; position: relative; width: 62px; height: 62px; border-radius: 50%; background: conic-gradient(var(--ds-accent) calc(var(--p) * 1%), var(--ds-soft) 0); display: flex; align-items: center; justify-content: center; flex: none; }
.ring.n1 { background: conic-gradient(var(--ds-gold) calc(var(--p) * 1%), var(--ds-soft) 0); }
.ring.n2 { background: conic-gradient(var(--ds-silver) calc(var(--p) * 1%), var(--ds-soft) 0); }
.ring.n3 { background: conic-gradient(var(--ds-bronze) calc(var(--p) * 1%), var(--ds-soft) 0); }
.ring::after { content: ""; position: absolute; inset: 7px; background: var(--ds-surface); border-radius: 50%; }
.ring span { position: relative; z-index: 1; font-weight: 800; font-size: 15px; color: var(--ds-ink); }
.tile .tPctTxt { font-weight: 700; }
.tile .tSub { color: var(--ds-muted); font-size: 12px; margin-top: 2px; }
.tile .tFoot { display: flex; justify-content: space-between; border-top: 1px solid var(--ds-grid-line); margin-top: 12px; padding-top: 10px; font-size: 12px; color: var(--ds-muted); }

/* 5) Neon 霓虹 → 主题辉光 */
.view-neon { display: flex; flex-direction: column; gap: 10px; }
.ncard { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--ds-line); background: linear-gradient(90deg, var(--ds-glow), transparent 70%); }
.ncard.topN { border-color: var(--ds-gold); box-shadow: 0 1px 6px rgba(245,179,1,.22); }
.nrank { font-size: 24px; font-weight: 900; width: 42px; color: var(--ds-accent); }
.ncard.topN .nrank { color: var(--ds-gold); }
/* 原 flex:0 0 160px（固定宽、不收缩）会让长模型名/徽章溢出卡片（P1-5） */
.nname { font-weight: 700; color: var(--ds-ink); flex: 1 1 160px; min-width: 0; }
.nname small { display: block; color: var(--ds-muted); font-size: 11px; }
.nbar { position: relative; flex: 1; height: 16px; border-radius: 8px; background: var(--ds-soft); overflow: hidden; }
.nbar .fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--ds-accent), var(--ds-good)); }
.nbar .fill.glow { background: linear-gradient(90deg, #f0bd31, var(--ds-gold)); }
.npct { min-width: 52px; text-align: right; font-weight: 800; color: var(--ds-accent); }
.nfootOut { margin-top: 6px; color: var(--ds-muted); font-size: 11px; text-align: right; }

/* 领奖台：桌面用 order 还原「2-1-3」站位（DOM 保持 1-2-3 自然名次） */
.pod.silver { order: 1; }
.pod.gold { order: 2; }
.pod.bronze { order: 3; }

/* 窄屏（≤720px）适配 —— 2026-09-25 UE 审核 P1-5：
   条形榜改两行（名次+模型+分数 / 进度条通栏）、Neon 卡片换行且模型名可伸缩、
   领奖台恢复 1→2→3 自然顺序、表格给出横向滑动提示。 */
@media (max-width: 720px) {
  .swipeHint { display: block; padding: 4px 2px 8px; font-size: 12px; color: var(--ds-muted); text-align: right; }
  .podium { grid-template-columns: 1fr; }
  .pod.silver, .pod.gold, .pod.bronze { order: 0; }
  .pod.gold { transform: none; }

  .barRow {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-areas: "dot name val" ". track track";
    gap: 8px 10px;
    padding: 12px 14px;
  }
  .barRow .bDot { grid-area: dot; }
  .barRow .bName { grid-area: name; white-space: normal; }
  .barRow .bTrack { grid-area: track; }
  .barRow .bVal { grid-area: val; min-width: 48px; }

  .ncard { flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; }
  .ncard .nrank { order: 0; width: auto; }
  .ncard .nname { order: 1; flex: 1 1 auto; min-width: 0; }
  .ncard .npct { order: 2; margin-left: auto; }
  .ncard .nbar { order: 3; flex: 1 0 100%; }
}

/* ============================================================
   聚合首页 /benchmarks（2026-10-01 UE 改版）
   这段样式原先抄在两份页面模板的内联 <style> 里（插件自带页 + theme-fluid 覆盖页），
   改一处必漏一处（P2-9）；现在只在这一处，页面模板只留 th:replace。
   ============================================================ */

/* 概览带：站点级事实，不放需要跨榜去重才成立的数字 */
.bm-brief { margin: 4px 0 0; }
.bm-brief-row { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 16px; border: 1px solid var(--ds-line); border-radius: 13px; background: var(--ds-glow); font-size: 12.5px; color: var(--ds-muted); }
.bm-bstat b { color: var(--ds-ink); font-weight: 800; }
.bm-bstat .num { font-size: 14px; }
.bm-bstat.warn b { color: var(--ds-warn); }
.bm-bstat.ok b { color: color-mix(in srgb, var(--ds-good) 72%, var(--ds-ink)); }
.bm-bnote { color: var(--ds-muted); font-size: 11.5px; margin-left: 3px; }
.bm-brief-note { margin: 7px 2px 0; font-size: 11.5px; color: var(--ds-muted); line-height: 1.6; }

/* 工具栏：搜索 / 预览密度 / 归属 / 排序，sticky 让筛选在长页面里始终可达 */
.bm-bar { position: sticky; top: 0; z-index: 30; margin: 18px 0 0; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; border: 1px solid var(--ds-line); border-radius: 13px; background: color-mix(in srgb, var(--ds-surface) 92%, transparent); backdrop-filter: blur(8px); }
.bm-bar-top { display: flex; gap: 8px; align-items: center; flex: 1 1 240px; min-width: 0; }
.bm-q { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--ds-line); background: var(--ds-surface); color: var(--ds-ink); font-size: 13.5px; }
.bm-q:focus { outline: none; border-color: var(--ds-accent); box-shadow: 0 0 0 3px var(--ds-glow); }
.bm-fold { display: none; flex: none; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--ds-line); background: var(--ds-surface); color: var(--ds-muted); font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.bm-bar-more { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.bm-seg { display: flex; border: 1px solid var(--ds-line); border-radius: 10px; overflow: hidden; background: var(--ds-surface); }
.bm-seglab { padding: 8px 10px; font-size: 12px; color: var(--ds-muted); display: inline-flex; align-items: center; }
.bm-seg button { padding: 8px 12px; border: 0; background: transparent; color: var(--ds-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.bm-seg button[aria-pressed="true"] { background: var(--ds-accent); color: #fff; }
.bm-seg button:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: -2px; }
.bm-opt { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ds-muted); }
.bm-opt select { padding: 7px 9px; border-radius: 10px; border: 1px solid var(--ds-line); background: var(--ds-surface); color: var(--ds-ink); font-size: 12.5px; }
.bm-opt select option { background: var(--ds-surface); color: var(--ds-ink); }
.bm-hits { margin: 0 0 0 auto; font-size: 12.5px; color: var(--ds-muted); }
.bm-hits b { color: var(--ds-accent); }

/* 用途分组 */
.bm-group { margin-top: 22px; }
/* 分组 Tab：一条 Tab 一屏一组（分组多了页面就不该继续往下长）。
   收组的开关是 .bm-groups[data-tab]，而这个属性只由 deepswe-index.js 挂 —— 没 JS 就四组平铺，
   Tab 条本身也藏起来，避免出现「看得见却点了没反应」的死控件。 */
.bm-tabs { display: none; }
html.ds-js .bm-tabs { display: flex; gap: 4px; margin-top: 18px; border-bottom: 1px solid var(--ds-line); }
.bm-tab { padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ds-muted); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.bm-tab:hover { color: var(--ds-ink); }
.bm-tab[aria-selected="true"] { color: var(--ds-accent); border-bottom-color: var(--ds-accent); }
.bm-tab:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: -4px; border-radius: 6px; }
html.ds-js .bm-groups[data-tab] .bm-group { display: none; }
html.ds-js .bm-groups[data-tab] .bm-group.show { display: block; }
.bm-ghead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bm-gtitle { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .3px; color: var(--ds-ink); }
.bm-gsub { font-size: 12px; color: var(--ds-muted); }
.bm-gn { font-size: 12px; color: var(--ds-muted); margin-left: auto; }
.bm-groups { margin-top: 4px; }
.bm-group + .bm-group { border-top: 1px solid var(--ds-line); padding-top: 4px; }

/* 卡片网格。minmax(320px,1fr) 的下界只在宽屏生效；窄屏另见下面 minmax(0,1fr) ——
   1fr 的默认 min-width 是 min-content，长模型名 + 归属徽章会把卡片撑破视口（320px 实测溢出到 406px）。 */
.bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; }
.bm-card { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--ds-line); border-radius: 16px; background: var(--ds-surface); padding: 16px 18px 13px; transition: border-color .12s ease, box-shadow .12s ease; }
.bm-card:hover { border-color: color-mix(in srgb, var(--ds-accent) 55%, var(--ds-line)); box-shadow: 0 6px 18px rgba(17, 32, 51, .10); }
.bm-card.off { opacity: .45; }
/* 点标题进完整榜：真链接在 .bm-clink 上，::after 当遮罩。注意遮罩的实际覆盖范围是**表头那一行**，
   不是整张卡 —— .bm-clink 是 static，遮罩的包含块往上找到的第一个定位祖先是 .bm-chead（position:relative），
   所以 inset:0 铺的是表头框。卡里凡是要自己响应指针的，都得抬到遮罩之上（z-index:2）。 */
html.ds-js .bm-clink::after { content: ""; position: absolute; inset: 0; border-radius: 16px; z-index: 1; }
.bm-cfoot, .bm-tags { position: relative; z-index: 2; }

/* 表头锁一行高：简介从「最多两行的段落」收进「!」气泡后，
   同一行里各卡的「第一名」起点才会对齐（2026-10-01 老板截图指出错开问题）。 */
.bm-chead { position: relative; display: flex; align-items: center; gap: 7px; min-height: 21px; padding-right: 84px; }
.bm-ctitle { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.3; min-width: 0; }
.bm-clink { display: block; color: var(--ds-ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-clink:hover { color: var(--ds-accent); }
.bm-clink:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 3px; border-radius: 4px; }
/* 抬按钮，不抬 .bm-tip：tip 一旦 position 化，气泡的包含块就从 .bm-chead 变成 17px 宽的 tip，
   锚点会跳到按钮下面（1.0.25 复量实测：不抬则 hover / 点按全被表头遮罩吃掉，只有键盘 Tab 能用）。 */
.bm-info { position: relative; z-index: 2; flex: none; width: 17px; height: 17px; padding: 0; border-radius: 50%; border: 1px solid var(--ds-line); background: var(--ds-soft); color: var(--ds-muted); font-size: 11px; font-weight: 800; line-height: 1; cursor: pointer; }
.bm-info:hover, .bm-info[aria-expanded="true"] { color: var(--ds-accent); border-color: color-mix(in srgb, var(--ds-accent) 45%, var(--ds-line)); background: var(--ds-glow); }
.bm-info:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
/* 三条显示路径：鼠标 hover、键盘/触屏 focus（无 JS 也成立）、点按后 aria-expanded（JS 给触屏兜底）。
   只留 hover 的话，手机上这条信息就等于被删掉了 —— 所以不这么做。 */
/* 简介是一整句，比新鲜度那三行短字段需要稍大的字号 */
/* 必须写成 .bm-pop.bm-pop-below：下面 .bm-pop 规则里带 bottom: calc(100% + 8px)，与本行同权重且排在后面，
   单类名写法的 bottom: auto 会被它吃掉 —— top 和 bottom 同时被钉住，内容高度压成 0，气泡只剩 padding 那 20px
   （1.0.27 线上量到，徽标气泡和榜简介气泡都中招）。 */
.bm-pop.bm-pop-below { top: calc(100% + 8px); bottom: auto; font-size: 12.5px; line-height: 1.6; }
.bm-cgo { position: absolute; right: 16px; top: 15px; z-index: 2; font-size: 11.5px; font-weight: 700; color: var(--ds-accent); padding: 3px 8px; border-radius: 8px; background: var(--ds-glow); opacity: 0; transition: opacity .12s ease; pointer-events: none; }
.bm-card:hover .bm-cgo, .bm-card:focus-within .bm-cgo { opacity: 1; }
@media (hover: none) { .bm-cgo { opacity: 1; } }

.bm-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 9px; }
.bm-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .3px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.bm-tag.arena { color: color-mix(in srgb, #7b3ff2 62%, var(--ds-ink)); background: rgba(123, 63, 242, .13); border: 1px solid color-mix(in srgb, #7b3ff2 46%, transparent); }
.bm-tag.board { color: color-mix(in srgb, #0a8f8d 62%, var(--ds-ink)); background: rgba(10, 162, 160, .13); border: 1px solid color-mix(in srgb, #0a8f8d 46%, transparent); }
.bm-tag.metric { color: var(--ds-muted); background: var(--ds-soft); border: 1px solid var(--ds-line); font-weight: 700; cursor: help; }
.bm-tag.dim { color: var(--ds-warn); background: color-mix(in srgb, var(--ds-warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ds-warn) 45%, transparent); cursor: help; }

/* 榜首单独一行：首屏最该看见的是「谁第一」，不是十行等高列表 */
/* 榜首与各行是徽标气泡的包含块：气泡不锚在 26px 宽的芯片上（那样最长 268px 的气泡会从卡片右缘溢出去），
   而是锚在整行、从左边界起铺 —— 永远不会出卡，代价是离芯片有一点横向距离。 */
.bm-champ { display: flex; align-items: center; gap: 10px; margin: 12px 0 3px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--ds-gold) 16%, transparent), var(--ds-glow)); min-width: 0; position: relative; }
.bm-medal { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex: none; background: var(--ds-soft); color: var(--ds-muted); }
.bm-medal.n1 { background: linear-gradient(135deg, #fdebb3, var(--ds-gold)); color: #3a2500; }
/* 榜首与列表行同构：模型名和归属徽标同一行，徽标不再独占第二行（2026-10-01 老板指出）。 */
.bm-cwho { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; }
.bm-cname { font-size: 15px; font-weight: 800; color: var(--ds-ink); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-cscore { flex: none; text-align: right; font-weight: 800; font-size: 20px; line-height: 1.15; color: var(--ds-ink); }
.bm-cscore small { display: block; font-size: 10.5px; font-weight: 600; color: var(--ds-muted); margin-top: 3px; }

.bm-rows { list-style: none; margin: 6px 0 0; padding: 0; flex: 1; }
.bm-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--ds-grid-line); font-size: 13.5px; position: relative; }
.bm-rk { font-size: 11.5px; font-weight: 800; color: var(--ds-muted); text-align: center; font-variant-numeric: tabular-nums; }
.bm-who { display: flex; align-items: center; gap: 7px; min-width: 0; }
/* 模型名自己省略、徽标 flex:none —— 同处一个 nowrap 容器时长名字会把徽章一起截掉（P1-7） */
.bm-name { min-width: 0; max-width: 100%; font-weight: 700; color: var(--ds-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 首页每行的归属徽标。认得出的厂商摆品牌图标，地区色就此让位给品牌色（2026-10-01 定）；
   认不出的退回首字徽标，那一份仍由 .origin-cn / .origin-us … 直接上色 —— 没有品牌色可认时，
   颜色是唯一还能扫读「哪些是国产」的线索。字号比长标签大一点：只剩两个字符，太细就糊成一团。 */
.bm-org { flex: none; position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 27px; padding: 1px 5px; border-radius: 7px; font-size: 10.5px; font-weight: 800; line-height: 1.55; white-space: nowrap; cursor: help; }
.bm-org.ico { min-width: 0; padding: 0; }
/* 单色版 logo 靠 currentColor 染色，所以这里给的是 color 而不是 background */
.bm-ico { display: block; flex: none; width: 18px; height: 18px; color: var(--ds-ink); }
/* sprite 容器用「绝对定位 + 零尺寸」藏，不用 display:none —— 后者在部分引擎里会让 <use> 取不到引用 */
.bm-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* 徽标只有 20px 高，气泡却按 top:calc(100%+8px) 定位 —— 若 .bm-org 不当定位祖先，
   100% 就是整行（44px）的高，气泡会弹到脚下 18px 处且左对齐到卡片边（1.0.26 线上实测）。
   顺手补一段透明桥：指针从徽标走进气泡要跨过那 8px 缝，没有桥就断 hover、气泡先关再到达。 */
.bm-org .bm-pop-below::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 12px; }
.bm-rs { flex: none; text-align: right; font-weight: 800; font-size: 14px; color: var(--ds-accent); font-variant-numeric: tabular-nums; min-width: 52px; }
.bm-tb { grid-column: 2 / 4; height: 4px; border-radius: 3px; background: var(--ds-soft); overflow: hidden; }
.bm-tb span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--ds-accent), color-mix(in srgb, var(--ds-accent) 45%, var(--ds-good))); }
.bm-row.faded { opacity: .35; }

/* 预览密度的折叠交给 CSS：nth-child 相对的是「已渲染的行」，
   榜首不在 ul 里，所以 Top3 是隐藏第 3 个 li 及之后（即第 4 名起）。 */
html.ds-js .bm-groups[data-density="3"] .bm-row:nth-child(n+3) { display: none; }
html.ds-js .bm-groups[data-density="5"] .bm-row:nth-child(n+5) { display: none; }

.bm-cfoot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--ds-grid-line); font-size: 11.5px; color: var(--ds-muted); }
.bm-count { margin-left: auto; }
.bm-fresh { position: relative; display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.bm-fresh.ok { color: color-mix(in srgb, var(--ds-good) 70%, var(--ds-ink)); }
.bm-fresh.aging { color: var(--ds-muted); }
.bm-fresh.warn { color: var(--ds-warn); }
.bm-fresh:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; border-radius: 6px; }
.bm-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ds-good); flex: none; }
.bm-fresh.aging .bm-dot { background: color-mix(in srgb, var(--ds-muted) 60%, transparent); }
.bm-fresh.warn .bm-dot { background: var(--ds-warn); }
.bm-stalemark { color: var(--ds-warn); }

/* 新鲜度浮层：上游生成 / 本地抓取 / 页面渲染三个时刻，悬停或键盘聚焦才出现（首屏只留相对时间） */
.bm-pop { display: none; position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 6; width: max-content; max-width: 268px; padding: 9px 11px; border: 1px solid var(--ds-line); border-radius: 10px; background: var(--ds-surface); box-shadow: 0 10px 26px rgba(17, 32, 51, .18); font-size: 11.5px; font-weight: 600; color: var(--ds-muted); }
.bm-prow { display: flex; gap: 8px; justify-content: space-between; line-height: 1.7; }
.bm-prow i { font-style: normal; }
.bm-prow b { color: var(--ds-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
/* 出现条件对三套触发者都成立：新鲜度芯片（span+tabindex）、表头「!」按钮（hover / focus / 点按）、
   行内归属徽标（hover / 点按 —— 它刻意不可聚焦，见模板注释） */
.bm-fresh:hover .bm-pop, .bm-fresh:focus .bm-pop, .bm-fresh:focus-within .bm-pop,
.bm-tip:hover .bm-pop, .bm-tip:focus-within .bm-pop, .bm-info[aria-expanded="true"] ~ .bm-pop,
.bm-org:hover .bm-pop, .bm-org[data-open="true"] .bm-pop { display: block; }

/* 抓取失败 / 等待首拉 / 有源无行：三态分开写，合并成一句「暂无数据」会让人查错地方（P1-2） */
.bm-state { display: flex; flex-direction: column; gap: 5px; margin: 12px 0 2px; padding: 14px 12px; text-align: center; border: 1px dashed color-mix(in srgb, var(--ds-warn) 55%, var(--ds-line)); border-radius: 12px; background: color-mix(in srgb, var(--ds-warn) 7%, transparent); font-size: 12px; color: var(--ds-muted); }
.bm-state b { color: var(--ds-ink); font-size: 13px; }
.bm-state.err { border-color: color-mix(in srgb, #e05b5b 55%, var(--ds-line)); background: color-mix(in srgb, #e05b5b 7%, transparent); }
.bm-state a { color: var(--ds-accent); font-weight: 700; text-decoration: none; }
.bm-state a:hover { text-decoration: underline; }
.bm-errmsg { min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bm-nohit { margin-top: 18px; padding: 22px 18px; text-align: center; border: 1px dashed var(--ds-line); border-radius: 14px; color: var(--ds-muted); font-size: 12.5px; }
.bm-nohit b { display: block; color: var(--ds-ink); font-size: 14px; margin-bottom: 5px; }
.bm-nohit-acts { display: flex; gap: 14px; justify-content: center; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.bm-nohit-acts button { padding: 6px 15px; border-radius: 9px; border: 1px solid var(--ds-line); background: var(--ds-soft); color: var(--ds-ink); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.bm-nohit-acts a { color: var(--ds-accent); font-weight: 700; text-decoration: none; }

/* 读法说明：默认折叠，不再占首屏（原实现是常开的一大段） */
.bm-faq { margin: 26px 0 0; border: 1px solid var(--ds-line); border-radius: 14px; background: var(--ds-surface); padding: 2px 18px; }
.bm-faq summary { cursor: pointer; font-weight: 800; font-size: 13.5px; padding: 12px 0; color: var(--ds-ink); }
.bm-faq summary:hover { color: var(--ds-accent); }
.bm-faq-in { padding: 0 0 14px; font-size: 13px; color: var(--ds-muted); line-height: 1.75; }
.bm-faq-in b { color: var(--ds-ink); }
.bm-faq-in ul { margin: 6px 0 0; padding-left: 20px; }
.bm-faq-in li { margin: 4px 0; }
.bm-faq-in .mini { margin: 10px 0 0; font-size: 12px; }

/* 顶部工具行（健康面板入口 / 插件版本 / 抓取时刻） */
.bm-tools { margin: 8px 0 0; font-size: 12.5px; color: var(--ds-muted); }
.bm-tools a { color: var(--ds-accent); font-weight: 700; text-decoration: none; }
.bm-tools a:hover { text-decoration: underline; }
.bm-tools b { color: var(--ds-ink); }

@media (max-width: 720px) {
  /* 窄屏：五个控件摊开约 234px 高，会吃掉三分之一视口 —— 取消 sticky，把筛选折进按钮 */
  .bm-bar { position: static; gap: 8px; padding: 9px; }
  /* 窄屏四个 Tab 一行放不下：横向滚，而不是折成两行把省下来的高度又吃掉 */
  .bm-tabs { overflow-x: auto; scrollbar-width: none; }
  .bm-tab { flex: none; padding: 7px 11px; font-size: 13px; white-space: nowrap; }
  .bm-fold { display: inline-flex; }
  .bm-bar-more { display: none; flex-basis: 100%; }
  .bm-bar.open .bm-bar-more { display: flex; }
  .bm-opt { flex: 1 1 46%; }
  .bm-opt select { flex: 1; min-width: 0; padding: 6px 8px; font-size: 12px; }
  .bm-seg button { padding: 6px 10px; font-size: 12px; }
  .bm-hits { margin-left: 0; width: 100%; font-size: 12px; }
  .bm-brief-row { gap: 6px 14px; padding: 10px 12px; }
  /* 单列：minmax(0,1fr) 见上面注释，这里必须一起收窄 */
  .bm-grid { grid-template-columns: minmax(0, 1fr); }
  .bm-chead { padding-right: 0; }
  /* 整卡即链接，窄屏不再需要右上「完整榜」提示占位 */
  .bm-cgo { display: none; }
  .bm-champ { flex-wrap: wrap; }
  .bm-cscore { font-size: 18px; }
  .bm-pop { max-width: 200px; }
}
