/**
 * 韩K联榜单页（排名 /paiming、球队榜 /qiuduibang、射手榜 /sheshoubang）。
 *
 * 2026-11-18 第二版版式，刻意和旧版（积分表 + 卡片栅格）以及参考静态稿拉开差距：
 *   · 页头左对齐，右侧三榜切换 Tab；
 *   · 排名 = 条形榜（行底积分进度条），球队榜 = 进球条形列表，
 *     射手榜 = 前三领奖台（2-1-3 站位）+ 双列名单。
 *
 * 榜单本体 .kb-* 前缀；榜尾「热门资讯 / 推荐赛事」两块沿用 .rk-*（与旧版一致，
 * 视图里这两块的标记没动）。颜色全部走 cs06.css 的主题令牌（--cs06-* / --accent-rgb），
 * 十套主题（含深色）自动跟随。只在榜单三页由视图经 $extraCss 加载，不进全站样式。
 */

.kb-page {
  max-width: 960px;
  margin: 0 auto;
  padding-top: 20px;
}

/* ---------- 页头：左对齐 + 三榜切换 Tab ---------- */
.kb-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgb(var(--accent-rgb));
}

.kb-hero-badge {
  display: inline-block;
  background: rgb(var(--accent-rgb));
  color: var(--cs06-on-accent);
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 8px;
  font-weight: 600;
}

.kb-hero-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--cs06-ink-title);
}

.kb-tabs {
  display: flex;
  gap: 6px;
  padding-bottom: 2px;
}

.kb-tab {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--cs06-line);
  background: var(--cs06-card);
  font-size: 13px;
  font-weight: 500;
  color: var(--cs06-muted);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.kb-tab:hover {
  color: var(--cs06-accent-ink);
  border-color: rgb(var(--accent-rgb));
}

.kb-tab.is-on {
  background: rgb(var(--accent-rgb));
  border-color: rgb(var(--accent-rgb));
  color: var(--cs06-on-accent);
  font-weight: 600;
}

/* ---------- 榜单容器（三种榜共用） ---------- */
.kb-board {
  background: var(--cs06-card);
  border: 1px solid var(--cs06-line);
  border-radius: 12px;
  padding: 6px 18px;
  margin-bottom: 24px;
  box-shadow: var(--cs06-shadow);
}

/* ---------- 排名：条形榜 ---------- */
.kb-standing {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 2px 15px;
  overflow: hidden;
}

.kb-standing + .kb-standing { border-top: 1px solid var(--cs06-line); }

/* 行底积分进度条：绝对定位贴住行底，不占布局高度 */
.kb-standing-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  border-radius: 0 3px 3px 0;
  background: rgb(var(--accent-rgb));
  opacity: 0.35;
}

.kb-standing.is-top3 .kb-standing-bar { opacity: 0.8; }

.kb-standing-no {
  flex: none;
  width: 30px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cs06-dim);
}

.kb-standing.is-top3 .kb-standing-no {
  color: var(--cs06-on-accent);
  background: rgb(var(--accent-rgb));
  border-radius: 6px;
  line-height: 26px;
  height: 26px;
}

.kb-standing-logo {
  flex: none;
  width: 30px;
  height: 30px;
  object-fit: contain;
  background: var(--cs06-soft);
  border: 1px solid var(--cs06-line);
  border-radius: 6px;
}

.kb-standing-logo.is-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--cs06-muted);
}

.kb-standing-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kb-standing-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cs06-ink-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 胜平负小签：三个描边小胶囊 */
.kb-standing-record {
  display: flex;
  gap: 4px;
}

.kb-standing-record i {
  font-style: normal;
  font-size: 10px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--cs06-soft);
  color: var(--cs06-muted);
  white-space: nowrap;
}

.kb-standing-stats {
  flex: none;
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--cs06-muted);
  white-space: nowrap;
}

.kb-standing-stats b {
  font-size: 13px;
  font-weight: 600;
  color: var(--cs06-ink);
  font-variant-numeric: tabular-nums;
}

.kb-standing-gd.is-pos b { color: #16a34a; }
.kb-standing-gd.is-neg b { color: var(--cs06-hot-text, #dc2626); }

.kb-standing-pts {
  flex: none;
  width: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--cs06-accent-ink);
  font-variant-numeric: tabular-nums;
}

.kb-standing-pts small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 400;
  color: var(--cs06-dim);
}

/* ---------- 球队榜：进球条形列表 ---------- */
.kb-goal {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
}

.kb-goal + .kb-goal { border-top: 1px solid var(--cs06-line); }

.kb-goal-no {
  flex: none;
  width: 26px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--cs06-dim);
  font-variant-numeric: tabular-nums;
}

