/* 排行榜页：标题横幅（含周/月/总 tab）、各分类榜卡（分类色淡色头部＋榜首横幅压在头部下缘＋2～10 名白底清单）。
   配色呼应首页分类榜单带：每张榜卡按分类编号取 main.css 的同一组色票（--band，见 .lb-rank-card--N），
   头部用分类色半透明渐层、榜首横幅海报下缘罩柔和深色，名次徽章取同一主色；清单区保持白底，保证文字对比 */

/* ===== 标题横幅：与资讯页分类导览同一套（--banner-bg 渐层、左对齐、4px 圆角、半透明白胶囊），标题＋周/月/总 切换同在一块 ===== */
.lb-rank-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 var(--gap-panel);
  padding: 20px 24px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--banner-bg);
  color: #fff;
  isolation: isolate;
}

.lb-rank-banner::after {
  content: "RANKING";
  position: absolute;
  right: 18px;
  bottom: -16px;
  z-index: -1;
  color: rgba(255, 255, 255, 0.2);
  font-size: 96px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  pointer-events: none;
}

.lb-rank-hero::before {
  content: "WEEKLY HOT RANKING";
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.lb-rank-hero-title {
  margin: 0;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

/* ===== 周/月/总 胶囊：半透明白底＋白细框，选中变白底蓝字 ===== */
.lb-rank-tabs {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.lb-rank-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.lb-rank-tab:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lb-rank-tab.lb-active {
  border-color: #fff;
  background: #fff;
  color: var(--banner-ink);
  font-weight: 700;
}

.lb-rank-panel {
  display: none;
}

.lb-rank-panel.lb-active {
  display: block;
}

/* ===== 分类榜卡：4 栏并排（排行榜栏位不受 3 的倍数限制，§11 例外） ===== */
.lb-rank-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

/* 榜卡外壳与色票变量（--band／--band-top）都在 main.css 的 .lb-rank-card／.lb-rank-card--N */
/* 分类色头部：分类色 50%→16% 透明度的渐层（比首页榜单带的 --band-top 深一档，需求方 2026-10-16 选定），右上大字 TOP 浮水印；下缘留出榜首横幅压上来的空间 */
.lb-rank-card-hd {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  padding: 16px 16px 46px;
  background: linear-gradient(rgba(var(--band), 0.5), rgba(var(--band), 0.16));
  color: var(--text);
  isolation: isolate;
}

.lb-rank-card-hd::after {
  content: "TOP";
  position: absolute;
  top: -8px;
  right: -4px;
  z-index: -1;
  color: rgba(var(--band), 0.16);
  font-size: 66px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.lb-rank-card-titles {
  min-width: 0;
}

.lb-rank-card-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 26px;
}

.lb-rank-card-sub {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
}

.lb-rank-card-more {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  transition: color 0.2s;
}

.lb-rank-card-more:hover {
  color: rgb(var(--band));
}

.lb-rank-empty {
  margin: 0;
  padding: 30px 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* 榜首横幅：海报当底图，左深右淡的横向遮罩（左侧深色托白字，右侧微泛白），文字白色；压在头部下缘 */
.lb-rank-top {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 88px;
  margin: -32px 12px 8px;
  padding: 10px 12px 10px 48px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg-elev);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  isolation: isolate;
}

.lb-rank-top-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.lb-rank-top:hover .lb-rank-top-bg {
  transform: scale(1.05);
}

.lb-rank-top::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(20, 24, 40, 0.75) 5%, rgba(20, 24, 40, 0.35) 50%, rgba(255, 255, 255, 0.25));
}

/* 榜首：金色书签角标贴在横幅左上角，文字让出左侧 */
.lb-rank-top-no {
  position: absolute;
  top: 0;
  left: 12px;
  width: 26px;
  height: 33px;
  background: linear-gradient(180deg, #ffd24d, #f09a00);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 26px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.lb-rank-top-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.lb-rank-top-name {
  overflow: hidden;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.lb-rank-top:hover .lb-rank-top-name {
  color: #ffe27a;
}

.lb-rank-top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.lb-rank-top-score {
  color: #ffd24d;
  font-size: 13px;
  font-weight: 800;
}

.lb-rank-top-hot {
  color: #fff;
}

/* 2～10 名：名次用 CSS 计数器做成小徽章；榜首金色书签角标，2、3 名银／铜圆形奖牌（金银铜三色固定，不随分类），其余只有灰色数字、不加底（label-rank.md 强制6） */
.lb-rank-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rank 1;
}

.lb-rank-item {
  counter-increment: rank;
  margin: 0 12px;
  border-bottom: 1px solid var(--bg-elev);
}

.lb-rank-item:last-child {
  border-bottom: none;
}

.lb-rank-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
}

.lb-rank-link::before {
  content: counter(rank);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

.lb-rank-item:nth-child(1) .lb-rank-link::before,
.lb-rank-item:nth-child(2) .lb-rank-link::before {
  color: #fff;
  font-style: normal;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), 0 1px 3px rgba(0, 0, 0, 0.25);
}

.lb-rank-item:nth-child(1) .lb-rank-link::before {
  background: radial-gradient(circle at 30% 25%, #fff, #c3cad6 45%, #8e9aac);
}

.lb-rank-item:nth-child(2) .lb-rank-link::before {
  background: radial-gradient(circle at 30% 25%, #ffe0bd, #d08a4a 45%, #a85f22);
}

.lb-rank-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.lb-rank-link:hover .lb-rank-name {
  color: rgb(var(--band));
}

.lb-rank-note {
  flex-shrink: 0;
  max-width: 40%;
  overflow: hidden;
  color: var(--text-weak);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 1199px) {
  .lb-rank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .lb-rank-banner {
    padding: 16px 16px 18px;
  }

  .lb-rank-banner::after {
    font-size: 64px;
  }

  .lb-rank-hero-title {
    font-size: 24px;
  }

  .lb-rank-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}
