/* Asleep on a Rainy Day — checkout
   一张雨夜里的收据：靠排版说话，不靠卡片和渐变。
   字体：Instrument Serif（数字与拉丁标题）· Geist Mono（地址、标签）· 霞鹜文楷子集（简繁中文标题）·
   日文、韩文标题用各自系统里的明朝体，免得汉字被借成中文字形。 */

@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/static/fonts/instrument-serif-400.woff2) format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(/static/fonts/instrument-serif-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/static/fonts/geist-mono-400.woff2) format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/static/fonts/geist-mono-500.woff2) format("woff2"); }
@font-face { font-family: "Wenkai UI"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/static/fonts/wenkai-e0df1eeaa5.woff2) format("woff2"); }

:root {
  /* 雨天午后：雾一样的纸 */
  --paper: #e7e5df;
  --paper-2: #dfddd6;
  --ink: #171c20;
  --ink-2: #3a4247;
  --muted: #6c7378;
  --faint: #9aa0a3;
  --rule: rgba(23, 28, 32, .14);
  --rule-strong: rgba(23, 28, 32, .32);
  --lamp: #9a6b1f;          /* 屋里的一盏灯：唯一的强调色 */
  --lamp-soft: rgba(154, 107, 31, .1);
  --ok: #2f6b4f;
  --bad: #9b3b2e;
  --rain: rgba(40, 56, 68, .16);
  --grain-o: .07;
  --qr-bg: #f6f5f1;

  --latin: "Instrument Serif", "Iowan Old Style", "Palatino", Georgia;   /* 不带通用 serif，免得系统宋体抢先补中文 */
  --serif: var(--latin), serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --display: var(--latin), "Wenkai UI", "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    /* 雨夜：墨蓝的窗，暖色的灯 */
    --paper: #0c1115;
    --paper-2: #11181d;
    --ink: #ebe7de;
    --ink-2: #c7c3ba;
    --muted: #8a9296;
    --faint: #586166;
    --rule: rgba(235, 231, 222, .11);
    --rule-strong: rgba(235, 231, 222, .28);
    --lamp: #e2b86b;
    --lamp-soft: rgba(226, 184, 107, .1);
    --ok: #8fd1ad;
    --bad: #f0a093;
    --rain: rgba(190, 210, 225, .17);
    --grain-o: .05;
    --qr-bg: #ebe7de;
  }
}
:lang(zh-Hant) { --sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  --display: var(--latin), "Wenkai UI", "Songti TC", "Noto Serif TC", serif; }
:lang(ja) { --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
  --display: var(--latin), "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; }
:lang(ko) { --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --display: var(--latin), "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt" 0;
  overflow-x: hidden;
}
::selection { background: var(--lamp); color: var(--paper); }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1.5px solid var(--lamp); outline-offset: 3px; border-radius: 2px; }
.mono { font-family: var(--mono); }

/* ---------- 雨与纸 ---------- */
.rain { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 70%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 70%, transparent 100%); }
.rain::before, .rain::after { content: ""; position: absolute; left: -10%; right: -10%; top: -260px; height: calc(100% + 520px);
  background-repeat: repeat; will-change: transform; }
