/* ═══════════════════════════════════════════
   冬天杯4.0 — T1 红黑主题 · 2×3 排行榜
   ═══════════════════════════════════════════ */

:root {
  --t1-red: #E2012D;
  --bg: #080808;
  --card-bg: #0d0d11;
  --text: #f0ece8;
  --text-dim: #908c88;
  --text-faint: #585450;
  --gold: #e6b422;
  --silver: #a0a8b0;
  --bronze: #b08860;
  --bar-bg: rgba(255,255,255,0.04);
}

* { margin:0; padding:0; box-sizing:border-box; }
html, body { width:100%; height:100%; overflow:hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC","Microsoft YaHei",sans-serif;
  display: flex; flex-direction: column;
  padding: 12px 10px 10px;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(226,1,45,0.025) 79px, rgba(226,1,45,0.025) 80px),
    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(226,1,45,0.025) 79px, rgba(226,1,45,0.025) 80px),
    radial-gradient(ellipse 60% 50% at 90% 90%, rgba(226,1,45,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 10% 10%, rgba(226,1,45,0.04) 0%, transparent 50%);
}

/* ── Page frame ── */
.frame {
  position: fixed; inset: 4px; pointer-events: none; z-index: 10;
  border: 1px solid rgba(226,1,45,0.12);
  box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 5px rgba(226,1,45,0.06);
}
.frame::before, .frame::after {
  content:''; position: absolute; width: 16px; height: 16px;
  border-color: var(--t1-red); border-style: solid; opacity: 0.5;
}
.frame::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.frame::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* ── Top bar: 10vh ── */
.top-bar {
  height: 10vh; min-height: 70px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 5;
}
.top-bar .brand {
  display: flex; align-items: center; gap: 14px;
}
.top-bar .brand img {
  height: 8vh; max-height: 64px; width: auto;
}
.top-bar .brand h1 {
  font-size: 1.3rem; font-weight: 800; letter-spacing: 0.1em;
  color: var(--text);
}
.top-bar .update-time {
  font-size: 0.62rem; color: #fff; letter-spacing: 0.06em;
  font-family: "SF Mono","Cascadia Code","Consolas",monospace;
}

/* ── 2×3 Grid ── */
.grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 8px;
  min-height: 0;
}

/* ── Metric Card ── */
.card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 2px;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.card-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 6px;
  background: rgba(255,255,255,0.015);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.card-hd .icon { font-size: 1rem; }
.card-hd .label {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em;
  color: #fff;
}

.card-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.card-body::-webkit-scrollbar { width: 4px; }
.card-body::-webkit-scrollbar-track { background: transparent; }
.card-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* ── Rank Row ── */
.rr {
  display: flex; align-items: center; padding: 0 14px; gap: 10px;
  height: 38px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.015);
  transition: background 0.12s;
}
.rr:hover { background: rgba(255,255,255,0.015); }
.rr.t1 { background: rgba(230,180,34,0.06); }
.rr.t2 { background: rgba(160,168,176,0.035); }
.rr.t3 { background: rgba(176,136,96,0.035); }

.rr .rk {
  width: 24px; flex-shrink: 0; text-align: center;
  font-family: "SF Mono","Cascadia Code","Consolas",monospace;
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-faint);
}
.rr .rk.g { color: var(--gold); font-weight: 900; font-size: 0.85rem; }
.rr .rk.s { color: var(--silver); font-weight: 800; font-size: 0.78rem; }
.rr .rk.b { color: var(--bronze); font-weight: 800; font-size: 0.74rem; }

.rr .av {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
}
.rr .nm {
  width: 72px; flex-shrink: 0;
  font-size: 0.72rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.rr .bar-wrap {
  flex: 1; align-self: stretch; margin: 5px 0;
  background: var(--bar-bg); border-radius: 2px;
  position: relative; overflow: hidden;
}
.rr .bar {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  background: linear-gradient(90deg, rgba(226,1,45,0.3), rgba(226,1,45,0.1));
}
.rr.t1 .bar { background: linear-gradient(90deg, rgba(230,180,34,0.5), rgba(230,180,34,0.14)); }
.rr.t2 .bar { background: linear-gradient(90deg, rgba(160,168,176,0.36), rgba(160,168,176,0.1)); }
.rr.t3 .bar { background: linear-gradient(90deg, rgba(176,136,96,0.36), rgba(176,136,96,0.1)); }

.rr .val {
  width: 56px; flex-shrink: 0; text-align: right;
  font-family: "SF Mono","Cascadia Code","Consolas",monospace;
  font-size: 0.68rem; font-weight: 600;
  color: var(--text-dim);
}
.rr.t1 .val { color: var(--gold); }
.rr.t2 .val { color: var(--silver); }
.rr.t3 .val { color: var(--bronze); }
