/* ============================================================================
   锻灵录  —  styles
   ========================================================================== */

:root {
  --bg: #07080b;
  --panel: rgba(17, 19, 25, 0.72);
  --panel-solid: #11131a;
  --line: rgba(224, 181, 104, 0.14);
  --line-soft: rgba(255, 255, 255, 0.06);
  --ink: #eae4d6;
  --ink-dim: #9aa3b0;
  --ink-faint: #626a77;
  --gold: #e0b568;
  --gold-soft: #f2d7a2;
  --cinnabar: #cf5a45;
  --jade: #5fbf8f;
  --blue: #5fb0ff;
  --radius: 16px;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- 背景 ---------- */
.bg-veil {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(224, 181, 104, 0.10), transparent 62%),
    radial-gradient(860px 560px at 88% 108%, rgba(88, 58, 150, 0.14), transparent 62%),
    radial-gradient(700px 480px at 6% 92%, rgba(28, 96, 96, 0.10), transparent 62%),
    rgba(7, 8, 11, 0.52);
}

.bg-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px clamp(16px, 3vw, 34px);
  background: linear-gradient(180deg, rgba(7, 8, 11, 0.94), rgba(7, 8, 11, 0.66) 70%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(224, 181, 104, 0.08);
}

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

.brand-seal {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-family: var(--serif);
  font-size: 22px;
  color: #1a1208;
  background: linear-gradient(150deg, #f0d29a, #c99b4e 55%, #8c6427);
  box-shadow: 0 0 0 1px rgba(255, 230, 180, 0.35), 0 8px 24px rgba(200, 150, 70, 0.28);
}

.brand-text h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #f3ecdd;
}

.brand-text p {
  margin: 1px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.32em;
  color: var(--ink-faint);
}

.resources {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.res {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  white-space: nowrap;
}

.res-icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.res-icon.stone { color: #ffd98a; background: rgba(224, 181, 104, 0.12); border: 1px solid rgba(224, 181, 104, 0.28); }
.res-icon.charm { color: #ffcf9a; background: rgba(207, 90, 69, 0.14); border: 1px solid rgba(207, 90, 69, 0.35); }
.res-icon.dot { font-size: 10px; }

.wanbi   { color: #8fd8ff; background: rgba(95, 176, 255, 0.12); border: 1px solid rgba(95, 176, 255, 0.34); }
.jixing  { color: #ffd98a; background: rgba(224, 181, 104, 0.12); border: 1px solid rgba(224, 181, 104, 0.34); }
.tianyuan{ color: #c6a9ff; background: rgba(150, 110, 255, 0.13); border: 1px solid rgba(150, 110, 255, 0.34); }

.res-num {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 13.5px;
  color: #f0ead9;
}

.res-rate {
  font-size: 10px;
  color: var(--jade);
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}

.top-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-dim);
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s;
}

.icon-btn:hover { color: var(--gold); border-color: rgba(224, 181, 104, 0.34); background: rgba(224, 181, 104, 0.08); }
.icon-btn.off { opacity: 0.38; }

/* ---------- 布局 ---------- */
.board {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(380px, 1fr) minmax(290px, 350px);
  gap: 18px;
  padding: 22px clamp(16px, 3vw, 34px) 8px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.panel {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 42%), var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
}

.panel-head.sub { padding-top: 18px; }

.panel-title {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.34em;
  color: var(--ink-dim);
}

.badge {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--gold);
  border: 1px solid rgba(224, 181, 104, 0.3);
  background: rgba(224, 181, 104, 0.07);
}

.link-btn {
  border: 0;
  background: none;
  padding: 2px;
  color: var(--ink-faint);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
}
.link-btn:hover { color: var(--gold); }



/* ---------- 主器卡 ---------- */
.equip-panel { padding-bottom: 16px; }

.item-card {
  --gc: #9fb0c0;
  --gc-glow: rgba(159, 176, 192, 0.3);
  position: relative;
  margin: 0 12px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  text-align: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--gc) 26%, transparent);
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--gc) 14%, transparent), transparent 60%),
    rgba(10, 12, 17, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 40px -18px var(--gc-glow);
  transition: border-color 0.35s, box-shadow 0.35s, transform 0.35s;
}

.card-aura {
  position: absolute;
  left: 50%; top: 42%;
  width: 240px; height: 240px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--gc-glow), transparent 62%);
  opacity: 0.38;
  filter: blur(8px);
  pointer-events: none;
  animation: breathe 5.5s ease-in-out infinite;
}

.card-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.05) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.9s ease;
}

.item-card:hover .card-scan { transform: translateX(120%); }

.item-portrait {
  position: relative;
  height: 160px;
  margin: 4px 0 -2px;
  display: grid;
  place-items: center;
}

.item-portrait::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gc-glow), transparent 70%);
  filter: blur(9px);
  opacity: 0.95;
  pointer-events: none;
  animation: portraitHalo 4.5s ease-in-out infinite;
}

.item-portrait img.hero-art {
  position: relative;
  z-index: 1;
  height: 152px;
  width: auto;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
  animation: portraitFloat 6s ease-in-out infinite;
}

.item-portrait svg {
  height: 156px;
  width: auto;
  filter:
    drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 9px var(--gc-glow))
    drop-shadow(0 0 24px var(--gc-glow));
  animation: portraitFloat 6s ease-in-out infinite;
}

@keyframes portraitFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.item-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grade-chip {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 3px 9px;
  border-radius: 6px;
  color: var(--gc);
  border: 1px solid color-mix(in srgb, var(--gc) 34%, transparent);
  background: color-mix(in srgb, var(--gc) 10%, transparent);
}

.item-tier { font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.08em; }

.item-name {
  position: relative;
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.1em;
  color: #f2ecdd;
}

.item-level {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: 2px 0 2px;
  font-family: var(--serif);
  line-height: 0.95;
}

.lv-plus {
  font-size: 24px;
  margin-top: 8px;
  margin-right: 2px;
  color: var(--gc);
  opacity: 0.85;
}

