:root {
  --bg: #06080b;
  --bg-2: #0b0f14;
  --panel: rgba(13, 18, 25, 0.82);
  --line: #1c2632;
  --line-2: #2a3848;
  --fg: #d9e2ec;
  --dim: #6b7d90;
  --mint: #3cf2c0;
  --flow: #5aa9ff;
  --pool: #a77bff;
  --gold: #f5c542;
  --gold-2: #ffde7a;
  --danger: #ff6b6b;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  --radius: 2px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
b { font-weight: 700; }
.mono, code, pre, input, output, .btn, .kicker, .idx, .stat-v, .nav { font-family: var(--mono); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.c-mint { color: var(--mint); }
.c-flow { color: var(--flow); }
.c-gold { color: var(--gold); }

.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 70% 0%, rgba(60, 242, 192, 0.08), transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 100%, rgba(245, 197, 66, 0.06), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 48px;
  opacity: 0.55;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.6) 60%, rgba(0,0,0,.3) 100%);
}

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(6, 8, 11, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { text-transform: uppercase; display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--mono); font-weight: 700; letter-spacing: .08em; }
.brand-mark { width: 22px; height: 22px; fill: none; stroke: var(--mint); stroke-width: 1.4; }
.nav { display: flex; gap: 20px; margin-left: auto; font-size: 13px; }
.nav a { text-decoration: none; color: var(--dim); }
.nav a:hover { color: var(--fg); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--fg);
  font-size: 13px; letter-spacing: .02em;
  border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  transition: border-color .15s, background .15s, color .15s, transform .1s;
}
.btn:hover:not(:disabled) { border-color: var(--mint); color: var(--mint); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--mint); border-color: var(--mint); color: #021a13; font-weight: 700; }
.btn-primary:hover:not(:disabled) { background: transparent; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

/* hero：进度条 + 金字塔 */
.hero { max-width: 1280px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 40px) 56px; }
.lang-btn { padding: 6px 12px; font-size: 13px; }
.chain-tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--gold); border: 1px solid rgba(245,197,66,.35); padding: 6px 10px; }
.chain-tag i { width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }

.progress {
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
  max-width: 1080px; margin: 0 auto; padding: 16px 22px;
  background: var(--panel); border: 1px solid var(--line);
}
.prog-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.prog-k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.prog-v { font-family: var(--mono); font-size: 26px; }
.prog-v small { font-size: 14px; color: var(--dim); }
.prog-bar { position: relative; height: 10px; background: var(--line); border: 1px solid var(--line-2); overflow: hidden; }
.prog-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--flow)); box-shadow: 0 0 12px rgba(60,242,192,.5); transition: width .8s; }
.prog-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(6,8,11,.9) calc(10% - 1px) 10%); pointer-events: none; }
.prog-side { display: flex; gap: 28px; }
.prog-side div { display: flex; flex-direction: column; gap: 2px; min-width: 96px; }
.prog-side b { font-family: var(--mono); font-size: 16px; white-space: nowrap; }
.prog-side small { font-size: 11px; color: var(--dim); }

.stage { max-width: 1200px; margin: 18px auto 0; }
#pyramid { width: 100%; height: auto; display: block; }
#pyramid.fade { opacity: 0; transition: opacity .5s; }
.hdr-side { font-size: 11px; }
.sim-txt { font-family: var(--mono); font-size: 11px; fill: var(--dim); letter-spacing: .12em; }
.row-bar-band { fill: var(--flow) !important; opacity: .7; }
.row-txt.gold-id { fill: var(--gold); }

.hero-copy { text-align: center; max-width: 860px; margin: 36px auto 0; }
.kicker { color: var(--mint); font-size: 12px; letter-spacing: .14em; margin: 0 0 12px; font-family: var(--mono); }
.hero h1 { font-size: clamp(32px, 5vw, 60px); line-height: 1.08; margin: 0 0 14px; letter-spacing: -.02em; font-weight: 800; }
.lead { color: #b7c4d1; font-size: 17px; margin: 0 auto 26px; max-width: 760px; }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero-tags { font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* sections */
.section { scroll-margin-top: 56px; max-width: 1280px; margin: 0 auto; padding: 72px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); }
.section-head { display: flex; gap: 20px; margin-bottom: 32px; }
.section-head h2 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.01em; }
.section-head p { margin: 0; color: var(--dim); max-width: 760px; }
.idx { font-size: 13px; color: var(--mint); border: 1px solid var(--mint); padding: 2px 8px; height: fit-content; margin-top: 8px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-top: 10px; font-size: 13px; color: var(--dim); }
.legend > span { display: inline-flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 10px; height: 10px; transform: rotate(45deg); flex: none; }
.sw-self { background: var(--mint); }
.sw-flow { background: var(--flow); }
.sw-pool { background: var(--pool); }
.sw-gold { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-family: var(--mono); font-size: 12px; margin: 0; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; text-align: right; }

