/* ============ 设计 tokens ============ */
:root {
  --bg0: #070b16;
  --bg1: #0b1122;
  --card: rgba(255, 255, 255, .045);
  --card-hover: rgba(255, 255, 255, .07);
  --border: rgba(255, 255, 255, .09);
  --border-hi: rgba(34, 211, 238, .45);
  --accent: #22d3ee;
  --accent2: #a78bfa;
  --warn: #fbbf24;
  --ok: #34d399;
  --bad: #f87171;
  --ink: #e8eefc;
  --muted: #8b96ad;
  --input-bg: rgba(0, 0, 0, .25);
  --grid-line: rgba(255, 255, 255, .025);
  --stat-bg: rgba(0, 0, 0, .22);
  --row-hover: rgba(255, 255, 255, .04);
  --row-line: rgba(255, 255, 255, .05);
  --topbar-bg: rgba(7, 11, 22, .78);
  --btn-ink: #06121a;
  --radius: 14px;
  --t-fast: 180ms;
  --t-med: 320ms;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="light"] {
  --bg0: #eef2f9;
  --bg1: #f7f9fd;
  --card: rgba(255, 255, 255, .78);
  --card-hover: rgba(255, 255, 255, .95);
  --border: rgba(15, 23, 42, .12);
  --border-hi: rgba(8, 145, 178, .55);
  --accent: #0891b2;
  --accent2: #7c3aed;
  --warn: #b45309;
  --ok: #059669;
  --bad: #dc2626;
  --ink: #172033;
  --muted: #5b6b85;
  --input-bg: rgba(255, 255, 255, .9);
  --grid-line: rgba(15, 23, 42, .045);
  --stat-bg: rgba(15, 23, 42, .035);
  --row-hover: rgba(15, 23, 42, .04);
  --row-line: rgba(15, 23, 42, .07);
  --topbar-bg: rgba(247, 249, 253, .85);
  --btn-ink: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "MiSans", "HarmonyOS Sans SC", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(167, 139, 250, .10), transparent 60%),
    radial-gradient(800px 480px at -10% 110%, rgba(34, 211, 238, .09), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}

/* ============ 通用 ============ */
.wrap { max-width: 980px; margin: 0 auto; padding: 20px 18px 60px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  transition: border-color var(--t-med) var(--ease), background var(--t-med) var(--ease);
}
.card:hover { border-color: rgba(255,255,255,.16); background: var(--card-hover); }

.card-title { font-weight: 700; font-size: 15px; margin-bottom: 12px; letter-spacing: .5px; }
.card-sub { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }

.input {
  background: var(--input-bg); border: 1px solid var(--border); color: var(--ink);
  border-radius: 10px; padding: 10px 14px; font-size: 14px; outline: none; font-family: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus { border-color: var(--border-hi); box-shadow: 0 0 0 3px rgba(34,211,238,.12); }

.btn-primary {
  position: relative; overflow: hidden; cursor: pointer;
  border: none; border-radius: 10px; padding: 10px 22px;
  color: var(--btn-ink); font-size: 14px; font-weight: 800; font-family: inherit; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 22px rgba(34, 211, 238, .25);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(34,211,238,.35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: wait; }

.btn-ghost {
  cursor: pointer; background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 10px; padding: 9px 16px; font-size: 13px; font-family: inherit;
  transition: all var(--t-fast);
}
.btn-ghost:hover { border-color: var(--border-hi); color: var(--ink); }

.icon-btn {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 15px;
  transition: all var(--t-fast);
}
.icon-btn:hover { color: var(--bad); border-color: rgba(248,113,113,.4); }

.hint { color: var(--muted); font-size: 12px; margin-top: 10px; }
.meta-line { color: var(--muted); font-size: 11px; text-align: right; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 900; font-size: 16px; letter-spacing: 1px; }
.brand-tag { color: var(--accent); font-size: 12px; font-weight: 700; margin-left: 4px; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  background: transparent; border: none; cursor: pointer; font-family: inherit;
  color: var(--muted); font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 9px;
  transition: all var(--t-fast);
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); background: rgba(34, 211, 238, .10); }

.pool-chips { display: flex; gap: 6px; }
.chip { font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.chip b { color: var(--ink); }
.chip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--muted); }
.chip .dot.g { background: var(--ok); animation: dotPulse 2s infinite; }
.chip .dot.o { background: var(--warn); }
.chip .dot.r { background: var(--bad); }

