/* ============================================================
 * ranking.css — 排行榜专页样式（2026-09 表格版）
 * 依赖：all-games.css（token / 侧栏 / header / footer 共用）
 * 结构：rk-hero → rk-tabs → rk-podium → rk-table → 分页
 * ============================================================ */

.rk-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--ag-text-mute);
  font-size: 13px;
  list-style: none;
}

/* ============================================================
 * 1. Hero 横幅：奖杯像素画 + 标题 + 三统计卡
 * ============================================================ */
.rk-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  margin-bottom: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 204, 0, 0.35);
  background:
    radial-gradient(circle at 12% 30%, rgba(255, 170, 0, 0.14), transparent 46%),
    radial-gradient(circle at 88% 80%, rgba(255, 204, 0, 0.08), transparent 40%),
    radial-gradient(1.5px 1.5px at 42% 22%, rgba(255, 224, 130, 0.9), transparent 100%),
    radial-gradient(1.5px 1.5px at 62% 64%, rgba(255, 224, 130, 0.55), transparent 100%),
    radial-gradient(1.5px 1.5px at 78% 26%, rgba(255, 224, 130, 0.7), transparent 100%),
    radial-gradient(1.5px 1.5px at 30% 78%, rgba(255, 224, 130, 0.5), transparent 100%),
    linear-gradient(165deg, #1d130a 0%, #120b06 55%, #0d0906 100%);
  box-shadow: 0 0 26px rgba(255, 170, 0, 0.12), inset 0 0 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.rk-hero-art {
  width: 175px;
  flex-shrink: 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 14px rgba(255, 180, 0, 0.35));
}

.rk-hero-text { flex: 1; min-width: 0; }

.rk-hero-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffd24d;
  text-shadow: 0 0 18px rgba(255, 200, 0, 0.5);
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.rk-hero-title .en {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 3px;
  color: var(--ag-text-mute);
  font-family: 'Press Start 2P', monospace, sans-serif;
}
.rk-hero-sub {
  margin: 0;
  font-size: 12px;
  color: var(--ag-text-dim);
  letter-spacing: 0.5px;
}

/* 右侧三统计卡 */
.rk-hero-stats {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.rk-hstat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 118px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--ag-border-strong);
  background: rgba(10, 7, 14, 0.72);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}
