:root {
  color-scheme: light;
  --page-bg: #eef2f0;
  --panel: #ffffff;
  --text: #17201d;
  --muted: #66736f;
  --line: #dce5e1;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --accent: #2563eb;
  --amber: #b7791f;
  --amber-bg: #fff8e7;
  --danger-bg: #fff7ed;
  --shadow: 0 22px 60px rgba(15, 31, 28, 0.13);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.12), transparent 260px),
    var(--page-bg);
}

button {
  font: inherit;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.checkout {
  width: min(100%, 430px);
  overflow: hidden;
  border: 1px solid rgba(220, 229, 225, 0.95);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 16px;
  background: #0f766e;
  color: #fff;
}

.merchant {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.merchant-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 22px;
  font-weight: 800;
}

h1,
h2,
p,
figure,
dl,
dd {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.merchant p {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  line-height: 1.35;
}

.pay-state {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: #ecfeff;
  font-size: 13px;
  font-weight: 700;
}

.order-info {
  display: grid;
  padding: 10px 18px 4px;
}

.order-info div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 42px;
  border-bottom: 1px solid #eef2f0;
}

.order-info div:last-child {
  border-bottom: 0;
}

dt {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

dd {
  min-width: 0;
  color: #27332f;
  font-size: 14px;
  font-weight: 650;
  text-align: right;
  overflow-wrap: anywhere;
}

.status {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 18px 18px;
  padding: 13px 14px;
  border: 1px solid #cfe3df;
  border-radius: 8px;
  color: var(--primary-dark);
  background: #f1fbf9;
  font-size: 14px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #bddbd5;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.payment-box {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.pay-tip {
  padding: 14px 16px;
  border: 1px solid #f6c56b;
  border-radius: 8px;
  color: #7a3e00;
  background: linear-gradient(180deg, #fff7d6, #ffedaa);
  box-shadow: 0 10px 22px rgba(183, 121, 31, 0.16);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}

.qr-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f7faf9;
  border: 1px solid var(--line);
}

.qr-title span {
  color: #111827;
  font-weight: 800;
}

.qr-title strong {
  color: var(--accent);
  font-size: 14px;
  text-align: right;
}

.qr-wrap {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(90deg, #d7e2de 0 10px, transparent 10px 18px) border-box;
  text-align: center;
}

.qr-wrap img {
  display: block;
  width: min(100%, 360px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 75%;
  margin: 0 auto;
  border-radius: 6px;
  background: #f8faf9;
}

.secure-note {
  padding: 10px 12px;
  border-radius: 8px;
  color: #46615b;
  background: #f5f8f7;
  font-size: 13px;
  text-align: center;
}

.empty {
  margin: 14px 18px 18px;
  padding: 24px 16px;
  text-align: center;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: var(--danger-bg);
}

.empty-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--amber-bg);
  color: var(--amber);
  font-weight: 800;
}

.empty h2 {
  font-size: 18px;
  line-height: 1.35;
}

.empty p {
  margin-top: 8px;
  color: #7c4a14;
  font-size: 14px;
  line-height: 1.6;
}

.retry {
  width: calc(100% - 36px);
  min-height: 46px;
  margin: 0 18px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.retry:active {
  transform: translateY(1px);
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 360px) {
  .checkout-header,
  .order-info,
  .payment-box {
    padding-left: 14px;
    padding-right: 14px;
  }

  .status,
  .empty {
    margin-left: 14px;
    margin-right: 14px;
  }

  .retry {
    width: calc(100% - 28px);
    margin-left: 14px;
    margin-right: 14px;
  }

}
