/* ================================================================
   ranking.css — 動漫排行榜頁面專屬樣式
   對應 page-ranking.php
   ================================================================ */

/* ── Hero ── */
.rank-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(59,130,246,0.12) 0%, rgba(139,92,246,0.10) 50%, rgba(30,36,43,0) 100%);
  border-bottom: 1px solid var(--glass-border);
  padding: 64px 0 48px;
  text-align: center;
}
.rank-hero__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.rank-hero__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(99,168,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.rank-hero__content {
  position: relative;
  z-index: 1;
}
.rank-hero__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-secondary, rgba(208,215,224,0.75));
}
.chip--green {
  background: rgba(34,197,94,0.10);
  border-color: rgba(34,197,94,0.25);
  color: #4ade80;
}
.rank-hero__trophy {
  font-size: 2.2rem;
  margin-right: 10px;
}
.rank-hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 12px;
  line-height: 1.15;
}
.rank-hero__subtitle {
  font-size: 15px;
  color: var(--text-muted, rgba(208,215,224,0.55));
  margin: 0 0 32px;
}
.rank-hero__stats {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 50px;
  padding: 10px 28px;
  flex-wrap: wrap;
  justify-content: center;
}
.rank-hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
}
.rank-hero__stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #63a8ff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.rank-hero__stat-label {
  font-size: 11px;
  color: var(--text-muted, rgba(208,215,224,0.55));
  margin-top: 2px;
}
.rank-hero__stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}

/* ── 第一層分類 Tab ── */
.rank-category-row {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  padding: 0;
}
.rank-category-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.rank-category-tabs::-webkit-scrollbar { display: none; }
.rank-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, rgba(208,215,224,0.75));
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
}
.rank-category-tab:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, #fff);
}
.rank-category-tab.active {
  background: rgba(99,168,255,0.15);
  border-color: rgba(99,168,255,0.30);
  color: #63a8ff;
}
.rank-category-tab.coming-soon {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.soon-badge {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.30);
  border-radius: 50px;
  color: #fbbf24;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ── 主體佈局 ── */
.rank-body { padding: 36px 0 60px; }
.rank-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.rank-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ── 平台 Tab ── */
.rank-platform-row {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 8px;
}
.rank-platform-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.rank-platform-tab {
  flex: 1;
  min-width: 120px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary, rgba(208,215,224,0.75));
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-align: center;
  font-family: var(--font-main, 'Noto Sans TC', sans-serif);
}
.rank-platform-tab:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, #fff);
}
.rank-platform-tab.active {
  background: rgba(99,168,255,0.14);
  border-color: rgba(99,168,255,0.30);
  color: #63a8ff;
  font-weight: 700;
}

/* ── 站內子分類 ── */
.site-sub-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.site-sub-btn {
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary, rgba(208,215,224,0.75));
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main, 'Noto Sans TC', sans-serif);
}
.site-sub-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.site-sub-btn.active {
  background: rgba(99,168,255,0.14);
  border-color: rgba(99,168,255,0.30);
  color: #63a8ff;
}

/* ── 平台介紹卡 ── */
.platform-info-card {
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  font-size: 13px;
  color: var(--text-muted, rgba(208,215,224,0.55));
  line-height: 1.6;
  min-height: 52px;
}
.platform-info-card:empty { display: none; }

