:root {
  --paper: #f6f1e6;
  --paper-hi: #fffcf5;
  --ink: #15171d;
  --muted: #77756f;
  --rule: #d8d0c0;
  --blue: #1578d1;
  --green: #1f8a5b;
  --shadow: 0 26px 60px rgb(26 23 18 / 11%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(125deg, rgb(255 252 245 / 72%), transparent 37%), var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
}

button, iframe { font: inherit; }

.receipt-shell { width: min(1080px, calc(100% - 2.5rem)); margin: 0 auto; padding: 9vh 0 3.5rem; }

.masthead { max-width: 35rem; border-top: 3px solid var(--ink); padding-top: 1.25rem; }
.eyebrow, .label, dt { margin: 0; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .14em; }
h1, h2 { font-family: STSong, "Songti SC", "SimSun", serif; }
h1 { margin: .2rem 0 .55rem; font-size: clamp(3.1rem, 8vw, 6.4rem); font-weight: 600; letter-spacing: .04em; line-height: .95; }
.deck { margin: 0; color: #4e4f52; font-size: 1rem; }

.payment-card { display: grid; grid-template-columns: minmax(0, .88fr) minmax(360px, 1.12fr); margin-top: clamp(2.5rem, 7vw, 6rem); background: var(--paper-hi); box-shadow: var(--shadow); }
.order-panel { display: flex; min-height: 470px; flex-direction: column; padding: clamp(2rem, 5vw, 4.4rem); border-top: 11px solid var(--blue); }
.amount { margin: .65rem 0 3.2rem; font-family: STSong, "Songti SC", serif; line-height: 1; }
.amount span { margin-right: .2rem; font-size: 1.3rem; vertical-align: top; }
.amount strong { font-size: clamp(4.2rem, 9vw, 7.5rem); font-weight: 500; letter-spacing: -.07em; }
h2 { margin: 0 0 .8rem; font-size: 1.65rem; font-weight: 600; }
.order-message { min-height: 3rem; margin: 0; color: #52545a; line-height: 1.65; }
.order-meta { display: grid; gap: .8rem; margin: 1.75rem 0; border-top: 1px solid var(--rule); padding-top: 1rem; }
.order-meta div { display: grid; grid-template-columns: 5.5rem 1fr; gap: .8rem; }
dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.primary-action { margin-top: auto; border: 0; padding: 1rem 1.15rem; color: white; background: var(--blue); cursor: pointer; font-weight: 700; letter-spacing: .04em; text-align: left; transition: background .18s, transform .18s; }
.primary-action:hover { background: #0869bc; transform: translateX(3px); }
.primary-action:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.primary-action:disabled { cursor: wait; opacity: .68; transform: none; }

.checkout-panel { position: relative; display: grid; min-height: 470px; overflow: hidden; place-items: center; padding: 2.25rem; background: #181b21; color: #f7f3e9; }
.checkout-panel::before, .checkout-panel::after { position: absolute; width: 46px; height: 46px; content: ""; opacity: .7; }
.checkout-panel::before { top: 22px; left: 22px; border-top: 1px solid var(--blue); border-left: 1px solid var(--blue); }
.checkout-panel::after { right: 22px; bottom: 22px; border-right: 1px solid var(--blue); border-bottom: 1px solid var(--blue); }
.checkout-placeholder { display: grid; width: min(290px, 100%); min-height: 290px; place-items: center; border: 1px solid rgb(255 255 255 / 25%); text-align: center; }
.checkout-placeholder p { margin: 0; color: #c8c5bd; font-size: .88rem; }
.corner-mark { color: var(--blue); font-size: 2rem; }
.scan-line { position: absolute; z-index: 2; top: 20%; width: 64%; height: 1px; background: rgb(21 120 209 / 74%); box-shadow: 0 0 15px var(--blue); animation: scan 2.6s ease-in-out infinite; pointer-events: none; }
iframe { z-index: 1; width: min(100%, 390px); height: 370px; border: 0; background: white; }
.success-state { display: grid; z-index: 3; place-items: center; text-align: center; }
.success-mark { display: grid; width: 82px; height: 82px; place-items: center; border: 2px solid var(--green); border-radius: 50%; color: #83e0ae; font-size: 3rem; }
.success-state p { margin: 1.1rem 0 .35rem; color: #d2ffe2; font-size: 1.45rem; font-weight: 700; }.success-state small { color: #a9b5ad; }
footer { margin-top: 1.25rem; color: var(--muted); font-size: .77rem; }
footer p { max-width: 38rem; margin: 0; }
@keyframes scan { 0%, 100% { transform: translateY(-90px); opacity: 0; } 20%, 80% { opacity: .75; } 50% { transform: translateY(90px); opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .scan-line { animation: none; } .primary-action { transition: none; } }
@media (max-width: 760px) { .receipt-shell { width: min(100% - 1.5rem, 600px); padding-top: 2rem; }.payment-card { grid-template-columns: 1fr; }.order-panel, .checkout-panel { min-height: 390px; }.order-panel { padding: 2rem; }.checkout-panel { min-height: 440px; } }
