:root {
  color-scheme: light;
  --canvas: oklch(98.8% 0.004 251);
  --paper: oklch(100% 0 0);
  --wash: oklch(96.7% 0.009 251);
  --text: oklch(24% 0.028 252);
  --muted: oklch(45% 0.029 250);
  --line: oklch(88.5% 0.017 251);
  --outline: oklch(76% 0.025 250);
  --accent: oklch(33% 0.05 250);
  --accent-hover: oklch(40% 0.059 249);
  --focus: oklch(52% 0.13 245);
  --positive: oklch(40% 0.074 156);
  --positive-wash: oklch(95.8% 0.025 155);
  --warning: oklch(43% 0.091 73);
  --warning-wash: oklch(96% 0.032 84);
  --negative: oklch(43% 0.12 26);
  --negative-wash: oklch(96% 0.019 24);
  --radius-sm: 7px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 18px 60px oklch(24% 0.035 249 / 0.15);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: "Songti SC", "SimSun", "Noto Serif CJK SC", "Noto Serif SC", serif;
  font-family: var(--sans);
  background: var(--canvas);
  color: var(--text);
  font-synthesis: none;
  line-height: 1.65;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3, h4, p, ul, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
button, a, select { touch-action: manipulation; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
section[id] { scroll-margin-block-start: 28px; }
button:disabled { cursor: wait; opacity: 0.65; }

.shell { width: min(100% - 80px, 1152px); margin-inline: auto; }
.skip-link { position: absolute; z-index: 2; inset: 12px auto auto 12px; padding: 12px; background: var(--paper); transform: translateY(-140%); }
.skip-link:focus { transform: translateY(0); }
.site-header { border-bottom: 1px solid var(--line); background: var(--canvas); }
.header-inner { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; font-size: 17px; font-weight: 650; white-space: nowrap; letter-spacing: -0.035em; }
.brand-mark { display: flex; align-items: center; gap: 4px; width: 21px; height: 22px; transform: rotate(-22deg); }
.brand-mark i { width: 7px; height: 16px; border: 1.2px solid var(--text); border-radius: var(--radius-pill); }
.brand-mark i:last-child { margin-top: 7px; border-color: var(--muted); }
.header-nav { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.header-nav > a:not(.button), .site-footer a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; }
.header-nav > a:not(.button) { padding-inline: 8px; color: var(--muted); }
.header-nav > a:hover, .site-footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-block: clamp(40px, 7vw, 78px) 32px; }
.intro-text { min-width: 0; }
.intro h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 4.9vw, 58px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
}
.intro-note { margin-top: 14px; max-width: 54ch; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.section { padding: 28px 0 36px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.section-heading h2, dialog h2 { font-size: clamp(19px, 2vw, 25px); font-weight: 650; letter-spacing: -0.04em; }
.section-heading .button { min-width: max-content; }
.empty { margin: 3px 0; color: var(--muted); font-size: 14px; }
.empty a { margin-left: 10px; text-decoration: underline; text-underline-offset: 4px; padding-block: 12px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; border: 1px solid transparent; border-radius: var(--radius-pill);
  padding: 8px 16px; background: transparent; color: var(--text);
  font-size: 13px; font-weight: 600; line-height: 1.35; text-align: center; cursor: pointer;
  transition: background 150ms var(--ease-out), border-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.button-primary { background: var(--accent); color: var(--paper); }
.button-primary:hover { background: var(--accent-hover); }
.button-outline { border-color: var(--outline); background: var(--paper); }
.button-outline:hover { border-color: var(--muted); background: var(--wash); }
.button-quiet { color: var(--muted); }
.button-quiet:hover { background: var(--wash); color: var(--text); }
.button[aria-busy="true"]::before {
  content: ""; width: 12px; height: 12px; border: 2px solid currentColor;
  border-inline-end-color: transparent; border-radius: 50%; animation: spin 650ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.notice { margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--wash); font-size: 13px; }
.notice-error { background: var(--negative-wash); color: var(--negative); }
.notice .button { margin-top: 8px; }
.loading-line { padding-block: 15px 26px; color: var(--muted); font-size: 14px; }

.product-list { display: grid; gap: 16px; }
.product {
  min-width: 0; display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 2.3fr); gap: 20px 28px;
  align-items: start; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--paper);
}
.product-head { overflow-wrap: anywhere; }
.product-head h3 { font-size: 20px; font-weight: 650; letter-spacing: -0.055em; }
.product-head p { margin-top: 6px; color: var(--muted); font-size: 13px; }
.product-head > a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.offer-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 208px), 1fr)); gap: 10px; list-style: none; padding: 0; }
.offer {
  min-width: 0; display: flex; flex-direction: column; align-items: start; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--canvas);
  font-size: 13px; overflow-wrap: anywhere;
}
.offer h4 { font-size: 14px; font-weight: 650; }
.offer-price { font-size: 19px; font-weight: 650; line-height: 1.3; font-variant-numeric: tabular-nums; }
.offer-price span { font-size: 12px; font-weight: 450; color: var(--muted); margin-left: 5px; }
.offer-description, .offer-features { color: var(--muted); font-size: 12px; }
.offer-features { list-style: disc; padding-inline-start: 16px; }
.offer .button { margin-top: auto; }

