/* ============================================================
   Tarkov Leaderboard — 样式
   深色军工风，金色点缀
   ============================================================ */

:root {
  --bg: #0a0c0f;
  --bg-soft: #0e1116;
  --panel: #12161d;
  --panel-2: #161c26;
  --panel-3: #1b222d;
  --line: #232b37;
  --line-soft: #1a212b;
  --text: #e7ebf3;
  --muted: #8b96a8;
  --muted-2: #66707f;
  --gold: #c8a45c;
  --gold-2: #e9cf94;
  --gold-dim: rgba(200, 164, 92, 0.14);
  --bear: #d06161;
  --usec: #5493d6;
  --win: #6fbf8f;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --num: ui-monospace, "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }

html { scrollbar-color: #2a3341 #0b0e12; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 560px at 12% -12%, rgba(200, 164, 92, 0.09), transparent 62%),
    radial-gradient(900px 480px at 92% -6%, rgba(84, 147, 214, 0.07), transparent 58%),
    var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
}

a { color: var(--gold-2); }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: 0.01em; }

.muted { color: var(--muted); }
.note { color: var(--muted-2); font-size: 12px; margin: 14px 0 0; }

code {
  font-family: var(--num);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(10, 12, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(150deg, rgba(200, 164, 92, 0.22), rgba(200, 164, 92, 0.05));
  border: 1px solid rgba(200, 164, 92, 0.4);
  color: var(--gold-2);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  box-shadow: inset 0 0 18px rgba(200, 164, 92, 0.12);
}

.brand-text h1 { font-size: 17px; line-height: 1.2; }
.brand-text p { margin: 2px 0 0; font-size: 11px; color: var(--muted-2); letter-spacing: 0.08em; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 9px;
  cursor: pointer;
  transition: 0.18s ease;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  color: #14161a;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 4px 14px rgba(200, 164, 92, 0.28);
}

.live {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--win);
  box-shadow: 0 0 0 0 rgba(111, 191, 143, 0.55);
  animation: pulse 2.4s infinite;
}
.live.is-stale .live-dot { background: var(--gold); animation: none; }
.live.is-error .live-dot { background: var(--bear); animation: none; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 191, 143, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(111, 191, 143, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 191, 143, 0); }
}

/* ---------------- 布局 ---------------- */
.wrap {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 44px) 40px;
}

.view { display: none; animation: fade 0.35s ease; }
.view.is-active { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- KPI ---------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 14px 16px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.kpi::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 164, 92, 0.14), transparent 68%);
}
.kpi-label { display: block; font-size: 11px; letter-spacing: 0.14em; color: var(--muted-2); }
.kpi-value {
  display: block;
  margin-top: 6px;
  font-family: var(--num);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; }

/* ---------------- 榜单标题 ---------------- */
.board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.board-head > div { min-width: 0; }
.board-head h2 { font-size: 24px; }
.board-head h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 20px;
  margin-right: 10px;
  vertical-align: -2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-2), rgba(200, 164, 92, 0.15));
}
.board-head p { margin: 6px 0 0; font-size: 12.5px; }
.board-head-right { display: flex; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--gold-2);
  background: var(--gold-dim);
  border: 1px solid rgba(200, 164, 92, 0.32);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------------- 指标 chips ---------------- */
.chips {
  display: grid;
  gap: 8px;
  padding: 14px;
  margin-bottom: 18px;
  background: rgba(18, 22, 29, 0.65);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.chip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-group {
  flex: 0 0 46px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--muted-2);
}

