:root {
  color-scheme: light;
  --bg: #fbfbff;
  --surface: #ffffff;
  --surface-soft: #f6f4ff;
  --text: #101729;
  --muted: #626a7b;
  --line: #e2e6f3;
  --accent: #6847f5;
  --accent-strong: #5734e8;
  --success: #0f766e;
  --warning: #a16207;
  --danger: #b42318;
  --shadow: 0 24px 70px rgb(54 61 95 / 0.12);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 18%, rgb(239 234 255 / 0.86), transparent 30rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.checkout-header,
.shell,
.checkout-footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.checkout-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #7656ff, #5834dd);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgb(104 71 245 / 0.22);
}

.brand-mark::after {
  position: absolute;
  top: 50%;
  left: 53%;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 13px solid #ffffff;
  content: "";
  transform: translate(-50%, -50%);
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-name {
  font-size: 25px;
  font-weight: 950;
  line-height: 1;
}

.brand-subtitle,
.support-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.support-link:hover {
  color: var(--accent-strong);
}

.shell {
  padding: 46px 0 70px;
}

.checkout-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.72fr);
  gap: 28px;
  align-items: stretch;
}

.summary-panel,
.payment-panel {
  background: rgb(255 255 255 / 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-panel,
.payment-panel {
  padding: 34px;
}

.label {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro {
  max-width: 34rem;
  margin: 16px 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.details {
  display: grid;
  gap: 0;
  margin: 0;
}

.details div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  min-height: 42px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 850;
}

.assurance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.assurance-grid p {
  min-height: 52px;
  margin: 0;
  padding: 12px;
  color: #293249;
  background: var(--surface-soft);
  border: 1px solid #dfd9ff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.payment-panel {
  display: grid;
  gap: 20px;
}

.payment-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.35;
}

.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  background: #f0edff;
  border: 1px solid #dfd9ff;
  border-radius: 8px;
}

.method-tab {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #4b5570;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
}

.provider-logo {
  position: relative;
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  color: #ffffff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
}

.alipay-logo {
  background: #1677ff;
  box-shadow: 0 8px 18px rgb(22 119 255 / 0.22);
}

.wechat-logo {
  background: #20c45a;
  box-shadow: 0 8px 18px rgb(32 196 90 / 0.2);
}

.wechat-logo span {
  position: absolute;
  display: block;
  background: #ffffff;
  border-radius: 999px;
}

.wechat-logo span:first-child {
  top: 7px;
  left: 5px;
  width: 12px;
  height: 9px;
}

.wechat-logo span:last-child {
  right: 5px;
  bottom: 6px;
  width: 10px;
  height: 8px;
}

.method-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, #7656ff, var(--accent-strong));
  box-shadow: 0 10px 20px rgb(104 71 245 / 0.22);
}

.pay-action {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #faf9ff);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.polling-state {
  width: fit-content;
  margin: 0;
  padding: 7px 11px;
  color: var(--warning);
  background: #fff7ed;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.polling-state.success {
  color: var(--success);
  background: #ecfdf5;
}

.polling-state.error {
  color: var(--danger);
  background: #fff1f1;
}

.qr-frame {
  display: grid;
  min-height: 214px;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(90deg, rgb(104 71 245 / 0.08) 1px, transparent 1px),
    linear-gradient(rgb(104 71 245 / 0.08) 1px, transparent 1px),
    #ffffff;
  background-size: 18px 18px;
  border: 1px dashed #c8c2f6;
  border-radius: 8px;
}

[hidden] {
  display: none !important;
}

.qr-frame img {
  width: min(190px, 100%);
  height: auto;
  border-radius: 8px;
}

.qr-placeholder {
  display: grid;
  gap: 12px;
  place-items: center;
  opacity: 0.72;
  text-align: center;
}

.qr-blocks {
  display: grid;
  grid-template-columns: 42px 42px;
  grid-template-rows: 42px 42px;
  gap: 14px;
}

.qr-blocks span {
  display: block;
  background: #ddd7ff;
  border-radius: 7px;
}

.qr-blocks span:nth-child(2),
.qr-blocks span:nth-child(3) {
  background: #bfb3ff;
}

.qr-placeholder p {
  margin: 0;
  color: #293249;
  font-size: 14px;
  font-weight: 900;
}

.qr-placeholder small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.payment-link,
.refresh {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 950;
}

.payment-link {
  color: #ffffff;
  background: linear-gradient(135deg, #7656ff, var(--accent-strong));
  box-shadow: 0 14px 30px rgb(104 71 245 / 0.22);
}

.payment-link.disabled {
  color: #81889d;
  background: #eef0f7;
  box-shadow: none;
  pointer-events: none;
}

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

.refresh {
  width: 100%;
  color: var(--accent-strong);
  background: #ffffff;
  border: 1px solid #cfc6ff;
  cursor: pointer;
}

.payment-link:active,
.refresh:active {
  transform: translateY(1px);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgb(104 71 245 / 0.34);
  outline-offset: 3px;
}

.checkout-footer {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 32px;
  color: var(--muted);
  border-top: 1px solid #dedcf4;
  font-size: 14px;
}

.checkout-footer p {
  margin: 0;
}

.checkout-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .checkout-workspace {
    grid-template-columns: 1fr;
  }

  .assurance-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .checkout-header,
  .shell,
  .checkout-footer {
    width: min(100% - 28px, 1180px);
  }

  .checkout-header,
  .checkout-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-subtitle {
    display: none;
  }

  .shell {
    padding-top: 24px;
  }

  .summary-panel,
  .payment-panel {
    padding: 22px;
  }

  .details div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .payment-methods {
    grid-template-columns: 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101115;
    --surface: #1a1b20;
    --surface-soft: #18142a;
    --text: #f4f2ff;
    --muted: #b8b3cc;
    --line: #343147;
    --accent: #8f76ff;
    --accent-strong: #a895ff;
    --shadow: 0 24px 70px rgb(0 0 0 / 0.28);
  }

  body {
    background:
      radial-gradient(circle at 82% 18%, rgb(72 55 132 / 0.34), transparent 30rem),
      linear-gradient(180deg, #111218 0%, var(--bg) 100%);
  }

  .summary-panel,
  .payment-panel {
    background: rgb(26 27 32 / 0.94);
  }

  .assurance-grid p,
  .pay-action,
  .refresh {
    background: #1f2030;
  }

  .payment-methods {
    background: #201b34;
  }

  .qr-frame {
    background:
      linear-gradient(90deg, rgb(168 149 255 / 0.12) 1px, transparent 1px),
      linear-gradient(rgb(168 149 255 / 0.12) 1px, transparent 1px),
      #171821;
  }
}
