:root {
  --bg: #080a0e;
  --bg-2: #0d1117;
  --panel: #141a22;
  --panel-2: #1a222c;
  --line: #232c38;
  --line-2: #2e3947;
  --text: #e8edf4;
  --muted: #8291a3;
  --muted-2: #5b6878;
  --accent: #e9b74a;
  --accent-2: #ffd76e;
  --danger: #e2564a;
  --r5: #ffd700;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(78, 108, 168, .16), transparent 62%),
    radial-gradient(900px 500px at 92% 0%, rgba(233, 183, 74, .10), transparent 58%),
    var(--bg);
  color: var(--text);
  font: 14px/1.55 "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .45; }
img { display: block; max-width: 100%; -webkit-user-drag: none; user-select: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #29323f; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  height: 62px;
  padding-left: max(22px, env(safe-area-inset-left));
  padding-right: max(22px, env(safe-area-inset-right));
  background: rgba(10, 13, 18, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .06em; font-size: 15px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: linear-gradient(145deg, var(--accent-2), #b98a1e);
  display: grid; place-items: center; color: #1a1205; font-size: 13px; font-weight: 900;
}
.brand small { color: var(--muted-2); font-weight: 600; letter-spacing: .16em; font-size: 10px; }

.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav button {
  padding: 7px 14px; border-radius: 7px; color: var(--muted);
  font-size: 13px; font-weight: 600; transition: .18s;
}
.nav button:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
.nav button.on { color: #151006; background: var(--accent); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.coin-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 8px; border-radius: 20px;
  background: linear-gradient(180deg, #1e2732, #161d26);
  border: 1px solid var(--line-2);
  transition: border-color .16s, background .16s;
  cursor: pointer;
}
.coin-chip:hover { border-color: rgba(233, 183, 74, .5); background: linear-gradient(180deg, #242e3a, #1a222c); }
.coin-chip:active { transform: scale(.98); }
.coin-loan-tag {
  font-size: 9px; font-weight: 800; letter-spacing: .05em;
  color: var(--accent-2); background: rgba(233, 183, 74, .15);
  border: 1px solid rgba(233, 183, 74, .3);
  border-radius: 4px; padding: 1px 4px;
}
.coin-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffe6a4, #d8a02c 58%, #8a5c05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.coin-val { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.coin-val.bump { animation: bump .5s ease; }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.16); color: var(--accent-2); } 100% { transform: scale(1); } }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--panel);
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(140deg, #4c7bd8, #6f4bd8);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.user-name { font-size: 13px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 页面容器 ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 24px 22px 70px; }

.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; letter-spacing: .02em; font-weight: 800; }
.page-head p { color: var(--muted); font-size: 13px; }

/* ---------- 箱子网格 ---------- */
.box-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.box-select {
  padding: 10px 12px; border-radius: 9px; max-width: 220px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text); font-size: 13px; outline: none;
}
.box-select:focus { border-color: var(--accent); }
.inv-search-row { margin-bottom: 10px; }
.box-search {
  flex: 1; max-width: 340px;
  padding: 10px 14px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text); font-size: 13px; outline: none;
  transition: border-color .18s;
}
.box-search:focus { border-color: var(--accent); }
.box-search::placeholder { color: var(--muted-2); }

.back-bar { margin-bottom: 14px; }
.back-btn {
  padding: 6px 13px 6px 9px; border-radius: 7px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
  transition: .16s;
}
.back-btn:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, .07); }

.box-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
}

.box-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), #10151c);
  padding: 16px 14px 13px; text-align: left;
  transition: transform .22s cubic-bezier(.2,.8,.3,1), border-color .22s, box-shadow .22s;
}
.box-card:hover {
  transform: translateY(-4px);
  border-color: rgba(233, 183, 74, .45);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .5), 0 0 0 1px rgba(233, 183, 74, .12);
}
.box-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(280px 120px at 50% -20%, hsla(var(--hue), 70%, 60%, .18), transparent 70%);
  pointer-events: none;
}

.box-art {
  position: relative; height: 96px; margin-bottom: 12px;
  display: grid; place-items: center;
}
.box-crate {
  width: 82px; height: 72px; position: relative;
  border-radius: 7px;
  background: linear-gradient(160deg, hsl(var(--hue) 42% 34%), hsl(var(--hue) 55% 16%));
  border: 1px solid hsl(var(--hue) 45% 46% / .55);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .16);
  transform: perspective(600px) rotateX(6deg) rotateY(-9deg);
}
.box-crate::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: 26px; height: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(0, 0, 0, .25));
  border-radius: 2px;
}
.box-crate::after {
  content: ""; position: absolute; inset: 6px;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 4px;
}
.box-crate .latch {
  position: absolute; width: 14px; height: 10px; left: 50%; top: 30px; transform: translateX(-50%);
  background: linear-gradient(180deg, #e9c164, #9c7415); border-radius: 2px; z-index: 2;
  box-shadow: 0 0 8px rgba(233, 183, 74, .55);
}
.box-cover {
  position: absolute; inset: 0; margin: auto; z-index: 1;
  max-width: 100%; max-height: 100%; object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .55));
}
/* 有真实箱图时隐藏 CSS 画的箱体，图片加载失败会自动露出 */
.box-cover + .box-crate { display: none; }

.box-name { font-size: 13.5px; font-weight: 700; line-height: 1.35; min-height: 37px; }
.box-en { color: var(--muted-2); font-size: 10.5px; letter-spacing: .03em; margin-top: 2px; }
.box-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; }
.box-price { color: var(--accent-2); font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13px; }
.box-price span { color: var(--muted-2); font-weight: 500; font-size: 10px; margin-left: 3px; }
.box-count { color: var(--muted-2); font-size: 11px; }

/* ---------- 箱子详情 ---------- */
.detail-head {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--panel), #0e131a);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px; margin-bottom: 20px;
}
.detail-head .box-art { margin: 0; width: 122px; height: 110px; flex: none; }
.detail-head .box-crate { width: 98px; height: 86px; }
.detail-meta { flex: 1; min-width: 190px; }
.detail-meta h2 { font-size: 20px; font-weight: 800; }
.detail-meta .en { color: var(--muted-2); font-size: 11px; letter-spacing: .05em; margin-top: 3px; }
.detail-meta .rates { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.rate-pill { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.rate-pill i { width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.rates-note { color: var(--muted-2); font-size: 10.5px; margin-top: 9px; }

.btn-open {
  min-width: 190px; padding: 14px 20px; border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-2), #cf9a28);
  color: #1a1205; font-weight: 800; font-size: 15px;
  box-shadow: 0 10px 26px rgba(233, 183, 74, .26), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: .18s; display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.2;
}
.btn-open:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.btn-open small { font-size: 10.5px; font-weight: 600; opacity: .72; letter-spacing: .04em; }

.open-actions { display: flex; flex-direction: column; gap: 8px; min-width: 190px; }
.btn-ten {
  background: linear-gradient(180deg, #2b3644, #1a2430);
  color: var(--text);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 8px 20px rgba(0, 0, 0, .3);
}
.btn-ten:hover:not(:disabled) { filter: brightness(1.18); }

.items-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}

/* ---------- 箱子内稀有度分组 ---------- */
.rare-group + .rare-group { margin-top: 26px; }
.rare-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; margin-bottom: 12px;
}
.rare-title i { width: 3px; height: 15px; border-radius: 2px; background: var(--rc); }
.rare-title span { color: var(--muted-2); font-size: 11px; font-weight: 500; }
.rare-toggle {
  margin-left: auto; padding: 4px 11px; border-radius: 6px;
  font-size: 11px; font-weight: 600; color: var(--accent-2);
  background: rgba(233, 183, 74, .09); border: 1px solid rgba(233, 183, 74, .26);
}
.rare-toggle:hover { background: rgba(233, 183, 74, .18); }

/* ---------- 通用物品卡 ---------- */
.item-card {
  position: relative; overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(180deg, var(--panel-2), #0f141b);
  border: 1px solid var(--line);
  padding: 10px 10px 9px;
  transition: transform .18s, border-color .18s;
}
.item-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .16); }