.chip {
  appearance: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.16s ease;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: #334054; transform: translateY(-1px); }
.chip.is-active {
  color: #15181d;
  font-weight: 650;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(200, 164, 92, 0.25);
}
.chip .chip-unit { opacity: 0.55; margin-left: 5px; font-size: 11px; }

/* ---------------- 具体枪械选择 ---------------- */
.gun-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin: -6px 0 18px;
  background: rgba(18, 22, 29, 0.65);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.gun-bar.is-active { border-color: rgba(200, 164, 92, 0.4); background: rgba(200, 164, 92, 0.05); }
.gun-bar label { font-size: 11px; letter-spacing: 0.14em; color: var(--muted-2); white-space: nowrap; }
.gun-bar select {
  min-width: 220px;
  height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.gun-bar select:focus { border-color: rgba(200, 164, 92, 0.6); }
.gun-hint { font-size: 11.5px; color: var(--muted-2); margin-left: auto; }

/* ---------------- 前三名 ---------------- */
.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 18px;
  align-items: end;
}

.podium-card {
  position: relative;
  padding: 18px 16px 16px;
  border-radius: var(--radius);
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-soft);
  cursor: pointer;
  transition: 0.2s ease;
  overflow: hidden;
}
.podium-card:hover { transform: translateY(-3px); border-color: rgba(200, 164, 92, 0.42); box-shadow: var(--shadow); }
.podium-card.first {
  order: 2;
  padding-top: 24px;
  border-color: rgba(200, 164, 92, 0.5);
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(200, 164, 92, 0.18), transparent 62%),
    linear-gradient(170deg, #1a1f28, #12161d);
  box-shadow: 0 14px 34px rgba(200, 164, 92, 0.1);
}
.podium-card.second { order: 1; }
.podium-card.third { order: 3; }

.podium-rank {
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--num);
  font-size: 30px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.07);
  line-height: 1;
}
.podium-card.first .podium-rank { color: rgba(200, 164, 92, 0.25); }

