:root {
  --brand: #8f2e3d;
  --brand-deep: #641b2a;
  --brand-soft: #f7e8e9;
  --gold: #b58a52;
  --ink: #272226;
  --muted: #6f686d;
  --paper: #fffdf9;
  --canvas: #f3eee7;
  --line: #e6ddd3;
  --success: #2e725b;
  --success-soft: #e7f4ed;
  --danger: #a13c39;
  --danger-soft: #faecea;
  --shadow: 0 22px 70px rgba(62, 38, 35, .12);
  --font-ui: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .72), transparent 46%),
    radial-gradient(circle at 80% 4%, rgba(181, 138, 82, .15), transparent 29%),
    linear-gradient(180deg, #f8f3ed 0%, var(--canvas) 72%, #eee7de 100%);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .68; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(2px);
  opacity: .55;
}

.ambient-one {
  width: 280px;
  height: 280px;
  top: -148px;
  right: -102px;
  border: 1px solid rgba(143, 46, 61, .15);
  box-shadow: inset 0 0 0 48px rgba(255, 255, 255, .24), inset 0 0 0 49px rgba(143, 46, 61, .06);
}

.ambient-two {
  width: 190px;
  height: 190px;
  top: 36%;
  left: -150px;
  border: 1px solid rgba(181, 138, 82, .18);
}

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 20px max(36px, env(safe-area-inset-bottom));
  position: relative;
}

.shell-compact { width: min(100%, 650px); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 2px 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(143, 46, 61, .12);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(117, 63, 54, .08);
}

.brand-mark svg { width: 31px; height: 31px; }

.brand-copy { display: grid; gap: 2px; }
.brand-copy strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: .05em;
}
.brand-copy small { color: var(--muted); font-size: 11px; letter-spacing: .08em; }

.version {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, .48);
}

.hero { padding: 12px 4px 30px; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
}

.hero h1,
.landing-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(39px, 10vw, 62px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -.035em;
}

.hero h1 span { color: var(--brand); }

.lede {
  max-width: 550px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.progress {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 0 22px;
  padding: 0 2px;
}

.progress-item {
  position: relative;
  display: grid;
  gap: 6px;
  padding-top: 13px;
  color: #a0989c;
  font-size: 11px;
  letter-spacing: .04em;
}

.progress-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(143, 46, 61, .13);
}

.progress-item::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 0;
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
  transition: width .25s ease;
}

.progress-item.is-active { color: var(--brand); }
.progress-item.is-active::after { width: 38%; }
.progress-item.is-done { color: var(--ink); }
.progress-item.is-done::after { width: 100%; background: var(--gold); }
.progress-number { font-family: var(--font-mono); font-size: 10px; }

.panel {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 6vw, 42px);
  background: rgba(255, 253, 249, .93);
  border: 1px solid rgba(128, 92, 75, .13);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel-topline {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--gold) 58%, transparent 93%);
}

.step-heading {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 26px;
}

.step-index {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--brand);
  background: var(--brand-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.step h2 {
  margin: 1px 0 6px;
  font-family: var(--font-display);
  font-size: 25px;
  letter-spacing: -.015em;
}

.step-heading p,
.result-heading p,
.landing-card p,
.unavailable-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

label {
  display: inline-block;
  margin-bottom: 9px;
  color: #4b4247;
  font-size: 12px;
  font-weight: 700;
}

.textarea-wrap { position: relative; }

textarea {
  width: 100%;
  resize: vertical;
  min-height: 150px;
  padding: 17px 17px 24px;
  color: var(--ink);
  caret-color: var(--brand);
  background:
    linear-gradient(rgba(255, 255, 255, .86), rgba(255, 255, 255, .86)),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(143, 46, 61, .05) 28px);
  border: 1px solid #dcd1c7;
  border-radius: 14px;
  outline: none;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  transition: border-color .18s ease, box-shadow .18s ease;
}

textarea::placeholder { color: #b4a9aa; }
textarea:focus {
  border-color: rgba(143, 46, 61, .72);
  box-shadow: 0 0 0 4px rgba(143, 46, 61, .08);
}

.field-corner {
  position: absolute;
  right: 13px;
  bottom: 13px;
  width: 15px;
  height: 15px;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  pointer-events: none;
}

.field-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 9px 1px 22px;
  color: var(--muted);
  font-size: 11px;
}

code { font-family: var(--font-mono); color: var(--brand); }

