:root {
  --canvas: #edf4f2;
  --paper: #fffdf8;
  --ink: #17322e;
  --muted: #627873;
  --line: #bdd0ca;
  --line-strong: #78958d;
  --teal: #137a6d;
  --teal-dark: #0b594f;
  --mint: #b9e3d3;
  --amber: #e5b95d;
  --coral: #d8775f;
  --danger: #b9473d;
  --shadow: rgba(23, 50, 46, 0.14);
  --mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { min-height: 100vh; margin: 0; overflow-x: hidden; color: var(--ink); background: var(--canvas); font-family: var(--sans); font-size: 1rem; line-height: 1.6; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pixel-field { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.pixel-field::before { content: ""; position: absolute; inset: 0; opacity: .48; background-image: linear-gradient(rgba(98,120,115,.11) 1px, transparent 1px), linear-gradient(90deg, rgba(98,120,115,.11) 1px, transparent 1px); background-size: 24px 24px; }
.pixel-field i { position: absolute; width: 8px; height: 8px; background: var(--mint); box-shadow: 8px 0 0 var(--amber), 0 8px 0 rgba(19,122,109,.24); animation: drift 12s linear infinite; }
.pixel-field i:nth-child(1) { left: 7%; top: 74%; animation-delay: -2s; }
.pixel-field i:nth-child(2) { left: 18%; top: 38%; animation-delay: -8s; transform: scale(.72); }
.pixel-field i:nth-child(3) { left: 31%; top: 86%; animation-delay: -5s; transform: scale(.55); }
.pixel-field i:nth-child(4) { left: 52%; top: 18%; animation-delay: -10s; }
.pixel-field i:nth-child(5) { left: 69%; top: 63%; animation-delay: -1s; transform: scale(.7); }
.pixel-field i:nth-child(6) { left: 82%; top: 29%; animation-delay: -7s; }
.pixel-field i:nth-child(7) { left: 91%; top: 82%; animation-delay: -4s; transform: scale(.65); }
.pixel-field i:nth-child(8) { left: 43%; top: 52%; animation-delay: -11s; transform: scale(.45); }
@keyframes drift { 0% { translate: 0 24px; opacity: 0; } 14% { opacity: .8; } 82% { opacity: .35; } 100% { translate: 0 -80vh; opacity: 0; } }
.page-shell { position: relative; z-index: 1; display: flex; width: 100%; min-height: 100vh; align-items: center; justify-content: center; padding: 2rem 1rem; }
.generator-card { width: min(100%, 43rem); border: 2px solid var(--ink); background: var(--paper); box-shadow: 10px 10px 0 var(--shadow); }
.hero { position: relative; padding: 1.5rem 1.25rem 1.35rem; border-bottom: 2px solid var(--ink); }
.hero::after { content: ""; position: absolute; right: -.1rem; bottom: -.1rem; width: 4.2rem; height: 4.2rem; background-image: linear-gradient(45deg, transparent 46%, var(--line) 46%, var(--line) 54%, transparent 54%), linear-gradient(-45deg, transparent 46%, var(--line) 46%, var(--line) 54%, transparent 54%); background-size: 16px 16px; opacity: .45; pointer-events: none; }
.hero-mark { display: flex; width: max-content; gap: .25rem; margin-bottom: .9rem; }
.hero-mark span { width: .72rem; height: .72rem; border: 1px solid var(--ink); }
.hero-mark span:nth-child(1) { background: var(--mint); }
.hero-mark span:nth-child(2) { background: var(--amber); }
.hero-mark span:nth-child(3) { background: var(--coral); }
.eyebrow { margin: 0 0 .2rem; color: var(--teal); font-family: var(--mono); font-size: .75rem; font-weight: 700; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .45rem; font-size: clamp(1.85rem, 7vw, 2.7rem); line-height: 1.08; letter-spacing: -.045em; }
.hero-copy { max-width: 36rem; margin-bottom: 0; color: var(--muted); font-size: .95rem; line-height: 1.75; }
.hero-copy strong { color: var(--teal-dark); }
.flow-line { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; padding: 1rem 1.25rem .9rem; border-bottom: 1px solid var(--line); background: #f6faf8; }
.flow-node { display: grid; width: 1.7rem; height: 1.7rem; place-items: center; border: 1px solid var(--line-strong); background: var(--paper); color: var(--muted); font-family: var(--mono); font-size: .75rem; font-weight: 700; }
.flow-node.active, .flow-node.complete { border-color: var(--teal); background: var(--teal); color: white; }
.flow-track { height: 2px; background: var(--line); }
.stage-panel { min-height: 22.5rem; }
.step { padding: 1.4rem 1.25rem 1.5rem; animation: step-in .28s ease-out both; }
@keyframes step-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
.step-heading { display: grid; grid-template-columns: 2.4rem 1fr; gap: .75rem; margin-bottom: 1.15rem; }
.step-index { color: var(--coral); font-family: var(--mono); font-size: .82rem; font-weight: 700; }
.step-heading h2 { margin-bottom: .18rem; font-size: 1.15rem; line-height: 1.3; }
.step-heading p { margin-bottom: 0; color: var(--muted); font-size: .875rem; }
.captcha-frame { position: relative; margin-bottom: .8rem; border: 1px solid var(--line-strong); background: #f7fbfa; }
#captcha-canvas { display: block; width: 100%; height: 6.5rem; }
.text-button { position: absolute; right: .55rem; bottom: .45rem; min-height: 36px; padding: .2rem .45rem; border: 0; background: rgba(255,253,248,.9); color: var(--teal); font-size: .78rem; font-weight: 700; cursor: pointer; }
.text-button:hover, .text-button:focus-visible { text-decoration: underline; }
.inline-form { display: grid; grid-template-columns: 1fr; gap: .7rem; }
input, textarea { width: 100%; min-height: 48px; border: 1px solid var(--line-strong); border-radius: 0; outline: none; background: white; color: var(--ink); }
input { padding: .7rem .8rem; font-family: var(--mono); }
input:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(19,122,109,.13); }
.primary-button, .secondary-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: .72rem 1rem; border: 2px solid var(--ink); border-radius: 0; font-weight: 800; cursor: pointer; transition: translate .12s ease, box-shadow .12s ease, background-color .12s ease; }
.primary-button { background: var(--teal); color: white; box-shadow: 4px 4px 0 var(--ink); }
.primary-button:hover:not(:disabled), .primary-button:focus-visible:not(:disabled) { background: var(--teal-dark); translate: 1px 1px; box-shadow: 3px 3px 0 var(--ink); }
.secondary-button { background: var(--paper); color: var(--ink); box-shadow: 4px 4px 0 var(--line); }
.secondary-button:hover:not(:disabled), .secondary-button:focus-visible:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .6; }
.primary-button.wide, .secondary-button.wide { width: 100%; }
.form-message { min-height: 1.5rem; margin: .65rem 0 0; color: var(--muted); font-size: .875rem; }
.form-message.error { color: var(--danger); }
.sms-ticket { margin-bottom: .9rem; border: 1px solid var(--line-strong); background: #f7fbfa; }
.ticket-row { display: grid; grid-template-columns: 6rem 1fr; align-items: center; min-height: 3.8rem; padding: .6rem .8rem; }
.ticket-row > span { color: var(--muted); font-size: .82rem; }
.ticket-value { min-height: 44px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.ticket-value strong { display: block; color: var(--teal-dark); font-family: var(--mono); font-size: clamp(1.15rem, 5vw, 1.55rem); letter-spacing: .04em; }
.ticket-value::after { content: "点击复制"; display: block; margin-top: .1rem; color: var(--muted); font-size: .7rem; }
.ticket-divider { height: 1px; margin: 0 .8rem; background: var(--line); }
.ticket-note { margin: 0; padding: .65rem .8rem; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: .75rem; }
.progress-block { padding: 1rem; border: 1px solid var(--line-strong); background: #f7fbfa; }
.progress-meta { display: flex; align-items: center; justify-content: flex-end; margin-bottom: .7rem; color: var(--muted); font-family: var(--mono); font-size: .85rem; }
.progress-meta strong { color: var(--teal); font-size: 1rem; }
.progress-track { height: 1.05rem; padding: 3px; border: 1px solid var(--ink); background: white; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--teal); transition: width .35s ease; }
.privacy-note { margin: 0; padding: .9rem 1.25rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; text-align: center; }
.modal-mask { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 1rem; background: rgba(16,40,36,.74); }
.result-dialog { width: min(100%, 39rem); max-height: calc(100vh - 2rem); overflow: auto; padding: 1.4rem; border: 2px solid var(--ink); background: var(--paper); box-shadow: 10px 10px 0 rgba(0,0,0,.24); }
.result-badge { display: inline-block; margin-bottom: .55rem; padding: .18rem .45rem; border: 1px solid var(--teal); color: var(--teal-dark); font-family: var(--mono); font-size: .7rem; font-weight: 700; letter-spacing: .08em; }
.result-dialog h2 { margin-bottom: .35rem; font-size: 1.45rem; }
.result-dialog > p { color: var(--muted); font-size: .9rem; }
.result-dialog label { display: block; margin: .85rem 0 .4rem; font-size: .85rem; font-weight: 700; }
#result-cookie { min-height: 11rem; resize: vertical; padding: .75rem; font-family: var(--mono); font-size: .75rem; line-height: 1.5; word-break: break-all; }
.result-actions { display: grid; grid-template-columns: 1fr; gap: .7rem; margin-top: .9rem; }
.copy-status { min-height: 1.4rem; margin: .65rem 0 0; color: var(--teal); font-size: .82rem; }
@media (min-width: 640px) {
  .page-shell { padding: 3rem 2rem; }
  .hero { padding: 1.8rem 1.75rem 1.55rem; }
  .flow-line { padding-right: 1.75rem; padding-left: 1.75rem; }
  .step { padding: 1.7rem 1.75rem 1.9rem; }
  .inline-form { grid-template-columns: minmax(0, 1fr) auto; }
  .inline-form .primary-button { min-width: 10.5rem; }
  .result-actions { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}