:root {
  color-scheme: light;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #4b4947;
  background: #fbf7f4;
  --paper: #fffdfd;
  --orange: #ff9a28;
  --amber-text: #b17423;
  --price: #2f6dcc;
  --warning: #c95651;
  --muted: #716e6b;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: linear-gradient(180deg, #ffd3a5 0, #f8dbbf 164px, #f5e9de 420px, #fbf7f4 600px);
}

.checkout {
  width: min(100%, 31rem);
  margin-inline: auto;
  padding: 0 14px calc(82px + env(safe-area-inset-bottom, 0px));
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 70px;
}

.page-header img {
  display: block;
  flex: none;
  width: 104px;
  height: auto;
}

h1 {
  margin: 0;
  padding-left: 9px;
  border-left: 1px solid #bd9567;
  color: #453321;
  font-size: clamp(13px, 4.15vw, 16px);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.receipt,
.page-message {
  margin: 0;
  border: 1px solid #f4e6d8;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 4px 13px rgb(99 68 40 / 13%);
}

.page-message {
  padding: 16px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.checkout-placeholder {
  padding: 24px 16px;
}

.checkout-placeholder h2 {
  margin: 0 0 8px;
  color: #453321;
  font-size: 1.125rem;
}

.checkout-placeholder p {
  margin: 0;
}

.receipt-header {
  padding: 17px 10px 0;
  text-align: center;
}

.order {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 5px;
  min-height: 36px;
  color: var(--muted);
  font-size: 14px;
  line-height: 16px;
  text-align: left;
}

.order-label {
  padding-top: 2px;
  white-space: nowrap;
}

.order-number {
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.copy-button {
  display: grid;
  width: 28px;
  min-height: 30px;
  place-items: start end;
  padding: 0 1px 0 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #85817e;
  cursor: pointer;
}

.copy-button:hover {
  background: #fff2de;
}

.copy-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.copy-status:empty {
  display: none;
}

.amount {
  margin: 13px 0 0;
  color: var(--price);
  font-size: clamp(28px, 9vw, 36px);
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1.13;
  overflow-wrap: anywhere;
}

.amount [data-unset] {
  display: block;
  font-size: 17px;
  line-height: 1.4;
}

.receipt-body {
  padding: 3px 10px 8px;
  text-align: center;
}

.payment-code {
  width: min(100%, 182px);
  margin: 0 auto;
  padding: 15px 14px 10px;
  border-radius: 9px;
  background: var(--orange);
  box-shadow: inset 0 -3px 5px rgb(145 76 13 / 22%), 0 1px 3px rgb(174 92 12 / 20%);
}

.code-frame {
  overflow: hidden;
  border: 1px solid #fff0d8;
  border-radius: 7px;
  background: white;
}

.code-frame canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
}

.payment-code figcaption {
  margin-top: 7px;
  color: #fff7ea;
  font-size: 12px;
  line-height: 1.45;
  text-shadow: 0 1px 1px #98510c;
}

.countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 9px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.countdown time {
  color: var(--warning);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.order-note,
.checkout-state {
  margin: 7px 0 0;
  color: #4d4946;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.order-note .payer-name {
  color: var(--warning);
}

.order-note .recipient-name {
  color: var(--price);
}

.checkout-state {
  padding: 12px;
  border: 1px solid #f1d3ba;
  border-radius: 6px;
  color: #812b1b;
  background: #fff0e3;
}

.payment-guide {
  margin-top: 8px;
}

.payment-guide summary {
  display: inline-flex;
  min-width: 88px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 3px 12px;
  border: 1px solid #e6bf85;
  border-radius: 999px;
  color: var(--amber-text);
  font-size: 14px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.payment-guide summary::-webkit-details-marker {
  display: none;
}

.payment-guide[open] summary,
.payment-guide summary:hover {
  background: #fff1dc;
}

.payment-guide p {
  max-width: 25rem;
  margin: 7px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.receipt-notes {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: start;
  padding: 9px 10px 6px;
  border-top: 2px dotted #e2dcda;
  border-radius: 0 0 8px 8px;
  background: #f7f3f3;
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
}

.receipt-notes h2 {
  margin: 0;
  color: #514c49;
  font-size: 14px;
  line-height: inherit;
}

.receipt-notes ul {
  margin: 0;
  padding-left: 13px;
}

.receipt-notes li {
  overflow-wrap: anywhere;
}

.receipt-notes strong {
  color: var(--warning);
  font-weight: 650;
}

.receipt-notes a,
.original-link {
  color: #2d68b4;
  text-underline-offset: 2px;
}

.original-link[href] {
  display: block;
  width: max-content;
  margin: 4px auto 0;
}

.original-link:not([href]) {
  display: none;
}

.payment-dock {
  position: fixed;
  z-index: 1;
  inset-inline: 0;
  bottom: 0;
  border-top: 1px solid #f3eeeb;
  background: #fffdfd;
  box-shadow: 0 -3px 9px rgb(96 66 43 / 6%);
}

.payment-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  gap: clamp(28px, 16vw, 64px);
  width: min(100%, 31rem);
  margin-inline: auto;
  padding: 12px clamp(19px, 8vw, 32px) calc(13px + env(safe-area-inset-bottom, 0px));
}

.action {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.action-primary {
  color: #fff9f0;
  background: var(--orange);
  box-shadow: inset 0 -2px 4px rgb(162 85 9 / 20%), 0 2px 4px rgb(140 75 18 / 19%);
  text-shadow: 0 1px 1px #98510c;
}

.action-primary:hover {
  background: #f38c19;
}

.action-secondary {
  color: var(--amber-text);
  border-color: #e9e0da;
  background: var(--paper);
}

.action-secondary:hover {
  background: #fff1dc;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid #225ca4;
  outline-offset: 2px;
}