.lv-num {
  display: inline-block;
  font-size: 62px;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff6e2 8%, var(--gc) 58%, color-mix(in srgb, var(--gc) 55%, #000) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px var(--gc-glow));
  font-variant-numeric: tabular-nums;
}

.item-tone {
  position: relative;
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
}

.item-tone b { font-weight: 600; letter-spacing: 0.12em; }

.item-atk {
  position: relative;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}
.item-atk b { color: var(--ink-dim); font-weight: 600; }

.pips {
  position: relative;
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 3px;
  margin: 14px 2px 12px;
}

.pips i {
  display: block;
  height: 12px;
  border-radius: 1.5px;
  background: rgba(255, 255, 255, 0.07);
  transition: background 0.3s, box-shadow 0.3s;
}

.pips i.on {
  background: linear-gradient(180deg, var(--gc), color-mix(in srgb, var(--gc) 45%, #000));
  box-shadow: 0 0 8px var(--gc-glow);
}

.pity { position: relative; margin: 10px 2px 0; }

.pity-head {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

.pity-num { font-variant-numeric: tabular-nums; color: var(--ink-dim); }
.pity.ready .pity-num { color: var(--jade); }
.pity.ready .bar i { background: linear-gradient(90deg, #3f9a6c, #6fe0a8); }

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

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

.item-actions {
  position: relative;
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.ghost-btn {
  flex: 1;
  padding: 7px 0;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink-dim);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: 0.2s;
}
.ghost-btn:hover { color: var(--gold); border-color: rgba(224, 181, 104, 0.32); background: rgba(224, 181, 104, 0.06); }
.ghost-btn:disabled { opacity: 0.32; cursor: not-allowed; }

.item-card.is-empty .item-top,
.item-card.is-empty .item-portrait,
.item-card.is-empty .item-name,
.item-card.is-empty .item-level,
.item-card.is-empty .item-tone,
.item-card.is-empty .item-atk,
.item-card.is-empty .pips,
.item-card.is-empty .pity,
.item-card.is-empty .item-actions { visibility: hidden; }

.item-card.is-empty { min-height: 300px; }

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.empty-mark {
  width: 62px; height: 62px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px dashed rgba(224, 181, 104, 0.3);
  font-family: var(--serif);
  font-size: 26px;
  color: rgba(224, 181, 104, 0.5);
  margin-bottom: 8px;
}

.empty-state p { margin: 0; font-family: var(--serif); font-size: 15px; color: var(--ink-dim); letter-spacing: 0.1em; }
.empty-state span { font-size: 11px; color: var(--ink-faint); }

/* 破碎 / 成功 动画 */
.item-card.breaking { animation: shatter 0.6s ease; border-color: rgba(207, 90, 69, 0.8); }
.item-card.success-flash { animation: cardFlash 0.7s ease; }
.item-card.fail-flash { animation: cardShake 0.5s ease; }

@keyframes cardFlash {
  0% { box-shadow: 0 0 0 0 var(--gc-glow), inset 0 0 0 0 rgba(255, 240, 200, 0.6); }
  35% { box-shadow: 0 0 60px 6px var(--gc-glow), inset 0 0 40px rgba(255, 240, 200, 0.22); }
  100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 40px -18px var(--gc-glow); }
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-6px); }
  38% { transform: translateX(5px); }
  58% { transform: translateX(-4px); }
  78% { transform: translateX(3px); }
}

@keyframes shatter {
  0% { transform: scale(1); filter: none; }
  20% { transform: scale(1.02) rotate(-0.6deg); filter: brightness(1.6) saturate(1.4); }
  100% { transform: scale(0.97); filter: grayscale(1) brightness(0.5); }
}

/* ---------- 垫器 ---------- */
.pad-card {
  margin: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
}

.pad-info { display: flex; align-items: center; gap: 8px; min-width: 0; }

.pad-grade {
  font-family: var(--serif);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-dim);
  border: 1px solid var(--line-soft);
}

.pad-name {
  font-size: 12.5px;
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pad-lv {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.pad-actions { display: flex; gap: 6px; flex-shrink: 0; }

.mini-btn {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid rgba(224, 181, 104, 0.26);
  background: rgba(224, 181, 104, 0.08);
  color: var(--gold);
  font-size: 11px;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}
.mini-btn:hover { background: rgba(224, 181, 104, 0.16); }
.mini-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.mini-btn.danger { color: var(--ink-faint); border-color: var(--line-soft); background: transparent; }

.pad-hint {
  margin: 8px 14px 0;
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* ---------- 炼器炉 ---------- */
.forge-panel {
  display: flex;
  flex-direction: column;
  padding: 6px 22px 20px;
  min-height: 560px;
}

.forge-current {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

.forge-current .fc-grade {
  font-family: var(--serif);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 4px;
  color: var(--ink-dim);
  border: 1px solid var(--line-soft);
}

.forge-current .fc-name { color: var(--ink-dim); }

.forge-current .fc-lv {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.forge-stage {
  position: relative;
  flex: 1;
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.halo {
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 150, 60, 0.18), rgba(224, 181, 104, 0.06) 40%, transparent 68%);
  filter: blur(10px);
  animation: breathe 4.5s ease-in-out infinite;
}

.runes {
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  border: 1px dashed rgba(224, 181, 104, 0.16);
  box-shadow: 0 0 0 18px rgba(224, 181, 104, 0.02), 0 0 0 19px rgba(224, 181, 104, 0.06);
  animation: spin 26s linear infinite;
}

.runes::before,
.runes::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  border: 1px solid rgba(224, 181, 104, 0.06);
}

.runes::after { inset: 52px; border-style: dashed; animation: spin 16s linear infinite reverse; }

.forge-weapon {
  position: absolute;
  left: 50%;
  bottom: 57%;
  width: 70px;
  height: 112px;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
}

.forge-weapon svg {
  width: 100%;
  height: 100%;
  transform: rotate(180deg);
  filter:
    drop-shadow(0 0 10px var(--gc-glow, rgba(224, 181, 104, 0.4)))
    drop-shadow(0 0 30px var(--gc-glow, rgba(224, 181, 104, 0.4)));
  animation: forgeHover 5s ease-in-out infinite;
}

@keyframes forgeHover {
  0%, 100% { transform: rotate(180deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.035); }
}

.cauldron {
  position: relative;
  width: 210px;
  height: 190px;
  z-index: 2;
}

.cauldron-aura {
  position: absolute;
  left: 50%; top: 46%;
  width: 190px; height: 150px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 140, 40, 0.32), transparent 68%);
  filter: blur(18px);
  opacity: 0.7;
}

/* 火焰 */
.flame {
  position: absolute;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  border-radius: 50% 50% 44% 44% / 60% 60% 40% 40%;
  filter: blur(7px);
  mix-blend-mode: screen;
  transform-origin: 50% 100%;
  opacity: 0.92;
}

.f1 {
  width: 46px; height: 84px;
  background: radial-gradient(circle at 50% 82%, #fff6cf, #ffbb55 38%, #e2601f 68%, transparent 82%);
  animation: flicker 1.5s ease-in-out infinite;
}

.f2 {
  width: 84px; height: 110px;
  left: 50%;
  bottom: 100px;
  background: radial-gradient(circle at 50% 80%, rgba(255, 190, 90, 0.9), rgba(224, 96, 30, 0.5) 52%, transparent 74%);
  animation: flicker 2.1s ease-in-out infinite reverse;
  opacity: 0.6;
}

.f3 {
  width: 26px; height: 54px;
  bottom: 112px;
  background: radial-gradient(circle at 50% 80%, #ffffff, #ffe3a0 45%, rgba(255, 150, 60, 0.6) 70%, transparent 84%);
  animation: flicker 1.05s ease-in-out infinite;
}

.cauldron-rim {
  position: absolute;
  left: 50%; top: 74px;
  width: 178px; height: 30px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #a5824d, #6b4f2b 45%, #33230f);
  border: 1px solid rgba(240, 205, 140, 0.34);
  box-shadow: inset 0 2px 4px rgba(255, 232, 180, 0.4), 0 3px 4px rgba(0, 0, 0, 0.7);
  z-index: 3;
}

.cauldron-body {
  position: absolute;
  left: 50%; top: 84px;
  width: 154px; height: 84px;
  transform: translateX(-50%);
  border-radius: 10px 10px 78px 78px / 8px 8px 72px 72px;
  background:
    linear-gradient(180deg, rgba(255, 190, 110, 0.18), transparent 22%),
    linear-gradient(180deg, #6f5130, #3a2814 45%, #1a120a);
  border: 1px solid rgba(240, 205, 140, 0.26);
  box-shadow:
    inset 0 -26px 36px rgba(0, 0, 0, 0.85),
    inset 0 8px 18px rgba(255, 180, 100, 0.12),
    0 26px 50px -14px rgba(0, 0, 0, 0.9);
  z-index: 2;
}

/* 炉身云纹 */
.cauldron-body::after {
  content: "";
  position: absolute;
  inset: 18px 16px 20px;
  border-radius: 50%;
  border: 1px solid rgba(240, 205, 140, 0.16);
  border-top-color: transparent;
  border-left-color: transparent;
  transform: rotate(8deg);
}

.leg {
  position: absolute;
  bottom: 4px;
  width: 18px; height: 42px;
  background: linear-gradient(180deg, #4a3419, #1a1109);
  border-radius: 0 0 8px 8px;
  border: 1px solid rgba(240, 205, 140, 0.12);
  z-index: 1;
}

.leg.left { left: 42px; transform: rotate(7deg); }
.leg.right { right: 42px; transform: rotate(-7deg); }

/* 炼器时 */
.forge-stage.working .f1 { animation-duration: 0.42s; }
.forge-stage.working .f2 { animation-duration: 0.6s; opacity: 0.95; }
.forge-stage.working .f3 { animation-duration: 0.3s; }
.forge-stage.working .halo { animation-duration: 1s; }
.forge-stage.working .runes { animation-duration: 5s; }
.forge-stage.working .cauldron { animation: cauldronPulse 0.55s ease; }

@keyframes cauldronPulse {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.045); }
}

@keyframes flicker {
  0%, 100% { transform: translateX(-50%) scale(1, 1) rotate(-1deg); opacity: 0.9; }
  25% { transform: translateX(-52%) scale(1.08, 0.94) rotate(2deg); opacity: 1; }
  50% { transform: translateX(-49%) scale(0.94, 1.08) rotate(-2deg); opacity: 0.82; }
  75% { transform: translateX(-51%) scale(1.04, 0.98) rotate(1deg); opacity: 0.96; }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.08); opacity: 1; }
}

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

/* 飘字 */
.result-pop {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, 0);
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 600;
  letter-spacing: 0.06em;
  pointer-events: none;
  opacity: 0;
  z-index: 6;
  white-space: nowrap;
}

.result-pop.show { animation: popUp 1.1s ease forwards; }
.result-pop.good { color: #ffe6a8; text-shadow: 0 0 28px rgba(255, 200, 90, 0.85); }
.result-pop.bad { color: #ff9c86; text-shadow: 0 0 26px rgba(255, 90, 60, 0.7); font-size: 32px; }
.result-pop.broken { color: #ff7a5c; text-shadow: 0 0 30px rgba(255, 60, 30, 0.8); font-size: 34px; letter-spacing: 0.2em; }

@keyframes popUp {
  0% { opacity: 0; transform: translate(-50%, 18px) scale(0.8); }
  22% { opacity: 1; transform: translate(-50%, -6px) scale(1.06); }
  60% { opacity: 1; transform: translate(-50%, -26px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62px) scale(0.96); }
}

/* ---------- 概率 / 按钮 ---------- */
.forge-info {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 12px;
}

.forge-rate { display: flex; align-items: baseline; gap: 9px; }
.fr-label { font-size: 11px; letter-spacing: 0.18em; color: var(--ink-faint); }

.forge-rate b {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.forge-rate b small { font-size: 14px; color: var(--gold); margin-left: 1px; }

.forge-rate em {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
}

.forge-conseq {
  margin: 0;
  font-size: 10.5px;
  color: var(--ink-faint);
  text-align: right;
  line-height: 1.6;
}

.forge-conseq b { color: var(--cinnabar); font-weight: 600; }

.forge-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 16px 10px 13px;
  border-radius: 14px;
  border: 1px solid rgba(224, 181, 104, 0.45);
  background:
    linear-gradient(180deg, rgba(240, 210, 154, 0.14), rgba(224, 181, 104, 0.02) 60%),
    #14100a;
  color: var(--gold-soft);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.25s, border-color 0.25s;
  box-shadow: 0 12px 34px -16px rgba(224, 181, 104, 0.7), inset 0 1px 0 rgba(255, 240, 200, 0.16);
}

.forge-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(240, 210, 154, 0.8);
  box-shadow: 0 18px 44px -14px rgba(224, 181, 104, 0.85), inset 0 1px 0 rgba(255, 240, 200, 0.24);
}

.forge-btn:active:not(:disabled) { transform: translateY(1px) scale(0.995); }

.forge-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.forge-btn-glow {
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(circle at 50% 120%, rgba(255, 190, 100, 0.35), transparent 55%);
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.3s;
}

.forge-btn:hover .forge-btn-glow { opacity: 0.95; }

.forge-btn-label {
  position: relative;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-shadow: 0 0 22px rgba(255, 210, 130, 0.45);
}

.forge-btn-cost {
  position: relative;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(224, 181, 104, 0.6);
  font-variant-numeric: tabular-nums;
}

.forge-btn.ready {
  animation: readyGlow 1.8s ease-in-out infinite;
  border-color: rgba(111, 206, 143, 0.6);
}
@keyframes readyGlow {
  0%, 100% { box-shadow: 0 12px 34px -16px rgba(95, 191, 143, 0.6); }
  50% { box-shadow: 0 12px 46px -8px rgba(95, 191, 143, 0.95); }
}

.toggles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink-faint);
  font-size: 11.5px;
  cursor: pointer;
  transition: 0.2s;
}

.toggle b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-dim);
}