/* ── 週期工具列 ── */
.rank-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.period-btns {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 50px;
  padding: 4px;
}
.period-btn {
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary, rgba(208,215,224,0.75));
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main, 'Noto Sans TC', sans-serif);
}
.period-btn:hover { color: #fff; }
.period-btn.active {
  background: rgba(99,168,255,0.20);
  color: #63a8ff;
  font-weight: 700;
}
.rank-count-info {
  font-size: 12px;
  color: var(--text-muted, rgba(208,215,224,0.55));
  white-space: nowrap;
}

/* ── 排行列表 ── */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rank-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 排行卡片 */
.rank-card {
  display: grid;
  grid-template-columns: 52px 72px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  text-decoration: none;
  color: var(--text-primary, #d0d7e0);
  transition: all 0.22s ease;
  cursor: pointer;
}
.rank-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(99,168,255,0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* 名次 */
.rank-card__rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 40px;
}
.rank-card__num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-muted, rgba(208,215,224,0.55));
  line-height: 1;
}
.rank-card__num--top1 { color: #FFD700; font-size: 1.6rem; }
.rank-card__num--top2 { color: #C0C0C0; }
.rank-card__num--top3 { color: #CD7F32; }
.rank-card__crown { font-size: 1.1rem; line-height: 1; }
.rank-card__change {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}
.rank-card__change--up   { color: #4ade80; background: rgba(74,222,128,0.12); }
.rank-card__change--down { color: #f87171; background: rgba(248,113,113,0.12); }
.rank-card__change--new  { color: #60a5fa; background: rgba(96,165,250,0.12); }
.rank-card__change--same { color: var(--text-muted); }

/* 封面 */
.rank-card__cover {
  width: 72px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}
.rank-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rank-card__cover-fb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(99,168,255,0.08);
}

/* 內容 */
.rank-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rank-card__title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rank-card__native {
  font-size: 11px;
  color: var(--text-muted, rgba(208,215,224,0.55));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-card__tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.rank-card__tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 50px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-muted, rgba(208,215,224,0.55));
}
.rank-card__tag--year { color: #63a8ff; background: rgba(99,168,255,0.08); border-color: rgba(99,168,255,0.18); }
.rank-card__tag--new  { color: #4ade80; background: rgba(74,222,128,0.10); border-color: rgba(74,222,128,0.22); }

/* 右側評分 */
.rank-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.rank-card__score {
  font-size: 1.3rem;
  font-weight: 800;
  color: #FFD580;
  line-height: 1;
}
.rank-card__score-label {
  font-size: 10px;
  color: var(--text-muted, rgba(208,215,224,0.55));
}
.rank-card__votes {
  font-size: 10px;
  color: var(--text-muted, rgba(208,215,224,0.55));
  white-space: nowrap;
}
.rank-card__action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(99,168,255,0.12);
  border: 1px solid rgba(99,168,255,0.25);
  color: #63a8ff;
  white-space: nowrap;
  margin-top: 2px;
}

/* 站內排行提示 */
.site-rank-note {
  font-size: 12px;
  color: var(--text-muted, rgba(208,215,224,0.55));
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(99,168,255,0.06);
  border: 1px solid rgba(99,168,255,0.15);
  border-radius: 10px;
}

/* Skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border: 1px solid rgba(255,255,255,0.06);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 右側欄 ── */
.rank-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 80px;
}
.rank-sidebar-card {
  border-radius: 16px;
  padding: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
}
.rank-sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #d0d7e0);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* 側欄排行列表 */
.sb-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sb-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  color: var(--text-primary, #d0d7e0);
  transition: all 0.2s ease;
  cursor: pointer;
}
.sb-rank-item:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(99,168,255,0.20);
}
.sb-rank-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, rgba(208,215,224,0.55));
  min-width: 18px;
  text-align: center;
}
.sb-rank-cover {
  width: 36px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
}
.sb-rank-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-rank-info { flex: 1; min-width: 0; }
.sb-rank-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #d0d7e0);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}
.sb-rank-meta { font-size: 10px; color: var(--text-muted, rgba(208,215,224,0.55)); margin-top: 2px; }
.sb-rank-change {
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.sb-rank-change--up   { color: #4ade80; }
.sb-rank-change--down { color: #f87171; }
.sb-rank-change--new  { color: #60a5fa; font-size: 9px; }

/* 平台說明 */
.platform-guide { display: flex; flex-direction: column; gap: 10px; }
.pg-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pg-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.pg-info { display: flex; flex-direction: column; gap: 1px; }
.pg-name { font-size: 12px; font-weight: 700; color: var(--text-primary, #d0d7e0); }
.pg-desc { font-size: 11px; color: var(--text-muted, rgba(208,215,224,0.55)); }

/* ── RWD ── */
@media (max-width: 1024px) {
  .rank-layout { grid-template-columns: 1fr; }
  .rank-sidebar { position: static; }
}
@media (max-width: 768px) {
  .rank-hero { padding: 40px 0 32px; }
  .rank-hero__title { font-size: 1.8rem; }
  .rank-hero__stats { padding: 8px 16px; }
  .rank-hero__stat { padding: 0 12px; }
  .rank-card {
    grid-template-columns: 40px 56px 1fr auto;
    gap: 10px;
    padding: 10px 12px;
  }
  .rank-card__cover { width: 56px; height: 75px; }
  .rank-card__title { font-size: 13px; }
  .rank-card__score { font-size: 1.1rem; }
  .rank-platform-tab { min-width: auto; flex: none; padding: 8px 12px; font-size: 12px; }
}
@media (max-width: 480px) {
  .rank-card { grid-template-columns: 36px 48px 1fr; }
  .rank-card__meta { display: none; }
  .rank-hero__stat-divider { display: none; }
  .rank-hero__stat { padding: 0 8px; }
}