.item-art {
  position: relative; height: 76px; border-radius: 6px; overflow: hidden;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 50% 118%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 68%),
    linear-gradient(180deg, rgba(255, 255, 255, .03), transparent);
}
.item-art::after {
  content: ""; position: absolute; inset: auto 0 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--rc), transparent);
  opacity: .9;
}
.item-art svg { width: 74%; height: 74%; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .65)); }

/* 真实饰品图：有图时不渲染 SVG，失败时由 JS 换回剪影 */
.item-art img, .strip-item img, .big-art img, .result-art img, .t-art img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; z-index: 2;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .55));
}
.big-art { position: relative; }
.t-art { position: relative; }

.item-name {
  font-size: 11.5px; font-weight: 600; line-height: 1.35; margin-top: 7px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 31px;
}
.item-sub { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.item-rarity { font-size: 10px; color: var(--rc); font-weight: 600; }
.item-price { font-size: 11px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.item-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  font-size: 9px; font-weight: 800; letter-spacing: .05em;
  padding: 2px 5px; border-radius: 3px;
  background: rgba(8, 10, 14, .78); color: var(--accent-2);
  border: 1px solid rgba(233, 183, 74, .35);
}
.item-wear { font-size: 9.5px; color: var(--muted-2); margin-top: 3px; }

.sell-btn {
  width: 100%; margin-top: 7px; padding: 5px 6px; border-radius: 5px;
  font-size: 10.5px; font-weight: 700; color: var(--accent-2);
  background: rgba(233, 183, 74, .09); border: 1px solid rgba(233, 183, 74, .24);
  transition: .15s;
}
.sell-btn:hover:not(:disabled) { background: rgba(233, 183, 74, .2); }

/* ---------- 保险柜 ---------- */
.lock-btn {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 22px; height: 22px; border-radius: 5px;
  display: grid; place-items: center;
  color: var(--muted-2); background: rgba(8, 10, 14, .72);
  border: 1px solid transparent; transition: .15s;
}
.lock-btn:hover { color: var(--text); border-color: var(--line-2); }
.lock-btn.on {
  color: var(--accent-2);
  background: rgba(233, 183, 74, .16);
  border-color: rgba(233, 183, 74, .34);
}
.item-card.locked { border-color: rgba(233, 183, 74, .26); }
.item-card.locked .item-art { opacity: .7; }

/* ---------- 开箱覆盖层 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: center; justify-content: center;
  background: rgba(4, 6, 9, .9);
  backdrop-filter: blur(10px);
}
.overlay.show { display: flex; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.open-stage { width: 100%; max-width: 1180px; padding: 0 16px; }

.open-top { text-align: center; margin-bottom: 26px; }
.open-top h3 { font-size: 17px; font-weight: 800; letter-spacing: .03em; }
.open-top p { color: var(--muted); font-size: 12px; margin-top: 4px; }

.strip-viewport {
  position: relative; overflow: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 22px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .022), transparent);
}
.strip-track {
  display: flex; gap: 12px; will-change: transform;
  transition: transform 5.1s cubic-bezier(.07, .74, .02, .99);
}
.strip-item {
  flex: 0 0 150px; height: 128px; border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-2), #0d1218);
  border: 1px solid var(--line);
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.strip-item::after {
  content: ""; position: absolute; inset: auto 0 0; height: 3px; background: var(--rc);
}
.strip-item svg { width: 66%; height: 66%; opacity: .92; }

.strip-pointer {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-1px);
  background: linear-gradient(180deg, transparent, var(--accent-2) 22%, var(--accent-2) 78%, transparent);
  z-index: 5; box-shadow: 0 0 16px rgba(255, 215, 110, .55);
}
.strip-pointer::before, .strip-pointer::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent;
}
.strip-pointer::before { top: -1px; border-top: 8px solid var(--accent-2); }
.strip-pointer::after { bottom: -1px; border-bottom: 8px solid var(--accent-2); }

.strip-fade {
  position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: linear-gradient(90deg, rgba(4,6,9,.92), transparent 18%, transparent 82%, rgba(4,6,9,.92));
}

/* PK 对战开奖 */
.duel-overlay { z-index: 200; }
.duel-stage { width: min(820px, 94vw); padding: 0 16px; }
.duel-head { text-align: center; margin-bottom: 18px; }
.duel-head h3 { font-size: 17px; font-weight: 800; letter-spacing: .03em; }
.duel-head p { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.duel-side { margin-bottom: 10px; }
.duel-side-tag { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted-2); margin-bottom: 6px; }
.duel-side-tag.you { color: #5fd48b; }
.duel-strip { border-radius: 10px; border: 1px solid var(--line); padding: 12px 0; }
.duel-strip .strip-item { flex: 0 0 108px; height: 92px; }
.duel-strip .strip-item svg { width: 70%; height: 70%; }
.duel-strip .strip-item img { width: 70%; height: 70%; object-fit: contain; }
.strip-none { font-size: 12px; color: var(--muted-2); }

/* 结果卡 */
.result-wrap {
  position: absolute; inset: 0; z-index: 90;
  display: none; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(0, 0, 0, .55), rgba(0, 0, 0, .9));
}
.result-wrap.show { display: flex; }

.result-card {
  width: min(360px, 86vw); max-height: 88vh; overflow-y: auto;
  text-align: center;
  padding: 26px 22px 20px; border-radius: 14px;
  background: linear-gradient(180deg, #1a212b, #0d1218);
  border: 1px solid var(--rc);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc) 40%, transparent),
              0 0 70px color-mix(in srgb, var(--rc) 35%, transparent),
              var(--shadow);
  animation: pop .42s cubic-bezier(.18, .9, .3, 1.2);
  position: relative;
}
@keyframes pop { from { opacity: 0; transform: scale(.82) translateY(14px); } to { opacity: 1; transform: none; } }

.result-card .glow {
  position: absolute; inset: -1px; border-radius: 14px; pointer-events: none;
  background: radial-gradient(60% 46% at 50% 8%, color-mix(in srgb, var(--rc) 26%, transparent), transparent 70%);
}
.result-art { position: relative; height: 130px; display: grid; place-items: center; }
.result-art svg { width: 78%; height: 100%; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .7)); }
.result-rarity {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .12em;
  color: var(--rc); padding: 3px 10px; border-radius: 20px;
  background: color-mix(in srgb, var(--rc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--rc) 35%, transparent);
  margin-bottom: 10px;
}
.result-name { font-size: 17px; font-weight: 800; line-height: 1.3; }
.result-weapon { color: var(--muted); font-size: 11.5px; margin-top: 3px; letter-spacing: .04em; }