.toggle .t-ico {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 5px;
  font-style: normal;
  font-family: var(--serif);
  font-size: 10px;
  border: 1px solid transparent;
}

.toggle.on {
  border-color: rgba(111, 206, 143, 0.42);
  background: rgba(95, 191, 143, 0.08);
  color: #cfe9d9;
}
.toggle.on b { color: var(--jade); }
.toggle.empty { opacity: 0.4; }

.hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}

/* ---------- 右侧 ---------- */
.side-panel { padding-bottom: 12px; display: flex; flex-direction: column; }

.fortune { padding: 2px 16px 0; }

.fortune-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  margin-bottom: 7px;
}

.fortune-head b { font-family: var(--serif); font-size: 14px; color: var(--gold); letter-spacing: 0.14em; }

.fortune-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1b2a44 0%, #24405c 22%, #5a5330 50%, #7a4d1e 76%, #6d2a18 100%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.fortune-band {
  position: absolute;
  top: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 245, 220, 0.45), transparent);
  border-radius: 999px;
  transition: left 0.4s ease, width 0.4s ease;
}

.fortune-needle {
  position: absolute;
  top: -2px; bottom: -2px;
  width: 2px;
  border-radius: 2px;
  background: #fff8e8;
  box-shadow: 0 0 8px rgba(255, 240, 200, 0.9);
  transition: left 0.4s ease;
}

.fortune-truth {
  position: absolute;
  bottom: 2px;
  width: 6px; height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: #6fe0a8;
  box-shadow: 0 0 8px #6fe0a8;
  display: none;
}
.fortune-truth.show { display: block; }

.fortune-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}

.fortune-note {
  margin: 6px 0 0;
  font-size: 10.5px;
  color: var(--ink-faint);
  line-height: 1.6;
}

.odds-box {
  margin: 12px 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.022);
}

.odds-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-faint);
  padding: 3px 0;
}

.odds-row b { color: var(--ink-dim); font-variant-numeric: tabular-nums; font-weight: 600; }
.odds-row.strong { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 7px; }
.odds-row.strong span { color: var(--ink-dim); letter-spacing: 0.1em; }
.odds-row.strong b { color: var(--gold-soft); font-size: 15px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px 12px 4px;
}

.stat {
  text-align: center;
  padding: 7px 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line-soft);
}

.stat small { display: block; font-size: 9.5px; color: var(--ink-faint); letter-spacing: 0.08em; }
.stat b { font-family: var(--serif); font-size: 15px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

.log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 6px;
  font-family: var(--serif);
  font-size: 11.5px;
  letter-spacing: 0.24em;
  color: var(--ink-dim);
}

.log {
  list-style: none;
  margin: 0;
  padding: 0 10px 8px;
  max-height: 244px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(224, 181, 104, 0.2) transparent;
}

.log::-webkit-scrollbar { width: 5px; }
.log::-webkit-scrollbar-thumb { background: rgba(224, 181, 104, 0.2); border-radius: 3px; }

.log li {
  display: flex;
  gap: 8px;
  padding: 5px 6px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-faint);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
  animation: logIn 0.35s ease;
}

.log li .lt {
  flex: none;
  font-variant-numeric: tabular-nums;
  opacity: 0.55;
  font-size: 10px;
  padding-top: 1px;
}

.log li.success { color: #a9d9bd; }
.log li.fail { color: #d8a89c; }
.log li.break { color: #ff8f78; font-weight: 600; }
.log li.info { color: #b9c6d6; }
.log li.buy { color: #cbb98e; }

@keyframes logIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 坊市 ---------- */
.shop {
  max-width: 1400px;
  margin: 14px auto 0;
  padding: 0 clamp(16px, 3vw, 34px);
}

.shop-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 2px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.shop-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--ink-dim);
}

.shop-head p { margin: 0; font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.12em; }

.shop-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.shop-item {
  --gc: #9fb0c0;
  --gc-glow: rgba(159, 176, 192, 0.3);
  position: relative;
  display: flex;
  gap: 11px;
  align-items: stretch;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--gc) 20%, transparent);
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--gc) 9%, transparent), transparent 60%),
    rgba(255, 255, 255, 0.02);
  transition: 0.22s;
}

.shop-item:hover { border-color: color-mix(in srgb, var(--gc) 42%, transparent); transform: translateY(-2px); }

.si-art {
  width: 56px;
  flex: none;
  display: grid;
  place-items: center;
}

.si-art svg {
  width: 100%;
  height: 86px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}

