/* 《不想上班》打工人抽卡模拟器
   配色与结构参考主流抽卡游戏：暗底 + 金色高光 + 星级稀有度分色 */

:root {
  --bg: #080a0f;
  --bg-2: #0f131c;
  --panel: #131826;
  --panel-2: #1a2130;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef1f7;
  --muted: #8d97ad;
  --gold: #f0b429;
  --gold-2: #ffe6a8;
  --r5: #f0b429;
  --r4: #a06ee1;
  --r3: #4f8fd6;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system,
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 150px;
  /* 背景鱼层是穿透点击的，点在文字上会拖出选区，这里统一关掉 */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body.no-scroll {
  overflow: hidden;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.muted {
  color: var(--muted);
}

/* ---------- 背景光效 ---------- */

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(240, 180, 41, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(122, 106, 224, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
}

.bg-fx span {
  position: absolute;
  width: 46vw;
  height: 46vw;
  opacity: 0.55;
  animation: float 22s ease-in-out infinite;
}

.bg-fx span:nth-child(1) {
  background: radial-gradient(circle, rgba(240, 180, 41, 0.5), rgba(240, 180, 41, 0) 68%);
  top: -14vw;
  left: -10vw;
}

.bg-fx span:nth-child(2) {
  background: radial-gradient(circle, rgba(79, 143, 214, 0.5), rgba(79, 143, 214, 0) 68%);
  bottom: -20vw;
  right: -12vw;
  animation-delay: -8s;
}

.bg-fx span:nth-child(3) {
  background: radial-gradient(circle, rgba(57, 160, 142, 0.45), rgba(57, 160, 142, 0) 68%);
  top: 30vh;
  right: 20vw;
  width: 30vw;
  height: 30vw;
  animation-delay: -14s;
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(3vw, -4vh, 0) scale(1.12);
  }
}

/* ---------- 背景鱼群 ---------- */

.bg-fish {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.fish {
  position: absolute;
  top: var(--top, 50%);
  left: 0;
  width: var(--size, 80px);
  opacity: var(--op, 0.35);
  animation: fishSwim var(--dur, 30s) linear var(--delay, 0s) infinite;
  transition: opacity 0.9s ease;
}

.fish.left {
  animation-name: fishSwimLeft;
}

.fish.dash {
  animation-name: fishSwimDash;
}

.fish.dash.left {
  animation-name: fishSwimDashLeft;
}

.fish-bob {
  animation: fishBob var(--bob, 3.6s) ease-in-out infinite;
}

/* 捕食时的位移与长大都作用在这一层，避免和游动动画抢 transform */
.fish-move {
  transform-origin: 50% 50%;
  transition: transform 0.6s ease;
}

/* 只在追鱼时提升为独立图层，平时不占用 */
.fish-move.moving {
  will-change: transform;
}

.fish-flip {
  transform: scaleX(var(--dir, 1));
}

.fish-art svg {
  display: block;
  width: 100%;
  height: auto;
}

@keyframes fishSwim {
  from {
    transform: translateX(-20vw);
  }
  to {
    transform: translateX(118vw);
  }
}

@keyframes fishSwimLeft {
  from {
    transform: translateX(118vw);
  }
  to {
    transform: translateX(-20vw);
  }
}

/* 一部分鱼用「慢—冲—慢」的节奏游，看起来更有性格 */
@keyframes fishSwimDash {
  0% {
    transform: translateX(-20vw);
  }
  42% {
    transform: translateX(20vw);
  }
  56% {
    transform: translateX(66vw);
  }
  100% {
    transform: translateX(118vw);
  }
}

@keyframes fishSwimDashLeft {
  0% {
    transform: translateX(118vw);
  }
  44% {
    transform: translateX(58vw);
  }
  58% {
    transform: translateX(18vw);
  }
  100% {
    transform: translateX(-20vw);
  }
}

@keyframes fishBob {
  0% {
    transform: translateY(-9px) rotate(calc(var(--tilt, 0deg) - 4deg));
  }
  25% {
    transform: translateY(0) rotate(calc(var(--tilt, 0deg) + 4deg));
  }
  50% {
    transform: translateY(9px) rotate(calc(var(--tilt, 0deg) - 4deg));
  }
  75% {
    transform: translateY(0) rotate(calc(var(--tilt, 0deg) + 4deg));
  }
  100% {
    transform: translateY(-9px) rotate(calc(var(--tilt, 0deg) - 4deg));
  }
}

/* 被大鱼吞掉的小鱼 */
.fish.eaten {
  transition: none;
}

.fish.eaten .fish-bob {
  animation: fishGulp 0.44s ease-in forwards;
}

@keyframes fishGulp {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: var(--op, 0.35);
  }
  35% {
    transform: scale(0.85) rotate(-14deg);
  }
  100% {
    transform: scale(0.04) rotate(32deg);
    opacity: 0;
  }
}

/* 咬合瞬间的挤压 */
.fish.chomp .fish-bob {
  animation: fishChomp 0.3s ease-out;
}

@keyframes fishChomp {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.16, 0.84);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fish {
    display: none;
  }
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px clamp(12px, 3vw, 32px);
  /* 不用 backdrop-filter：顶栏常驻，背景鱼一直在动，每帧重采样虚化非常吃 GPU */
  background: rgba(8, 10, 15, 0.93);
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 22px;
  background: linear-gradient(145deg, #f0b429, #8a4b0a);
  box-shadow: 0 6px 18px rgba(240, 180, 41, 0.28);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 17px;
  letter-spacing: 2px;
}

.brand-text small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.res {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(240, 180, 41, 0.16), rgba(240, 180, 41, 0.06));
  border: 1px solid rgba(240, 180, 41, 0.35);
  font-variant-numeric: tabular-nums;
}

.res-sign {
  color: var(--gold);
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.chip.monthly {
  color: var(--gold-2);
  border-color: rgba(240, 180, 41, 0.45);
  background: rgba(240, 180, 41, 0.12);
}

.chip.guarantee {
  color: #2a1a00;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: transparent;
  font-weight: 700;
  margin-left: 8px;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text);
  transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  filter: brightness(1.12);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn.buy {
  border: none;
  color: #2a1a00;
  font-weight: 700;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 8px 20px rgba(240, 180, 41, 0.26);
}

.btn.ghost {
  background: rgba(0, 0, 0, 0.42);
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 16px;
}

.icon-btn:hover {
  filter: brightness(1.15);
}

/* ---------- 主体 ---------- */

.stage {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pool-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  transition: all 0.2s ease;
}

.tab-tag {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}

.tab-name {
  font-size: 14px;
  font-weight: 600;
}

.tab.active {
  border-color: rgba(240, 180, 41, 0.6);
  background: linear-gradient(180deg, rgba(240, 180, 41, 0.18), rgba(240, 180, 41, 0.04));
  box-shadow: inset 0 0 0 1px rgba(240, 180, 41, 0.2);
}

.tab.active .tab-tag {
  color: var(--gold-2);
}

/* ---------- 卡池主视觉 ---------- */

.banner {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #101625, #0a0d14 70%);
  box-shadow: var(--shadow);
  min-height: 340px;
}

.banner[data-theme="limited"] {
  background: linear-gradient(135deg, #241a08, #0d0f16 62%);
}

.banner[data-theme="standard"] {
  background: linear-gradient(135deg, #0d1a2a, #0b0e15 62%);
}

.banner-glow {
  position: absolute;
  inset: -40% -10% auto auto;
  width: 60%;
  height: 160%;
  background: radial-gradient(circle at 60% 40%, rgba(240, 180, 41, 0.4), transparent 62%);
  opacity: 0.7;
  pointer-events: none;
}

.banner[data-theme="standard"] .banner-glow {
  background: radial-gradient(circle at 60% 40%, rgba(79, 143, 214, 0.4), transparent 62%);
}

.banner-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 24px;
  padding: clamp(18px, 3vw, 34px);
  align-items: center;
}

.banner-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.banner-tag {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 2px;
  color: #2a1a00;
  font-weight: 700;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}

.banner h1 {
  font-size: clamp(26px, 4.2vw, 42px);
  letter-spacing: 3px;
  background: linear-gradient(180deg, #fff8e6, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.banner-sub {
  color: var(--gold-2);
  font-size: 14px;
}

.banner-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.banner-notes li {
  position: relative;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.banner-notes li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.8;
}

.banner-stat {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.banner-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

/* ---------- 保底 ---------- */

.pity {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(19, 24, 38, 0.72);
}

.pity-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.pity-label b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.pity-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.pity-bar.small {
  height: 6px;
}

.pity-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #7a6ae0, var(--gold));
  transition: width 0.35s ease;
}

.pity-bar i.soft {
  background: linear-gradient(90deg, var(--gold), #ff7a45);
  box-shadow: 0 0 14px rgba(240, 180, 41, 0.6);
}

.pity-bar i.p4 {
  background: linear-gradient(90deg, #4f8fd6, var(--r4));
}

.pity-hint {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 底部操作栏 ---------- */

.actionbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px clamp(12px, 3vw, 32px) calc(14px + env(safe-area-inset-bottom));
  background: rgba(8, 10, 15, 0.95);
  border-top: 1px solid var(--line);
}

.btn-pull {
  min-width: 170px;
  padding: 12px 22px;
  border: none;
  border-radius: 12px;
  flex-direction: column;
  gap: 2px;
  color: #eaeefb;
  background: linear-gradient(180deg, #2b3245, #1b2130);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 22px rgba(0, 0, 0, 0.4);
}

.btn-pull .btn-main {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}

.btn-pull .btn-cost {
  font-size: 12px;
  color: var(--muted);
}

.btn-pull.ten {
  color: #2a1a00;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 10px 26px rgba(240, 180, 41, 0.32);
}

.btn-pull.ten .btn-cost {
  color: rgba(42, 26, 0, 0.72);
}

.btn-pull:hover {
  filter: brightness(1.08);
}

.pull-count {
  position: absolute;
  right: clamp(12px, 3vw, 32px);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 卡片 ---------- */

.mcard {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #10141d;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mcard:hover {
  transform: translateY(-3px);
}

.mcard-art {
  position: relative;
  aspect-ratio: 3 / 4;
}

.mcard-art svg,
.rcard-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.mcard-star {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--accent, var(--gold));
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.mcard-name {
  padding: 7px 8px 5px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mcard-code {
  padding: 0 8px 8px;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.mcard-tag,
.mcard-count,
.mcard-lock {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.mcard-tag.up {
  color: #2a1a00;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}

.mcard-count {
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  font-variant-numeric: tabular-nums;
}

.mcard-lock {
  color: #cfd6e4;
  background: rgba(0, 0, 0, 0.62);
}

.mcard.r5 {
  border-color: rgba(240, 180, 41, 0.55);
  box-shadow: 0 10px 26px rgba(240, 180, 41, 0.18);
}

.mcard.r4 {
  border-color: rgba(160, 110, 225, 0.5);
}

.mcard.r3 {
  border-color: rgba(79, 143, 214, 0.4);
}

.mcard.locked {
  filter: grayscale(0.9) brightness(0.62);
}

/* ---------- 抽卡演出 ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  overflow: auto;
  background: #05060a;
}

.overlay.show {
  display: block;
  animation: fadeIn 0.25s ease both;
}

.pull-sky {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(79, 143, 214, 0.55), #05060a 68%);
  transition: background 0.3s ease;
}

.overlay.r4 .pull-sky {
  background: radial-gradient(circle at 50% 42%, rgba(160, 110, 225, 0.6), #05060a 68%);
}

.overlay.r5 .pull-sky {
  background: radial-gradient(circle at 50% 42%, rgba(255, 206, 94, 0.75), #1a1206 55%, #05060a 82%);
}

.pull-stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 84px clamp(12px, 3vw, 40px) 96px;
}

.burst {
  position: relative;
  width: min(46vw, 300px);
  height: min(46vw, 300px);
  display: grid;
  place-items: center;
}

.burst-core {
  width: 34%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, rgba(255, 255, 255, 0.1) 70%);
  animation: burstCore 0.9s ease-out both;
}

.overlay.r5 .burst-core {
  background: radial-gradient(circle, #fff6dc, var(--gold) 45%, rgba(240, 180, 41, 0) 72%);
}

.overlay.r4 .burst-core {
  background: radial-gradient(circle, #f0e4ff, var(--r4) 45%, rgba(160, 110, 225, 0) 72%);
}

.burst-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  animation: ringOut 1.1s ease-out both;
}

.burst-ring.d2 {
  animation-delay: 0.18s;
  border-color: rgba(255, 255, 255, 0.3);
}

.overlay.r5 .burst-ring {
  border-color: rgba(255, 214, 122, 0.8);
}

.burst-rays {
  position: absolute;
  inset: -18%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.5) 0deg 2deg,
    rgba(255, 255, 255, 0) 2deg 10deg
  );
  mask-image: radial-gradient(circle, #000 30%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 72%);
  animation: spin 3.4s linear infinite;
  opacity: 0.75;
}

.overlay.r5 .burst-rays {
  opacity: 1;
}

.burst-text {
  font-size: 15px;
  letter-spacing: 8px;
  color: #fff;
  opacity: 0.85;
  animation: fadeIn 0.5s 0.15s ease both;
}

.pull-skip {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 5;
}

.pull-continue {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  min-width: 180px;
  border: none;
  flex-direction: row;
}

.result-wrap {
  display: grid;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.result-wrap.ten {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 880px;
}

.result-wrap.one {
  grid-template-columns: minmax(0, 250px);
}

.rcard-slot {
  opacity: 0;
}

.rcard-slot.in {
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.rcard-slot.landed {
  opacity: 1;
}

/* ---------- 稀有卡放大演出 ---------- */

.spotlight-layer {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  animation: fadeIn 0.28s ease both;
}

.spotlight-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(160, 110, 225, 0.34), rgba(160, 110, 225, 0) 58%);
  animation: spotlightGlow 0.5s ease both;
}

.spotlight-layer.r5::before {
  background: radial-gradient(circle at 50% 50%, rgba(255, 206, 94, 0.42), rgba(255, 206, 94, 0) 60%);
}

.spotlight-layer.r5::after {
  content: "";
  position: absolute;
  inset: -18%;
  opacity: 0.75;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.26) 0deg 1.4deg,
    rgba(255, 255, 255, 0) 1.4deg 9deg
  );
  mask-image: radial-gradient(circle, #000 20%, transparent 60%);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 60%);
  animation: spin 12s linear infinite;
}

/* 位置与尺寸等于目标结果格，靠 transform 放大到屏幕中央，再归零缩回 */
.hero-pop {
  position: fixed;
  z-index: 9;
  transform-origin: center center;
  will-change: transform;
  animation: heroIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.rcard-hero {
  width: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px var(--accent, rgba(240, 180, 41, 0.5));
}

@keyframes heroIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spotlightGlow {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.rcard {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #141926, #0c0f16);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

.rcard.r5 {
  border-color: rgba(240, 180, 41, 0.75);
  box-shadow: 0 0 30px rgba(240, 180, 41, 0.4);
}

.rcard.r4 {
  border-color: rgba(160, 110, 225, 0.7);
  box-shadow: 0 0 22px rgba(160, 110, 225, 0.28);
}

.rcard-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.32), transparent 70%);
  transform: translateX(-120%);
  animation: sweep 1.6s 0.35s ease-out both;
  pointer-events: none;
  z-index: 3;
}

.rcard.r5 .rcard-glow {
  animation: sweep 2.2s 0.4s ease-out 2 both;
}

.rcard-art {
  aspect-ratio: 3 / 4;
}

.rcard-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rcard-star {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--accent, var(--gold));
}

.rcard-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rcard-meta,
.rcard-code {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rcard-badges {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.badge {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
}

.badge.up {
  color: #2a1a00;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}

.badge.new {
  color: #051b12;
  background: linear-gradient(180deg, #8ff0c4, #35c98d);
}

.result-tip {
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.6);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes burstCore {
  0% {
    transform: scale(0.1);
    opacity: 0;
  }
  45% {
    opacity: 1;
  }
  100% {
    transform: scale(1.05);
    opacity: 0.95;
  }
}

@keyframes ringOut {
  0% {
    transform: scale(0.2);
    opacity: 0;
  }
  40% {
    opacity: 0.9;
  }
  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}

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

@keyframes sweep {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes cardIn {
  0% {
    opacity: 0;
    transform: translateY(26px) rotateY(70deg) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateY(0) scale(1);
  }
}

/* ---------- 弹层 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3vw, 30px);
  background: rgba(3, 5, 9, 0.86);
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  width: min(920px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #141a27, #0b0e14);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: cardIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 17px;
  letter-spacing: 2px;
}

.modal-body {
  padding: 18px 20px 24px;
  overflow: auto;
  -webkit-user-select: text;
  user-select: text;
}

.sub {
  margin: 20px 0 12px;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--gold-2);
}

.sub:first-child {
  margin-top: 0;
}

/* 统计 */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

.stat-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.table th {
  color: var(--muted);
  font-weight: 500;
}

.table td:not(:first-child),
.table th:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 300px;
  overflow: auto;
}

.log {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 24px 82px 74px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}

.log.r5 {
  background: linear-gradient(90deg, rgba(240, 180, 41, 0.16), rgba(255, 255, 255, 0.02));
  border-left: 3px solid var(--gold);
}

.log.r4 {
  border-left: 3px solid var(--r4);
}

.log.r3 {
  border-left: 3px solid var(--r3);
}

.log-star {
  color: var(--accent, var(--gold));
  font-size: 10px;
  letter-spacing: 1px;
}

.log.r5 .log-star {
  color: var(--gold);
}

.log.r4 .log-star {
  color: var(--r4);
}

.log.r3 .log-star {
  color: var(--r3);
}

.log-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-pool,
.log-n {
  color: var(--muted);
  text-align: right;
}

/* 图鉴 */

.book-head {
  font-size: 13px;
  color: var(--muted);
}

.book-head b {
  color: var(--gold);
  font-size: 16px;
}

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

/* 成就 */

.ach-btn {
  position: relative;
}

.ach-badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #2a1a00;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border: 1px solid rgba(0, 0, 0, 0.35);
  font-variant-numeric: tabular-nums;
}

.ach-badge.full {
  background: linear-gradient(180deg, #9cf3c9, #35c98d);
  color: #05230f;
}

.ach-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

.ach-summary b {
  margin: 0 4px;
  font-size: 24px;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.ach-overall {
  margin: 10px 0 4px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.ach-overall i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7a6ae0, var(--gold));
  transition: width 0.35s ease;
}

.ach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ach {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.ach.done {
  border-color: rgba(240, 180, 41, 0.45);
  background: linear-gradient(90deg, rgba(240, 180, 41, 0.13), rgba(255, 255, 255, 0.02));
}

.ach.hidden-locked {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
}

.ach.hidden-locked .ach-mark {
  color: #6f7a8d;
  font-size: 18px;
  font-weight: 700;
}

.ach.hidden-locked .ach-title b {
  color: #8d97ad;
  letter-spacing: 3px;
}

.ach-mark {
  flex: none;
  width: 26px;
  text-align: center;
  font-size: 16px;
  line-height: 1.3;
  color: var(--muted);
}

.ach-main {
  flex: 1;
  min-width: 0;
}

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

.ach-title b {
  font-size: 14px;
}

.ach.done .ach-title b {
  color: var(--gold-2);
}

.ach-points {
  font-size: 11px;
  color: var(--muted);
}

.ach-gain {
  margin-left: auto;
  font-size: 12px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.ach-desc {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.ach-bar {
  margin-top: 8px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.ach-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f8fd6, var(--r4));
  transition: width 0.35s ease;
}

.ach.done .ach-bar i {
  background: linear-gradient(90deg, var(--gold), #ffd98a);
}

.ach-progress {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 充值 */

.shop-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(240, 180, 41, 0.35);
  background: linear-gradient(180deg, rgba(240, 180, 41, 0.14), rgba(240, 180, 41, 0.04));
  font-size: 15px;
}

.shop-balance b {
  color: var(--gold-2);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.tier {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 18px 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1a2130, #12171f);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tier:hover {
  transform: translateY(-3px);
  border-color: rgba(240, 180, 41, 0.5);
  box-shadow: 0 12px 26px rgba(240, 180, 41, 0.16);
}

.tier-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.tier-unit {
  font-size: 11px;
  color: var(--muted);
}

.tier-price {
  margin-top: 12px;
  width: 100%;
  padding: 7px 0;
  border-radius: 8px;
  font-weight: 700;
  color: #2a1a00;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}

.tier-tag,
.tier-first {
  position: absolute;
  top: -9px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.tier-tag {
  right: 8px;
  color: #2a1a00;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}

.tier-first {
  left: 8px;
  color: #05230f;
  background: linear-gradient(180deg, #9cf3c9, #35c98d);
}

.monthly-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(122, 106, 224, 0.45);
  background: linear-gradient(135deg, rgba(122, 106, 224, 0.16), rgba(255, 255, 255, 0.02));
}

.monthly-info strong {
  font-size: 15px;
}

.monthly-info p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.6;
}

.disclaimer {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.shop-extra {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  font-size: 12.5px;
}

/* 设置 */

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row strong {
  font-size: 14px;
}

.setting-row p {
  margin-top: 4px;
  font-size: 12px;
  max-width: 560px;
  line-height: 1.6;
}

.setting-row.danger strong {
  color: #ff9a8b;
}

.danger-btn {
  border-color: rgba(255, 122, 102, 0.45);
  color: #ffb4a6;
}

.switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}

.switch .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.switch.on {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: transparent;
}

.switch.on .knob {
  transform: translateX(24px);
}

.confirm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.confirm h3 {
  font-size: 18px;
  letter-spacing: 1px;
}

.confirm p {
  font-size: 13px;
  color: #cbd3e2;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 6px;
}

.confirm-actions .btn {
  min-width: 120px;
}

/* 提示 */

.toast {
  position: fixed;
  left: 50%;
  top: calc(82px + env(safe-area-inset-top));
  bottom: auto;
  z-index: 200;
  transform: translate(-50%, -16px);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13px;
  background: rgba(20, 26, 39, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.gold {
  border-color: rgba(240, 180, 41, 0.6);
  background: linear-gradient(180deg, rgba(240, 180, 41, 0.22), rgba(20, 26, 39, 0.96));
  color: var(--gold-2);
}

.toast.warn {
  border-color: rgba(255, 122, 102, 0.55);
  color: #ffb4a6;
}

/* ---------- 成就：右侧滑入卡片 ---------- */

.ach-toasts {
  position: fixed;
  top: calc(82px + env(safe-area-inset-top));
  right: 16px;
  z-index: 210;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.ach-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(320px, 82vw);
  padding: 12px 15px;
  border-radius: 14px;
  border: 1px solid rgba(240, 180, 41, 0.55);
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.24), rgba(16, 20, 29, 0.96) 62%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: achToastIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ach-toast.leaving {
  animation: achToastOut 0.36s ease forwards;
}

.ach-toast-icon {
  flex: none;
  font-size: 26px;
  filter: drop-shadow(0 0 10px rgba(240, 180, 41, 0.7));
}

.ach-toast-body {
  min-width: 0;
}

.ach-toast-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
}

.ach-toast-name {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ach-toast-gain {
  margin-top: 3px;
  font-size: 11.5px;
  color: #cbd3e2;
  font-variant-numeric: tabular-nums;
}

/* 意外之财：换一套金绿色，和成就卡区分开 */
.ach-toast.money {
  width: min(340px, 84vw);
  border-color: rgba(53, 201, 141, 0.6);
  background: linear-gradient(135deg, rgba(53, 201, 141, 0.24), rgba(14, 20, 26, 0.96) 62%);
}

.ach-toast.money .ach-toast-icon {
  filter: drop-shadow(0 0 10px rgba(53, 201, 141, 0.7));
}

.ach-toast.money .ach-toast-label {
  color: #6ee7b0;
}

.ach-toast.money .ach-toast-name {
  color: #d8fbe9;
}

.ach-toast-desc {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #9fb0c4;
}

.ach-toast.money .ach-toast-gain {
  color: #8ff0c4;
  font-weight: 700;
}

@keyframes achToastIn {
  from {
    opacity: 0;
    transform: translateX(115%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes achToastOut {
  to {
    opacity: 0;
    transform: translateX(115%) scale(0.96);
  }
}

/* ---------- 响应式 ---------- */

/* 窗口不够宽时，顶部提示与右侧成就卡片改为上下错开，避免互相压住 */
@media (max-width: 1080px) {
  .toast {
    top: calc(94px + env(safe-area-inset-top));
  }

  .ach-toasts {
    top: calc(158px + env(safe-area-inset-top));
    right: 12px;
  }
}

@media (max-width: 860px) {
  .banner-inner {
    grid-template-columns: 1fr;
  }

  .banner-cards {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  }

  .brand-text small {
    display: none;
  }

  .btn-pull {
    min-width: 0;
    flex: 1;
  }

  .pull-count {
    position: static;
    width: 100%;
    text-align: center;
    order: 3;
  }

  .actionbar {
    flex-wrap: wrap;
  }

  .log {
    grid-template-columns: 54px minmax(0, 1fr) 60px;
  }

  .log-el,
  .log-pool {
    display: none;
  }

  .result-wrap.ten {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

}

@media (max-width: 520px) {
  .topbar-right .btn {
    padding: 8px 11px;
    font-size: 13px;
  }

  /* 手机上收起规则说明，避免卡池区域过高、抽卡按钮被推到屏幕外 */
  .banner {
    min-height: 0;
  }

  .banner-inner {
    gap: 16px;
    padding: 16px;
  }

  .banner-notes {
    display: none;
  }

  .banner h1 {
    font-size: 26px;
  }

  .result-wrap.ten {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-wrap.one {
    grid-template-columns: minmax(0, 200px);
  }
}
