:root {
  color-scheme: light;
  --paper: #f5f4ee;
  --panel: #fffefa;
  --ink: #18221f;
  --muted: #6f7773;
  --line: #dddeda;
  --line-dark: #c6cbc4;
  --green: #168454;
  --green-dark: #116b43;
  --green-wash: #e9f4ec;
  --warning: #88591c;
  --warning-wash: #fff3db;
  --serif: Georgia, 'Songti SC', STSong, 'Noto Serif CJK SC', serif;
  --sans: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', Arial, sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #86bd9b; outline-offset: 3px; }
[hidden] { display: none !important; }

.page-frame {
  width: min(1100px, calc(100% - 64px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-dark);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #183d35;
  color: #fffefa;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.04em;
}
.brand-name { font-size: 14px; font-weight: 650; letter-spacing: .03em; }
.header-note, .site-footer { color: var(--muted); font-size: 12px; letter-spacing: .04em; }

.checkout-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(355px, .78fr);
  gap: clamp(48px, 9vw, 116px);
  align-items: center;
  padding: 66px 0 76px;
}

.product-panel { max-width: 550px; padding: 8px 0 18px; }
.eyebrow { display: flex; align-items: center; gap: 11px; color: #47715b; font-size: 12px; font-weight: 700; letter-spacing: .18em; }
.eyebrow-line { width: 26px; height: 1px; background: #5f9171; }
h1 {
  margin: 30px 0 16px;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: 1.23;
}
.lead { margin: 0 0 50px; color: var(--muted); font-size: 16px; letter-spacing: .015em; }
.product-meta { display: grid; grid-template-columns: 34px 100px 1fr; gap: 10px; align-items: baseline; max-width: 385px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.product-meta:last-of-type { border-bottom: 1px solid var(--line); }
.product-meta strong { color: var(--ink); font-size: 13px; font-weight: 600; text-align: right; }
.meta-index { color: #9ca29c; font-family: var(--serif); font-size: 12px; }
.product-rule { width: 100%; max-width: 385px; margin: 28px 0 17px; border-top: 1px solid var(--line-dark); }
.product-note { max-width: 385px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }

.order-panel {
  width: 100%;
  max-width: 440px;
  justify-self: end;
  padding: 28px 30px 24px;
  border: 1px solid var(--line-dark);
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(33, 45, 38, .045);
}
.order-topline { display: flex; align-items: center; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.order-label { font-size: 13px; font-weight: 700; letter-spacing: .05em; }
.order-number { max-width: 172px; overflow: hidden; color: #9ba19b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.order-number.is-created { color: #64716a; }
.order-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 21px 0 22px; border-bottom: 1px solid var(--line); }
.order-item h2 { margin: 0 0 6px; font-size: 14px; font-weight: 650; line-height: 1.5; }
.order-item p { margin: 0; color: var(--muted); font-size: 12px; }
.item-price { flex: none; padding-top: 2px; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; }
.order-total { display: flex; align-items: flex-end; justify-content: space-between; padding: 20px 0 22px; }
.order-total > span { padding-bottom: 5px; color: var(--muted); font-size: 13px; }
.order-total strong { color: var(--ink); font-family: var(--serif); font-size: 36px; font-weight: 500; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.order-total small { margin-right: 3px; font-family: var(--sans); font-size: 17px; }
.order-total em { font-size: 19px; font-style: normal; }
.merchant-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: -5px 0 18px; color: var(--muted); font-size: 12px; }
.merchant-row strong { color: var(--ink); font-weight: 600; text-align: right; }
.payment-area { display: grid; gap: 13px; }
.payment-status { min-height: 22px; display: flex; align-items: center; gap: 9px; color: #59635c; font-size: 12px; }
.payment-status[data-tone='warning'] { color: var(--warning); }
.payment-status[data-tone='success'] { color: var(--green-dark); }
.status-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #80aa89; }
.payment-status[data-tone='warning'] .status-dot { background: #d28b30; }
.payment-status[data-tone='success'] .status-dot { background: var(--green); }
.pay-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 5px;
  background: var(--green);
  color: white;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .035em;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}
.pay-button:not(:disabled):hover { background: var(--green-dark); }
.pay-button:not(:disabled):active { transform: translateY(1px); }
.pay-button:disabled { background: #aab5ad; cursor: not-allowed; }
.wechat-glyph { width: 28px; height: 22px; display: inline-flex; }
.wechat-glyph svg { width: 100%; height: 100%; fill: currentColor; }
.payment-footnote { margin: -2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; text-align: center; }
.setup-notice { margin: 13px 0 0; padding: 12px 13px; border-left: 2px solid #d39b4b; background: var(--warning-wash); color: #73501e; font-size: 12px; line-height: 1.7; }
.order-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 20px; margin-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.order-footer a, .back-link { color: #316b4d; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.qr-panel { padding-top: 4px; text-align: center; }
.qr-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; text-align: left; }
.qr-heading h2, .success-panel h2 { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 500; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: #4b7258; font-size: 12px; cursor: pointer; }
.qr-image-wrap { width: 238px; height: 238px; display: grid; place-items: center; margin: 0 auto 12px; border: 1px solid var(--line); background: white; }
.payment-qr { display: block; width: 224px; height: 224px; image-rendering: pixelated; }
.qr-instruction { max-width: 300px; margin: 0 auto; color: #58635c; font-size: 12px; line-height: 1.75; }
.qr-expiry { margin-top: 8px; color: #8a908a; font-size: 11px; font-variant-numeric: tabular-nums; }
.success-panel { padding: 20px 0 12px; text-align: center; }
.success-check { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 50%; background: var(--green-wash); color: var(--green-dark); font-size: 24px; }
.success-panel p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.download-button { display: block; margin: 18px 0 0; padding: 12px 14px; border: 1px solid var(--green); color: var(--green-dark); font-size: 13px; text-decoration: none; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 19px 0 24px; border-top: 1px solid var(--line-dark); font-size: 10px; letter-spacing: .11em; }
.toast { position: fixed; z-index: 10; right: 24px; bottom: 24px; max-width: min(360px, calc(100vw - 32px)); padding: 13px 16px; border: 1px solid #d3d8d1; background: var(--panel); color: var(--ink); box-shadow: 0 8px 26px rgba(24, 34, 31, .12); font-size: 13px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 160ms ease, transform 160ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.terms-page { width: min(760px, calc(100% - 40px)); margin: 70px auto; }
.terms-page h1 { margin: 26px 0 24px; font-size: clamp(32px, 4vw, 44px); }
.terms-copy { padding: 22px; border: 1px solid var(--line-dark); background: var(--panel); color: #39443d; font: inherit; font-size: 14px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .page-frame { width: min(100% - 36px, 520px); }
  .site-header { min-height: 68px; }
  .header-note { font-size: 11px; }
  .checkout-layout { grid-template-columns: 1fr; gap: 30px; align-items: start; padding: 40px 0 44px; }
  .product-panel { padding: 0; }
  h1 { margin: 20px 0 10px; font-size: clamp(34px, 9vw, 46px); }
  .lead { margin-bottom: 24px; font-size: 14px; }
  .product-meta { max-width: none; padding: 10px 0; }
  .product-rule { display: none; }
  .product-note { display: none; }
  .order-panel { justify-self: stretch; max-width: none; padding: 22px 20px 19px; }
  .order-total strong { font-size: 34px; }
  .site-footer { flex-direction: column; gap: 5px; padding: 15px 0 18px; font-size: 9px; }
  .toast { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