.si-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.si-sect {
  flex: none;
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: #7fd8a8;
  border: 1px solid rgba(95, 191, 143, 0.34);
  background: rgba(95, 191, 143, 0.08);
  border-radius: 4px;
  padding: 0 4px;
}

.shop-item .si-top { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.shop-item .si-grade { font-family: var(--serif); font-size: 10px; color: var(--gc); letter-spacing: 0.14em; }
.shop-item .si-tier { margin-left: auto; font-size: 9.5px; color: var(--ink-faint); white-space: nowrap; }
.shop-item .si-name { font-family: var(--serif); font-size: 14.5px; color: #ece5d6; letter-spacing: 0.08em; margin-top: 2px; }
.shop-item .si-desc { font-size: 10px; color: var(--ink-faint); line-height: 1.5; min-height: 30px; }
.shop-item .si-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 5px; }

.si-price { font-size: 12px; color: var(--gold); font-variant-numeric: tabular-nums; }
.si-price::before { content: "◆ "; font-size: 9px; opacity: 0.7; }
.si-price.poor { color: var(--cinnabar); opacity: 0.75; }

.buy-btn {
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid rgba(224, 181, 104, 0.3);
  background: rgba(224, 181, 104, 0.08);
  color: var(--gold);
  font-size: 11px;
  cursor: pointer;
  transition: 0.2s;
}
.buy-btn:hover:not(:disabled) { background: rgba(224, 181, 104, 0.18); }
.buy-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.shop-sub {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 -2px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink-faint);
}

.shop-sub::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(224, 181, 104, 0.18), transparent);
}

.shop-supplies {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 14px 0 6px;
}

.supply {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}

.supply .sup-ico {
  width: 30px; height: 30px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  font-family: var(--serif);
  font-size: 13px;
}

.supply .sup-ico.charm { color: #ffcf9a; background: rgba(207, 90, 69, 0.14); border: 1px solid rgba(207, 90, 69, 0.34); }

.supply .sup-body { min-width: 0; flex: 1; }
.supply .sup-name { font-size: 12.5px; color: var(--ink-dim); }
.supply .sup-desc { font-size: 9.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supply .sup-buy { flex: none; }

.supply .sup-price { font-size: 10px; color: var(--gold); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 页脚 ---------- */
.footer {
  max-width: 1400px;
  margin: 22px auto 0;
  padding: 18px clamp(16px, 3vw, 34px) 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
}

.footer p { margin: 0 0 5px; font-size: 10.5px; color: var(--ink-faint); line-height: 1.7; }
.footer .footer-dim { opacity: 0.6; }

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.toast {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(16, 18, 24, 0.95);
  border: 1px solid rgba(224, 181, 104, 0.28);
  color: var(--ink-dim);
  font-size: 12px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.9);
  animation: toastIn 0.25s ease, toastOut 0.3s ease 1.9s forwards;
  white-space: nowrap;
}

.toast.good { color: #b8e6c9; border-color: rgba(111, 206, 143, 0.4); }
.toast.bad { color: #ffb3a0; border-color: rgba(207, 90, 69, 0.42); }

@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

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

.modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 24px 20px;
  border-radius: 18px;
  border: 1px solid rgba(224, 181, 104, 0.22);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(224, 181, 104, 0.08), transparent 60%),
    #101219;
  box-shadow: 0 40px 100px -30px #000;
}

.modal.wide .modal-card { width: min(880px, 100%); }

.modal-head { display: flex; justify-content: space-between; align-items: center; }

.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: #f2ecdd;
}

.modal-sub { margin: 8px 0 16px; font-size: 11px; color: var(--ink-faint); line-height: 1.7; }

.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }

.preset-row button {
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink-dim);
  cursor: pointer;
  transition: 0.2s;
  font-family: inherit;
}

.preset-row button b { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; }
.preset-row button small { display: block; font-size: 9px; color: var(--ink-faint); margin-top: 2px; }
.preset-row button.on { border-color: rgba(224, 181, 104, 0.5); background: rgba(224, 181, 104, 0.09); color: var(--gold-soft); }

.field { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.field label { font-size: 12px; color: var(--ink-dim); }

.field select {
  background: #0c0e14;
  border: 1px solid var(--line-soft);
  color: var(--ink);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
}

.check input {
  appearance: none;
  width: 16px; height: 16px;
  margin: 1px 0 0;
  flex: none;
  border-radius: 4px;
  border: 1px solid rgba(224, 181, 104, 0.32);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  position: relative;
  transition: 0.2s;
}

.check input:checked { background: rgba(224, 181, 104, 0.85); border-color: var(--gold); }
.check input:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #1a1206;
  font-weight: 700;
}

.check span { font-size: 12px; color: var(--ink-dim); line-height: 1.5; }
.check small { display: block; font-size: 9.5px; color: var(--ink-faint); margin-top: 1px; }

.modal-actions { display: flex; gap: 10px; margin-top: 18px; }

.primary-btn, .danger-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 9px;
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: 0.2s;
}

.primary-btn {
  border: 1px solid rgba(224, 181, 104, 0.45);
  background: linear-gradient(180deg, rgba(240, 210, 154, 0.16), rgba(224, 181, 104, 0.04));
  color: var(--gold-soft);
}
.primary-btn:hover { background: rgba(224, 181, 104, 0.18); }

.danger-btn { border: 1px solid rgba(207, 90, 69, 0.3); background: rgba(207, 90, 69, 0.08); color: #e79a89; }
.danger-btn:hover { background: rgba(207, 90, 69, 0.16); }

/* 概率表 */
.table-wrap { overflow-x: auto; }

.rate-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.rate-table th, .rate-table td {
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 5px 4px;
  text-align: center;
  white-space: nowrap;
}

.rate-table thead th {
  position: sticky;
  top: 0;
  background: #12141c;
  color: var(--ink-faint);
  font-weight: 500;
  font-size: 10px;
}

.rate-table tbody th {
  text-align: left;
  padding-left: 9px;
  color: var(--ink-dim);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.02);
}