.text-button {
  padding: 4px 0;
  color: var(--brand);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.copy-button {
  border-radius: 13px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 20px;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border: 1px solid var(--brand-deep);
  box-shadow: 0 12px 28px rgba(111, 30, 48, .22);
  font-size: 14px;
  font-weight: 700;
}

.primary-button:hover { transform: translateY(-1px); box-shadow: 0 15px 32px rgba(111, 30, 48, .26); }
.primary-button:active { transform: translateY(0); }
.primary-button.is-loading .button-arrow { animation: pulse-arrow .8s ease-in-out infinite alternate; }
.button-arrow { font-size: 20px; font-weight: 400; }

.secondary-button {
  min-height: 50px;
  padding: 0 18px;
  color: var(--brand);
  background: transparent;
  border: 1px solid rgba(143, 46, 61, .25);
  font-size: 13px;
  font-weight: 700;
}

.button-row { display: flex; gap: 10px; }
.button-row .primary-button { flex: 1; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 18px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.summary-grid > div {
  min-width: 0;
  padding: 16px;
  background: rgba(255, 255, 255, .55);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-grid .summary-wide { grid-column: 1 / -1; }
.summary-grid dt { margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.summary-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.mono { font-family: var(--font-mono); font-size: 11px !important; }

.entitlement-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 17px 18px;
  border: 1px solid rgba(181, 138, 82, .3);
  border-radius: 14px;
  background: linear-gradient(110deg, #fbf6ed, #fffdf9);
}

.entitlement-card > div { display: grid; gap: 4px; }
.entitlement-kicker { color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.entitlement-card strong { color: var(--brand-deep); font-family: var(--font-display); font-size: 19px; }
.entitlement-card > span { color: var(--muted); font-size: 11px; text-align: right; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.65;
}

.notice-error { color: var(--danger); background: var(--danger-soft); border: 1px solid rgba(161, 60, 57, .2); }
.notice-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: white;
  background: var(--danger);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.success-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid rgba(46, 114, 91, .2);
  border-radius: 50%;
}
.success-mark svg { width: 31px; height: 31px; }
.result-heading { margin-bottom: 24px; }
.result-heading h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 31px;
}

.code-output {
  min-height: 132px;
  color: #3f3540;
  background: #fbf7f1;
  font-size: 11px;
  line-height: 1.85;
  user-select: all;
}

.copy-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid rgba(46, 114, 91, .18);
  font-size: 13px;
  font-weight: 700;
}
.copy-button svg { width: 19px; height: 19px; }

.next-steps {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 26px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
}
.next-steps li { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 12px; }
.next-steps span {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 20px 0 0;
  overflow: hidden;
  background: rgba(143, 46, 61, .1);
  border: 1px solid rgba(143, 46, 61, .09);
  border-radius: 17px;
}
.trust-strip div { display: grid; gap: 4px; padding: 17px; background: rgba(255, 253, 249, .62); }
.trust-strip strong { color: #594b4f; font-size: 12px; }
.trust-strip span { color: var(--muted); font-size: 10px; line-height: 1.5; }

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 28px 0 2px;
  color: #8f8589;
  font-size: 10px;
}
.footer-separator { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); }

.status-announcer {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.landing-card,
.unavailable-card {
  padding: clamp(30px, 8vw, 56px);
  background: rgba(255, 253, 249, .9);
  border: 1px solid rgba(128, 92, 75, .13);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.landing-card h1,
.unavailable-card h1 { font-size: clamp(32px, 8vw, 48px); line-height: 1.15; }
.landing-card p:not(.eyebrow),
.unavailable-card p:not(.eyebrow) { margin-top: 18px; max-width: 480px; }

.unavailable-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-weight: 700;
}
.unavailable-card .unavailable-help { color: var(--brand); font-weight: 700; }

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(181, 138, 82, .5);
  outline-offset: 3px;
}

@keyframes pulse-arrow {
  from { transform: translateX(0); opacity: .55; }
  to { transform: translateX(4px); opacity: 1; }
}

@media (max-width: 520px) {
  .shell { padding-left: 14px; padding-right: 14px; }
  .site-header { padding-bottom: 24px; }
  .hero { padding-bottom: 24px; }
  .hero h1 { font-size: 43px; }
  .lede { font-size: 13px; }
  .progress-item { font-size: 10px; }
  .panel { padding: 24px 18px; border-radius: 20px; }
  .step h2 { font-size: 22px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid .summary-wide { grid-column: auto; }
  .entitlement-card { align-items: flex-start; flex-direction: column; gap: 8px; }
  .entitlement-card > span { text-align: left; }
  .button-row { flex-direction: column-reverse; }
  .secondary-button { width: 100%; }
  .trust-strip { grid-template-columns: 1fr; }
  .field-meta { align-items: flex-start; }
}

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