:root {
  color-scheme: light;
  --paper: #f5f0e6;
  --paper-deep: #ece6dc;
  --panel: #fbf7f0;
  --ink: #11110f;
  --ink-soft: rgba(17, 17, 15, 0.64);
  --muted: #6a6b62;
  --line: rgba(17, 17, 15, 0.16);
  --red: #d01622;
  --red-soft: rgba(208, 22, 34, 0.1);
  --ease: cubic-bezier(0.65, 0.05, 0, 1);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --max: 720px;
  --header: 72px;
  font-family: var(--sans);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #21191c;
  --paper-deep: #1a1416;
  --panel: #292124;
  --ink: #f5e9cc;
  --ink-soft: rgba(245, 233, 204, 0.72);
  --muted: #a79a87;
  --line: #504339;
  --red: #e24b56;
  --red-soft: rgba(226, 75, 86, 0.16);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(900px 420px at 50% -80px, var(--red-soft), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.site-header {
  height: var(--header);
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  border-radius: 4px;
}
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1.2;
}
.brand-sub {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}
#theme-toggle {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 20px;
  padding: 6px;
}
#theme-toggle:hover { color: var(--red); }

main { max-width: var(--max); margin: 0 auto; padding: 36px 24px 80px; }
.hero { margin-bottom: 28px; }
.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(36px, 9vw, 56px);
  letter-spacing: 0.14em;
  line-height: 1.15;
}
.lede { margin: 14px 0 0; color: var(--ink-soft); font-size: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 24px 24px;
}
.field { display: block; margin-bottom: 20px; }
.field > span, .sum span, .facts dt {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}
input[type="text"], input:not([type]), input[inputmode] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0.04em;
}
input::placeholder { color: var(--muted); opacity: .8; }
.qty { display: flex; gap: 8px; align-items: center; }
.qty input { text-align: center; font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; }
.chips, .pay-tabs, .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip, .pay {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 99px;
  padding: 6px 13px;
  font-size: 13px;
  color: var(--ink-soft);
}
.chip.ghost { border-radius: 4px; min-width: 52px; }
.chip.on, .pay.on {
  color: var(--red);
  background: var(--red-soft);
  border-color: transparent;
}
.pay { flex: 1; padding: 10px 12px; border-radius: 4px; }
.sum {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0 6px;
  border-top: 1px solid var(--line);
  margin-bottom: 18px;
}
.sum strong {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 650;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--red);
}
.cta {
  width: 100%;
  border: 0;
  background: var(--red);
  color: #fffaf1;
  padding: 14px 18px;
  border-radius: 4px;
  letter-spacing: 0.16em;
  font-size: 14px;
}
.cta:hover:not(:disabled) { filter: brightness(1.05); }
.cta.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.hint, .muted { color: var(--muted); font-size: 12px; line-height: 1.6; }
.hint { margin: 14px 0 0; }
.text-btn {
  display: block;
  margin: 16px auto 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  padding: 8px;
}
.text-btn:hover { color: var(--red); }

.state h2 {
  margin: 6px 0 10px;
  font-family: var(--serif);
  font-weight: 650;
  font-size: 28px;
  letter-spacing: 0.1em;
}
.state-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--red);
}
.state-kicker.warn { color: var(--red); }
.progress {
  height: 2px;
  background: var(--line);
  margin-bottom: 22px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  width: 30%;
  background: var(--red);
  animation: slide 1.2s var(--ease) infinite;
}
@keyframes slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(400%); }
}
.facts { margin: 22px 0; padding: 0; }
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
#cf-nick { font-family: var(--serif); font-size: 20px; letter-spacing: 0.08em; }
.qr-wrap {
  margin: 18px auto 16px;
  width: min(280px, 72vw);
  aspect-ratio: 1;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
}
.qr-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
#open-link[hidden] { display: none; }
html.i18n-pending body { visibility: hidden; }
html[lang="zh-Hant"] {
  --serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", "PingFang TC", "Microsoft JhengHei", serif;
  --sans: "PingFang TC", "HarmonyOS Sans TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}
html[lang="ja"] {
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "MS PMincho", serif;
  --sans: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "Meiryo", system-ui, sans-serif;
}
html[lang="ko"] {
  --serif: "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", serif;
  --sans: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}
html[lang="en"] {
  --serif: "Times New Roman", "Noto Serif", Georgia, serif;
  --sans: "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
}
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  z-index: 5;
}
.footer-credit {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  letter-spacing: 0.12em;
  font-size: 12px;
  text-align: center;
}
.lang-dropdown { position: relative; width: 112px; }
.lang-trigger {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}
.lang-trigger:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.lang-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-arrow {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 8px;
  transition: transform 0.16s var(--ease);
}
.lang-dropdown.is-open .lang-arrow { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 10;
  padding: 4px 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
}
.lang-option {
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}
.lang-option.is-selected,
.lang-option:hover { background: color-mix(in srgb, var(--ink) 8%, var(--panel)); }
@media (min-width: 720px) {
  .card { padding: 36px 40px 32px; }
}