.rate-table td { color: var(--ink-dim); }
.rate-table td.hi { color: #9fe0b6; }
.rate-table td.mid { color: var(--gold-soft); }
.rate-table td.lo { color: #e08a76; }

.table-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 10px;
  color: var(--ink-faint);
}

.legend-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}
.legend-dot.fan { background: #9fb0c0; }
.legend-dot.shang { background: #6fce8f; }
.legend-dot.san { background: #5fb0ff; }
.legend-dot.zhen { background: #e6b45a; }

/* 登顶 */
.win-card { text-align: center; overflow: hidden; }

.win-glow {
  position: absolute;
  left: 50%; top: 40px;
  width: 320px; height: 320px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 120, 0.28), transparent 66%);
  filter: blur(8px);
  animation: breathe 3.4s ease-in-out infinite;
  pointer-events: none;
}

.win-mark {
  position: relative;
  font-family: var(--serif);
  font-size: 66px;
  line-height: 1;
  margin: 14px 0 6px;
  background: linear-gradient(180deg, #fff6e2, #e6b45a 60%, #9c6c26);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(230, 180, 90, 0.5));
}

.win-card h2 {
  position: relative;
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--gold-soft);
}

.win-card > p { position: relative; margin: 8px 0 18px; font-size: 12px; color: var(--ink-faint); }

.win-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.win-stats div {
  padding: 9px 4px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
}
.win-stats small { display: block; font-size: 9.5px; color: var(--ink-faint); }
.win-stats b { font-family: var(--serif); font-size: 17px; color: var(--gold-soft); font-variant-numeric: tabular-nums; }

.weapon-svg .spark { animation: sparkle 2.6s ease-in-out infinite; }

.weapon-svg .fx-ring {
  transform-box: view-box;
  transform-origin: 60px 88px;
  animation: spin 22s linear infinite;
}

.weapon-svg .fx-ring-2 {
  animation-direction: reverse;
  animation-duration: 32s;
}

.weapon-svg .fx-ring-3 {
  animation-duration: 44s;
  animation-direction: reverse;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.95; }
}


/* ---------- 原版炼器窗 ---------- */
.forge-panel {
  padding: 0;
  min-height: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(40, 90, 160, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(9, 33, 70, 0.72) 0%, rgba(6, 23, 53, 0.78) 48%, rgba(3, 13, 31, 0.84) 100%);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  border: 1px solid #5b7fb0;
  box-shadow:
    0 0 0 1px rgba(150, 190, 245, 0.12),
    0 0 44px -12px rgba(60, 130, 230, 0.35),
    inset 0 0 50px rgba(8, 32, 70, 0.85);
  overflow: hidden;
}

.ow-title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  flex: none;
  background: linear-gradient(180deg, #1d3f72, #0d2344 65%, #0a1b34);
  border-bottom: 1px solid #6f92c0;
  box-shadow: inset 0 1px 0 rgba(190, 220, 255, 0.25);
}

.ow-title-text {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  color: #e6f0ff;
  text-shadow: 0 0 10px rgba(120, 180, 255, 0.7);
}

.ow-x {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #8fb2dd;
  border-radius: 3px;
  background: linear-gradient(180deg, #3a6aa8, #163458);
  color: #eaf3ff;
  font-size: 11px;
  cursor: pointer;
}

.ow-x:hover { background: linear-gradient(180deg, #4b80c4, #1d4470); }

.ow-body { padding: 14px 16px 14px; }

.ow-slots {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 86px;
  gap: 12px;
  align-items: start;
}

.ow-slot.small {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-top: 4px;
}

.ow-ico {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 2px solid #7fa3d4;
  border-radius: 3px;
  background: linear-gradient(180deg, #122c55, #071a33);
  box-shadow: inset 0 0 16px rgba(70, 130, 220, 0.45), 0 2px 6px rgba(0, 0, 0, 0.5);
  font-family: var(--serif);
  font-size: 24px;
  color: #cfe2ff;
}

.ow-ico.charm { color: #ffd7a0; border-color: #c9a45e; box-shadow: inset 0 0 16px rgba(200, 150, 70, 0.35); }
.ow-ico.bless { color: #ffe27a; border-color: #c9a45e; box-shadow: inset 0 0 16px rgba(200, 150, 70, 0.35); }

.ow-cap { font-size: 10.5px; letter-spacing: 0.2em; color: #9db6d8; }

.ow-num {
  font-family: var(--serif);
  font-size: 13px;
  color: #ffd98a;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(255, 200, 90, 0.35);
}

.ow-slot.equip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.equip-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
  border: 2px solid color-mix(in srgb, var(--gc, #8fb2dd) 42%, #8fb2dd);
  border-radius: 3px;
  background: #04101f;
  box-shadow:
    0 0 22px var(--gc-glow, rgba(60, 120, 220, 0.35)),
    inset 0 0 24px rgba(4, 16, 36, 0.9);
  overflow: hidden;
}

.equip-frame .forge-stage {
  position: absolute;
  inset: 0;
  min-height: 0;
  display: block;
  overflow: hidden;
}

.equip-frame .forge-weapon {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  transform: none;
  z-index: 1;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.equip-frame .forge-weapon img.hero-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

.equip-frame .forge-weapon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.equip-frame .forge-weapon svg {
  width: 100%;
  height: 100%;
  transform: none;
  filter: drop-shadow(0 0 14px var(--gc-glow, rgba(120, 180, 255, 0.4)));
  animation: none;
}

.equip-frame::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 16%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 16, 36, 0.85), transparent);
}

.equip-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(125% 105% at 50% 45%, transparent 42%, rgba(3, 10, 24, 0.6) 100%);
}

.ow-lv {
  position: absolute;
  top: 5px;
  right: 8px;
  z-index: 4;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--gc, #cfe2ff);
  text-shadow: 0 0 8px var(--gc-glow, rgba(120, 180, 255, 0.5)), 0 1px 3px #000;
  font-variant-numeric: tabular-nums;
}

.forge-stage.working::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(circle at 50% 50%, rgba(170, 215, 255, 0.55), transparent 70%);
  animation: stageFlash 0.55s ease;
}

@keyframes stageFlash {
  0%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

.forge-info { padding: 12px 4px 6px; }

.ow-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 4px 0 8px;
}

.ow-btn {
  min-width: 104px;
  padding: 9px 20px;
  border: 1px solid #8fb2dd;
  border-radius: 3px;
  background: linear-gradient(180deg, #2b4f84, #10294d 60%, #0a1c36);
  color: #eaf3ff;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(200, 225, 255, 0.35), 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: background 0.15s, transform 0.1s;
}

.ow-btn:hover:not(:disabled) { background: linear-gradient(180deg, #3a68a6, #173a66 60%, #0d2344); }
.ow-btn:active:not(:disabled) { transform: translateY(1px); }
.ow-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.ow-btn.ghost { background: linear-gradient(180deg, #1a2c45, #0b1829); color: #a9c0dd; }

.ow-cost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0 2px;
  border-top: 1px solid rgba(120, 160, 220, 0.16);
  font-size: 10.5px;
  color: #8fa8c8;
  letter-spacing: 0.08em;
}

.ow-cost b { color: #ffd98a; font-weight: 500; font-variant-numeric: tabular-nums; }

.ow-result {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: radial-gradient(circle at 50% 38%, rgba(14, 38, 76, 0.98), rgba(3, 10, 24, 0.99));
  border: 2px solid #7fa6d8;
  animation: owResultIn 0.2s ease;
}

.ow-result p {
  margin: 0;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  color: #eef5ff;
  text-shadow: 0 0 10px rgba(110, 170, 255, 0.55);
  text-align: center;
  padding: 0 8px;
}

.ow-result small {
  font-size: 10.5px;
  color: #9db6d8;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.ow-result button {
  margin-top: 3px;
  padding: 5px 26px;
  border: 1px solid #b9c7d6;
  border-radius: 3px;
  background: linear-gradient(180deg, #333, #080808);
  color: #fff;
  font-size: 11.5px;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  cursor: pointer;
}

.ow-result button:hover { background: linear-gradient(180deg, #444, #111); }

@keyframes owResultIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

.ow-collapsed { display: none; padding: 48px 0; justify-content: center; }
.forge-panel.collapsed .ow-body { display: none; }
.forge-panel.collapsed .ow-collapsed { display: flex; }

.forge-panel .toggles { margin-top: 10px; }
.forge-panel .toggle { background: rgba(4, 18, 40, 0.6); border-color: rgba(120, 160, 220, 0.22); }
.forge-panel .toggle.on { border-color: rgba(111, 206, 143, 0.5); background: rgba(60, 140, 110, 0.14); }


/* ---------- 手感：蓄力 / 弹跳 / 震屏 / 引导 ---------- */
.charge-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.charge-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #c99b4e, #ffe6a8);
  box-shadow: 0 0 10px #ffd98a;
}

.equip-frame.charging .charge-bar i { animation: chargeFill 0.7s linear forwards; }

@keyframes chargeFill {
  from { width: 0; }
  to { width: 100%; }
}

.equip-frame.charging { animation: chargeGlow 0.7s ease-in-out; }

@keyframes chargeGlow {
  0%, 100% { box-shadow: 0 0 22px var(--gc-glow, rgba(60, 120, 220, 0.35)), inset 0 0 24px rgba(4, 16, 36, 0.9); }
  70% { box-shadow: 0 0 44px var(--gc-glow, rgba(60, 120, 220, 0.35)), inset 0 0 40px rgba(160, 210, 255, 0.35); }
}

.lv-num.pop { animation: numPop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); }

@keyframes numPop {
  0% { transform: scale(0.82); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.board.shake { animation: boardShake 0.5s ease; }

@keyframes boardShake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-6px, 2px); }
  30% { transform: translate(5px, -2px); }
  45% { transform: translate(-4px, 1px); }
  60% { transform: translate(3px, -1px); }
  75% { transform: translate(-2px, 0); }
}

.ow-actions { position: relative; }

.tut-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  padding: 7px 12px;
  border-radius: 8px;
  background: #1a1206;
  border: 1px solid rgba(224, 181, 104, 0.5);
  color: #ffe6b0;
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  z-index: 6;
  animation: tutFloat 1.8s ease-in-out infinite;
}

.tut-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: rgba(224, 181, 104, 0.5);
}

@keyframes tutFloat {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -3px); }
}

.ow-result-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ow-result-actions button { margin-top: 0; padding: 5px 16px; }

#ow-result-again {
  border-color: rgba(224, 181, 104, 0.6);
  background: linear-gradient(180deg, #3a3020, #100c06);
  color: #ffe6b0;
}

#ow-result-again:hover { background: linear-gradient(180deg, #4a3d28, #17110a); }


/* ---------- 我的器灵 / 器灵效果 ---------- */
.ph-actions { display: flex; align-items: center; gap: 8px; }

.equip-meta { display: none; }

.spirits-page { display: none; }

.spirits-page.open {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 90;
  flex-direction: column;
  gap: 16px;
  padding: 30px;
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(224, 181, 104, 0.08), transparent 60%),
    #07080b;
}

.sp-head { display: flex; align-items: center; justify-content: space-between; }
.sp-head-l { display: flex; flex-direction: column; gap: 2px; }
.sp-head-l b { font-family: var(--serif); font-size: 20px; letter-spacing: 0.2em; color: #f3ecdd; }
.sp-head-l span { font-size: 11px; color: var(--ink-dim); }

.sp-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(224, 181, 104, 0.22);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-dim);
  font-size: 14px;
}

.sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.sp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(224, 181, 104, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(22, 28, 40, 0.9), rgba(10, 13, 20, 0.95));
}

.sp-card.locked { border-style: dashed; opacity: 0.7; }

.sp-art {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  height: 210px;
  overflow: hidden;
  background: radial-gradient(60% 60% at 50% 55%, rgba(224, 181, 104, 0.14), rgba(8, 11, 17, 0.2) 70%);
}

.sp-art img {
  height: 100%;
  width: auto;
  max-height: 100%;
  filter: drop-shadow(0 0 14px rgba(224, 181, 104, 0.35));
}

.sp-art.locked-art {
  font-family: var(--serif);
  font-size: 40px;
  color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
}

.sp-info { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.sp-grade { font-size: 10px; letter-spacing: 0.1em; }
.sp-name { font-family: var(--serif); font-size: 17px; color: #f3ecdd; }
.sp-lv { font-size: 22px; color: var(--gold-soft); font-family: var(--serif); }
.sp-atk { font-size: 11px; color: var(--ink-dim); }
.sp-tag {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 3;
  padding: 1px 7px;
  border: 1px solid rgba(120, 220, 150, 0.3);
  border-radius: 99px;
  font-size: 9px;
  color: #9fe0b0;
}

.sp-buy {
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(224, 181, 104, 0.3);
  border-radius: 8px;
  background: rgba(224, 181, 104, 0.08);
  color: var(--gold-soft);
  font-size: 11px;
}

.sp-note { text-align: center; font-size: 11px; color: var(--ink-faint); }

/* ---------- 移动端标签页 ---------- */
.mobile-tabs { display: none; }

/* ---------- 3D 世界 ---------- */
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #0b1a2a;
  overflow: hidden;
}

#world canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

#ui-layer {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(224, 181, 104, 0.10), transparent 62%),
    radial-gradient(860px 560px at 88% 108%, rgba(88, 58, 150, 0.14), transparent 62%),
    radial-gradient(700px 480px at 6% 92%, rgba(28, 96, 96, 0.10), transparent 62%),
    rgba(7, 8, 11, 0.52);
}

.world-hud {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  font-family: var(--sans);
}

.wh-brand {
  position: absolute;
  left: 24px;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.wh-brand b {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.26em;
  color: #f3ecdd;
}

.wh-brand span {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(230, 220, 200, 0.55);
}

.wh-hint {
  position: absolute;
  left: 24px;
  top: 72px;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: rgba(230, 220, 200, 0.5);
}

.wh-forge {
  position: absolute;
  left: 50%;
  bottom: 38px;
  transform: translateX(-50%);
  pointer-events: auto;
  padding: 15px 44px;
  border-radius: 999px;
  border: 1px solid rgba(224, 181, 104, 0.6);
  background: radial-gradient(120% 160% at 50% 0%, rgba(255, 220, 150, 0.22), rgba(20, 15, 8, 0.92) 62%);
  color: #ffe6b0;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 26px rgba(224, 181, 104, 0.25);
  cursor: pointer;
}

.wh-forge:active { transform: translateX(-50%) scale(0.97); }

.wh-stick {
  position: absolute;
  left: 26px;
  bottom: 40px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  pointer-events: auto;
  background: radial-gradient(circle, rgba(20, 24, 32, 0.55), rgba(10, 12, 18, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
  touch-action: none;
  display: none;
}

.wh-stick i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255, 240, 210, 0.95), rgba(200, 160, 90, 0.85));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.wh-run {
  position: absolute;
  right: 30px;
  bottom: 56px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  pointer-events: auto;
  border: 1px solid rgba(224, 181, 104, 0.4);
  background: rgba(16, 18, 24, 0.7);
  color: #e6d7b0;
  font-size: 13px;
  letter-spacing: 0.1em;
  display: none;
}

.wh-run.on {
  background: rgba(224, 181, 104, 0.25);
  color: #fff0c8;
}

body.is-touch .wh-stick { display: block; }
body.is-touch .wh-run { display: grid; place-items: center; }
body.is-touch .wh-hint { display: none; }
body.is-touch .wh-forge { bottom: 186px; }

@media (hover: none), (pointer: coarse) {
  .wh-stick { display: block; }
  .wh-run { display: grid; place-items: center; }
  .wh-hint { display: none; }
  .wh-forge { bottom: 186px; }
}

/* ---------- 响应式 ---------- */
@media (min-width: 861px) and (max-width: 1023px) {
  .board { grid-template-columns: minmax(240px, 300px) 1fr; }
  .shop { grid-column: 1 / -1; }
  .board > * { min-width: 0; }
  .side-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .side-panel .panel-head { grid-column: 1 / -1; }
  .side-panel .fortune { grid-column: 1; }
  .side-panel .odds-box { grid-column: 2; grid-row: 2; }
  .side-panel .stat-grid { grid-column: 2; grid-row: 3; }
  .side-panel .log-head, .side-panel .log { grid-column: 1 / -1; }
  .side-panel .log { max-height: 180px; }
}

@media (max-width: 860px) {
  .topbar { gap: 10px; padding: 10px 14px; }
  .brand-text p { display: none; }
  .brand-text h1 { font-size: 16px; letter-spacing: 0.08em; }
  .resources { order: 3; width: 100%; margin-left: 0; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
  .res { padding: 4px 9px 4px 5px; }
  .res-icon { width: 19px; height: 19px; font-size: 9.5px; }
  .res-rate { display: none; }
  .top-actions { margin-left: auto; }

  .board {
    grid-template-columns: 1fr;
    padding: 12px 12px 4px;
    gap: 12px;
  }

  .forge-panel { order: 1; min-height: auto; padding: 4px 14px 16px; }
  .equip-panel { order: 2; }
  .side-panel { order: 3; grid-template-columns: 1fr; }
  .side-panel .fortune { grid-column: 1; grid-row: auto; }
  .side-panel .odds-box { grid-column: 1; grid-row: auto; }
  .side-panel .stat-grid { grid-column: 1; grid-row: auto; }
  .side-panel .log-head, .side-panel .log { grid-column: 1; }

  .forge-stage { min-height: 250px; }
  .cauldron { transform: scale(0.86); }
  .forge-weapon { width: 54px; height: 88px; bottom: 57%; }
  .ow-slots { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ow-slot.small {
    grid-row: 1;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 4px 8px;
  }
  .ow-slot.small:nth-child(1) { grid-column: 1; }
  .ow-slot.small:nth-child(3) { grid-column: 2; }
  .ow-slot.equip { grid-column: 1 / -1; grid-row: 2; padding-top: 0; }
  .ow-ico { width: 30px; height: 30px; font-size: 13px; }
  .ow-cap { font-size: 9px; letter-spacing: 0.12em; }
  .ow-num { font-size: 12px; }
  .ow-slot.equip .ow-cap { display: none; }
  .equip-frame {
    max-width: none;
    margin: 0;
    aspect-ratio: auto;
    height: 27vh;
    min-height: 190px;
    max-height: 250px;
  }
  .equip-meta {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    padding: 24px 12px 8px;
    background: linear-gradient(transparent, rgba(6, 10, 16, 0.9));
  }
  .equip-meta b { font-family: var(--serif); font-size: 15px; color: #f3ecdd; letter-spacing: 0.08em; }
  .equip-meta span { font-size: 10.5px; color: var(--ink-dim); }
  .ow-body { padding: 10px 12px 10px; }
  .ow-title { height: 36px; }
  .forge-info { padding: 8px 2px 4px; }
  .forge-rate b { font-size: 24px; }
  .ow-actions { gap: 12px; padding: 2px 0 6px; }
  .ow-btn { min-width: 92px; padding: 8px 16px; font-size: 12px; }
  .ow-cost { padding: 6px 0 0; }
  .forge-panel .toggles { margin-top: 8px; }
  .forge-panel .hint { display: none; }

  /* 单页滚动：所有面板都可见，底部导航做锚点 */
  #ui-layer {
    position: static;
    inset: auto;
    display: block;
    overflow: visible;
    min-height: 100vh;
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  #ui-layer .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(7, 8, 11, 0.86);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  #ui-layer .board { padding: 10px; gap: 10px; }
  #ui-layer .board > * { min-width: 0; }
  #ui-layer .shop { order: 4; margin: 0; width: auto; }
  .forge-panel .tut-bubble { display: none; }
  #ui-layer .shop { display: block; }
  #ui-layer .footer { display: none; }
  .forge-panel, .equip-panel, .side-panel { width: 100%; }
  .spirits-page.open { padding: 12px; gap: 12px; }
  .spirits-page .sp-grid { grid-template-columns: 1fr 1fr; }
  .spirits-page .sp-art { flex: 0 0 150px; height: 150px; max-height: 150px; }

  .mobile-tabs {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid rgba(224, 181, 104, 0.16);
    background: rgba(7, 8, 11, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .mobile-tabs button {
    flex: 1;
    padding: 12px 0 14px;
    border: 0;
    background: none;
    color: var(--ink-faint);
    font-family: var(--serif);
    font-size: 13px;
    letter-spacing: 0.2em;
  }
  .mobile-tabs button.on { color: var(--gold-soft); }
  .item-portrait { height: 94px; }
  .item-portrait img.hero-art { height: 94px; }
  .item-portrait svg { height: 94px; }
  .si-art { width: 46px; }
  .si-art svg { height: 72px; }
  .lv-num { font-size: 64px; }
  .shop-items, .shop-supplies { grid-template-columns: 1fr 1fr; }
  .shop-item .si-desc { min-height: 0; }
  .modal-card { padding: 18px 16px 16px; }
  .rate-table { font-size: 9.5px; }

  .toast-wrap { top: auto; bottom: 26px; }
  .toast { animation: toastIn 0.25s ease, toastOut 0.3s ease 1.9s forwards; }
}

@media (max-width: 520px) {
  .shop-items, .shop-supplies { grid-template-columns: 1fr; }
  .shop-item .si-desc { display: none; }
}

@media (max-width: 420px) {
  .shop-items, .shop-supplies { grid-template-columns: 1fr; }
  .toggles { gap: 5px; }
  .toggle { padding: 7px 6px; font-size: 10.5px; }
  .toggle .t-ico { display: none; }
}

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

/* ---------- 器灵辉光：器色染色 + 外扩高光（含头部） ---------- */
.hero-bloom,
.hero-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.hero-bloom {
  z-index: 2;
  background: var(--gc, #e0b568);
  -webkit-mask-image: url("assets/hero-glow.png");
  mask-image: url("assets/hero-glow.png");
  mix-blend-mode: screen;
  opacity: 0.92;
  animation: heroBloom 4.2s ease-in-out infinite;
}

.hero-tint {
  z-index: 3;
  background: var(--gc, #e0b568);
  -webkit-mask-image: url("assets/hero-tint.png");
  mask-image: url("assets/hero-tint.png");
  mix-blend-mode: color;
  opacity: 0.94;
}

@keyframes heroBloom {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}

/* ==========================================================================
   H5 主界面：上/下/左/右四条操作带，中间炼器窗（角色占最大面积）
   ========================================================================== */
html, body { height: 100%; overflow: hidden; background: #05070a; }

#ui-layer {
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#ui-layer .topbar { flex: none; padding: 8px 10px 4px; gap: 8px; }
#ui-layer .brand-text p { display: none; }
#ui-layer .brand-text h1 { font-size: 15px; }
#ui-layer .brand-seal { width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
#ui-layer .res { padding: 2px 7px 2px 3px; font-size: 10.5px; }
#ui-layer .res-icon { width: 16px; height: 16px; font-size: 8px; }
#ui-layer .res-rate { display: none; }
#ui-layer .icon-btn { width: 28px; height: 28px; font-size: 12px; }
#ui-layer .footer,
#ui-layer .mobile-tabs { display: none; }

#ui-layer .board {
  flex: 1;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 6px;
  gap: 6px;
  display: grid;
  align-items: stretch;
  justify-items: stretch;
  grid-template-columns: 76px minmax(0, 1fr) 112px;
  grid-template-rows: 74px minmax(0, 1fr) 88px;
  grid-template-areas:
    "top    top    top"
    "left   center right"
    "bottom bottom bottom";
}

/* ---------- 上：天时条 ---------- */
#ui-layer .side-panel {
  grid-area: top;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 0;
  padding: 6px 12px;
  overflow: hidden;
  border-radius: 12px;
}
#ui-layer .side-panel > * { max-height: 100%; }
#ui-layer .side-panel .panel-head,
#ui-layer .side-panel .stat-grid,
#ui-layer .side-panel .log-head,
#ui-layer .side-panel .log { display: none; }
#ui-layer .side-panel .fortune { flex: 1; min-width: 0; padding: 0; margin: 0; }
#ui-layer .side-panel .fortune-head { font-size: 9px; }
#ui-layer .side-panel .fortune-track { height: 8px; margin: 6px 0 3px; }
#ui-layer .side-panel .fortune-scale { font-size: 7px; }
#ui-layer .side-panel .fortune-note { display: none; }
#ui-layer .side-panel .odds-box { display: none; }
#ui-layer .side-panel .fortune { display: flex; flex-direction: column; justify-content: center; gap: 2px; width: 100%; min-width: 0; text-align: left; }
#ui-layer .side-panel .fortune-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
}
#ui-layer .side-panel .odds-row:not(.strong) { display: none; }
#ui-layer .side-panel .odds-row.strong {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 3px;
  padding: 0; font-size: 9px; color: var(--ink-faint);
}
#ui-layer .side-panel .odds-row.strong b { font-family: "Songti SC", serif; font-size: 26px; line-height: 1; color: #f0e6cf; }

/* ---------- 左：器灵属性条 ---------- */
#ui-layer .equip-panel {
  grid-area: left;
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 6px; overflow: hidden; border-radius: 12px;
}
#ui-layer .equip-panel .panel-head { padding: 0; min-height: 0; border: 0; }
#ui-layer .equip-panel .panel-title { font-size: 9px; letter-spacing: .12em; }
#ui-layer .equip-panel .ph-actions { display: none; }
#ui-layer .equip-panel .item-card {
  margin: 0; padding: 0; border: 0; background: none; box-shadow: none; border-radius: 0; overflow: visible;
}
#ui-layer .equip-panel .card-aura,
#ui-layer .equip-panel .card-scan,
#ui-layer .equip-panel .item-top,
#ui-layer .equip-panel .item-portrait,
#ui-layer .equip-panel .pips,
#ui-layer .equip-panel .empty-state { display: none; }
#ui-layer .equip-panel .item-name {
  margin: 0; padding: 0; text-align: left; font-size: 10px; letter-spacing: 0;
  color: #e7dfcd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#ui-layer .equip-panel .item-level { position: static; margin: 0; justify-content: flex-start; font-size: 0; line-height: 1.05; }
#ui-layer .equip-panel .item-level .lv-plus { font-size: 11px; }
#ui-layer .equip-panel .item-level .lv-num { font-size: 26px; }
#ui-layer .equip-panel .item-tone,
#ui-layer .equip-panel .item-atk { display: block; margin: 1px 0 0; font-size: 9px; white-space: nowrap; }
#ui-layer .equip-panel .pity { margin-top: 5px; }
#ui-layer .equip-panel .pity-head { font-size: 7.5px; white-space: nowrap; }
#ui-layer .equip-panel .bar { height: 4px; }
#ui-layer .equip-panel .item-actions { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
#ui-layer .equip-panel .ghost-btn { padding: 6px 0; font-size: 9px; letter-spacing: 0; }

/* ---------- 中：炼器窗 ---------- */
#ui-layer .center-stack { display: contents; }
#ui-layer .forge-panel {
  grid-area: center;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
#ui-layer .ow-title { height: 34px; flex: none; }
#ui-layer .ow-title-text { font-size: 13px; letter-spacing: .4em; }
#ui-layer .ow-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 8px; }
#ui-layer .ow-slots {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 34px minmax(0, 1fr);
  gap: 6px;
}
#ui-layer .ow-slot.small:nth-child(1) { grid-area: 1 / 1 / 2 / 2; }
#ui-layer .ow-slot.small:nth-child(3) { grid-area: 1 / 2 / 2 / 3; }
#ui-layer .ow-slot.equip { grid-area: 2 / 1 / 3 / 3; }
#ui-layer .ow-slot.small {
  flex-direction: row; align-items: center; justify-content: center; gap: 5px;
  width: auto; height: 34px; padding: 0 6px;
}
#ui-layer .ow-slot.equip { flex: 1; min-width: 0; min-height: 0; align-self: stretch; display: flex; padding: 0; }
#ui-layer .ow-ico { width: 24px; height: 24px; font-size: 11px; }
#ui-layer .ow-cap { font-size: 8px; letter-spacing: .04em; }
#ui-layer .ow-num { font-size: 11px; }
#ui-layer .equip-frame { flex: 1 1 auto; width: 100%; height: auto; aspect-ratio: auto; min-height: 0; max-height: none; }
#ui-layer .equip-meta { padding: 14px 8px 5px; }
#ui-layer .equip-meta b { font-size: 11px; }
#ui-layer .equip-meta span { font-size: 9px; }
#ui-layer .forge-info { padding: 0; }
#ui-layer .forge-rate { gap: 4px; flex-wrap: nowrap; }
#ui-layer .forge-rate .fr-label, #ui-layer .forge-rate em { font-size: 8px; white-space: nowrap; }
#ui-layer .forge-rate b { font-size: 20px; }
#ui-layer .forge-conseq { font-size: 8px; }
#ui-layer .ow-actions { padding: 0; }
#ui-layer .ow-btn { width: 100%; min-width: 0; padding: 9px 0; font-size: 13px; letter-spacing: .3em; }
#ui-layer .ow-cost { font-size: 9px; padding: 2px 0 0; }
#ui-layer .toggles { gap: 4px; margin-top: 0; }
#ui-layer .toggle { font-size: 8px; padding: 4px 2px; }
#ui-layer .toggle .t-ico { width: 13px; height: 13px; font-size: 7px; }
#ui-layer .forge-panel .hint,
#ui-layer .forge-panel .tut-bubble { display: none; }

/* ---------- 右：坊市快捷购买 ---------- */
#ui-layer .shop {
  grid-area: right;
  max-width: none; margin: 0; padding: 8px 6px;
  min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
  border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.022), transparent 42%), var(--panel);
}
#ui-layer .shop-head { padding: 0 0 5px; border: 0; }
#ui-layer .shop-head h2 { font-size: 9px; letter-spacing: .12em; }
#ui-layer .shop-head p { display: none; }
#ui-layer .shop-items { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; overflow: hidden; }
#ui-layer .shop-item { padding: 2px 4px; gap: 3px; border-radius: 6px; display: flex; align-items: center; }
#ui-layer .shop-item .si-body { display: flex; flex-direction: row; align-items: center; gap: 3px; min-width: 0; flex: 1; }
#ui-layer .shop-item .si-top,
#ui-layer .shop-item .si-desc { display: none; }
#ui-layer .shop-item .si-name { font-size: 9px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui-layer .shop-item .si-foot { margin: 0 0 0 auto; padding: 0; display: flex; align-items: center; gap: 2px; flex: none; }
#ui-layer .si-art { display: none; }
#ui-layer .si-art svg { height: 14px; width: 12px; }
#ui-layer .si-price { font-size: 7.5px; }
#ui-layer .si-price::before { display: none; }
#ui-layer .buy-btn { padding: 1px 4px; font-size: 7.5px; border-radius: 4px; }
#ui-layer .shop-sub { margin: 3px 0 1px; font-size: 6.5px; }
#ui-layer .shop-supplies { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 0; flex: none; }
#ui-layer .supply { padding: 2px 4px; gap: 3px; border-radius: 6px; }
#ui-layer .supply .sup-body { min-width: 0; flex: 1; }
#ui-layer .sup-name { font-size: 9px; white-space: nowrap; }
#ui-layer .sup-ico { width: 18px; height: 18px; font-size: 8px; }
#ui-layer .sup-desc { display: none; }
#ui-layer .sup-buy { flex: none; display: flex; align-items: center; gap: 2px; }
#ui-layer .sup-buy > div { display: flex; gap: 2px; margin: 0 !important; }
#ui-layer .sup-price { font-size: 7.5px; }

/* ---------- 下：垫器 ---------- */
#ui-layer .hud-bottom {
  grid-area: bottom;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 40px minmax(0, 1fr);
  gap: 4px 8px;
  padding: 5px 8px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18,24,34,.95), rgba(9,13,20,.95));
  overflow: hidden;
}
#ui-layer .hud-bottom .parts { grid-column: 1 / -1; grid-row: 1; }
#ui-layer .hud-bottom .panel-head.sub {
  grid-column: 1; grid-row: 2;
  display: flex; align-items: center; gap: 5px; padding: 0; min-height: 0; border: 0; margin: 0;
}
#ui-layer .hud-bottom .panel-title { font-size: 8px; letter-spacing: .08em; color: var(--ink-faint); }
#ui-layer .hud-bottom .pad-card { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 5px; margin: 0; padding: 0; border: 0; background: none; }
#ui-layer .hud-bottom .pad-info { gap: 4px; font-size: 10px; }
#ui-layer .hud-bottom .mini-btn { padding: 3px 6px; font-size: 8.5px; }
#ui-layer .hud-bottom .pad-hint { display: none; }