.ledger { list-style: none; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.ledger-row {
  min-width: 0; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) auto;
  column-gap: 18px; row-gap: 8px; align-items: center; padding: 12px 16px;
}
.ledger-row + .ledger-row { border-top: 1px solid var(--line); }
.ledger-row > * { min-width: 0; overflow-wrap: anywhere; }
.ledger-main { display: grid; gap: 2px; }
.ledger-main strong { font-size: 14px; }
.ledger-main small, .ledger-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ledger-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.ledger-group { margin-top: 12px; }
.ledger-group h3 { font-size: 14px; margin-bottom: 7px; }
.ledger-more { margin-top: 12px; }

.status-mark { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 550; background: var(--wash); color: var(--muted); }
.status-good { background: var(--positive-wash); color: var(--positive); }
.status-wait { background: var(--warning-wash); color: var(--warning); }
.status-bad { background: var(--negative-wash); color: var(--negative); }

.transaction { margin-bottom: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); overflow: hidden; }
.transaction-heading { padding: 14px 22px; margin: 0; border-bottom: 1px solid var(--line); }
.transaction-heading h2 { font-size: 19px; }
.checkout-body { padding: 22px; }
.checkout-body h3 { font-size: 20px; line-height: 1.45; overflow-wrap: anywhere; }
.checkout-body > p, .checkout-body > ul { margin-top: 8px; }
.checkout-body > .button { margin-top: 16px; }
.checkout-notes { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.checkout-body .status-mark { margin-top: 8px; }
.checkout-price { margin-top: 12px; font-size: 27px; line-height: 1.4; font-weight: 650; font-variant-numeric: tabular-nums; }
.checkout-form { display: grid; align-items: start; justify-items: start; gap: 14px; margin-top: 18px; }
.field { display: grid; gap: 6px; min-width: min(100%, 235px); max-width: 100%; font-size: 13px; }
.field select {
  min-height: 44px; width: 100%; padding: 8px 12px; border: 1px solid var(--outline); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--text); font-size: 16px;
}
.consent { min-height: 44px; display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 13px; }
.consent input { width: 18px; height: 18px; flex: none; margin: 2px 0 0; accent-color: var(--accent); font-size: 16px; }
.checkout-form .notice { margin: 0; }
.checkout-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.qr-code {
  display: block; width: min(100%, 188px); aspect-ratio: 1 / 1; height: auto; margin-top: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper);
}

dialog {
  width: min(420px, 100% - 32px); max-height: calc(100% - 32px); padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius-lg); color: var(--text); background: var(--paper); box-shadow: var(--shadow);
}
dialog::backdrop { background: oklch(24% 0.03 250 / 0.4); }
.dialog-inner { padding: 24px; }
.dialog-inner > p { margin-top: 10px; color: var(--muted); font-size: 14px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 18px; }

.site-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding: 13px 0 max(16px, env(safe-area-inset-bottom)); margin-top: 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer small { font-size: inherit; }
@media (max-width: 820px) {
  .shell { width: calc(100% - 48px); }
  .product { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 66px; gap: 8px; }
  .header-nav { gap: 0; }
  .header-nav > a:not(.button) { padding-inline: 7px; }
  .header-nav .button { padding-inline: 9px; }
  .brand { font-size: 15px; gap: 7px; }
  .intro { flex-direction: column; align-items: flex-start; gap: 14px; padding-block: 38px 24px; }
  .section { padding-block: 20px 24px; }
  .product { padding: 15px; }
  .transaction-heading, .checkout-body { padding-inline: 15px; }
  .ledger-row { grid-template-columns: minmax(0, 1fr) max-content; gap: 2px 10px; padding-inline: 12px; }
  .ledger-row .ledger-meta { grid-row: 2; grid-column: 1 / -1; }
  .ledger-actions { grid-row: 1; grid-column: 2; }
  .ledger-actions .button { padding-inline: 10px; font-size: 12px; }
}
@media (max-width: 380px) {
  .ledger-row .ledger-actions { grid-row: 3; grid-column: 1 / -1; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button[aria-busy="true"]::before { animation: none; }
}
