/* Ranking Arena — BP Shell leaderboard */

:root {
  --rk-ink: #1f2d3d;
  --rk-muted: #6b7c8f;
  --rk-blue: #1890ff;
  --rk-deep: #0f6fd8;
  --rk-sky: #40a9ff;
  --rk-teal: #13c2c2;
  --rk-amber: #faad14;
  --rk-coral: #ff7a45;
  --rk-bg: #eef3f8;
  --rk-line: rgba(24, 144, 255, 0.14);
  --rk-surface: #fff;
  --rk-shadow: 0 14px 34px rgba(15, 111, 216, 0.1);
}

* { box-sizing: border-box; }

body.page-ranking,
body.has-unified-header.bp-shell {
  min-height: 100vh;
  color: var(--rk-ink);
  background:
    radial-gradient(1200px 420px at 12% -8%, rgba(64, 169, 255, 0.18), transparent 55%),
    radial-gradient(900px 380px at 92% 8%, rgba(19, 194, 194, 0.12), transparent 50%),
    linear-gradient(180deg, #e8f1fa 0%, var(--rk-bg) 38%, #f4f7fb 100%) !important;
  font-family: "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
}

.ranking-shell.ranking-arena {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 16px 72px;
}

/* ---- Hero ---- */
.rk-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.85fr);
  gap: 18px;
  align-items: stretch;
  padding: 26px 24px 24px;
  margin-bottom: 14px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, #0b4f9c 0%, #0f6fd8 46%, #1890ff 78%, #36cfc9 130%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--rk-shadow);
}

.rk-hero-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  right: -40px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 68%);
  pointer-events: none;
}

.rk-hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  pointer-events: none;
  background:
    repeating-linear-gradient(-18deg, transparent 0 11px, rgba(255, 255, 255, 0.05) 11px 12px),
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.2), transparent 26%);
}

.rk-hero-copy,
.rk-hero-meters {
  position: relative;
  z-index: 1;
}

.rk-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.14em;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.rk-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #95de64;
  box-shadow: 0 0 0 0 rgba(149, 222, 100, 0.7);
  animation: rkPulse 1.8s ease-out infinite;
}

@keyframes rkPulse {
  0% { box-shadow: 0 0 0 0 rgba(149, 222, 100, 0.65); }
  70% { box-shadow: 0 0 0 9px rgba(149, 222, 100, 0); }
  100% { box-shadow: 0 0 0 0 rgba(149, 222, 100, 0); }
}

.rk-title {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 860;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0, 40, 100, 0.25);
}

.rk-sub {
  margin: 0;
  max-width: 36em;
  font-size: 14px;
  line-height: 1.7;
  opacity: 0.92;
}

.rk-hero-meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: center;
}

.rk-meter {
  padding: 14px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.rk-meter-num {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.rk-meter-label {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.88;
}

.rk-meter[data-tone="blue"] { box-shadow: inset 3px 0 0 #91d5ff; }
.rk-meter[data-tone="teal"] { box-shadow: inset 3px 0 0 #87e8de; }
.rk-meter[data-tone="amber"] { box-shadow: inset 3px 0 0 #ffe58f; }

/* ---- Dock / filters ---- */
.rk-dock.ranking-toolbar {
  position: sticky;
  top: 72px;
  z-index: 30;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 28px rgba(31, 45, 61, 0.06);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
}

.ranking-major-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(24, 144, 255, 0.06);
}

.ranking-major-tab,
.ranking-subtab {
  border: 0;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.ranking-major-tab {
  min-height: 44px;
  border-radius: 999px;
  background: transparent;
  color: var(--rk-muted);
  font-size: 14px;
  font-weight: 700;
}

.ranking-major-tab.active {
  background: linear-gradient(135deg, var(--rk-sky), var(--rk-deep));
  color: #fff;
  box-shadow: 0 8px 18px rgba(24, 144, 255, 0.28);
}

/* 维度芯片轨：单行横滑，避免手机换行难看 */
.rk-subrail-wrap {
  position: relative;
}

.rk-subrail-wrap::before,
.rk-subrail-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}

.rk-subrail-wrap::before {
  left: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), transparent);
}

.rk-subrail-wrap::after {
  right: 0;
  background: linear-gradient(270deg, rgba(255, 255, 255, 0.95), transparent);
}

.rk-subrail-wrap.is-overflow::before,
.rk-subrail-wrap.is-overflow::after {
  opacity: 1;
}

.ranking-subtabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 5px;
  margin: 0;
  border-radius: 16px;
  background: rgba(24, 144, 255, 0.055);
  border: 1px solid rgba(24, 144, 255, 0.08);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}

.ranking-subtabs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.ranking-subtab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--rk-muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  scroll-snap-align: start;
  line-height: 1;
}

.ranking-subtab:hover {
  color: var(--rk-deep);
  background: rgba(255, 255, 255, 0.7);
}

.ranking-subtab.active {
  background: #fff;
  border-color: rgba(24, 144, 255, 0.18);
  color: var(--rk-deep);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.12);
  font-weight: 750;
}