.kb-goal.is-top3 .kb-goal-no { color: var(--cs06-accent-ink); }

.kb-goal-logo {
  flex: none;
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: var(--cs06-soft);
  border: 1px solid var(--cs06-line);
  border-radius: 6px;
}

.kb-goal-logo.is-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--cs06-muted);
}

.kb-goal-main {
  flex: 1;
  min-width: 0;
}

.kb-goal-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.kb-goal-top b {
  font-size: 14px;
  font-weight: 600;
  color: var(--cs06-ink-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-goal-top span {
  flex: none;
  font-size: 11px;
  color: var(--cs06-muted);
}

/* 进球条：轨道满宽，填充按进球占比 */
.kb-goal-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--cs06-soft);
  overflow: hidden;
}

.kb-goal-bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.55), rgb(var(--accent-rgb)));
}

.kb-goal.is-top3 .kb-goal-bar i {
  background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.75), rgb(var(--accent-rgb)));
}

.kb-goal-num {
  flex: none;
  width: 44px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--cs06-accent-ink);
  font-variant-numeric: tabular-nums;
}

.kb-goal-num small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 400;
  color: var(--cs06-dim);
}

/* ---------- 射手榜：前三领奖台 ---------- */
.kb-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 24px;
}

.kb-pod {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--cs06-line);
  background: var(--cs06-card);
  box-shadow: var(--cs06-shadow);
  text-align: center;
}

/* 第一位：垫高 + 描边强调 */
.kb-pod.is-first {
  padding-top: 28px;
  padding-bottom: 26px;
  border-color: rgb(var(--accent-rgb));
  border-width: 2px;
}

.kb-pod-no {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgb(var(--accent-rgb));
  color: var(--cs06-on-accent);
  font-size: 13px;
  font-weight: 700;
  line-height: 28px;
}

.kb-pod.is-first .kb-pod-no {
  width: 34px;
  height: 34px;
  line-height: 34px;
  font-size: 15px;
}

.kb-pod-face {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--cs06-soft);
  border: 2px solid var(--cs06-line);
}

.kb-pod.is-first .kb-pod-face {
  width: 84px;
  height: 84px;
  border-color: rgb(var(--accent-rgb));
}

.kb-pod-face.is-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--cs06-muted);
}

.kb-pod-name {
  max-width: 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--cs06-ink-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-pod-team {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--cs06-muted);
}

.kb-pod-logo {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.kb-pod-logo.is-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 9px;
  font-weight: 600;
  color: var(--cs06-muted);
  background: var(--cs06-soft);
  border-radius: 2px;
}

.kb-pod-goals {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--cs06-accent-ink);
  font-variant-numeric: tabular-nums;
}

.kb-pod-goals small {
  font-size: 11px;
  font-weight: 400;
  color: var(--cs06-dim);
  margin-left: 2px;
}

/* ---------- 射手榜：第 4 名起双列名单 ---------- */
.kb-board.kb-board-scorers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  padding: 6px 18px;
}

.kb-scorer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
}

/* 双列里用左 border 分隔行；列间距已由 gap 承担 */
.kb-scorer + .kb-scorer { border-top: 1px solid var(--cs06-line); }

.kb-scorer-no {
  flex: none;
  width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--cs06-dim);
  font-variant-numeric: tabular-nums;
}

.kb-scorer-face {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--cs06-soft);
  border: 1px solid var(--cs06-line);
}

.kb-scorer-face.is-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--cs06-muted);
}

.kb-scorer-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kb-scorer-main b {
  font-size: 13px;
  font-weight: 600;
  color: var(--cs06-ink-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-scorer-main span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--cs06-muted);
}

.kb-scorer-logo {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.kb-scorer-logo.is-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  font-size: 8px;
  font-weight: 600;
  color: var(--cs06-muted);
  background: var(--cs06-soft);
  border-radius: 2px;
}

.kb-scorer-goals {
  flex: none;
  min-width: 34px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--cs06-accent-ink);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.kb-scorer-goals small {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.7;
  margin-left: 1px;
}