/* ============ 面板切换 ============ */
.panel { display: none; }
.panel.on { display: block; animation: fadeIn var(--t-med) var(--ease); }

/* ============ 搜索行 ============ */
.search-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tag-input { flex: 1; min-width: 240px; font-size: 15px; }
.season-select { width: 120px; }
.check-label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.check-label input { accent-color: var(--accent); }
.num-input { width: 80px; }

/* ============ 登录 ============ */
.login-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 8, 16, .92); backdrop-filter: blur(20px);
  transition: opacity var(--t-med) var(--ease);
}
.login-overlay.off { opacity: 0; pointer-events: none; }
.login-card {
  width: min(380px, 92vw); text-align: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 40px 34px; backdrop-filter: blur(16px);
  animation: popIn .45s var(--ease);
}
.login-logo { font-size: 42px; margin-bottom: 10px; }
.login-card h1 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.login-sub { color: var(--muted); font-size: 12px; margin-bottom: 26px; }
.login-card input {
  width: 100%; margin-bottom: 14px; text-align: center; letter-spacing: 2px;
  background: var(--input-bg); border: 1px solid var(--border); color: var(--ink);
  border-radius: 10px; padding: 12px; font-size: 15px; outline: none; font-family: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.login-card input:focus { border-color: var(--border-hi); box-shadow: 0 0 0 3px rgba(34,211,238,.12); }
.login-card .btn-primary { width: 100%; }
.login-err { color: var(--bad); font-size: 12px; margin-top: 12px; }
.login-link { display: inline-block; margin-top: 12px; color: var(--muted); font-size: 12px; text-decoration: none; transition: color var(--t-fast); }
.login-link:hover { color: var(--accent); }
.reset-tip { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.code-row { display: flex; gap: 8px; margin-bottom: 14px; }
.code-row input { flex: 1; margin-bottom: 0; text-align: center; letter-spacing: 4px; }
.btn-code { white-space: nowrap; font-size: 13px; padding: 0 14px; }
.btn-code:disabled { opacity: .55; cursor: not-allowed; }

/* ============ 邮箱设置弹窗 ============ */
.email-card { width: min(420px, 94vw); }
.email-row { display: flex; gap: 8px; margin-bottom: 12px; }
.email-row .input { flex: 1; min-width: 0; }
.email-row input[textmode], .email-row .input[inputmode] { letter-spacing: 4px; text-align: center; }
.email-card .btn-primary { width: 100%; margin-top: 4px; }
.email-card .hint { margin-bottom: 12px; }

/* ============ 名片 ============ */
.profile-card { display: flex; align-items: center; gap: 18px; }
.avatar {
  width: 64px; height: 64px; border-radius: 14px;
  border: 1px solid var(--border-hi); object-fit: cover;
  box-shadow: 0 0 24px rgba(34,211,238,.18);
}
.p-name { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.p-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.p-meta span { color: var(--ink); font-weight: 600; }
.p-bnet { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ============ 行为数据 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat {
  background: var(--stat-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 12px; text-align: center; transition: border-color var(--t-fast), transform var(--t-fast) var(--ease);
}
.stat:hover { transform: translateY(-2px); border-color: var(--border-hi); }
.stat-icon { font-size: 20px; margin-bottom: 6px; }
.stat-num { font-size: 34px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat-pill {
  display: inline-block; margin-top: 8px; padding: 5px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 800;
}
.stat-pill.lv-good { color: var(--ok); background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.35); }
.stat-pill.lv-mid { color: var(--warn); background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.35); }
.stat-pill.lv-bad { color: var(--bad); background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.4); animation: pillPulse 2s infinite; }
.stat-pill.lv-none { color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--border); }
.empty-note { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* ============ 段位表 ============ */
.rank-row {
  display: grid; grid-template-columns: 90px minmax(0,1fr) minmax(120px,150px) 70px 76px;
  align-items: center; gap: 10px;
  padding: 10px 8px; border-radius: 10px;
  border-bottom: 1px solid var(--row-line);
  transition: background var(--t-fast);
}
.rank-row:hover { background: var(--row-hover); }
.rank-row .role { color: var(--muted); font-size: 13px; font-weight: 700; }
.tier-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 800;
  background: rgba(255,255,255,.05); color: var(--muted); border: 1px solid var(--border);
}
.tier-badge.gm      { color: #ff9d5c; border-color: rgba(255,138,76,.5); background: rgba(255,138,76,.1); text-shadow: 0 0 18px rgba(255,138,76,.55); }
.tier-badge.master  { color: #d8b4fe; border-color: rgba(192,132,252,.5); background: rgba(192,132,252,.1); text-shadow: 0 0 18px rgba(192,132,252,.5); }
.tier-badge.dia     { color: #7dd3fc; border-color: rgba(56,189,248,.45); background: rgba(56,189,248,.09); text-shadow: 0 0 14px rgba(56,189,248,.4); }
.tier-badge.gold    { color: #fde047; border-color: rgba(253,224,71,.4); background: rgba(253,224,71,.08); text-shadow: 0 0 14px rgba(253,224,71,.35); }
.tier-badge.low     { color: #e2e8f0; border-color: rgba(148,163,184,.35); background: rgba(148,163,184,.08); }
.rank-icon { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255,255,255,.25)); }
.rank-score { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.rank-meta { color: var(--muted); font-size: 12px; text-align: center; }

/* ============ 休闲角斗 ============ */
.fight-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kv { background: var(--stat-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.kv span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.kv b { font-size: 18px; font-variant-numeric: tabular-nums; }

/* ============ 对局时间线 ============ */
.match-line { display: flex; gap: 8px; flex-wrap: wrap; }
.m-dot {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 52px; padding: 8px 6px; border-radius: 10px;
  background: var(--stat-bg); border: 1px solid var(--border); font-size: 11px; color: var(--muted);
}
.m-dot .res { font-size: 12px; font-weight: 900; }
.m-dot.w .res { color: var(--ok); }
.m-dot.l .res { color: var(--bad); }

/* ============ 骨架屏 ============ */
.skel {
  border-radius: 10px; min-height: 16px;
  background: linear-gradient(100deg, rgba(255,255,255,.05) 40%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.05) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}
.skel-avatar { width: 64px; height: 64px; border-radius: 14px; }
.skel-lines { display: flex; flex-direction: column; gap: 10px; }
.w60 { width: 60%; } .w40 { width: 40%; } .w80 { width: 80%; height: 48px; margin-top: 12px; border-radius: 12px; } .w50 { width: 50%; height: 48px; border-radius: 12px; }
.skel-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.skel-lines { flex: 1; }
.skel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; }
.skel-stat { height: 84px; border-radius: 12px; }

/* ============ 巡检 ============ */
.progress {
  position: relative; height: 26px; border-radius: 999px; overflow: hidden;
  background: var(--input-bg); border: 1px solid var(--border); margin-top: 12px;
}
.progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent));
  background-size: 200% 100%;
  animation: sweep 1.5s infinite linear;
  transition: width var(--t-med) var(--ease);
}
.progress-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums;
}
.table-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtable th { color: var(--muted); font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.dtable td { padding: 9px 10px; border-bottom: 1px solid var(--row-line); font-variant-numeric: tabular-nums; }
.dtable tr { transition: background var(--t-fast); }
.dtable tbody tr:hover { background: var(--row-hover); }
.dtable tr.warn-row { background: rgba(248,113,113,.07); }
.dtable tr.warn-row:hover { background: rgba(248,113,113,.12); }
.cnt-bad { color: var(--bad); font-weight: 800; }
.cnt-ok { color: var(--ink); }
.tag-empty { color: var(--muted); }

/* ============ Toast ============ */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  padding: 12px 18px; border-radius: 12px; font-size: 13px;
  background: rgba(15, 23, 42, .95); border: 1px solid var(--border-hi); color: var(--ink);
  box-shadow: 0 14px 40px rgba(0,0,0,.4);
  animation: popIn .3s var(--ease);
}

/* ============ 动画 ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes sweep { from { background-position: 0 0; } to { background-position: 200% 0; } }
@keyframes dotPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,.4); } 50% { box-shadow: 0 0 0 5px rgba(52,211,153,0); } }
@keyframes pillPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(248,113,113,.35); } 50% { box-shadow: 0 0 0 6px rgba(248,113,113,0); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.anim { animation: riseIn .45s var(--ease) both; }
.anim:nth-of-type(2) { animation-delay: 60ms; }
.anim:nth-of-type(3) { animation-delay: 120ms; }
.anim:nth-of-type(4) { animation-delay: 180ms; }
.anim:nth-of-type(5) { animation-delay: 240ms; }

/* ============ 响应式 / 降级 ============ */
@media (max-width: 760px) {
  .stat-grid, .fight-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .pool-chips { order: 3; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ 对局模块 ============ */
.mode-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.mode-tab {
  background: transparent; border: 1px solid var(--border); cursor: pointer; font-family: inherit;
  color: var(--muted); font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 9px;
  transition: all var(--t-fast);
}
.mode-tab:hover { color: var(--ink); border-color: var(--border-hi); }
.mode-tab.on {
  color: var(--accent); border-color: var(--border-hi);
  background: rgba(34, 211, 238, .10);
}
html[data-theme="light"] .mode-tab.on { color: var(--accent); background: rgba(8, 145, 178, .08); }
.btn-detail { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.match-row td { font-size: 13px; }


/* hidden 属性被 display:flex 覆盖的问题修复 */
.modal-overlay[hidden] { display: none; }

/* ============ 单局详情弹窗 ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 7, 14, .7); backdrop-filter: blur(8px);
  animation: fadeIn var(--t-fast) var(--ease);
}
.modal-card {
  width: min(860px, 94vw); max-height: 86vh; overflow-y: auto;
  background: var(--bg1); border: 1px solid var(--border-hi); border-radius: 16px;
  padding: 20px 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  animation: popIn .3s var(--ease);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 800; margin-bottom: 10px;
}
.modal-meta { color: var(--muted); font-size: 12px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }

/* ============ 双队伍记分板 ============ */
.team-title {
  font-size: 13px; font-weight: 800; letter-spacing: 1px;
  padding: 6px 10px; margin: 12px 0 6px; border-radius: 8px;
}
.team-title.mine {
  color: #7dd3fc; background: rgba(56, 189, 248, .08);
  border-left: 3px solid #38bdf8;
}
.team-title.enemy {
  color: #fca5a5; background: rgba(248, 113, 113, .08);
  border-left: 3px solid var(--bad);
}
.enemy-table tbody tr td:first-child { border-left: 2px solid transparent; }
.enemy-table tbody tr { border-left: 2px solid rgba(248,113,113,.25); }
.party-mark { font-size: 12px; }

/* ============ 对局详情：头像 / 天赋图标 / 组队标记 ============ */
.hero-mini {
  width: 28px; height: 28px; border-radius: 6px; vertical-align: middle;
  margin-right: 6px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, .25);
}
.hero-name { color: var(--muted); font-size: 11px; margin-left: 4px; }
.build-line {
  display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; align-items: center;
}
.mod-icon {
  width: 32px; height: 32px; border-radius: 7px; object-fit: cover;
  cursor: pointer; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, .3);
}
.party-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-left: 4px; vertical-align: middle; cursor: help;
  box-shadow: 0 0 4px currentColor;
}
#scoreBody td:first-child, #scoreBodyEnemy td:first-child { min-width: 180px; }

/* ============ 搜索历史 ============ */
.search-history {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center;
}
.hist-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 5px; border-radius: 999px;
  background: var(--card-2, rgba(148,163,184,.1));
  border: 1px solid rgba(148,163,184,.2);
  color: var(--fg); font-size: 12px; cursor: pointer;
  transition: all .15s ease;
}
.hist-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.hist-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

/* ============ 详情内可点击玩家 ============ */
.player-link { cursor: pointer; color: var(--accent); text-decoration: underline dotted; transition: opacity .15s; }
.player-link:hover { opacity: .75; }
img.player-link { display: inline-block; text-decoration: none; }

/* ============ 对局子模式标签 ============ */
.gm-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; vertical-align: middle;
  color: var(--muted); background: rgba(148,163,184,.12); border: 1px solid rgba(148,163,184,.25);
}

/* ============ 浅色模式段位徽章：深色文字保证可读 ============ */
html[data-theme="light"] .tier-badge { text-shadow: none; }
html[data-theme="light"] .tier-badge.gm      { color: #9a3412; border-color: rgba(234,88,12,.4); background: rgba(251,146,60,.15); }
html[data-theme="light"] .tier-badge.master  { color: #6d28d9; border-color: rgba(139,92,246,.4); background: rgba(167,139,250,.16); }
html[data-theme="light"] .tier-badge.dia     { color: #0e7490; border-color: rgba(6,182,212,.4); background: rgba(34,211,238,.13); }
html[data-theme="light"] .tier-badge.gold    { color: #a16207; border-color: rgba(202,138,4,.4); background: rgba(253,224,71,.2); }
html[data-theme="light"] .tier-badge.low     { color: #475569; border-color: rgba(100,116,139,.3); background: rgba(148,163,184,.12); }

/* ============ 翡翠段位徽章 ============ */
.tier-badge.emerald {
  color: #34d399; border-color: rgba(52,211,153,.5); background: rgba(52,211,153,.1);
  text-shadow: 0 0 14px rgba(52,211,153,.4);
}
html[data-theme="light"] .tier-badge.emerald {
  color: #047857; border-color: rgba(16,185,129,.4); background: rgba(110,231,183,.2);
  text-shadow: none;
}
.rank-icon { color: var(--muted); }

/* ============ 赞赏等级图标 ============ */
.appr-icon { width: 30px; height: 30px; vertical-align: -10px; margin-right: 4px; object-fit: contain; }
#apprLevel { font-weight: 800; }

/* ============ 对局胜负徽章 ============ */
.res-pill {
  display: inline-block; min-width: 38px; padding: 4px 0; border-radius: 9px;
  text-align: center; font-weight: 900; font-size: 12.5px; letter-spacing: 2px;
  color: #fff;
}
.res-pill.w { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 2px 10px rgba(16,185,128,.4); }
.res-pill.l { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 2px 10px rgba(220,38,38,.35); }

/* ============ 段位分数进度条 ============ */
.score-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.score-bar {
  flex: 1; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--stat-bg); border: 1px solid var(--border);
}
.score-fill { height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.22,1,.36,1); }
.score-fill.gm      { background: linear-gradient(90deg, rgba(255,138,76,.5), #ff9d5c); }
.score-fill.master  { background: linear-gradient(90deg, rgba(167,139,250,.5), #c084fc); }
.score-fill.emerald { background: linear-gradient(90deg, rgba(52,211,153,.5), #34d399); }
.score-fill.dia     { background: linear-gradient(90deg, rgba(34,211,238,.5), #38bdf8); }
.score-fill.gold    { background: linear-gradient(90deg, rgba(253,224,71,.5), #fde047); }
.score-fill.low     { background: rgba(148,163,184,.45); }

/* ============ 个人称号 ============ */
.p-title {
  display: flex; align-items: center; gap: 5px; margin-top: 3px;
  font-size: 12.5px; font-weight: 700; color: var(--accent);
}
.title-icon { width: 18px; height: 18px; object-fit: contain; }

/* ============ 名片右侧（排行榜按钮 + 战网ID） ============ */
.p-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.btn-billboard { font-size: 12.5px; padding: 5px 12px; }
.bb-rank { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ============ 玩家地区 ============ */
.p-region { font-size: 12.5px; font-weight: 700; color: var(--muted); }

/* ============ KDA 合并列 ============ */
.kda { white-space: nowrap; font-variant-numeric: tabular-nums; }
.kda .k { color: var(--ink); font-size: 15px; }
.kda .d { color: var(--bad); font-size: 14px; }
.kda .a { color: #7dd3fc; font-size: 13.5px; }
.kda .sep { color: var(--muted); opacity: .5; margin: 0 4px; font-style: normal; }

/* ============ 彩色数字 ============ */
.stat-num { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.stat-num.dmg    { color: #fbbf24; }
.stat-num.heal   { color: #4ade80; }
.stat-num.taken  { color: #f87171; }
.stat-num.healed { color: #22d3ee; }
.stat-num.gold   { color: #e2e8f0; }
html[data-theme="light"] .stat-num.dmg    { color: #b45309; }
html[data-theme="light"] .stat-num.heal   { color: #15803d; }
html[data-theme="light"] .stat-num.taken  { color: #b91c1c; }
html[data-theme="light"] .stat-num.healed { color: #0e7490; }
html[data-theme="light"] .stat-num.gold   { color: #334155; }
html[data-theme="light"] .kda .k { color: var(--ink); }
html[data-theme="light"] .kda .d { color: #b91c1c; }
html[data-theme="light"] .kda .a { color: #0369a1; }

/* ============ 天赋/异能详情气泡 ============ */
#buildPop {
  position: fixed; z-index: 2000; width: 300px;
  background: rgba(15, 23, 42, .97); color: #e2e8f0;
  border: 1px solid rgba(148,163,184,.3); border-radius: 12px;
  padding: 12px 14px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: bpIn .16s ease-out;
}
@keyframes bpIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bp-icon { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.bp-name { font-weight: 800; font-size: 14px; }
.bp-type {
  display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; color: #7dd3fc;
  background: rgba(56,189,248,.12); border: 1px solid rgba(56,189,248,.3);
}
.bp-desc { font-size: 12.5px; line-height: 1.65; color: #cbd5e1; }
html[data-theme="light"] #buildPop {
  background: #ffffff; color: #1e293b; border-color: rgba(100,116,139,.35);
  box-shadow: 0 12px 40px rgba(15,23,42,.18);
}
html[data-theme="light"] .bp-desc { color: #475569; }
html[data-theme="light"] .bp-type { color: #0369a1; background: rgba(14,165,233,.1); border-color: rgba(14,165,233,.3); }

/* ============ 对局地图 ============ */
.map-cell { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.map-img { width: 40px; height: 22px; border-radius: 4px; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(148,163,184,.2); }
.map-cell span { font-size: 11.5px; color: var(--muted); }
.hero-cell { display: flex; align-items: center; gap: 7px; }
.hero-img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(148,163,184,.25); }
.hero-cell span { font-size: 12.5px; }
.dim { color: var(--muted); opacity: .5; }

/* ============ 浅色模式：白底威能图标加深色衬底 ============ */
html[data-theme="light"] .mod-icon {
  background: #334155;
  box-shadow: 0 0 0 1px rgba(51,65,85,.4);
}

/* ============ 出装分组（异能/威能/天赋 分隔） ============ */
.build-group { display: inline-flex; align-items: center; gap: 3px; margin-right: 10px; }
.build-label {
  font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted);
  opacity: .85; margin-right: 3px; letter-spacing: 1px;
}
html[data-theme="light"] .build-label { color: #64748b; opacity: 1; }

/* ============ 浅色模式：气泡内白底图标加深色衬底 ============ */
html[data-theme="light"] .bp-icon {
  background: #334155;
  box-shadow: 0 0 0 1px rgba(51,65,85,.4);
}