.rain::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='260'%3E%3Cg stroke='%23000' stroke-linecap='round'%3E%3Cpath d='M14 8l-2 15M61 40l-2 11M103 4l-2 17M150 62l-2 13M33 96l-2 14M82 130l-2 18M128 118l-2 11M170 160l-2 15M8 176l-2 12M55 200l-2 16M97 222l-2 12M141 236l-2 14' stroke-width='.9'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 180px 260px; animation: fall-a 1.15s linear infinite; }
.rain::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='520'%3E%3Cg stroke='%23000' stroke-linecap='round' stroke-width='.7'%3E%3Cpath d='M40 30l-2.5 26M190 90l-2.5 30M110 210l-2.5 24M235 300l-2.5 28M20 380l-2.5 26M150 450l-2.5 30'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 260px 520px; animation: fall-b 1.9s linear infinite; opacity: .7; }
@supports ((-webkit-mask-image: none) or (mask-image: none)) {
  .rain::before, .rain::after { background-color: var(--rain);
    -webkit-mask-image: var(--m); mask-image: var(--m); -webkit-mask-size: var(--ms); mask-size: var(--ms);
    background-image: none; }
  .rain::before { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='260'%3E%3Cg stroke='%23000' stroke-linecap='round'%3E%3Cpath d='M14 8l-2 15M61 40l-2 11M103 4l-2 17M150 62l-2 13M33 96l-2 14M82 130l-2 18M128 118l-2 11M170 160l-2 15M8 176l-2 12M55 200l-2 16M97 222l-2 12M141 236l-2 14' stroke-width='.9'/%3E%3C/g%3E%3C/svg%3E"); --ms: 180px 260px; }
  .rain::after { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='520'%3E%3Cg stroke='%23000' stroke-linecap='round' stroke-width='.7'%3E%3Cpath d='M40 30l-2.5 26M190 90l-2.5 30M110 210l-2.5 24M235 300l-2.5 28M20 380l-2.5 26M150 450l-2.5 30'/%3E%3C/g%3E%3C/svg%3E"); --ms: 260px 520px; }
}
@keyframes fall-a { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-17px, 260px, 0); } }
@keyframes fall-b { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-25px, 520px, 0); } }
.grain { position: fixed; inset: -50%; pointer-events: none; z-index: 1; opacity: var(--grain-o);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.4 -.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- 版心 ---------- */
.page { position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  max-width: 1120px; margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); }
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.mark { font-family: var(--serif); font-size: 19px; letter-spacing: -.005em; text-decoration: none; white-space: nowrap; }
.mark em { color: var(--muted); }
.tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.langs { display: flex; gap: 2px; }
.langs button { background: none; border: 0; cursor: pointer; padding: 4px 7px; font: 500 12px/1 var(--mono); color: var(--faint);
  letter-spacing: .04em; position: relative; transition: color .2s; }
.langs button:lang(zh-Hans), .langs button:lang(zh-Hant), .langs button:lang(ja), .langs button:lang(ko) { font-family: var(--sans); font-weight: 500; }
.langs button:hover { color: var(--ink-2); }
.langs button[aria-pressed="true"] { color: var(--ink); }
.langs button[aria-pressed="true"]::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: -1px; height: 1px; background: var(--ink); }
.bottom { margin-top: auto; padding-top: 28px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); border-top: 1px solid var(--rule); padding-bottom: 2px; margin-bottom: 0; }
.bottom .mono { letter-spacing: .1em; font-size: 11px; color: var(--faint); }