/* ---------- 榜尾两块：热门资讯 + 推荐赛事（沿用旧版标记） ----------
   桌面两列等宽，760 以下单列。两块都是「标题 + 列表」，外壳（.rk-card），
   间距只由 .rk-two 的 gap 承担 —— 里面的 .rk-card 不能再带 margin-bottom。 */
.rk-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.rk-card {
  background: var(--cs06-card);
  border: 1px solid var(--cs06-line);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--cs06-shadow);
}

.rk-two .rk-card { margin-bottom: 0; }

.rk-panel { min-width: 0; }

.rk-sec-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--cs06-ink-title);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 3px solid rgb(var(--accent-rgb));
}

.rk-sec-title small {
  font-size: 12px;
  color: var(--cs06-muted);
  font-weight: normal;
}

/* 标题右侧的「更多」：靠 margin-left:auto 顶到行尾 */
.rk-more {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--cs06-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.rk-more:hover { color: var(--cs06-accent-ink); }

/* 空态：模块不消失，只留一行说明 */
.rk-empty {
  margin: 0;
  padding: 26px 0;
  text-align: center;
  font-size: 12px;
  color: var(--cs06-muted);
}

/* ---------- 热门资讯 ---------- */
.rk-news, .rk-mlist { list-style: none; margin: 0; padding: 0; }

.rk-news > li + li,
.rk-mlist > li + li { border-top: 1px solid var(--cs06-line); }

.rk-news-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  text-decoration: none;
}

.rk-news-thumb {
  position: relative;
  flex: none;
  width: 64px;
  height: 46px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--cs06-soft);
  border: 1px solid var(--cs06-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--cs06-muted);
}

/* 封面图浮在首字上面；图裂了 onerror 直接摘掉 img，露出来的就是首字 */
.rk-news-thumb i { font-style: normal; }

.rk-news-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rk-news-txt { flex: 1; min-width: 0; }

.rk-news-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cs06-ink-title);
  transition: color 0.15s ease;
}

.rk-news-row:hover .rk-news-title { color: var(--cs06-accent-ink); }

.rk-news-meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--cs06-dim);
}

/* ---------- 推荐赛事 ---------- */
.rk-mrow {
  display: block;
  padding: 10px 0;
  text-decoration: none;
}

.rk-mrow-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.rk-mrow-time {
  font-size: 11px;
  color: var(--cs06-dim);
  font-variant-numeric: tabular-nums;
}

.rk-mrow-teams {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.rk-mrow-name {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--cs06-ink-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.rk-mrow:hover .rk-mrow-name { color: var(--cs06-accent-ink); }

.rk-mrow-teams em {
  flex: none;
  font-style: normal;
  font-size: 11px;
  color: var(--cs06-muted);
}

.rk-mrow-teams em.is-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--cs06-accent-ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- 手机 ---------- */
@media (max-width: 760px) {
  .rk-two {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .kb-page { padding-top: 12px; }
  .kb-hero-title { font-size: 19px; }
  .kb-hero { margin-bottom: 16px; }
  .kb-tabs { width: 100%; }
  .kb-tab { flex: 1; text-align: center; padding: 7px 6px; }
  .kb-board { padding: 2px 10px; border-radius: 10px; }
  .kb-board.kb-board-scorers { grid-template-columns: 1fr; gap: 0; }

  /* 条形榜：中间的赛/进/失/净收掉，只留名次 + 队 + 积分 + 进度条 */
  .kb-standing { gap: 8px; padding: 11px 0 13px; }
  .kb-standing-stats { display: none; }
  .kb-standing-no { width: 24px; font-size: 15px; }
  .kb-standing-logo { width: 24px; height: 24px; }
  .kb-standing-name { font-size: 12px; }
  .kb-standing-pts { width: 40px; font-size: 18px; }

  .kb-goal { padding: 10px 0; }
  .kb-goal-num { width: 38px; font-size: 17px; }

  /* 领奖台改单列，第一位移到最上面（grid order），卡片保持居中纵排 */
  .kb-podium { grid-template-columns: 1fr; gap: 14px; }
  .kb-pod.is-first { order: -1; }
  .kb-pod-face, .kb-pod.is-first .kb-pod-face { width: 64px; height: 64px; }

  .rk-news-thumb { width: 56px; height: 40px; }
  .rk-news-title { font-size: 12px; }
}
