:root {
  --bg: #120806;
  --bg-2: #1c0d0a;
  --paper: #f3e6c8;
  --ink: #2a1610;
  --gold: #d4af37;
  --gold-2: #f0d78c;
  --red: #c43c28;
  --red-2: #e25822;
  --muted: #c4b39a;
  --line: rgba(212, 175, 55, 0.28);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --serif: "Noto Serif SC", "ZCOOL XiaoWei", serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(226, 88, 34, 0.18), transparent 55%),
    radial-gradient(800px 400px at 80% 100%, rgba(212, 175, 55, 0.08), transparent 50%),
    var(--bg);
  color: var(--paper);
  font-family: var(--sans);
}

.smoke {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    -12deg,
    transparent 0 18px,
    rgba(255, 240, 210, 0.015) 18px 19px
  );
  opacity: 0.5;
}

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: rgba(18, 8, 6, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand strong { display: block; font-family: var(--serif); font-size: 18px; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #ffd39a, #e25822 45%, #7a1d12 80%);
  box-shadow: 0 0 16px rgba(226, 88, 34, 0.7);
}
.nav { display: flex; gap: 8px; flex: 1; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
}
.nav a.on, .nav a:hover { color: var(--gold-2); background: rgba(212, 175, 55, 0.08); }
.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
}
.top-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.wallet-chip-wrap { position: relative; flex-shrink: 0; }
.wallet-chip-wrap[hidden] { display: none; }
.wallet-chip {
  display: flex; align-items: center;
  min-width: 120px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer; padding: 0;
  color: var(--paper);
  font-size: 12px;
  font-family: var(--sans);
}
@media (min-width: 30rem) {
  .wallet-chip { min-width: 170px; height: 40px; }
}
.wallet-addr {
  margin: 0;
  padding: 0 10px;
  font-weight: 500;
  white-space: nowrap;
}
.wallet-bal {
  display: flex; align-items: center;
  height: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  flex-shrink: 0;
}
.wallet-bal-ico {
  width: 30px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold);
  color: var(--ink);
  flex-shrink: 0;
}
.wallet-bal-ico svg { width: 18px; height: 18px; display: block; }
.wallet-bal-amt {
  display: flex; align-items: center; justify-content: center;
  min-width: 88px;
  padding: 0 8px;
  color: var(--gold-2);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.wallet-chip .chevron-sm {
  width: 18px; height: 18px;
  margin: 0 4px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.wallet-chip-wrap.open .wallet-chip .chevron-sm { transform: rotate(180deg); }

.wallet-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(380px, 92vw);
  padding: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 60;
  overflow: hidden;
  font-size: 14px;
  color: var(--paper);
  text-align: left;
}
.wallet-chip-wrap.open .wallet-menu { display: flex; flex-direction: column; }
.wm-stack { display: flex; flex-direction: column; width: 100%; }
.wm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.wm-head-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wm-head-addr { margin: 0; font-size: 14px; font-weight: 500; }
.wm-copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.wm-copy:hover { color: var(--gold); background: rgba(212, 175, 55, 0.08); }
.wm-copy svg { display: block; }
.wm-body { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px 12px; }
.wm-sec { display: flex; flex-direction: column; gap: 8px; }
.wm-lab-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wm-lab, .wm-equity-lab { margin: 0; font-size: 12px; color: var(--muted); font-weight: 500; }
.wm-fx-select {
  appearance: none;
  border: 0; background: transparent;
  color: var(--paper);
  font-size: 12px; font-weight: 600;
  padding: 0 16px 0 0;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%23c4b39a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 12px;
}
.wm-fx-select:focus { outline: none; }
.wm-bal-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wm-amt { display: flex; align-items: baseline; gap: 2px; min-width: 0; }
.wm-amt-sym { font-size: 22px; font-weight: 600; line-height: 1; }
.wm-amt-val {
  font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.wm-equity-amt .wm-amt-val { font-size: 22px; }
.wm-equity-amt .wm-amt-sym { font-size: 18px; }
.wm-deposit {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--gold); color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--sans);
}
.wm-deposit:hover { filter: brightness(1.05); }
.wm-deposit svg { display: block; }
.wm-table-wrap {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.wm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wm-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  background: rgba(243, 230, 200, 0.06);
  border-bottom: 1px solid var(--line);
}
.wm-table th:not(:first-child),
.wm-table td:not(:first-child) { text-align: right; }
.wm-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.wm-table tr:last-child td { border-bottom: 0; }
.wm-asset { display: flex; align-items: center; gap: 8px; }
.wm-asset img { width: 22px; height: 22px; border-radius: 50%; display: block; }
.wm-asset-name { margin: 0; font-weight: 600; }
.wm-cell-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.wm-cell-main { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.wm-cell-sub { margin: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wm-foot {
  display: flex; align-items: stretch;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}
.wm-foot-btn {
  flex: 1 1 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  min-height: 64px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--sans);
}
.wm-foot-btn:hover { background: rgba(212, 175, 55, 0.08); border-color: var(--gold); }
.wm-foot-btn p { margin: 0; }
.wm-foot-btn svg { display: block; }

.btn {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-2);
  height: 40px;
  padding: 0 16px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 15px;
}
.btn.solid { background: linear-gradient(180deg, #e25822, #9e2a1b); border-color: #ffb089; color: #fff7ea; }
.btn.ghost { background: transparent; }
.btn.text { border: 0; color: var(--muted); background: none; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; }
.view[hidden] { display: none !important; }

.hero { padding: 48px 8px 24px; max-width: 720px; }
.eyebrow { letter-spacing: 0.4em; color: var(--gold); font-size: 12px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.2;
  font-weight: 600;
  margin: 8px 0 16px;
}
.lead { color: var(--muted); line-height: 1.8; max-width: 42em; }
.hero-actions { display: flex; gap: 12px; margin: 24px 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0; list-style: none; }
.steps li {
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}
.steps span {
  display: block;
  font-family: var(--serif);
  color: var(--gold);
  margin-bottom: 6px;
}

.page-head h2 { font-family: var(--serif); font-size: 32px; margin: 0 0 8px; }
.page-head p { color: var(--muted); }
.tabs { display: flex; gap: 8px; margin-top: 16px; }
.tabs button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--serif);
}
.tabs button.on { color: var(--bg); background: var(--gold); border-color: var(--gold); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.card {
  background: linear-gradient(180deg, rgba(243, 230, 200, 0.08), rgba(18, 8, 6, 0.4));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.card .icon { height: 88px; display: flex; align-items: center; justify-content: center; }
.card h3 { font-family: var(--serif); margin: 8px 0 4px; font-size: 20px; }
.card p { color: var(--muted); font-size: 13px; flex: 1; }
.card .price { color: var(--gold); font-weight: 600; margin: 8px 0; }
.card .row { display: flex; gap: 8px; align-items: center; }
.card input[type="number"] {
  width: 72px;
  height: 36px;
  background: #2a1610;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
}
.card label.check { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }

.altar-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: start;
}
.brazier-wrap {
  background: #0a0504;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}
#fire { width: 100%; height: auto; display: block; }
.brazier-caption {
  position: absolute;
  bottom: 10px;
  width: 100%;
  text-align: center;
  letter-spacing: 0.5em;
  color: rgba(243, 230, 200, 0.45);
  font-family: var(--serif);
}
.wish-card, .panel, .verse-card {
  background: rgba(243, 230, 200, 0.06);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
.wish-card h2, .panel h3, .verse-card h3 { font-family: var(--serif); margin-top: 0; }
label { display: block; margin: 12px 0; color: var(--muted); font-size: 13px; }
input, textarea {
  width: 100%;
  margin-top: 6px;
  background: #2a1610;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--sans);
}
.picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.pick {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--gold-2);
}
.hint { color: var(--muted); font-size: 13px; }
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.asset-rows { display: grid; gap: 10px; margin: 8px 0 16px; }
.asset-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.asset-row span { color: var(--muted); letter-spacing: 0.04em; }
.asset-row strong { font-family: var(--serif); font-size: 28px; font-weight: 600; }
.big { font-family: var(--serif); font-size: 36px; margin: 8px 0 16px; }
.big small { font-size: 14px; color: var(--muted); }
.verse-card { margin-top: 20px; }
.verse-card pre {
  white-space: pre-wrap;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.8;
  color: var(--gold-2);
}

.records { display: grid; gap: 12px; }
.record {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: rgba(243, 230, 200, 0.04);
}
.record h3 { font-family: var(--serif); margin: 0 0 8px; }
.record .meta { color: var(--muted); font-size: 12px; }
.record pre { white-space: pre-wrap; font-family: var(--serif); color: var(--gold-2); }

.empty { color: var(--muted); text-align: center; padding: 40px; }
.bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(18, 8, 6, 0.92);
  border: 1px solid var(--gold);
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 16px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  z-index: 40;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(420px, 92vw);
  background: var(--bg-2);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 24px;
}
.modal-card h3 { font-family: var(--serif); }
a.btn.text { display: block; text-align: center; margin-top: 8px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #2a1610;
  color: var(--paper);
  border: 1px solid var(--gold);
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 50;
}

@media (max-width: 860px) {
  .top { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow: auto; }
  .altar-layout, .wallet-grid, .steps { grid-template-columns: 1fr; }
}