.wear-bar { display: flex; gap: 2px; margin: 16px 0 8px; }
.wear-bar i { flex: 1; height: 5px; border-radius: 2px; background: #232c38; }
.wear-bar i.on { background: var(--rc); box-shadow: 0 0 8px color-mix(in srgb, var(--rc) 60%, transparent); }
.wear-info { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.wear-info b { color: var(--text); font-weight: 700; }

.result-value {
  margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
}
.result-value .num { font-size: 22px; font-weight: 900; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.result-value .unit { font-size: 11px; color: var(--muted-2); }

.result-actions { display: flex; gap: 9px; margin-top: 18px; }

/* ---------- 十连结果 ---------- */
.overlay.multi .open-top, .overlay.multi .strip-viewport { display: none; }
.multi-card {
  width: min(900px, 94vw); max-height: 88vh; overflow-y: auto;
  padding: 24px 22px 20px; border-radius: 14px;
  background: linear-gradient(180deg, #1a212b, #0c1117);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  animation: pop .35s cubic-bezier(.18, .9, .3, 1.15);
}
.multi-head { text-align: center; margin-bottom: 18px; }
.multi-title { font-size: 19px; font-weight: 800; letter-spacing: .05em; }
.multi-sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.multi-sub b { font-weight: 800; margin-left: 5px; }
.multi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.multi-item {
  border-radius: 9px; padding: 8px;
  border: 1px solid color-mix(in srgb, var(--rc) 34%, transparent);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(0, 0, 0, .12));
  animation: fadeUp .42s both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.mi-art { position: relative; height: 68px; }
.mi-art svg, .mi-art img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.mi-name {
  font-size: 10.5px; font-weight: 600; line-height: 1.35; margin-top: 6px; min-height: 28px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mi-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 5px; font-size: 9.5px; color: var(--muted-2);
}
.mi-meta b { color: var(--accent-2); font-size: 10.5px; font-weight: 800; }
.btn { flex: 1; padding: 11px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; transition: .16s; }
.btn-primary { background: linear-gradient(180deg, var(--accent-2), #cf9a28); color: #1a1205; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: rgba(255, 255, 255, .055); border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .09); }

/* ---------- 库存 ---------- */
.inv-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.inv-stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 18px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line);
}
.inv-stat small { color: var(--muted-2); font-size: 10px; letter-spacing: .06em; }
.inv-stat b { font-size: 17px; font-variant-numeric: tabular-nums; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 600;
  color: var(--muted); background: rgba(255, 255, 255, .04); border: 1px solid transparent;
}
.filters button:hover { color: var(--text); }
.filters button.on { color: var(--text); border-color: var(--fc, var(--line-2)); background: rgba(255, 255, 255, .07); }

.inv-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }

.empty {
  text-align: center; padding: 70px 20px; color: var(--muted-2);
}
.empty b { display: block; color: var(--muted); font-size: 15px; margin-bottom: 6px; font-weight: 600; }

/* ---------- 登录 ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(800px 500px at 50% 0%, rgba(233, 183, 74, .10), transparent 65%),
    var(--bg);
  padding: 24px;
}
.login-screen[hidden] { display: none; }
.login-card { width: min(400px, 100%); text-align: center; }
.login-card .brand-mark { width: 52px; height: 52px; font-size: 20px; border-radius: 12px; margin: 0 auto 20px; }
.login-card h1 { font-size: 25px; font-weight: 900; letter-spacing: .07em; }
.login-card .sub { color: var(--muted); font-size: 13px; margin: 8px 0 26px; line-height: 1.6; }
.login-input {
  width: 100%; padding: 14px 16px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line-2);
  color: var(--text); font-size: 16px; outline: none; text-align: center;
  transition: .18s;
}
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233, 183, 74, .13); }
.login-btn {
  width: 100%; margin-top: 12px; padding: 14px; border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-2), #cf9a28); color: #1a1205;
  font-weight: 800; font-size: 15px; transition: .18s;
}
.login-btn:hover:not(:disabled) { filter: brightness(1.07); }
.login-note { color: var(--muted-2); font-size: 11.5px; margin-top: 16px; line-height: 1.7; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 120;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 11px 20px; border-radius: 9px;
  background: #232c38; border: 1px solid var(--line-2);
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
  transition: .26s cubic-bezier(.2,.8,.3,1);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.err { background: #3a1f1d; border-color: #6b302b; color: #ffb9b2; }

/* ---------- 选择态物品卡 ---------- */
.item-card.selectable { cursor: pointer; }
.item-card.selectable:hover { border-color: rgba(233, 183, 74, .45); }
.item-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 24px rgba(233, 183, 74, .22);
}
.item-card.disabled { opacity: .32; pointer-events: none; filter: grayscale(.6); }
.tick {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #1a1205;
  font-size: 11px; font-weight: 900; display: grid; place-items: center;
}

/* ---------- 合成操作条 ---------- */
.tu-summary { color: var(--muted); font-size: 12px; margin-left: auto; }
.tradeup-bar {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 22px; padding: 13px 16px;
  background: rgba(11, 15, 21, .94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .35);
}
.tu-count { font-size: 12.5px; color: var(--muted); }
.tu-count b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.tu-actions { margin-left: auto; display: flex; gap: 9px; }
.tu-actions .btn { flex: 0 0 auto; padding: 9px 18px; }
.tu-actions .btn-primary:disabled { background: #2a323d; color: var(--muted-2); box-shadow: none; }

/* ---------- 升级布局 ---------- */
.upgrade-layout {
  display: grid; gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: start;
}
.up-left, .up-right {
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, rgba(20, 26, 34, .7), rgba(13, 17, 23, .5));
  padding: 16px;
}
.up-title {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 13px; font-weight: 700; margin-bottom: 13px;
}
.up-title span { color: var(--muted-2); font-size: 11px; font-weight: 500; }
.up-grid { display: grid; gap: 9px; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); }
.up-rule { color: var(--muted-2); font-size: 10.5px; line-height: 1.7; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.target-list { display: flex; flex-direction: column; gap: 8px; }
.target-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  background: rgba(255, 255, 255, .028);
  border: 1px solid var(--line);
  transition: .15s;
}
.target-row:hover { background: rgba(255, 255, 255, .06); border-color: var(--line-2); }
.t-art {
  width: 52px; height: 40px; flex: none; border-radius: 6px;
  display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 120% at 50% 120%, color-mix(in srgb, var(--rc) 32%, transparent), transparent 70%);
}
.t-art svg { width: 78%; height: 78%; }
.t-info { min-width: 0; flex: 1; }
.t-info b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-info span { font-size: 10px; color: var(--muted-2); }
.t-chance {
  font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums;
  min-width: 52px; text-align: right;
}
.t-chance.good { color: #5fd48b; }
.t-chance.mid { color: var(--accent-2); }
.t-chance.low { color: #e2564a; }
.t-go {
  flex: none; padding: 6px 12px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700;
  background: rgba(233, 183, 74, .14); color: var(--accent-2);
  border: 1px solid rgba(233, 183, 74, .32);
  transition: .15s;
}
.t-go:hover { background: rgba(233, 183, 74, .26); }
.t-go[data-pk] {
  background: rgba(136, 71, 255, .14); color: #bb9bff;
  border-color: rgba(136, 71, 255, .35);
}
.t-go[data-pk]:hover { background: rgba(136, 71, 255, .26); }

/* ---------- 通用弹层 ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 150;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 9, .84);
  backdrop-filter: blur(9px);
}
.modal-wrap.show { display: flex; animation: fadeIn .18s ease; }
.modal-card {
  width: min(470px, 100%); max-height: 86vh; overflow-y: auto;
  padding: 24px 20px 20px;
  background: linear-gradient(180deg, #1a212b, #0c1117);
  border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow);
  animation: pop .3s cubic-bezier(.18, .9, .3, 1.15);
}
.modal-eyebrow {
  text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .16em;
  color: var(--muted-2); margin-bottom: 16px;
}
.modal-eyebrow.win { color: #5fd48b; }
.modal-eyebrow.lose { color: #e2564a; }
.modal-note { color: var(--muted-2); font-size: 11.5px; line-height: 1.7; text-align: center; margin-top: 14px; }
.modal-actions { display: flex; gap: 9px; margin-top: 18px; }

.big-item {
  text-align: center; padding: 14px 10px;
  border-radius: 11px;
  background: radial-gradient(90% 120% at 50% 0%, color-mix(in srgb, var(--rc) 16%, transparent), transparent 72%);
  border: 1px solid color-mix(in srgb, var(--rc) 32%, transparent);
}
.big-art { height: 88px; display: grid; place-items: center; }
.big-art svg { width: 72%; height: 100%; filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .65)); }
.big-rarity {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .08em;
  color: var(--rc); padding: 2px 9px; border-radius: 20px;
  background: color-mix(in srgb, var(--rc) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--rc) 32%, transparent);
  margin-top: 8px;
}
.big-name { font-size: 15px; font-weight: 800; margin-top: 7px; }
.big-wear { font-size: 10.5px; color: var(--muted-2); margin-top: 3px; }
.big-value { font-size: 17px; font-weight: 900; color: var(--accent-2); margin-top: 8px; font-variant-numeric: tabular-nums; }

.conflict-row { display: flex; align-items: center; gap: 8px; }
.conflict-row .big-item { flex: 1; min-width: 0; padding: 10px 6px; }
.conflict-row .big-art { height: 64px; }
.conflict-row .big-name { font-size: 12.5px; }
.conflict-row .big-value { font-size: 14px; }
.conflict-row .big-wear { display: none; }
.conflict-arrow { flex: none; color: var(--accent-2); font-size: 17px; font-weight: 900; }
.chance-line {
  text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted);
}
.chance-line b { font-size: 20px; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.lose-box {
  text-align: center; padding: 24px 12px; border-radius: 11px;
  background: rgba(226, 86, 74, .07);
  border: 1px solid rgba(226, 86, 74, .28);
  font-size: 14px; font-weight: 600; color: #ffb9b2; line-height: 1.9;
}

/* ---------- 贷款 ---------- */
.loan-box {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px;
  background: rgba(255, 255, 255, .025);
}
.loan-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; font-size: 12.5px; color: var(--muted);
}
.loan-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.loan-row b.loan-good { color: #5fd48b; }
.loan-row b.loan-bad { color: #e2564a; }
.loan-input { margin-bottom: 2px; }

/* ---------- 欠款明细 ---------- */
.debt-head { margin: 16px 0 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.debt-list { display: flex; flex-direction: column; gap: 6px; }
.debt-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
}
.debt-main { flex: 1; min-width: 0; }
.debt-main b { display: block; font-size: 12.5px; }
.debt-main span { font-size: 10px; color: var(--muted-2); }
.debt-empty { text-align: center; color: var(--muted-2); font-size: 12px; padding: 14px 0; }
#repayAll { width: 100%; margin-top: 10px; }

/* ---------- 库存工具条 ---------- */
.inv-tools {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 18px;
}
.inv-tools .btn { flex: 0 0 auto; margin-left: auto; }
.more-hint { text-align: center; padding: 22px 0 10px; color: var(--muted-2); font-size: 11.5px; }

/* ---------- 开箱记录 ---------- */
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  background: rgba(255, 255, 255, .026); border: 1px solid var(--line);
}
.hr-art {
  position: relative; width: 54px; height: 42px; flex: none; border-radius: 6px; overflow: hidden;
  background: radial-gradient(120% 120% at 50% 120%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%);
}
.hr-art svg, .hr-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.hr-main { flex: 1; min-width: 0; }
.hr-main b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-main span { font-size: 10px; color: var(--muted-2); }
.hr-val { text-align: right; flex: none; }
.hr-val b { display: block; font-size: 12.5px; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.hr-val span { font-size: 9.5px; color: var(--muted-2); }

/* 历史最高价值物品 */
.best-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--rc) 45%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 16%, transparent), rgba(255, 255, 255, .02));
}
.best-tag {
  flex: none; font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: #1b1404; background: var(--rc); padding: 4px 9px; border-radius: 5px;
}
.best-art {
  position: relative; width: 64px; height: 46px; flex: none; border-radius: 7px;
  background: radial-gradient(120% 120% at 50% 120%, color-mix(in srgb, var(--rc) 34%, transparent), transparent 70%);
}
.best-art svg, .best-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.best-main { flex: 1; min-width: 0; }
.best-main b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.best-main span { font-size: 10.5px; color: var(--muted-2); }
.best-val { flex: none; font-size: 17px; font-weight: 800; color: var(--accent-2); font-variant-numeric: tabular-nums; }