.podium-top { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 17px;
  color: #0f1216;
  background: linear-gradient(160deg, #9aa7b8, #6d7787);
  text-transform: uppercase;
}
.podium-card.first .avatar { background: linear-gradient(160deg, var(--gold-2), #b68b3e); }

.avatar.av-usec { background: linear-gradient(160deg, #8fbfe9, #40709e); color: #070d13; }
.avatar.av-bear { background: linear-gradient(160deg, #e69797, #9b4b4b); color: #140a0a; }

.podium-card:focus-visible,
tbody tr:focus-visible {
  outline: 2px solid rgba(200, 164, 92, 0.65);
  outline-offset: -2px;
}

.podium-name {
  font-weight: 650;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.podium-sub { font-size: 11px; color: var(--muted-2); margin-top: 3px; }

.podium-value {
  font-family: var(--num);
  font-size: 25px;
  font-weight: 700;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.podium-value small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.podium-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted-2);
  font-size: 12.5px;
}

/* ---------------- 工具栏 ---------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 36px;
  min-width: 220px;
  flex: 0 1 280px;
  color: var(--muted-2);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: 0.16s ease;
}
.search:focus-within { border-color: rgba(200, 164, 92, 0.55); color: var(--gold); }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.search input::-webkit-search-cancel-button { filter: invert(0.6); }

.seg {
  display: flex;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  padding: 6px 13px;
  border-radius: 7px;
  cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px rgba(200, 164, 92, 0.25); }

.row-count { font-size: 12px; color: var(--muted-2); margin-left: auto; }

.btn-ghost, .btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.16s ease;
}
.btn-ghost { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--text); border-color: #334054; }
.btn-gold {
  color: #15181d;
  font-weight: 650;
  border: 0;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 6px 18px rgba(200, 164, 92, 0.22);
}
.btn-gold:hover { filter: brightness(1.06); }
.btn-ghost.is-loading svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 表格 ---------------- */
.table-wrap {
  position: relative;
  max-height: 68vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

table { width: 100%; border-collapse: separate; border-spacing: 0; }

thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #0f131a;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: right;
  padding: 11px 14px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  user-select: none;
  cursor: pointer;
  transition: color 0.15s ease;
}
thead th:hover { color: var(--gold-2); }
thead th.col-rank, thead th.col-player { text-align: left; cursor: default; }
thead th.col-player:hover { color: var(--muted-2); }
thead th.is-sorted { color: var(--gold-2); }
thead th .sort-arrow { font-size: 9px; opacity: 0.85; margin-left: 3px; }

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
tbody tr { cursor: pointer; transition: background 0.12s ease; }
tbody tr:hover { background: rgba(200, 164, 92, 0.05); }
tbody tr:last-child td { border-bottom: 0; }
tbody td.col-rank, tbody td.col-player { text-align: left; }

.rank-badge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 8px;
  font-family: var(--num);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}
.rank-badge.r1 { color: #211a0a; background: linear-gradient(180deg, var(--gold-2), #b98f43); }
.rank-badge.r2 { color: #171b21; background: linear-gradient(180deg, #d9e0ea, #9aa6b6); }
.rank-badge.r3 { color: #201410; background: linear-gradient(180deg, #d9a179, #a86b43); }

.player-cell { display: flex; align-items: center; gap: 10px; }
.player-cell .avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.player-meta { min-width: 0; }
.player-name { font-weight: 600; font-size: 13.5px; }
.player-sub { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted-2); margin-top: 1px; }

.side-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.side-badge.usec { color: var(--usec); background: rgba(84, 147, 214, 0.12); border: 1px solid rgba(84, 147, 214, 0.3); }
.side-badge.bear { color: var(--bear); background: rgba(208, 97, 97, 0.12); border: 1px solid rgba(208, 97, 97, 0.3); }
.side-badge.scav { color: var(--muted); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }

.primary-col { color: var(--gold-2); font-weight: 650; }
.table-num-dim { color: var(--muted); }
.table-unit { color: var(--muted-2); font-size: 10.5px; margin-left: 3px; }

.empty { padding: 40px; text-align: center; color: var(--muted-2); font-size: 13px; }

/* ---------------- 对比 ---------------- */
.cmp-pickers {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: end;
  margin: 18px 0 14px;
}
.picker label { display: block; font-size: 11px; letter-spacing: 0.14em; color: var(--muted-2); margin-bottom: 6px; }
.picker select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.picker select:focus { border-color: rgba(200, 164, 92, 0.6); }
.vs-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: -1px;
  border-radius: 50%;
  font-family: var(--num);
  font-weight: 800;
  font-size: 13px;
  color: var(--gold-2);
  background: var(--gold-dim);
  border: 1px solid rgba(200, 164, 92, 0.4);
}

.cmp-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.cmp-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.cmp-card .avatar { width: 46px; height: 46px; border-radius: 13px; }
.cmp-card .cmp-name { font-size: 16px; font-weight: 650; }
.cmp-card .cmp-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }
.cmp-card .cmp-score-badge {
  margin-left: auto;
  text-align: right;
  font-family: var(--num);
  color: var(--gold-2);
  font-size: 20px;
  font-weight: 700;
}
.cmp-card .cmp-score-badge small { display: block; font-family: inherit; font-size: 10px; color: var(--muted-2); font-weight: 500; letter-spacing: 0.1em; }

.cmp-score {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 0 14px;
}
.cmp-score b { color: var(--gold-2); font-family: var(--num); font-size: 15px; }

.cmp-rows {
  display: grid;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.cmp-row {
  display: grid;
  grid-template-columns: 1fr 150px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.cmp-row:last-child { border-bottom: 0; }
.cmp-row:nth-child(even) { background: rgba(255, 255, 255, 0.014); }
.cmp-side { min-width: 0; }
.cmp-val {
  font-family: var(--num);
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cmp-side.left .cmp-val { text-align: right; }
.cmp-side.right .cmp-val { text-align: left; }
.cmp-bar { height: 3px; margin-top: 5px; border-radius: 2px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.cmp-bar span { display: block; height: 100%; width: 0; border-radius: 2px; background: #4a5668; }
.cmp-side.left .cmp-bar span { margin-left: auto; }
.cmp-side.left .cmp-bar { direction: rtl; }
.cmp-row .cmp-label { text-align: center; font-size: 12px; color: var(--muted-2); letter-spacing: 0.04em; }

.cmp-row.win-left .cmp-side.left .cmp-val, .cmp-row.win-right .cmp-side.right .cmp-val { color: var(--gold-2); font-weight: 650; }
.cmp-row.win-left .cmp-side.left .cmp-bar span { background: var(--gold); }
.cmp-row.win-right .cmp-side.right .cmp-bar span { background: var(--gold); }
.cmp-row.win-left .cmp-side.left .cmp-val::after,
.cmp-row.win-right .cmp-side.right .cmp-val::after { content: " ▲"; font-size: 9px; vertical-align: 1px; margin-left: 3px; }

.cmp-sub { margin-top: 22px; }
.cmp-sub-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.cmp-sub-title span { font-family: var(--num); font-size: 13px; color: var(--gold-2); letter-spacing: 0; }
.cmp-empty { padding: 26px; text-align: center; color: var(--muted-2); font-size: 12.5px; }

.cmp-card > div { min-width: 0; }
.cmp-card .cmp-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 详情弹窗 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 9, 0.72);
  backdrop-filter: blur(4px);
  animation: fade 0.2s ease;
}
.modal-card {
  position: relative;
  width: min(880px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 26px;
  background: linear-gradient(170deg, #161b23, #0f1319);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: pop 0.22s ease;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.modal-close:hover { color: var(--text); border-color: #3a4657; }

.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding-right: 40px; }
.modal-head .avatar { width: 54px; height: 54px; border-radius: 15px; font-size: 21px; }
.modal-head .mh-name { font-size: 21px; font-weight: 700; }
.modal-head .mh-sub { font-size: 12px; color: var(--muted-2); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}
.stat-tile {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.026);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}
.stat-tile .st-label { font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted-2); }
.stat-tile .st-value { margin-top: 4px; font-family: var(--num); font-size: 16px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-tile .st-value small { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 2px; }

.modal-weapons h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; letter-spacing: 0.06em; }
.modal-weapons h3 + h3, .modal-weapons .recent-list + h3 { margin-top: 20px; }
.h3-sub { margin-left: 6px; font-size: 11px; font-weight: 500; color: var(--muted-2); letter-spacing: 0.02em; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.recent-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  font-size: 12px;
}
.rk-weapon { font-weight: 600; color: var(--text); white-space: nowrap; }
.rk-meta { font-family: var(--num); font-size: 11.5px; color: var(--muted-2); text-align: right; }
.hint { margin: 10px 0 0; font-size: 11.5px; color: var(--muted-2); line-height: 1.6; }
.weapon-row { display: grid; grid-template-columns: 92px 1fr 56px; gap: 10px; align-items: center; margin-bottom: 7px; font-size: 12px; }
.weapon-row .wr-name { color: var(--muted); }
.weapon-row .wr-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.weapon-row .wr-bar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, rgba(200, 164, 92, 0.55), var(--gold)); }
.weapon-row .wr-num { text-align: right; font-family: var(--num); color: var(--gold-2); font-variant-numeric: tabular-nums; }

.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.modal-foot .muted { font-size: 11.5px; }

/* ---------------- 页脚 ---------------- */
.foot {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 44px) 36px;
  font-size: 11.5px;
  color: var(--muted-2);
}
.foot p { margin: 4px 0; }

.noscript {
  position: fixed;
  inset: auto 0 0 0;
  padding: 12px;
  text-align: center;
  background: #3a1d1d;
  color: #ffb4b4;
  z-index: 90;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 19px; }
}

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px; }
  .live { width: 100%; margin-left: 0; }
  .brand-text h1 { font-size: 15px; }
  .wrap { padding-top: 18px; }

  .podium { grid-template-columns: 1fr; }
  .podium-card.first { order: 0; }
  .podium-card.second { order: 1; }
  .podium-card.third { order: 2; }
  .podium-value { font-size: 22px; }

  .board-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .board-head-right { align-self: flex-start; }
  .board-head h2 { font-size: 20px; }

  .chips { padding: 12px; }
  .chip-group { flex-basis: 100%; }

  .cmp-pickers { grid-template-columns: 1fr; }
  .vs-badge { justify-self: center; }
  .cmp-cards { grid-template-columns: 1fr; }
  .cmp-row { grid-template-columns: 1fr 96px 1fr; padding: 9px 10px; gap: 8px; }
  .cmp-val { font-size: 12.5px; }
  .cmp-row .cmp-label { font-size: 11px; }

  .table-wrap { max-height: none; }
  thead th, tbody td { padding: 9px 10px; font-size: 12.5px; }
  .player-sub { display: none; }
  .modal-card { padding: 18px; }
  .modal-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
}

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