:root {
  color-scheme: light;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #d92035;
  --ok: #15803d;
  --bg: #f5f6f8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.card {
  width: 100%;
  max-width: 560px;
  margin: clamp(16px, 6vh, 64px) auto;
  padding: clamp(20px, 5vw, 36px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 36px rgb(31 36 48 / 4%);
}

.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 28px; font-size: 18px; font-weight: 700; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; }
.brand-divider { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; }

.summary { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.subject { margin: 0; overflow-wrap: anywhere; }
.amount { margin: 4px 0 0; font-size: 40px; font-weight: 700; }
.currency { font-size: 18px; margin-right: 2px; }

.label { margin: 16px 0 8px; font-size: 14px; font-weight: 500; color: var(--muted); }

.methods { display: grid; gap: 10px; }

button {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
button:disabled { opacity: .55; cursor: progress; }
button:focus-visible { outline: 3px solid #ffb8c0; outline-offset: 2px; }
button.secondary { margin-top: 16px; background: #fff; color: var(--brand); }

.qr { margin-top: 16px; text-align: center; }
.qr canvas { width: 232px; height: 232px; max-width: 100%; image-rendering: pixelated; }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.message { margin: 16px 0 0; min-height: 1.6em; color: var(--muted); }
.message.ok { color: var(--ok); }

[hidden] { display: none !important; }
.paid-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 28px auto 12px; border-radius: 50%; background: #eaf7ef; color: var(--ok); font-size: 34px; font-weight: 700; }
.state-title { margin: 20px 0 8px; text-align: center; font-size: 26px; line-height: 1.3; }
.state-title:not([hidden]) + .message { text-align: center; }
button.secondary { color: var(--ink); border-color: var(--line); }
@media (max-width: 440px) { .brand-divider { flex-basis: 100%; margin-left: 42px; } .amount { font-size: 36px; } }
