:root {
  --rk-bg: #08111f;
  --rk-bg-2: #0c1729;
  --rk-ink: #f3ecdc;
  --rk-gold: #f0c97c;
  --rk-gold-hi: #ffd98f;
  --rk-muted: rgba(243, 236, 220, 0.42);
  --rk-line: rgba(255, 255, 255, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--rk-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--rk-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(900px 620px at 50% -180px, rgba(229, 183, 95, 0.22), rgba(229, 183, 95, 0) 70%),
    linear-gradient(180deg, #0a1424 0%, var(--rk-bg-2) 46%, var(--rk-bg) 100%);
  background-attachment: fixed;
}

button {
  font-family: inherit;
}

img {
  display: block;
}

a {
  -webkit-tap-highlight-color: transparent;
}

/* ===== 顶部栏（小程序内隐藏，避免与原生导航重复） ===== */
.rk-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: rgba(9, 18, 32, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.rk-topbar-in {
  max-width: 720px;
  height: 56px;
  margin: 0 auto;
  padding: 0 clamp(12px, 3.6vw, 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rk-back,
.rk-home {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: rgba(243, 236, 220, 0.82);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.rk-back:hover,
.rk-home:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.rk-back svg {
  width: 21px;
  height: 21px;
}

.rk-home svg {
  width: 19px;
  height: 19px;
}

.rk-topbar-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
}

.in-mp .rk-topbar {
  display: none;
}

/* ===== 页面主体 ===== */
.rk-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4.6vw, 28px) calc(42px + env(safe-area-inset-bottom));
}

.rk-hero {
  padding: clamp(20px, 4vw, 34px) 4px 0;
}

.rk-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rk-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(243, 236, 220, 0.58);
}

.rk-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4fd6a3;
  box-shadow: 0 0 0 4px rgba(79, 214, 163, 0.12);
  animation: rkPulse 2s ease-in-out infinite;
}

.rk-date {
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(243, 236, 220, 0.38);
}

.rk-wordmark {
  margin: 10px 0 0;
  font-size: clamp(40px, 11.5vw, 70px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 1px;
  color: #f3ecdc;
  text-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.rk-wordmark span {
  color: var(--rk-gold);
}

.rk-sub {
  margin: 8px 0 0;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--rk-muted);
}

.rk-tabs {
  display: inline-flex;
  margin-top: clamp(16px, 3.6vw, 26px);
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rk-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(243, 236, 220, 0.62);
  cursor: pointer;
  transition: all 0.18s ease;
}

.rk-tab.is-on {
  color: #2c1d05;
  font-weight: 900;
  background: linear-gradient(135deg, #f7d78c 0%, #e0aa46 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===== 前三名 ===== */
.rk-podium {
  display: flex;
  align-items: flex-end;
  gap: clamp(8px, 2.2vw, 14px);
  margin-top: clamp(22px, 4.5vw, 34px);
}

.rk-podium.is-single {
  justify-content: center;
}

.rk-podium.is-single .rk-seat {
  flex: 0 0 min(62%, 260px);
}

.rk-seat {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(16px, 4vw, 26px) 6px clamp(14px, 3vw, 22px);
  border-radius: 22px 22px 10px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065) 0%, rgba(255, 255, 255, 0.012) 100%);
  border: 1px solid var(--rk-line);
}

.rk-seat.is-1 {
  margin-top: clamp(-22px, -4vw, -14px);
  padding-top: clamp(36px, 8vw, 50px);
  background: linear-gradient(180deg, rgba(229, 183, 95, 0.24) 0%, rgba(229, 183, 95, 0.05) 60%, rgba(229, 183, 95, 0.015) 100%);
  border-color: rgba(243, 207, 122, 0.42);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.rk-ribbon {
  position: absolute;
  top: clamp(8px, 2vw, 14px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(9px, 2vw, 11px);
  font-weight: 900;
  letter-spacing: 4px;
  text-indent: 4px;
  color: rgba(243, 207, 122, 0.85);
}

.rk-ava-wrap {
  position: relative;
  width: clamp(56px, 14.5vw, 84px);
  height: clamp(56px, 14.5vw, 84px);
  margin-top: 4px;
}

.rk-seat.is-1 .rk-ava-wrap {
  width: clamp(72px, 18.5vw, 106px);
  height: clamp(72px, 18.5vw, 106px);
}

.rk-ava {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #20304f;
  border: 2px solid rgba(255, 255, 255, 0.16);
}

.rk-seat.is-1 .rk-ava {
  border: 3px solid var(--rk-gold);
  box-shadow: 0 0 0 6px rgba(240, 201, 124, 0.1), 0 14px 30px rgba(0, 0, 0, 0.4);
}

.rk-seat.is-2 .rk-ava {
  border-color: rgba(207, 216, 230, 0.75);
}

.rk-seat.is-3 .rk-ava {
  border-color: rgba(212, 154, 106, 0.8);
}

.rk-medal {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  line-height: 22px;
  font-weight: 900;
  color: #101d35;
  background: linear-gradient(135deg, #f7d78c, #d8a848);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.32);
}

.rk-seat.is-1 .rk-medal {
  top: -11px;
  min-width: 25px;
  height: 25px;
  line-height: 25px;
  font-size: 13px;
}

.rk-seat.is-2 .rk-medal {
  background: linear-gradient(135deg, #eef3fa, #b9c6da);
}

.rk-seat.is-3 .rk-medal {
  background: linear-gradient(135deg, #f0c09c, #c98658);
}

.rk-crown {
  position: absolute;
  z-index: 2;
  top: -13px;
  right: -9px;
  width: clamp(20px, 5vw, 28px);
  height: clamp(20px, 5vw, 28px);
  color: var(--rk-gold);
  transform: rotate(16deg);
}

.rk-crown svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.rk-name {
  max-width: 100%;
  margin-top: clamp(10px, 2.4vw, 16px);
  font-size: clamp(12px, 3.2vw, 16px);
  line-height: 1.4;
  color: rgba(243, 236, 220, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rk-time {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  column-gap: 0.16em;
  width: 100%;
  max-width: 100%;
  margin-top: 4px;
  font-size: clamp(17px, 4.8vw, 27px);
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: 0;
  color: #f3ecdc;
  text-align: center;
}

.rk-t-part {
  white-space: nowrap;
}

.rk-t-unit {
  margin-left: 0.06em;
  font-size: 0.58em;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.72;
}

.rk-seat.is-1 .rk-time {
  font-size: clamp(21px, 5.9vw, 36px);
  color: var(--rk-gold-hi);
  text-shadow: 0 6px 18px rgba(229, 183, 95, 0.38);
}

.rk-total {
  margin-top: 2px;
  font-size: clamp(9px, 2.2vw, 12px);
  color: rgba(243, 236, 220, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ===== 4 名以后 ===== */
.rk-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: clamp(24px, 5vw, 36px) 4px 10px;
}

.rk-list-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.rk-list-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--rk-gold);
}

.rk-list-sub {
  font-size: 10px;
  color: rgba(243, 236, 220, 0.4);
}

.rk-updated {
  font-size: 10px;
  color: rgba(243, 236, 220, 0.35);
}

.rk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.6vw, 10px);
}

.rk-row {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.6vw, 16px);
  padding: clamp(10px, 2.4vw, 15px) clamp(12px, 3vw, 18px);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.rk-row:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.03) 100%);
  border-color: rgba(240, 201, 124, 0.18);
}

.rk-no {
  width: clamp(24px, 6vw, 34px);
  flex: 0 0 auto;
  text-align: center;
  font-size: clamp(13px, 3.2vw, 18px);
  font-weight: 900;
  color: rgba(243, 236, 220, 0.46);
  font-variant-numeric: tabular-nums;
}

.rk-row.is-r4 .rk-no,
.rk-row.is-r5 .rk-no,
.rk-row.is-r6 .rk-no {
  color: var(--rk-gold);
}

.rk-ava-sm {
  flex: 0 0 auto;
  width: clamp(36px, 9vw, 50px);
  height: clamp(36px, 9vw, 50px);
  border-radius: 50%;
  object-fit: cover;
  background: #20304f;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.rk-user {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rk-name-sm {
  font-size: clamp(12px, 3vw, 16px);
  line-height: 1.35;
  font-weight: 700;
  color: var(--rk-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rk-total-sm {
  font-size: clamp(9px, 2.2vw, 12px);
  color: rgba(243, 236, 220, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rk-time-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.rk-time-sm {
  font-size: clamp(14px, 3.6vw, 20px);
  font-weight: 900;
  color: var(--rk-gold-hi);
  white-space: nowrap;
}

.rk-time-label {
  font-size: 8px;
  letter-spacing: 1px;
  color: rgba(243, 236, 220, 0.35);
}

/* ===== 底部 ===== */
.rk-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(20px, 4vw, 28px);
  padding: 0 4px;
}

.rk-foot-note {
  font-size: 10px;
  color: rgba(243, 236, 220, 0.3);
}

.rk-refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(229, 183, 95, 0.24);
  background: rgba(229, 183, 95, 0.1);
  color: #e8c989;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.rk-refresh:hover {
  border-color: rgba(229, 183, 95, 0.45);
  background: rgba(229, 183, 95, 0.16);
}

.rk-refresh-ic {
  width: 14px;
  height: 14px;
  color: currentColor;
}

.rk-refresh-ic svg {
  width: 100%;
  height: 100%;
}

.rk-refresh-ic.is-spin {
  animation: rkSpin 0.9s linear infinite;
}

/* ===== 骨架 / 状态 ===== */
.rk-loading {
  margin-top: clamp(22px, 4.5vw, 34px);
}

.rk-sk-podium {
  display: flex;
  align-items: flex-end;
  gap: clamp(8px, 2.2vw, 14px);
  height: clamp(220px, 55vw, 300px);
}

.rk-sk-col {
  flex: 1;
  border-radius: 22px 22px 10px 10px;
  background: rgba(255, 255, 255, 0.06);
  animation: rkShimmer 1.5s ease-in-out infinite;
}

.rk-sk-col.is-1 {
  height: 100%;
}

.rk-sk-col.is-2 {
  height: 82%;
  animation-delay: 0.15s;
}

.rk-sk-col.is-3 {
  height: 74%;
  animation-delay: 0.3s;
}

.rk-sk-row {
  display: block;
  height: clamp(52px, 13vw, 68px);
  margin-top: clamp(6px, 1.6vw, 10px);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  animation: rkShimmer 1.5s ease-in-out infinite;
}

.rk-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(70px, 18vw, 120px) 0 clamp(40px, 9vw, 70px);
  text-align: center;
}

.rk-state[hidden] {
  display: none;
}

.rk-state-ico {
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #e5b75f;
  background: rgba(229, 183, 95, 0.1);
  border: 1px solid rgba(229, 183, 95, 0.22);
}

.rk-state-ico svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.rk-state-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.rk-state-sub {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--rk-muted);
}

.rk-retry {
  margin-top: 20px;
  padding: 10px 28px;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  color: #2c1d05;
  cursor: pointer;
  background: linear-gradient(135deg, #f7d78c, #e0aa46);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ===== 动效 ===== */
@keyframes rkPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

@keyframes rkShimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes rkSpin {
  to { transform: rotate(360deg); }
}

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

.rk-hero,
.rk-podium {
  animation: rkFadeUp 0.5s ease-out both;
}

.rk-podium {
  animation-delay: 0.08s;
}

/* ===== 窄屏微调 ===== */
@media (max-width: 380px) {
  .rk-podium {
    gap: 6px;
  }

  .rk-seat {
    padding-left: 2px;
    padding-right: 2px;
  }

  .rk-seat.is-1 {
    padding-left: 2px;
    padding-right: 2px;
  }

  .rk-row {
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .rk-name {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