.rk-hstat .ic {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  object-fit: contain;
  image-rendering: pixelated;
}
.rk-hstat .ic svg { width: 100%; height: 100%; }
.rk-hstat.hot .ic { color: #ff7a3c; }
.rk-hstat.fav .ic { color: #ff5a8a; }
.rk-hstat .num { display: flex; flex-direction: column; line-height: 1.25; }
.rk-hstat .num strong {
  font-size: 17px;
  font-weight: 800;
  color: var(--ag-text);
  font-family: 'Press Start 2P', monospace, 'Courier New', monospace;
  letter-spacing: 0.5px;
}
.rk-hstat .num em {
  font-style: normal;
  font-size: 11px;
  color: var(--ag-text-mute);
  margin-top: 3px;
}

/* ============================================================
 * 2. Tab 行：榜单类型 + 快捷排序
 * ============================================================ */
.rk-tabs-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.rk-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rk-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--ag-border);
  background: rgba(13, 9, 18, 0.66);
  color: var(--ag-text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.rk-tab .ic { width: 14px; height: 14px; color: var(--ag-text-mute); display: inline-flex; }
.rk-tab .ic svg { width: 100%; height: 100%; }
.rk-tab:hover { color: var(--ag-text); border-color: var(--ag-border-strong); }
.rk-tab.active {
  color: var(--ag-yellow);
  border-color: rgba(255, 204, 0, 0.75);
  background: rgba(255, 204, 0, 0.07);
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.22);
}
.rk-tab.active .ic { color: var(--ag-yellow); }

.rk-pills { display: flex; gap: 8px; }
.rk-pill {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--ag-border);
  background: rgba(13, 9, 18, 0.66);
  color: var(--ag-text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.rk-pill:hover { color: var(--ag-text); border-color: var(--ag-border-strong); }
.rk-pill.active {
  color: #241a00;
  background: linear-gradient(160deg, #ffe08a, #ffc21d);
  border-color: #ffc21d;
  box-shadow: 0 0 14px rgba(255, 194, 29, 0.4);
}

/* ============================================================
 * 3. TOP 3 领奖台（竖版卡：大封面上 + 名称/标签中 + 大统计下）
 * ============================================================ */
.rk-podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
}

.rk-podium-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 16px 14px;
  border-radius: 12px;
  border: 1px solid var(--ag-border);
  background: linear-gradient(165deg, rgba(24, 17, 34, 0.92), rgba(11, 8, 16, 0.94));
  text-decoration: none;
  color: inherit;
  transition: 0.25s;
}

.rk-podium-item:hover { transform: translateY(-4px); }

/* 金银铜配色 */
.rk-podium-item.rank-1 {
  border-color: #ffd24d;
  background: linear-gradient(165deg, rgba(46, 32, 8, 0.95), rgba(16, 11, 5, 0.96));
  box-shadow: 0 0 30px rgba(255, 200, 0, 0.28);
  padding: 18px 16px 16px;
  z-index: 1;
}
.rk-podium-item.rank-2 {
  border-color: #3fa9e0;
  box-shadow: 0 0 18px rgba(63, 169, 224, 0.2);
}
.rk-podium-item.rank-3 {
  border-color: #e0643f;
  box-shadow: 0 0 18px rgba(224, 100, 63, 0.22);
}

/* 名次皇冠徽章（银/铜悬于封面正上方，冠军居中压卡沿） */
.rk-pcrown {
  position: absolute;
  top: -26px;
  left: 82px;              /* 封面中心：padding 16 + cover 132/2 */
  transform: translateX(-50%);
  z-index: 3;
  width: 46px;
  height: 44px;
  animation: rkFloat 2.2s ease-in-out infinite;
}
.rk-pcrown svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.55));
}
.rk-pcrown i {
  position: absolute;
  top: 74%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-style: normal;
  font-size: 16px;
  font-weight: 800;
  font-family: 'Press Start 2P', monospace, 'Courier New', monospace;
  line-height: 1;
}
.rank-1 .rk-pcrown { width: 58px; height: 54px; top: -32px; left: 50%; color: #ffd24d; }
.rank-1 .rk-pcrown i { color: #4a3000; font-size: 20px; }
.rank-1 .rk-pcrown svg { filter: drop-shadow(0 0 12px rgba(255, 210, 77, 0.85)); }
.rank-2 .rk-pcrown { color: #c8d4e6; }
.rank-2 .rk-pcrown i { color: #16202e; }
.rank-2 .rk-pcrown svg { filter: drop-shadow(0 0 8px rgba(200, 212, 230, 0.6)); }
.rank-3 .rk-pcrown { color: #e08a52; }
.rank-3 .rk-pcrown i { color: #3d1608; }
.rank-3 .rk-pcrown svg { filter: drop-shadow(0 0 8px rgba(224, 138, 82, 0.6)); }

/* 冠军皇冠左上角闪光 */
.rank-1 .rk-pcrown::before {
  content: '✦';
  position: absolute;
  top: -4px;
  left: -8px;
  font-size: 13px;
  color: #ffe9a0;
  text-shadow: 0 0 6px rgba(255, 233, 160, 0.9);
  animation: rkTwinkle 1.6s ease-in-out infinite;
}
@keyframes rkTwinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}
@keyframes rkFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

/* 角色装饰（右侧，与封面同高区域） */
.rk-pdeco {
  position: absolute;
  right: 4px;
  top: 14px;
  z-index: 2;
  width: 88px;
  opacity: 0.92;
  pointer-events: none;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
}
.rank-1 .rk-pdeco { width: 118px; top: 18px; }

/* 头部行：大封面 + TOP 徽章 */
.rk-phead {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  margin-bottom: 12px;
}

/* 封面缩略块 */
.rk-pthumb {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ag-border-strong);
  background: #0a0710;
}
.rank-1 .rk-pthumb { width: 156px; height: 156px; }
.rk-pthumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
}
.rk-ptop {
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  font-family: 'Press Start 2P', monospace, sans-serif;
  color: #241a00;
  background: linear-gradient(160deg, rgba(255, 236, 170, 0.95), rgba(255, 193, 29, 0.95));
}
.rank-2 .rk-ptop { color: #062a3a; background: linear-gradient(160deg, #9adcf5, #45b1e8); }
.rank-3 .rk-ptop { color: #3d0e00; background: linear-gradient(160deg, #f5a988, #e0643f); }

/* 名称 / 标签 */
.rk-pname {
  font-size: 17px;
  font-weight: 700;
  color: var(--ag-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  margin-bottom: 6px;
}
.rank-1 .rk-pname { font-size: 20px; }
.rk-ptag { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.rk-ptag b {
  font-size: 12px;
  font-weight: 800;
  color: var(--ag-yellow);
  padding: 0;
  border-radius: 0;
  background: none;
  border: none;
}
.rk-ptag i {
  font-style: normal;
  font-size: 12px;
  color: var(--ag-text-dim);
  padding: 0;
  border-radius: 0;
  background: none;
  border: none;
}
.rk-pstats {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding-right: 56px;
  margin-top: auto;
}
.rk-pstats .stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.2;
}
.rk-pstats .stat .v {
  display: flex;
  align-items: center;
  gap: 7px;
}
.rk-pstats .stat .ic {
  font-style: normal;
  font-size: 11px;
  display: inline-flex;
}
.rk-pstats .stat .ic svg { width: 15px; height: 15px; }
.rk-pstats .stat.play .ic { color: #3ddc84; }
.rk-pstats .stat.like .ic { color: #ff5a8a; }
.rk-pstats .stat strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--ag-text);
  font-family: 'Press Start 2P', monospace, 'Courier New', monospace;
}
.rank-1 .rk-pstats .stat strong { font-size: 20px; }
.rk-pstats .stat em {
  font-style: normal;
  font-size: 11px;
  color: var(--ag-text-mute);
  white-space: nowrap;
}

/* ============================================================
 * 4. 完整榜单（表格式）
 * ============================================================ */
.rk-table {
  border-radius: 12px;
  border: 1px solid var(--ag-border-strong);
  background: linear-gradient(180deg, rgba(16, 11, 22, 0.92), rgba(9, 7, 13, 0.92));
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  margin-bottom: 22px;
}

.rk-thead,
.rk-trow {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 128px 158px 142px 96px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.rk-thead {
  height: 42px;
  border-bottom: 1px dashed var(--ag-border-strong);
  font-size: 11.5px;
  color: var(--ag-text-mute);
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.02);
}

.rk-trow {
  list-style: none;
  padding-top: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s;
}
.rk-trow:last-child { border-bottom: none; }
.rk-trow:hover { background: rgba(255, 204, 0, 0.045); }

/* 排名 */
.rk-t-num {
  font-family: 'Press Start 2P', monospace, 'Courier New', monospace;
  font-size: 14px;
  color: var(--ag-text-dim);
}
.rk-trow:nth-child(-n+7) .rk-t-num { color: var(--ag-yellow); }

/* 游戏（缩略图 + 名称 + 标签） */
.rk-t-game {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.rk-t-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ag-border);
  background: #0a0710;
}
.rk-t-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
}
.rk-t-name { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rk-t-name .nm {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ag-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rk-t-name .tags { display: flex; gap: 5px; }
.rk-t-name .chip {
  font-style: normal;
  font-size: 10px;
  color: var(--ag-yellow);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.25);
  white-space: nowrap;
}
.rk-t-name .chip:nth-child(2) {
  color: var(--ag-text-dim);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--ag-border);
}

/* 平台 / 类型 */
.rk-t-plat {
  font-size: 12px;
  color: var(--ag-text);
  line-height: 1.5;
}
.rk-t-plat i {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--ag-text-mute);
}

/* 热度条 */
.rk-t-heat { display: flex; align-items: center; gap: 8px; }
.rk-t-heat .bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.rk-t-heat .bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2ee06e, #7dffab);
  box-shadow: 0 0 8px rgba(61, 220, 132, 0.55);
}
.rk-t-heat em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  color: #3ddc84;
  min-width: 34px;
  text-align: right;
}

/* 游玩 / 收藏 */
.rk-t-data {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.rk-t-data .stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ag-text-dim);
}
.rk-t-data .stat .ic {
  display: inline-flex;
  width: 12px;
  height: 12px;
  font-style: normal;
  font-size: 10px;
}
.rk-t-data .stat .ic svg { width: 100%; height: 100%; }
.rk-t-data .stat.play .ic { color: #3ddc84; }
.rk-t-data .stat.like .ic { color: #ff5a8a; }

/* 操作 */
.rk-t-op { text-align: right; }
.rk-t-btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid rgba(61, 220, 132, 0.65);
  background: rgba(61, 220, 132, 0.08);
  color: #3ddc84;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: 0.2s;
}
.rk-t-btn:hover {
  box-shadow: 0 0 14px rgba(61, 220, 132, 0.45);
  transform: translateY(-1px);
}

/* ============================================================
 * 5. 响应式
 * ============================================================ */
@media (max-width: 1240px) {
  .rk-thead, .rk-trow { grid-template-columns: 44px minmax(0, 1fr) 118px 138px 128px 90px; gap: 10px; }
  .rk-hero-art { width: 108px; }
  .rk-hstat { min-width: 104px; }
}

@media (max-width: 1080px) {
  .rk-hero { flex-wrap: wrap; }
  .rk-hero-stats { width: 100%; }
  .rk-hstat { flex: 1; }
  /* 隐藏热度列，保证名称可读 */
  .rk-thead, .rk-trow { grid-template-columns: 44px minmax(0, 1fr) 110px 132px 90px; }
  .col-heat, .rk-t-heat { display: none; }
}

@media (max-width: 960px) {
  .rk-podium { grid-template-columns: 1fr; max-width: 560px; margin-left: auto; margin-right: auto; }
  .rk-podium-item.rank-1 { order: -1; }
}

@media (max-width: 720px) {
  .rk-hero { padding: 12px 14px; }
  .rk-hero-title { font-size: 20px; }
  .rk-hero-art { width: 84px; }
  .rk-hero-stats { flex-wrap: wrap; gap: 8px; }
  .rk-hstat { min-width: 0; flex: 1 1 30%; padding: 8px 10px; gap: 8px; }
  .rk-hstat .ic { width: 32px; height: 32px; }
  .rk-hstat .num strong { font-size: 13px; }
  .rk-hstat .num em { font-size: 10px; }
  /* 只留 排名 / 游戏 / 操作 */
  .rk-thead, .rk-trow { grid-template-columns: 40px minmax(0, 1fr) 88px; }
  .col-plat, .rk-t-plat, .col-data, .rk-t-data { display: none; }
  .rk-podium-item { padding: 12px; }
  .rk-pthumb, .rank-1 .rk-pthumb { width: 96px; height: 96px; }
  .rank-2 .rk-pcrown, .rank-3 .rk-pcrown { left: 64px; }
  .rk-pdeco, .rank-1 .rk-pdeco { display: none; }
  .rk-pstats { gap: 28px; }
  .rk-tabs-wrap { flex-direction: column; align-items: stretch; }
  .rk-pills { justify-content: center; }
}