/* pyramid svg */
.layer { cursor: default; transition: fill .4s, stroke .4s; }
.layer.empty { fill: rgba(28, 38, 50, .35); stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 4; }
.layer.minted { fill: rgba(60, 242, 192, .10); stroke: var(--mint); stroke-width: 1.2; cursor: pointer; }
.layer.minted:hover, .layer.selected { fill: rgba(60, 242, 192, .22); }
.layer.flash { fill: rgba(60, 242, 192, .45); }
.layer.ff { fill: rgba(90, 169, 255, .16); stroke: var(--flow); stroke-dasharray: none; }
.layer.receive { fill: rgba(90, 169, 255, .30); stroke: var(--flow); }
.layer.gold-slot { fill: rgba(245, 197, 66, .05); stroke: var(--gold); stroke-dasharray: 5 4; }
.layer.gold { fill: url(#goldGrad); stroke: var(--gold-2); stroke-width: 1.6; filter: url(#glow); cursor: pointer; }
.layer-no { font-family: var(--mono); font-size: 13px; fill: var(--dim); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.layer-no.on { fill: var(--fg); }
.layer-no.gold-txt { fill: #2a1d00; font-weight: 700; }
.lead-line { stroke: var(--line-2); stroke-dasharray: 2 4; }
.lead-line.on { stroke: rgba(60, 242, 192, .35); }
.row-txt { font-family: var(--mono); font-size: 14px; fill: var(--dim); dominant-baseline: middle; }
.row-txt.on { fill: var(--fg); }
.row-amt { font-family: var(--mono); font-size: 14px; fill: var(--mint); text-anchor: end; dominant-baseline: middle; }
.row-amt.gold-txt { fill: var(--gold); }
.row-bar-bg { fill: var(--line); }
.row-bar { fill: var(--mint); transition: width .5s; }
.row-bar-div { fill: var(--flow); transition: width .5s, x .5s; }
.pool-box { fill: rgba(167, 123, 255, .08); stroke: var(--pool); stroke-dasharray: 4 3; }
.pool-txt { font-family: var(--mono); font-size: 12px; fill: var(--pool); dominant-baseline: middle; }
.hdr-txt { font-family: var(--mono); font-size: 11px; fill: var(--dim); letter-spacing: .1em; }
.prize-txt { font-family: var(--mono); font-size: 13px; fill: var(--gold); font-weight: 700; dominant-baseline: middle; }

/* rules */
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.rule { background: var(--panel); padding: 24px; position: relative; }
.rule h3 { margin: 6px 0 8px; font-size: 17px; }
.rule p { margin: 0 0 8px; color: #b7c4d1; font-size: 14px; }
.rule-no { font-family: var(--mono); font-size: 12px; color: var(--mint); }
.rule-wide { grid-column: span 3; }
.rule-gold { background: linear-gradient(135deg, rgba(245, 197, 66, .12), rgba(13, 18, 25, .82) 60%); }
.rule-gold .rule-no { color: var(--gold); }
.note { font-size: 13px !important; color: var(--dim) !important; }
.split { display: grid; grid-template-columns: 1fr 1.3fr; gap: 28px; align-items: center; margin: 14px 0; }
.split-bar { display: flex; height: 44px; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.seg { display: flex; align-items: center; justify-content: center; font-style: normal; color: #06080b; }
.seg-self { background: var(--mint); }
.seg-flow { background: var(--flow); }
.seg-pool { background: var(--pool); }
.split-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #b7c4d1; }
.split-list li { display: flex; align-items: baseline; gap: 10px; }
.split-list u { text-decoration-color: var(--flow); text-underline-offset: 3px; }

/* curve */
.curve { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.curve-chart { padding: 12px; }
#curveSvg { width: 100%; height: auto; display: block; }
.axis { stroke: var(--line-2); }
.grid-line { stroke: var(--line); stroke-dasharray: 2 4; }
.axis-txt { font-family: var(--mono); font-size: 11px; fill: var(--dim); }
.curve-path { fill: none; stroke: var(--mint); stroke-width: 2; }
.curve-area { fill: url(#curveGrad); }
.curve-marker { fill: var(--gold); stroke: #06080b; stroke-width: 2; }
.curve-guide { stroke: var(--gold); stroke-dasharray: 3 3; opacity: .6; }
.curve-label { font-family: var(--mono); font-size: 12px; fill: var(--gold); }
.calc { display: flex; flex-direction: column; }
.field { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 0; font-size: 13px; color: var(--dim); }
input[type="number"], input[type="text"] {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 10px 12px; font-size: 14px; outline: none; width: 100%;
}
input:focus { border-color: var(--mint); }
.calc-out { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); margin: 16px 14px 0; border: 1px solid var(--line); }
.calc-out div { background: var(--bg-2); padding: 10px 12px; display: flex; flex-direction: column; font-size: 12px; }
.calc-out b { font-family: var(--mono); font-size: 18px; }
.calc-total b { color: var(--mint); }
.formula { font-family: var(--mono); font-size: 11px; color: var(--dim); padding: 0 14px 14px; margin: 14px 0 0; line-height: 1.8; }

/* prompt */
.prompt-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.chat { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chat-row { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.avatar { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); padding: 4px 8px; color: var(--dim); }
.bubble { background: var(--bg-2); border: 1px solid var(--line-2); padding: 8px 14px; font-size: 13px; }
.prompt-card { position: relative; }
.prompt-text {
  margin: 0; padding: 16px 18px; font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  max-height: 300px; overflow: hidden; color: #c9d4df;
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.prompt-card.open .prompt-text { max-height: none; mask-image: none; }
.prompt-more { display: block; width: 100%; background: transparent; border: none; border-top: 1px solid var(--line); color: var(--mint); font-family: var(--mono); font-size: 12px; padding: 10px; cursor: pointer; }
.prompt-side { position: sticky; top: 72px; }
.ps-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.mint-qty { display: flex; align-items: center; border: 1px solid var(--line-2); width: fit-content; }
.qty-btn { border: none; width: 44px; height: 46px; font-size: 20px; background: transparent; }
.mint-qty output { width: 56px; text-align: center; font-size: 24px; font-weight: 700; }
.ps-links { display: flex; gap: 14px; font-family: var(--mono); font-size: 12px; }
.ps-links a { color: var(--dim); }
.ps-links a:hover { color: var(--mint); }
.ask { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.chip { font-size: 13px; border: 1px solid var(--line-2); padding: 4px 10px; color: #b7c4d1; background: var(--bg-2); }

/* faq */
.faq { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.faq details { background: var(--panel); padding: 18px 22px; }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--mint); }
.faq details[open] summary::after { content: "−"; }
.faq p { color: #b7c4d1; font-size: 14px; margin: 10px 0 0; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 32px clamp(16px, 4vw, 48px) 48px; max-width: 1280px; margin: 0 auto; }
.foot-grid { display: flex; gap: 40px; flex-wrap: wrap; font-size: 13px; margin-bottom: 12px; }
.foot-grid div { display: flex; flex-direction: column; }
.foot-grid a { text-decoration: none; color: var(--fg); }
.foot-grid a[href]:hover { color: var(--mint); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--bg-2); border: 1px solid var(--mint); color: var(--fg);
  padding: 10px 18px; font-family: var(--mono); font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--danger); }

@media (max-width: 1000px) {
  .curve, .prompt-wrap { grid-template-columns: 1fr; }
  .prompt-side { position: static; }
  .progress { grid-template-columns: 1fr; gap: 14px; }
  .prog-side { justify-content: space-between; gap: 12px; }
  .rules { grid-template-columns: 1fr 1fr; }
  .rule-wide { grid-column: span 2; }
  .split { grid-template-columns: 1fr; }
  .faq { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .topbar { justify-content: space-between; }
  .rules { grid-template-columns: 1fr; }
  .rule-wide { grid-column: span 1; }
  .prog-side div { min-width: 0; }
  .prog-side b { font-size: 13px; }
  .prog-v { font-size: 20px; }
  .chain-tag { display: none; }
  .section-head { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot { animation: none; }
}