@media (min-width: 760px) {
  .rk-subrail-wrap::before,
  .rk-subrail-wrap::after {
    display: none;
  }

  .ranking-subtabs[data-group="site"] {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
    scroll-snap-type: none;
  }

  .ranking-subtabs[data-group="article"] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .ranking-subtabs[data-group="site"] .ranking-subtab,
  .ranking-subtabs[data-group="article"] .ranking-subtab {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* ---- Panel ---- */
.ranking-content-wrapper {
  border-radius: 22px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.ranking-panel {
  display: none;
  padding: 0;
}

.ranking-panel.active {
  display: block;
}

.ranking-panel.is-entering .rk-podium .ranking-card,
.ranking-panel.is-entering .rk-track .ranking-card {
  animation: rkRise .45s ease both;
  animation-delay: calc(var(--rk-i, 1) * 35ms);
}

@keyframes rkRise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.rk-panel-head.ranking-panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 4px 4px 14px;
  border-bottom: 1px dashed rgba(24, 144, 255, 0.22);
}

.ranking-panel-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--rk-deep);
}

.ranking-panel-heading h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  color: var(--rk-ink);
}

.ranking-panel-heading p {
  margin: 0;
  max-width: 340px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--rk-muted);
  text-align: right;
}

.rk-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--rk-muted);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  border: 1px dashed var(--rk-line);
}

/* ---- Podium ---- */
.rk-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.rk-podium .ranking-card.is-podium {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 210px;
  padding: 16px 14px 18px;
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, #fff, #f7fbff);
  border: 1px solid var(--rk-line);
  box-shadow: 0 10px 24px rgba(31, 45, 61, 0.06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.rk-podium .ranking-card.is-podium.top-1 {
  min-height: 248px;
  border-color: rgba(250, 173, 20, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 251, 230, 0.95), #fff 48%),
    #fff;
  box-shadow: 0 16px 34px rgba(250, 173, 20, 0.16);
}

.rk-podium .ranking-card.is-podium.top-2 {
  min-height: 220px;
  border-color: rgba(24, 144, 255, 0.28);
}

.rk-podium .ranking-card.is-podium.top-3 {
  min-height: 200px;
  border-color: rgba(255, 122, 69, 0.35);
}

.rk-podium .ranking-card.is-podium:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(24, 144, 255, 0.14);
}

.rk-podium .ranking-rank {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  border: 0;
}

.rk-podium .ranking-rank-num {
  font-size: 42px;
  font-weight: 860;
  line-height: 1;
  letter-spacing: -0.03em;
}

.rk-podium .top-1 .ranking-rank-num { color: #d48806; }
.rk-podium .top-2 .ranking-rank-num { color: var(--rk-deep); }
.rk-podium .top-3 .ranking-rank-num { color: #d4380d; }

.rk-podium .ranking-rank-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--rk-muted);
}

.rk-podium .ranking-card-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.rk-podium .ranking-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--rk-line);
  background: #fff;
}

.rk-podium .ranking-card-topline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.rk-podium .ranking-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 780;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rk-podium .ranking-card-tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--rk-deep);
  background: rgba(24, 144, 255, 0.1);
}

.rk-podium .ranking-card-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--rk-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rk-podium .ranking-card-meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--rk-muted);
}

.rk-podium .is-article-card .ranking-card-icon { display: none; }

/* ---- Track list ---- */
.rk-track.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 24px rgba(31, 45, 61, 0.05);
}

.rk-track .ranking-card.is-track {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid transparent;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.rk-track .ranking-card.is-track:hover {
  transform: translateX(3px);
  border-color: rgba(24, 144, 255, 0.22);
  box-shadow: 0 8px 18px rgba(24, 144, 255, 0.08);
}

.rk-track .ranking-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 44px;
  border-radius: 12px;
  background: rgba(24, 144, 255, 0.06);
  border: 0;
  padding: 0;
}

.rk-track .ranking-rank-num {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--rk-deep);
}

.rk-track .ranking-rank-label { display: none; }

.rk-track .ranking-card-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.rk-track .is-article-card .ranking-card-main {
  grid-template-columns: minmax(0, 1fr);
}

.rk-track .ranking-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  object-fit: cover;
  border: 1px solid var(--rk-line);
}

.rk-track .ranking-card-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.rk-track .ranking-card-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rk-track .ranking-card-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--rk-muted);
  background: #f3f7fb;
}

.rk-track .ranking-card-desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--rk-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rk-track .ranking-card-meta {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--rk-muted);
}

@media (max-width: 900px) {
  .rk-hero {
    grid-template-columns: 1fr;
    padding: 22px 18px;
  }

  .rk-hero-meters {
    grid-template-columns: repeat(3, 1fr);
  }

  .rk-dock.ranking-toolbar {
    top: 64px;
  }

  .rk-panel-head.ranking-panel-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .ranking-panel-heading p {
    text-align: left;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .rk-podium {
    grid-template-columns: 1fr;
  }

  .rk-podium .ranking-card.is-podium,
  .rk-podium .ranking-card.is-podium.top-1,
  .rk-podium .ranking-card.is-podium.top-2,
  .rk-podium .ranking-card.is-podium.top-3 {
    min-height: 0;
  }

  .rk-podium .ranking-card-main {
    flex-direction: row;
    align-items: flex-start;
  }

  .rk-track .ranking-card-desc {
    display: none;
  }

  .rk-hero-meters {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .rk-meter {
    padding: 10px 8px;
  }

  .rk-meter-num { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .rk-pulse,
  .ranking-panel.is-entering .rk-podium .ranking-card,
  .ranking-panel.is-entering .rk-track .ranking-card {
    animation: none !important;
  }
}