/* ---------- 部位装备：五层染色 + 选择条 ---------- */
.part-tint {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: var(--pc, #9aa4b2);
  mix-blend-mode: color;
  opacity: .92;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.part-tint[data-part="hands"]  { background: var(--pc-hands, #9aa4b2);  -webkit-mask-image: url("assets/part-hands.png");  mask-image: url("assets/part-hands.png"); }
.part-tint[data-part="weapon"] { background: var(--pc-weapon, #9aa4b2); -webkit-mask-image: url("assets/part-weapon.png"); mask-image: url("assets/part-weapon.png"); }
.part-tint[data-part="chest"]  { background: var(--pc-chest, #9aa4b2);  -webkit-mask-image: url("assets/part-chest.png");  mask-image: url("assets/part-chest.png"); }
.part-tint[data-part="legs"]   { background: var(--pc-legs, #9aa4b2);   -webkit-mask-image: url("assets/part-legs.png");   mask-image: url("assets/part-legs.png"); }
.part-tint[data-part="feet"]   { background: var(--pc-feet, #9aa4b2);   -webkit-mask-image: url("assets/part-feet.png");   mask-image: url("assets/part-feet.png"); }

/* 部位选择条 */
.parts { display: flex; gap: 4px; flex: 1; min-width: 0; }
.parts .part {
  flex: 1; min-width: 0; height: 38px; border-radius: 9px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  color: #9aa3b0; font-family: inherit; cursor: pointer;
}
.parts .part .pl { font-size: 8.5px; letter-spacing: .04em; font-style: normal; }
.parts .part b { font-family: "Songti SC", serif; font-size: 11px; font-weight: 500; color: var(--pc, #cbd2dd); }
.parts .part.on {
  background: color-mix(in srgb, var(--pc, #e0b568) 16%, rgba(10,14,22,.9));
  border-color: color-mix(in srgb, var(--pc, #e0b568) 60%, transparent);
}
.parts .part.on b { color: var(--pc, #f0e6cf); }