.sheet { padding: 34px 0 48px; }
.loading { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.loading::after { content: "…"; display: inline-block; animation: blink 1.2s steps(4) infinite; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes blink { from { width: 0; } to { width: 1.2em; } }
.err { color: var(--bad); }

/* ---------- 摘要 ---------- */
.eyebrow { margin: 0 0 6px; font: 500 11px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
:lang(zh-Hans) .eyebrow, :lang(zh-Hant) .eyebrow, :lang(ja) .eyebrow, :lang(ko) .eyebrow { letter-spacing: .2em; }
.merchant { margin: 0; font-size: 15px; color: var(--ink-2); }
.item { margin: 2px 0 0; font-family: var(--latin), var(--sans); font-size: 21px; line-height: 1.35; overflow-wrap: anywhere; }
.amount { margin: 22px 0 0; display: flex; align-items: baseline; gap: 10px; }
.num { font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; }
.amount .num { font-size: clamp(64px, 19vw, 112px); line-height: .82; }
.cur { font: 500 12px/1 var(--mono); letter-spacing: .14em; color: var(--muted); }
.gauge { margin-top: 26px; height: 1px; background: var(--rule); overflow: hidden; }
.gauge .fill { display: block; height: 100%; background: var(--ink); transform-origin: left center; transition: transform 1s linear; }
.left { margin: 10px 0 0; font-size: 12px; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.left.low { color: var(--bad); }
.summary { padding-bottom: 30px; border-bottom: 1px solid var(--rule); }
.ref { margin: 28px 0 0; font-size: 11px; letter-spacing: .06em; color: var(--faint); overflow-wrap: anywhere; }
.ref b { font-weight: 500; letter-spacing: .16em; text-transform: uppercase; margin-right: 8px; color: var(--muted); }

/* ---------- 面板 ---------- */
.panel { padding-top: 30px; }
.h { margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.2; letter-spacing: -.01em; }
.note { margin: 12px 0 0; max-width: 38em; font-size: 13.5px; line-height: 1.65; color: var(--muted); }

.toggle { display: inline-flex; gap: 22px; margin: 22px 0 6px; }
.toggle button { background: none; border: 0; padding: 0 0 6px; cursor: pointer; font: 500 13px/1 var(--mono); letter-spacing: .1em; color: var(--faint);
  border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.toggle button:hover { color: var(--ink-2); }
.toggle button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.nets { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.nets li { border-bottom: 1px solid var(--rule); }
.net { width: 100%; display: grid; grid-template-columns: 1fr auto 22px; align-items: baseline; gap: 14px; padding: 17px 2px 15px; background: none; border: 0;
  cursor: pointer; text-align: left; transition: padding .35s var(--ease), color .2s; }
.net .n { font-family: var(--serif); font-size: 25px; line-height: 1; letter-spacing: -.01em; }
.net .std { font: 500 11px/1 var(--mono); letter-spacing: .12em; color: var(--muted); }
.net .arr { font-family: var(--serif); font-size: 22px; line-height: 1; color: var(--faint); transition: transform .35s var(--ease), color .2s; justify-self: end; }
.net:hover, .net:focus-visible { padding-left: 10px; }
.net:hover .arr, .net:focus-visible .arr { transform: translateX(4px); color: var(--lamp); }
.net:focus-visible { outline-offset: -2px; }

/* ---------- 三步 ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 0 10px; padding: 24px 0; border-bottom: 1px solid var(--rule); }
.step:first-child { padding-top: 0; }
.idx { font-size: 11px; letter-spacing: .1em; color: var(--faint); padding-top: 9px; }
.step .h { font-size: 22px; }
.big { margin: 14px 0 0; display: flex; align-items: baseline; gap: 10px; }
.big .num { font-size: clamp(52px, 15vw, 76px); line-height: .85; }
.partial { margin: 14px 0 0; font-size: 12px; letter-spacing: .06em; color: var(--lamp); }
.chain { margin: 12px 0 0; display: flex; align-items: baseline; gap: 12px; }
.chain .n { font-family: var(--serif); font-size: 34px; line-height: 1; }
.chain .std { font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.addr { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 9px; font-size: 16px; line-height: 1.45; letter-spacing: .02em; max-width: 28em; }
.addr span:nth-child(odd) { color: var(--ink); }
.addr span:nth-child(even) { color: var(--ink-2); }
.contract { margin: 18px 0 0; font-size: 11px; line-height: 1.6; color: var(--faint); letter-spacing: .02em; overflow-wrap: anywhere; }
.contract span:first-child { letter-spacing: .1em; text-transform: uppercase; margin-right: 6px; color: var(--muted); }

.copy { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0 0 3px; cursor: pointer;
  font: 500 12px/1.2 var(--mono); letter-spacing: .08em; color: var(--ink); border-bottom: 1px solid var(--rule-strong); transition: border-color .2s, color .2s; }
.copy::before { content: ""; width: 9px; height: 9px; border: 1px solid currentColor; border-radius: 1px; box-shadow: 2px -2px 0 -1px var(--paper), 2px -2px 0 0 currentColor;
  transition: transform .3s var(--ease); }
.copy:hover { border-color: var(--lamp); color: var(--lamp); }
.copy.done { color: var(--ok); border-color: var(--ok); }
.copy.done::before { width: 10px; height: 5px; border: 0; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; border-radius: 0; box-shadow: none;
  transform: rotate(-45deg) translate(1px, -1px); }

.qr { position: relative; margin: 22px 0 0; width: 196px; padding: 14px; background: var(--qr-bg); color: #121619; }
.qr svg { display: block; width: 168px; height: 168px; }
.qr svg path { fill: #121619; }
.qr svg rect { fill: var(--qr-bg); }
.qr::before, .qr::after { content: ""; position: absolute; width: 12px; height: 12px; border: 1px solid var(--rule-strong); }
.qr::before { left: -7px; top: -7px; border-right: 0; border-bottom: 0; }
.qr::after { right: -7px; bottom: -7px; border-left: 0; border-top: 0; }

.waiting { display: flex; align-items: center; gap: 14px; padding: 22px 0 0; font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.drop { position: relative; flex: none; width: 18px; height: 22px; }
.drop::before { content: ""; position: absolute; left: 8px; top: 0; width: 2px; height: 6px; border-radius: 2px; background: var(--ink-2); animation: drip 2.4s var(--ease) infinite; }
.drop::after { content: ""; position: absolute; left: 1px; bottom: 1px; width: 16px; height: 5px; border-radius: 50%; border: 1px solid var(--ink-2); opacity: 0; transform: scale(.2);
  animation: ring 2.4s ease-out infinite; }
@keyframes drip { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 45% { transform: translateY(14px); opacity: 1; } 50%, 100% { transform: translateY(14px); opacity: 0; } }
@keyframes ring { 0%, 45% { opacity: 0; transform: scale(.2); } 50% { opacity: .9; } 100% { opacity: 0; transform: scale(1.5); } }
.link { margin-top: 18px; background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; color: var(--muted); text-decoration: underline; text-decoration-color: var(--rule-strong);
  text-underline-offset: 4px; }
.link:hover { color: var(--ink); }

/* ---------- 结局 ---------- */
.end { position: relative; }
.end .h { font-size: clamp(36px, 10vw, 52px); line-height: 1.05; }
.end .eyebrow { margin-bottom: 14px; }
.end.ok .eyebrow { color: var(--ok); }
.meta { margin: 14px 0 0; font-size: 13px; letter-spacing: .06em; color: var(--ink-2); }
.ext { display: inline-block; margin-top: 18px; font-size: 13.5px; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 4px; }
.ext:hover { text-decoration-color: var(--lamp); }
.ripple { position: relative; height: 70px; margin: 0 0 18px; }
.ripple i { position: absolute; left: 0; top: 50%; width: 70px; height: 22px; margin-top: -11px; border: 1px solid var(--ok); border-radius: 50%; opacity: 0; transform: scale(.1);
  animation: ripple 2.2s var(--ease) forwards; }
.ripple i:nth-child(1) { --s: 1; --o: .2; }
.ripple i:nth-child(2) { --s: .68; --o: .45; animation-delay: .2s; }
.ripple i:nth-child(3) { --s: .36; --o: .9; animation-delay: .4s; }
.ripple i { left: 0; transform-origin: 35px 50%; }
@keyframes ripple { 0% { opacity: 0; transform: scale(.05); } 25% { opacity: 1; } 100% { opacity: var(--o); transform: scale(var(--s)); } }
.return { margin-top: 30px; }
.return .bar { display: block; height: 1px; background: var(--rule); position: relative; overflow: hidden; margin-bottom: 10px; }
.return .bar::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); animation: fill 4s linear forwards; }
@keyframes fill { to { transform: scaleX(1); } }
.return .mono { font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.go { display: inline-block; margin-top: 16px; font-family: var(--display); font-size: 20px; text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.go::after { content: " →"; font-family: var(--serif); transition: margin .3s var(--ease); }
.go:hover { color: var(--lamp); border-color: var(--lamp); }

/* ---------- 进场 ---------- */
.sheet > * { animation: rise .7s var(--ease) both; }
.sheet > *:nth-child(2) { animation-delay: .08s; }
.sheet.enter .step { animation: rise .6s var(--ease) both; }
.sheet.enter .step:nth-child(2) { animation-delay: .07s; }
.sheet.enter .step:nth-child(3) { animation-delay: .14s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 首页 ---------- */
.home .hero { padding: 12vh 0 10vh; }
.wordmark { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(64px, 17vw, 168px); line-height: .86; letter-spacing: -.035em; }
.wordmark em { color: var(--muted); font-size: .62em; letter-spacing: -.01em; }
.lede { margin: 40px 0 0; max-width: 26em; font-family: var(--display); font-size: 19px; line-height: 1.55; color: var(--ink-2); }

/* ---------- 宽屏：左摘要、右操作 ---------- */
@media (min-width: 900px) {
  .page { padding-left: 48px; padding-right: 48px; }
  .top { padding-top: 10px; }
  .sheet { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0; padding: 64px 0 72px; }
  .summary { position: sticky; top: 48px; align-self: start; padding: 0 56px 0 0; border-bottom: 0; }
  .panel { padding: 0 0 0 56px; border-left: 1px solid var(--rule); min-height: 420px; }
  .amount .num { font-size: 112px; }
  .h { font-size: 34px; }
  .step { grid-template-columns: 48px 1fr; padding: 30px 0; }
  .step .h { font-size: 24px; }
  .nets { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; border-top: 0; }
  .nets li:nth-child(-n+2) { border-top: 1px solid var(--rule); }
  .home .hero { padding: 16vh 0 12vh; }
}

@media (prefers-reduced-motion: reduce) {
  .rain::before, .rain::after, .drop::before, .drop::after, .loading::after { animation: none; }
  .sheet > *, .sheet.enter .step, .ripple i, .return .bar::after { animation-duration: .01s; animation-delay: 0s; }
  .net, .net .arr { transition: none; }
}
@media print { .rain, .grain, .langs { display: none; } body { background: #fff; color: #000; } }