/* 出货统计 */
.drop-stats {
  margin-bottom: 14px; padding: 12px 14px;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
}
.ds-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ds-head b { font-size: 12.5px; }
.ds-head span { font-size: 10px; color: var(--muted-2); }
.ds-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ds-item {
  position: relative; overflow: hidden;
  padding: 9px 10px; border-radius: 8px;
  background: rgba(255, 255, 255, .025); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 1px;
}
.ds-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--rc); }
.ds-name { font-size: 10px; font-weight: 700; color: var(--rc); }
.ds-count { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ds-rate { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ds-off { font-size: 9px; color: var(--muted-2); }

/* ---------- 排行榜 ---------- */
.podium {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  align-items: end; margin: 10px 0 22px;
}
.podium-item {
  text-align: center; padding: 18px 10px 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(0, 0, 0, .08));
}
.podium-item.ghost { visibility: hidden; }
.podium-item.p1 {
  padding-top: 26px;
  border-color: rgba(255, 215, 0, .36);
  background: linear-gradient(180deg, rgba(255, 215, 0, .1), rgba(0, 0, 0, .08));
  box-shadow: 0 0 26px rgba(255, 215, 0, .1);
}
.podium-item.p2 { border-color: rgba(201, 212, 224, .32); }
.podium-item.p3 { border-color: rgba(208, 139, 74, .32); }
.pd-rank {
  width: 24px; height: 24px; line-height: 24px; margin: 0 auto 10px;
  border-radius: 50%; background: var(--mc); color: #0b0e13;
  font-size: 12px; font-weight: 900;
}
.pd-avatar {
  width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 800;
  background: linear-gradient(140deg, #4c7bd8, #6f4bd8);
}
.pd-name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-total { color: var(--accent-2); font-weight: 800; font-size: 13px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pd-count { color: var(--muted-2); font-size: 10px; margin-top: 2px; }

.me-rank {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 16px;
  background: rgba(233, 183, 74, .09); border: 1px solid rgba(233, 183, 74, .26);
  font-size: 12.5px; color: var(--muted);
}
.me-rank b { font-size: 18px; color: var(--accent-2); font-variant-numeric: tabular-nums; }

/* ---------- 对决 ---------- */
.battle-card {
  width: min(720px, 94vw); max-height: 88vh; overflow-y: auto;
  padding: 24px 20px 20px; border-radius: 14px;
  background: linear-gradient(180deg, #1a212b, #0c1117);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  animation: pop .35s cubic-bezier(.18, .9, .3, 1.15);
}
.battle-head {
  text-align: center; font-size: 20px; font-weight: 900; letter-spacing: .1em;
  margin-bottom: 18px; color: var(--muted);
}
.battle-head.bwin { color: #5fd48b; text-shadow: 0 0 22px rgba(95, 212, 139, .4); }
.battle-head.blose { color: #e2564a; }
.battle-arena { display: flex; align-items: stretch; gap: 10px; }
.bside { flex: 1; min-width: 0; border-radius: 11px; padding: 8px; border: 1px solid var(--line); }
.bside.bwin { border-color: rgba(95, 212, 139, .45); background: rgba(95, 212, 139, .05); }
.bside .big-item { border: 0; background: transparent; padding: 0 0 6px; }
.bside .big-art { height: 76px; }
.bside-tag { font-size: 10px; font-weight: 700; color: var(--muted-2); letter-spacing: .1em; margin-bottom: 2px; }
.bside.bwin .bside-tag { color: #5fd48b; }
.vs {
  align-self: center; font-size: 15px; font-weight: 900; color: var(--accent-2);
  letter-spacing: .06em; padding: 0 2px;
}
.battle-note { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 16px; }
.duel-empty {
  display: grid; place-items: center; min-height: 96px;
  font-size: 12px; color: var(--muted-2);
  border: 1px dashed var(--line-2); border-radius: 9px; margin: 4px 0;
}
.battle-record {
  text-align: center; font-size: 11.5px; color: var(--muted-2);
  margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line);
}
.battle-record .rw { color: #5fd48b; font-weight: 700; }
.battle-record .rd { color: var(--accent-2); font-weight: 700; }
.battle-record .rl { color: #e2564a; font-weight: 700; }
.btn-battle {
  background: linear-gradient(180deg, #3a2b45, #241a2e);
  color: #e6d9f5;
  border: 1px solid rgba(136, 90, 210, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 8px 20px rgba(0, 0, 0, .3);
}
.btn-battle:hover:not(:disabled) { filter: brightness(1.2); }

/* 页面切换的轻微入场，避免生硬闪跳 */
#main { animation: pageIn .26s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 真人 PK ---------- */
.pk-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.pk-tabs button {
  flex: 1; padding: 8px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: rgba(255, 255, 255, .04); border: 1px solid transparent;
}
.pk-tabs button.on { color: var(--accent-2); background: rgba(233, 183, 74, .12); border-color: rgba(233, 183, 74, .3); }
.pk-hint { font-size: 11px; color: var(--muted-2); line-height: 1.7; margin-bottom: 12px; }
.pk-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.pk-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
}
.pk-ava {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: linear-gradient(140deg, #4c7bd8, #6f4bd8);
}
.pk-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-codebox {
  text-align: center; padding: 16px; border-radius: 10px; margin-bottom: 14px;
  border: 1px dashed rgba(233, 183, 74, .4); background: rgba(233, 183, 74, .06);
}
.pk-code-label { font-size: 10px; color: var(--muted-2); letter-spacing: .1em; }
.pk-code {
  font-size: 26px; font-weight: 900; letter-spacing: .18em;
  color: var(--accent-2); margin: 6px 0 10px;
  font-family: Consolas, monospace;
}
.pk-code-actions { display: flex; gap: 8px; }
.pk-code-actions .btn { flex: 1; padding: 8px; font-size: 11.5px; }
.pk-join { display: flex; gap: 8px; }
.pk-join .box-search { max-width: none; }
.pk-hist { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.pk-hrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 11.5px; }
.pk-hrow span:first-child { width: 18px; font-weight: 800; }
.pk-hval { color: var(--muted); }
.rw { color: #5fd48b; }
.rd { color: var(--accent-2); }
.rl { color: #e2564a; }

.pk-invite {
  position: fixed; left: 50%; bottom: 90px; z-index: 130;
  width: min(420px, 92vw); padding: 14px 16px; border-radius: 12px;
  background: #1b2430; border: 1px solid rgba(233, 183, 74, .4);
  box-shadow: var(--shadow);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: .25s cubic-bezier(.2, .8, .3, 1);
}
.pk-invite.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.pki-text { font-size: 12.5px; line-height: 1.6; }
.pki-text span { color: var(--muted-2); font-size: 11px; }
.pki-actions { display: flex; gap: 8px; margin-top: 10px; }
.pki-actions .btn { flex: 1; padding: 8px; font-size: 12px; }
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 9px;
  background: rgba(255, 255, 255, .026); border: 1px solid var(--line);
}
.rk-no { width: 28px; text-align: center; font-weight: 800; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.rk-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-count { color: var(--muted-2); font-size: 11px; flex: none; }
.rk-total { color: var(--accent-2); font-weight: 800; font-variant-numeric: tabular-nums; flex: none; }
.rank-row.top1 { border-color: rgba(255, 215, 0, .34); background: rgba(255, 215, 0, .05); }
.rank-row.top1 .rk-no { color: #ffd700; }
.rank-row.top2 .rk-no { color: #c9d4e0; }
.rank-row.top3 .rk-no { color: #d08b4a; }

.btn-danger {
  background: rgba(226, 86, 74, .14); color: #ff8a7e;
  border: 1px solid rgba(226, 86, 74, .35);
}
.btn-danger:hover { background: rgba(226, 86, 74, .24); }

/* ---------- 贷款页 ---------- */
.loan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 6px; }
.loan-stat {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
}
.loan-stat small { color: var(--muted-2); font-size: 10px; letter-spacing: .06em; }
.loan-stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.loan-stat b.loan-good { color: #5fd48b; }
.loan-stat b.loan-bad { color: #e2564a; }

.section-title { font-size: 13px; font-weight: 700; margin: 24px 0 12px; }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 10px; }
.tier-btn {
  padding: 16px 10px; border-radius: 10px;
  font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--accent-2);
  background: rgba(233, 183, 74, .09);
  border: 1px solid rgba(233, 183, 74, .28);
  transition: .16s;
}
.tier-btn:hover:not(:disabled) { background: rgba(233, 183, 74, .2); transform: translateY(-1px); }
.tier-btn:disabled { opacity: .3; }
.loan-note { color: var(--muted-2); font-size: 11px; margin-top: 10px; line-height: 1.8; }
.loan-note b { color: var(--accent-2); }
.forgive-box {
  margin-top: 26px; padding: 16px 18px; border-radius: 10px;
  background: rgba(226, 86, 74, .06);
  border: 1px solid rgba(226, 86, 74, .26);
  display: flex; flex-direction: column; gap: 8px;
}
.forgive-box b { font-size: 13px; color: #ff8a7e; }
.forgive-box span { font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.forgive-box .btn { width: 100%; margin-top: 4px; }

/* ---------- 移动端底部导航 ---------- */
.mobile-tabs { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .topbar {
    gap: 10px; height: 56px;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .brand small, .nav { display: none; }
  .wrap { padding: 16px 14px 60px; }
  .box-toolbar { margin-bottom: 13px; }
  .box-search { max-width: none; font-size: 16px; padding: 11px 14px; }
  .toast { bottom: 82px; }
  .filters button { padding: 8px 13px; font-size: 12.5px; }
  .rare-toggle { padding: 7px 12px; }
  .sell-btn { padding: 8px 6px; font-size: 11px; }
  .back-btn { padding: 8px 14px 8px 10px; }
  .box-grid { grid-template-columns: repeat(2, 1fr); gap: 11px; }
  .box-card { padding: 12px 10px 11px; }
  .box-art { height: 76px; }
  .box-crate { width: 62px; height: 56px; }
  .box-name { font-size: 12px; min-height: 34px; }
  .box-en { display: none; }
  .detail-head { padding: 15px; gap: 14px; }
  .detail-head .box-art { width: 82px; height: 84px; }
  .detail-head .box-crate { width: 66px; height: 60px; }
  .btn-open { width: 100%; }
  .strip-item { flex-basis: 112px; height: 96px; }
  .items-grid, .inv-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .coin-chip { padding: 5px 10px 5px 5px; }
  .user-name { display: none; }
  .wrap { padding-bottom: 92px; }
  .mobile-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(9, 12, 17, .96);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  }
  .mobile-tabs button {
    flex: 1; padding: 8px 0; border-radius: 8px; color: var(--muted);
    font-size: 10px; letter-spacing: .06em;
  }
  .mobile-tabs button b { display: block; font-size: 12px; font-weight: 700; }
  .mobile-tabs button.on { color: var(--accent-2); background: rgba(233, 183, 74, .08); }
  .upgrade-layout { grid-template-columns: minmax(0, 1fr); }
  .up-grid { grid-template-columns: repeat(2, 1fr); }
  .tradeup-bar { gap: 9px; padding: 11px 12px; }
  .tu-count { width: 100%; }
  .tu-actions { margin-left: 0; width: 100%; }
  .tu-actions .btn { flex: 1; }
  .target-row { gap: 8px; padding: 7px 8px; }
  .t-art { width: 42px; height: 34px; }
  .t-chance { font-size: 12px; min-width: 44px; }
  .t-go { padding: 9px 14px; font-size: 12px; }
  .modal-card { padding: 20px 15px 16px; }
  .open-actions { width: 100%; }
  .multi-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .multi-card { padding: 18px 14px 16px; width: 94vw; }
  .mi-art { height: 58px; }
  .inv-tools { gap: 8px; }
  .inv-tools .btn { width: 100%; margin-left: 0; }
  .mobile-tabs button { font-size: 9px; padding: 7px 0; }
  .mobile-tabs button b { font-size: 11px; }
  .hr-art { width: 46px; height: 36px; }
  .rk-count { display: none; }
  .loan-grid { grid-template-columns: 1fr; gap: 8px; }
  .loan-stat { flex-direction: row; align-items: center; justify-content: space-between; padding: 11px 14px; }
  .loan-stat b { font-size: 15px; }
  .tier-grid { grid-template-columns: repeat(2, 1fr); }
  .tier-btn { padding: 13px 8px; font-size: 14px; }
}

/* ============================================================
   移动端增强（覆盖上面的基础响应式）
   ============================================================ */
@media (max-width: 720px) {
  /* ---- 顶栏 ---- */
  .topbar {
    gap: 8px; height: 54px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    background: rgba(9, 12, 17, .92);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  }
  .brand { gap: 8px; font-size: 14px; }
  .brand-mark { width: 24px; height: 24px; font-size: 12px; }
  .brand small, .nav { display: none; }
  .top-right { gap: 7px; }
  .coin-chip { padding: 5px 9px 5px 6px; gap: 6px; }
  .coin-dot { width: 18px; height: 18px; }
  .coin-val { font-size: 13px; }
  .coin-loan-tag { font-size: 8px; padding: 0 3px; }
  .user-chip { padding: 4px; border-radius: 50%; }
  .avatar { width: 28px; height: 28px; font-size: 12px; }
  .user-name { display: none; }

  /* ---- 页面容器与标题 ---- */
  .wrap { padding: 14px 12px calc(86px + env(safe-area-inset-bottom)); }
  .page-head { gap: 4px 10px; margin-bottom: 14px; align-items: flex-start; }
  .page-head h1 { font-size: 18px; }
  .page-head p { font-size: 11.5px; line-height: 1.5; }

  /* ---- 筛选：横向滑动，不再堆成多行 ---- */
  .filters {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px; max-width: 100%;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: 0 0 auto; padding: 7px 12px; font-size: 12px; min-height: 32px; }

  /* ---- 统计块 ---- */
  .inv-head { gap: 8px; margin-bottom: 12px; }
  .inv-head > .filters { flex: 1 1 100%; min-width: 0; }
  .inv-stat { flex: 1 1 calc(50% - 4px); padding: 8px 12px; border-radius: 8px; }
  .inv-stat small { font-size: 9.5px; }
  .inv-stat b { font-size: 15px; }

  /* ---- 工具条 ---- */
  .inv-tools { gap: 8px; margin: 10px 0 12px; }
  .inv-tools > .filters { flex: 1 1 100%; min-width: 0; }
  .inv-tools .btn { width: 100%; margin-left: 0; min-height: 40px; }
  .inv-search-row { flex-wrap: nowrap; }
  .inv-search-row .box-search { flex: 1 1 auto; min-width: 0; }
  .inv-search-row .box-select { flex: 1 1 45%; max-width: none; min-width: 0; }

  /* ---- 箱子列表 ---- */
  .box-toolbar { gap: 8px; margin-bottom: 12px; }
  .box-toolbar > .box-search { flex: 1 1 100%; max-width: none; font-size: 16px; padding: 11px 13px; }
  .box-toolbar > .filters { flex: 1 1 100%; min-width: 0; }
  .box-select { font-size: 16px; padding: 10px 12px; max-width: none; }
  .inv-tools > .box-select { flex: 1 1 100%; }
  .box-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .box-card { padding: 11px 10px 10px; }
  .box-art { height: 74px; }
  .box-crate { width: 60px; height: 54px; }
  .box-name { font-size: 12px; min-height: 32px; }
  .box-en { display: none; }
  .box-price { font-size: 12.5px; }

  /* ---- 箱子详情 ---- */
  .detail-head { padding: 14px; gap: 12px; }
  .detail-head .box-art { width: 78px; height: 80px; }
  .detail-head .box-crate { width: 62px; height: 56px; }
  .open-actions { width: 100%; }
  .btn-open { width: 100%; min-height: 46px; }
  .rare-title { font-size: 12px; margin-bottom: 10px; }
  .rare-toggle { padding: 6px 11px; }
  .items-grid, .inv-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .item-card { padding: 8px 8px 7px; }
  .item-art { height: 72px; }
  .item-name { font-size: 11px; min-height: 29px; margin-top: 6px; }
  .item-rarity { font-size: 9.5px; }
  .item-price { font-size: 10.5px; }
  .item-wear { font-size: 9px; }
  .sell-btn { font-size: 10px; padding: 7px 4px; min-height: 34px; }
  .lock-btn { width: 26px; height: 26px; }

  /* ---- 开箱动画与结果 ---- */
  .strip-item { flex-basis: 104px; height: 90px; }
  .open-top { margin-bottom: 18px; }
  .open-top h3 { font-size: 15px; }
  .result-card { padding: 18px 16px 16px; }
  .result-art { height: 112px; }
  .result-name { font-size: 15px; }
  .result-value .num { font-size: 20px; }
  .result-actions { gap: 8px; }
  .result-actions .btn { flex: 1; padding: 11px 8px; }
  .multi-card { padding: 18px 13px calc(14px + env(safe-area-inset-bottom)); width: 94vw; }
  .multi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .mi-art { height: 56px; }

  /* ---- 弹层改底部抽屉 ---- */
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal-card {
    width: 100%; max-height: 90vh; border-radius: 16px 16px 0 0; border-bottom: 0;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
    animation: sheetUp .28s cubic-bezier(.2, .8, .3, 1);
  }

  /* ---- 真人 PK 面板 ---- */
  .pk-tabs { margin-bottom: 12px; }
  .pk-tabs button { padding: 9px; font-size: 12.5px; min-height: 38px; }
  .pk-hint { font-size: 10.5px; }
  .pk-list { max-height: 42vh; }
  .pk-row { padding: 9px 10px; }
  .pk-ava { width: 34px; height: 34px; }
  .pk-name { font-size: 12.5px; }
  .pk-row .t-go { padding: 8px 14px; min-height: 34px; }
  .pk-code { font-size: 24px; }
  .pk-code-actions .btn { padding: 9px; }
  .pk-join { gap: 7px; }
  .pk-join .btn { padding: 10px 14px; min-height: 42px; }
  .pk-invite {
    bottom: calc(66px + env(safe-area-inset-bottom));
    width: calc(100% - 20px); padding: 12px 13px;
  }
  .pki-text { font-size: 12px; }
  .pki-actions .btn { padding: 9px; }

  /* ---- 对决 / 结算 ---- */
  .battle-arena { gap: 7px; }
  .bside { padding: 6px; }
  .bside .big-art { height: 64px; }
  .bside .big-name { font-size: 11.5px; }
  .big-art { height: 78px; }
  .big-name { font-size: 13.5px; }
  .big-value { font-size: 15px; }
  .vs { font-size: 12px; }
  .battle-note { font-size: 12px; margin-top: 12px; }
  .duel-empty { min-height: 76px; }

  /* ---- 对战开奖 ---- */
  .duel-stage { width: 100%; padding: 0 10px; }
  .duel-head { margin-bottom: 12px; }
  .duel-head h3 { font-size: 15px; }
  .duel-head p { font-size: 10.5px; }
  .duel-strip { padding: 9px 0; }
  .duel-strip .strip-item { flex: 0 0 84px; height: 72px; }
  .duel-side { margin-bottom: 8px; }

  /* ---- 合成 ---- */
  .tu-summary { flex: 1 1 100%; margin-left: 0; font-size: 11px; }
  .tradeup-bar {
    bottom: calc(58px + env(safe-area-inset-bottom));
    gap: 8px; padding: 10px 11px;
  }
  .tu-count { width: 100%; font-size: 11.5px; }
  .tu-count b { font-size: 14px; }
  .tu-actions { margin-left: 0; width: 100%; gap: 7px; flex-wrap: wrap; }
  .tu-actions .btn { flex: 1 1 calc(50% - 4px); padding: 10px 6px; font-size: 12px; }

  /* ---- 升级 ---- */
  .upgrade-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .up-left, .up-right { padding: 12px; }
  .up-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .up-title { font-size: 12.5px; margin-bottom: 10px; }
  .target-row { gap: 7px; padding: 7px; }
  .t-art { width: 42px; height: 34px; }
  .t-info b { font-size: 11.5px; }
  .t-info span { font-size: 9.5px; }
  .t-chance { font-size: 11.5px; min-width: 38px; }
  .t-go { padding: 8px 9px; font-size: 11px; min-height: 34px; }

  /* ---- 记录 ---- */
  .hist-list { gap: 6px; }
  .hist-row { padding: 8px 10px; gap: 8px; }
  .hr-art { width: 46px; height: 36px; }
  .hr-main b { font-size: 12px; }
  .hr-main span { font-size: 9.5px; }
  .hr-val b { font-size: 12px; }
  .hr-val span { font-size: 9px; }
  .best-bar { gap: 9px; padding: 9px 11px; }
  .best-tag { font-size: 9px; padding: 3px 7px; }
  .best-art { width: 52px; height: 38px; }
  .best-main b { font-size: 12px; }
  .best-main span { font-size: 9.5px; }
  .best-val { font-size: 14px; }
  .drop-stats { padding: 10px 12px; }
  .ds-grid { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .ds-grid::-webkit-scrollbar { display: none; }
  .ds-item { flex: 0 0 96px; padding: 8px 9px; }
  .ds-count { font-size: 15px; }
  .ds-head span { display: none; }

  /* ---- 排行 ---- */
  .podium { gap: 7px; margin-bottom: 14px; }
  .podium-item { padding: 12px 6px 10px; border-radius: 10px; }
  .podium-item.p1 { padding-top: 18px; }
  .pd-avatar { width: 38px; height: 38px; font-size: 15px; border-radius: 11px; }
  .pd-rank { width: 20px; height: 20px; line-height: 20px; font-size: 10px; margin-bottom: 7px; }
  .pd-name { font-size: 11px; }
  .pd-total { font-size: 11.5px; }
  .pd-count { display: none; }
  .me-rank { padding: 10px 13px; gap: 9px; font-size: 11.5px; margin-bottom: 12px; }
  .me-rank b { font-size: 15px; }
  .rank-row { padding: 9px 12px; gap: 9px; }
  .rk-count { display: none; }

  /* ---- 贷款 ---- */
  .loan-grid { grid-template-columns: 1fr; gap: 7px; }
  .loan-stat { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 13px; }
  .loan-stat b { font-size: 15px; }
  .tier-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tier-btn { padding: 13px 8px; font-size: 14px; min-height: 48px; }
  .debt-row { padding: 8px 9px; }

  /* ---- 底部导航 ---- */
  .mobile-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(8, 11, 15, .97);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 4px 3px calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 22px rgba(0, 0, 0, .4);
  }
  .mobile-tabs button {
    position: relative; flex: 1; padding: 7px 0 6px; border-radius: 8px;
    color: var(--muted); font-size: 9.5px; letter-spacing: .02em; min-height: 48px;
  }
  .mobile-tabs button b { display: block; font-size: 11px; font-weight: 700; margin-bottom: 1px; }
  .mobile-tabs button.on { color: var(--accent-2); background: rgba(233, 183, 74, .08); }
  .mobile-tabs button.on::after {
    content: ""; position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%);
    width: 16px; height: 2px; border-radius: 1px; background: var(--accent-2);
  }

  /* ---- 提示 ---- */
  .toast {
    bottom: calc(76px + env(safe-area-inset-bottom));
    font-size: 12.5px; max-width: calc(100% - 24px); text-align: center;
  }

  /* ---- 登录 ---- */
  .login-screen { padding: 20px; }
  .login-card { width: 100%; }
  .login-card h1 { font-size: 23px; }
}

/* 超小屏（320~380） */
@media (max-width: 380px) {
  .wrap { padding-left: 10px; padding-right: 10px; }
  .mobile-tabs button { font-size: 9px; }
  .mobile-tabs button b { font-size: 10px; }
  .item-art { height: 64px; }
  .box-art { height: 66px; }
  .pd-avatar { width: 34px; height: 34px; }
  .tu-actions .btn { flex: 1 1 calc(50% - 4px); padding: 10px 4px; font-size: 11.5px; }
  .battle-arena { flex-direction: column; }
  .vs { padding: 2px 0; }
}

/* 手机横屏（矮屏） */
@media (max-width: 920px) and (max-height: 460px) and (orientation: landscape) {
  .topbar { height: 46px; }
  .wrap { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .modal-card { max-height: 94vh; }
  .tradeup-bar { bottom: calc(52px + env(safe-area-inset-bottom)); }
  .duel-strip .strip-item { flex: 0 0 72px; height: 62px; }
}

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

/* ---------- 库存 / 保险柜主 tab ---------- */
.inv-mtabs { display: flex; gap: 8px; margin-bottom: 14px; }
.inv-mtabs button {
  flex: 1; padding: 10px 0; border-radius: 9px; text-align: center;
  font-size: 14px; font-weight: 800; letter-spacing: .04em;
  color: var(--muted); background: var(--panel); border: 1px solid var(--line);
  transition: .15s;
}
.inv-mtabs button:hover { color: var(--text); border-color: var(--line-2); }
.inv-mtabs button.on {
  color: #100c02; background: linear-gradient(160deg, var(--accent-2), var(--accent));
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(233, 183, 74, .25);
}

/* ---------- 称号（顶栏 / 排行 / 资料） ---------- */
.user-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--accent-2);
  background: rgba(233, 183, 74, .12);
  border: 1px solid rgba(233, 183, 74, .28);
  padding: 1px 7px; border-radius: 99px; white-space: nowrap;
}
.user-title:empty { display: none; }
.pd-title { font-size: 10.5px; color: var(--accent); margin-top: 2px; }
.pd-title:empty { display: none; }
.rk-title {
  font-size: 10px; color: var(--accent-2); margin-left: 8px;
  background: rgba(233, 183, 74, .1); padding: 1px 6px; border-radius: 99px;
}
.rk-title:empty { display: none; }

/* ---------- 全站播报横幅 ---------- */
.news-banner {
  position: fixed; top: 68px; left: 50%; z-index: 95;
  width: min(640px, calc(100vw - 24px));
  transform: translate(-50%, -130%);
  opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.2, .9, .3, 1.2), opacity .3s;
}
.news-banner.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.nb-inner {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(28, 24, 10, .96), rgba(18, 22, 30, .96));
  border: 1px solid rgba(233, 183, 74, .5);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .55), 0 0 22px rgba(233, 183, 74, .18);
  font-size: 13px;
}
.nb-tag {
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
  color: #100c02; background: var(--rc, var(--accent));
  padding: 2px 8px; border-radius: 99px;
}
.nb-nick { color: var(--text); }
.nb-kind { color: var(--muted); font-size: 12px; }
.nb-item { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-val { margin-left: auto; font-weight: 800; color: var(--accent-2); font-variant-numeric: tabular-nums; }

/* ---------- 邀请时效 ---------- */
.pki-expire {
  display: inline-block; margin-left: 6px;
  font-size: 10.5px; color: var(--muted-2);
  border: 1px solid var(--line); border-radius: 99px; padding: 0 7px;
}

/* ---------- 公开匹配大厅 ---------- */
.lobby-list { display: flex; flex-direction: column; gap: 8px; }
.lobby-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.lobby-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lobby-main b { font-size: 13px; }
.lobby-main span {
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 排行榜 tabs ---------- */
.rank-tabs { margin-bottom: 8px; flex-wrap: wrap; }
.rank-desc { font-size: 11.5px; color: var(--muted-2); margin: 0 0 14px; }
.podium-item { cursor: pointer; transition: .15s; }
.podium-item:hover { border-color: var(--line-2); transform: translateY(-2px); }
.rank-row { cursor: pointer; }
.rank-row:hover { background: var(--panel-2); }

/* ---------- 玩家资料弹窗 ---------- */
.pf-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pf-ava {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 19px; font-weight: 800;
  background: linear-gradient(140deg, #2a3648, #171e28);
  border: 1px solid var(--line-2); color: var(--accent-2);
}
.pf-id { display: flex; flex-direction: column; gap: 3px; }
.pf-id b { font-size: 15px; }
.pf-title {
  align-self: flex-start; font-size: 11px; font-weight: 700;
  color: var(--accent-2); background: rgba(233, 183, 74, .12);
  border: 1px solid rgba(233, 183, 74, .3); padding: 1px 8px; border-radius: 99px;
}
.pf-titles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pf-chip {
  font-size: 11px; color: var(--rc, var(--accent));
  border: 1px solid color-mix(in srgb, var(--rc, #e9b74a) 34%, transparent);
  background: color-mix(in srgb, var(--rc, #e9b74a) 10%, transparent);
  padding: 2px 9px; border-radius: 99px;
}
.pf-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px;
}
.pf-stat {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 9px; text-align: center;
}
.pf-stat small { display: block; font-size: 10.5px; color: var(--muted-2); }
.pf-stat b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pf-showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ---------- 展示柜按钮 ---------- */
.show-btn {
  position: absolute; top: 6px; right: 34px; z-index: 3;
  width: 22px; height: 22px; border-radius: 5px;
  display: grid; place-items: center; font-size: 13px; line-height: 1;
  color: var(--muted-2); background: rgba(8, 10, 14, .72);
  border: 1px solid transparent; transition: .15s;
}
.show-btn:hover { color: var(--accent-2); border-color: var(--line-2); }
.show-btn.on {
  color: var(--accent-2);
  background: rgba(233, 183, 74, .16);
  border-color: rgba(233, 183, 74, .34);
}

/* ---------- 记录行：来源 / 胜负徽标 ---------- */
.hr-src {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 0 6px; border-radius: 4px; margin-right: 6px; vertical-align: 1px;
  color: #0b0e13; background: var(--muted);
}
.hr-src.s-open { background: #6ea8ff; }
.hr-src.s-tradeup { background: #b98cff; }
.hr-src.s-upgrade { background: #ff9d6b; }
.hr-src.s-pk { background: var(--accent-2); }
.hr-res {
  display: inline-block; font-size: 10px; font-weight: 800;
  padding: 0 6px; border-radius: 4px; margin-right: 6px; vertical-align: 1px;
}
.hr-res.win { color: #5fd48b; background: rgba(95, 212, 139, .12); }
.hr-res.draw { color: var(--muted); background: rgba(130, 145, 163, .14); }
.hr-res.lose { color: var(--danger); background: rgba(226, 86, 74, .12); }
.hr-multi { display: block; font-size: 10.5px; color: var(--accent); margin-top: 2px; }
.hist-row.hr-lost .hr-art { opacity: .5; }
.hr-x { color: var(--danger); font-size: 20px; font-weight: 800; }

/* ---------- PK 开奖：胜负高亮 + 判定横幅 ---------- */
.duel-side.win .duel-side-tag { color: var(--accent-2); }
.duel-side.win .strip-viewport {
  border-color: rgba(233, 183, 74, .6);
  box-shadow: 0 0 26px rgba(233, 183, 74, .3), inset 0 0 18px rgba(233, 183, 74, .12);
  animation: winPulse .7s ease-in-out 2;
}
.duel-side.lose { opacity: .45; filter: saturate(.5); transition: .3s; }
.duel-side.draw .strip-viewport { border-color: rgba(130, 145, 163, .5); }
@keyframes winPulse {
  0%, 100% { box-shadow: 0 0 26px rgba(233, 183, 74, .3); }
  50% { box-shadow: 0 0 44px rgba(233, 183, 74, .55); }
}
.duel-verdict {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.6);
  font-size: clamp(30px, 7vw, 56px); font-weight: 900; letter-spacing: .12em;
  opacity: 0; pointer-events: none; white-space: nowrap;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.4), opacity .25s;
  z-index: 5;
}
.duel-verdict.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.duel-verdict.vd-win {
  color: var(--accent-2);
  text-shadow: 0 0 30px rgba(233, 183, 74, .8), 0 4px 14px rgba(0, 0, 0, .7);
}
.duel-verdict.vd-lose {
  color: #c9d4e0;
  text-shadow: 0 4px 14px rgba(0, 0, 0, .7);
}
.duel-verdict.vd-draw {
  color: var(--muted);
  text-shadow: 0 4px 14px rgba(0, 0, 0, .7);
}
.duel-stage { position: relative; }

/* ---------- 移动端补充 ---------- */
@media (max-width: 720px) {
  .news-banner { top: 58px; }
  .pf-stats { grid-template-columns: repeat(2, 1fr); }
  .pf-showcase { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  /* 升级页：库存多时限制高度内部滚动，不用下滑很久才看到挑战目标 */
  .upgrade-layout .up-grid {
    max-height: 300px; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
  }
  .upgrade-layout .up-title {
    position: sticky; top: 0; z-index: 2;
    background: var(--bg-2);
  }
}
