:root {
  --qy-bg0: #0b1220;
  --qy-bg1: #121a2b;
  --qy-panel: #ffffff;
  --qy-ink: #152033;
  --qy-muted: #6b778c;
  --qy-line: #e6ebf2;
  --qy-brand: #c8161d;
  --qy-brand-deep: #9e0f14;
  --qy-gold: #d4a017;
  --qy-gold-soft: #f6e7b2;
  --qy-ok: #16a34a;
  --qy-ok-bg: #ecfdf3;
  --qy-warn: #b45309;
  --qy-warn-bg: #fff7ed;
  --qy-shadow: 0 18px 50px rgba(11, 18, 32, 0.28);
  --qy-radius: 18px;
  --qy-font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --qy-mono: Consolas, Menlo, "Courier New", monospace;
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--qy-font);
  color: var(--qy-ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(200, 22, 29, 0.28), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(212, 160, 23, 0.18), transparent 50%),
    linear-gradient(160deg, var(--qy-bg0), var(--qy-bg1) 55%, #0e1626);
}

a { color: var(--qy-brand); text-decoration: none; }
a:hover { color: var(--qy-brand-deep); text-decoration: underline; }

.qy-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.qy-card {
  width: 100%;
  max-width: 920px;
  background: var(--qy-panel);
  border-radius: var(--qy-radius);
  box-shadow: var(--qy-shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.qy-side {
  background:
    linear-gradient(165deg, #8f0e13 0%, #c8161d 42%, #a31217 100%);
  color: #fff;
  padding: 28px 24px;
  position: relative;
}

.qy-side::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 231, 178, 0.35), transparent 70%);
  pointer-events: none;
}

.qy-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.qy-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff6d0, #f0c85a 45%, #c89212 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  flex: 0 0 auto;
}

.qy-brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.qy-brand-sub {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-top: 2px;
}

.qy-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 8px 0 28px;
}

.qy-step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.55;
  font-size: 0.92rem;
}

.qy-step.is-active,
.qy-step.is-done {
  opacity: 1;
}

.qy-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.qy-step.is-active .qy-step-num,
.qy-step.is-done .qy-step-num {
  background: var(--qy-gold-soft);
  color: #7a4d00;
  border-color: transparent;
}

.qy-side-meta {
  margin-top: auto;
  font-size: 0.8rem;
  line-height: 1.55;
  opacity: 0.9;
}

.qy-side-meta strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}

.qy-main {
  padding: 28px 30px 26px;
}

.qy-main-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.qy-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.qy-subtitle {
  margin: 6px 0 0;
  color: var(--qy-muted);
  font-size: 0.88rem;
}

.qy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f4f6fa;
  border: 1px solid var(--qy-line);
  font-size: 0.78rem;
  color: var(--qy-ink);
  font-weight: 600;
}

.qy-chip em {
  font-style: normal;
  color: var(--qy-muted);
  font-weight: 500;
}

.qy-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--qy-warn-bg);
  color: var(--qy-warn);
  font-family: var(--qy-mono);
  font-size: 0.86rem;
  font-weight: 700;
  visibility: hidden;
}

.qy-timer.is-visible { visibility: visible; }

.qy-pay-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: start;
}

.qy-qr-wrap {
  text-align: center;
}

.qy-qr {
  width: 196px;
  height: 196px;
  padding: 10px;
  border: 1px solid var(--qy-line);
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
}

.qy-qr-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--qy-muted);
}

.qy-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qy-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--qy-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.qy-copyrow {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.qy-copyrow input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--qy-line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--qy-mono);
  font-size: 0.82rem;
  background: #f8fafc;
  color: var(--qy-ink);
}

.qy-btn {
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  background: var(--qy-brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.qy-btn:hover { background: var(--qy-brand-deep); }
.qy-btn:active { transform: translateY(1px); }
.qy-btn-ghost {
  background: #fff;
  color: var(--qy-brand);
  border: 1px solid rgba(200, 22, 29, 0.35);
}
.qy-btn-ghost:hover { background: #fff5f5; }

.qy-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--qy-brand);
  font-variant-numeric: tabular-nums;
}

.qy-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  padding-top: 4px;
}

.qy-meta-item {
  font-size: 0.84rem;
  color: var(--qy-muted);
}

.qy-meta-item b {
  display: block;
  margin-top: 3px;
  color: var(--qy-ink);
  font-weight: 650;
  word-break: break-all;
}

.qy-alert {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--qy-warn-bg);
  color: #9a3412;
  font-size: 0.84rem;
  line-height: 1.5;
  border: 1px solid #fed7aa;
}

.qy-help {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--qy-line);
  font-size: 0.82rem;
  color: var(--qy-muted);
  line-height: 1.7;
}

.qy-help strong { color: var(--qy-ink); }

/* Success overlay inside card */
.qy-success {
  display: none;
  text-align: center;
  padding: 36px 20px 20px;
}

.qy-success.is-show { display: block; }
.qy-pay.is-hide { display: none; }

.qy-check {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--qy-ok-bg);
  color: var(--qy-ok);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: 0 0 0 8px rgba(22, 163, 74, 0.08);
}

.qy-success h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.qy-success p {
  margin: 0;
  color: var(--qy-muted);
  font-size: 0.92rem;
}

.qy-success-actions {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* Empty / expired states */
.qy-state {
  text-align: center;
  padding: 48px 24px;
}

.qy-state h1 {
  margin: 0 0 10px;
  font-size: 1.5rem;
}

.qy-state p {
  margin: 0 0 18px;
  color: var(--qy-muted);
}

.qy-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(21, 32, 51, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.qy-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 860px) {
  .qy-card {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .qy-side {
    padding: 22px 20px 18px;
  }

  .qy-steps {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 16px;
  }

  .qy-pay-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .qy-fields { width: 100%; }

  .qy-meta { grid-template-columns: 1fr; }

  .qy-main { padding: 22px 18px 20px; }
}
