:root {
  --bg0: #0c0a08;
  --bg1: #16120c;
  --gold: #d4a017;
  --gold-bright: #f0c14b;
  --gold-dim: #8a6a12;
  --ember: #c45c26;
  --ink: #f3e6c8;
  --muted: #a89878;
  --line: rgba(212, 160, 23, 0.28);
  --danger: #e85d4c;
  --ok: #5cb85c;
  --panel: rgba(22, 18, 12, 0.82);
  --font-display: "Cinzel", "Noto Serif SC", "Songti SC", serif;
  --font-body: "Noto Sans SC", "PingFang SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(196, 92, 38, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 80%, rgba(212, 160, 23, 0.08), transparent 50%),
    linear-gradient(180deg, #1a140c 0%, var(--bg0) 45%, #080705 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.brand {
  text-align: center;
  margin-bottom: 1.75rem;
  animation: rise 0.7s ease both;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 0 6px rgba(212, 160, 23, 0.08), inset 0 0 18px rgba(212, 160, 23, 0.15);
  animation: pulse-ring 3s ease-in-out infinite;
}
.brand h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  letter-spacing: 0.18em;
  margin: 0 0 0.4rem;
  background: linear-gradient(180deg, #fff6d6 0%, var(--gold-bright) 45%, var(--gold-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.5rem 1.35rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  position: relative;
  animation: rise 0.8s 0.1s ease both;
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.7;
}
.panel::before { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.panel::after { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}
.field input, .field select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(8, 6, 4, 0.65);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
}
.field input::placeholder { color: #6a5c45; }

.presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}
.preset {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(8, 6, 4, 0.5);
  color: var(--ink);
  padding: 0.65rem 0.25rem;
  border-radius: 2px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  transition: all 0.2s;
}
.preset:hover { border-color: var(--gold); color: var(--gold-bright); }
.preset.active {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(212, 160, 23, 0.25), rgba(212, 160, 23, 0.08));
  color: var(--gold-bright);
  box-shadow: inset 0 0 12px rgba(212, 160, 23, 0.12);
}

.rate-tip {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0.25rem 0 1.2rem;
  padding: 0.75rem 0.9rem;
  border: 1px dashed var(--line);
  background: rgba(212, 160, 23, 0.05);
  font-size: 0.9rem;
}
.rate-tip strong {
  color: var(--gold-bright);
  font-size: 1.25rem;
  font-family: var(--font-display);
}

.channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.channels.channels-single {
  grid-template-columns: 1fr;
}
.channel {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  transition: all 0.2s;
}
.channel:disabled {
  opacity: 1;
  cursor: default;
  color: var(--ink);
  border-color: var(--ember);
  background: rgba(196, 92, 38, 0.12);
}

.sub-types {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}
.chip.active { color: var(--gold-bright); border-color: var(--gold); }

.btn-pay {
  width: 100%;
  appearance: none;
  border: none;
  padding: 0.95rem 1rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  color: #1a1208;
  cursor: pointer;
  background: linear-gradient(180deg, #f0c14b 0%, #d4a017 50%, #a07810 100%);
  box-shadow: 0 8px 24px rgba(212, 160, 23, 0.28);
  transition: transform 0.15s, filter 0.15s;
}
.btn-pay:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-pay:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.msg {
  margin-top: 0.9rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.88rem;
  border-left: 3px solid var(--danger);
  background: rgba(232, 93, 76, 0.1);
  color: #ffb4a8;
  display: none;
}
.msg.show { display: block; }

.footer-note {
  text-align: center;
  margin-top: 1.5rem;
  color: #6a5c45;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  animation: rise 1s 0.2s ease both;
}

/* result / qr */
.card-center { text-align: center; }
.status-icon {
  width: 72px; height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  border: 2px solid var(--gold);
  color: var(--gold-bright);
}
.status-icon.ok { border-color: var(--ok); color: var(--ok); }
.status-icon.wait { animation: pulse-ring 1.8s ease-in-out infinite; }
.result-title {
  margin: 0;
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 1.45rem;
  letter-spacing: 0.12em;
}
.result-sub {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.success-amount {
  margin: 1.35rem auto 0.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(92, 184, 92, 0.28);
  background: rgba(92, 184, 92, 0.08);
  max-width: 320px;
}
.success-amount-label {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}
.success-amount-value {
  font-family: var(--font-display);
  font-size: 2rem;
  color: #7dcea0;
  letter-spacing: 0.04em;
}
.meta-list {
  text-align: left;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}
.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(212, 160, 23, 0.12);
  font-size: 0.92rem;
}
.meta-list span { color: var(--muted); flex-shrink: 0; }
.meta-list b {
  word-break: break-all;
  text-align: right;
  font-weight: 600;
}
.qr-box {
  margin: 1rem auto;
  padding: 1rem;
  background: #fff;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-box canvas, .qr-box img { max-width: 100%; }
.link-back {
  display: inline-block;
  margin-top: 1rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.08em;
}
.link-back:hover { color: var(--gold-bright); }
a.link-as-btn {
  display: block;
  text-decoration: none;
  text-align: center;
  margin-top: 0.5rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 6px rgba(212, 160, 23, 0.08), inset 0 0 18px rgba(212, 160, 23, 0.15); }
  50% { box-shadow: 0 0 0 10px rgba(212, 160, 23, 0.14), inset 0 0 22px rgba(212, 160, 23, 0.22); }
}

@media (max-width: 420px) {
  .presets { grid-template-columns: repeat(3, 1fr); }
  .wrap { padding-top: 1.5rem; }
}
