:root {
  --black: #080908;
  --ink: #151515;
  --graphite: #4c504d;
  --mist: #eef4df;
  --paper: #f8f5ea;
  --white: #fffdf6;
  --grid: rgba(8, 9, 8, 0.13);
  --green: #cbfcc0;
  --green-deep: #5fae64;
  --green-ink: #3f774b;
  --sakura: #f9b2c0;
  --sakura-ink: #b76478;
  --sakura-soft: #fde5eb;
  --orange: #ff9b55;
  --blue: #263a66;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --pixel-font: "Zpix", "Fusion Pixel 12px Proportional zh_hans", "Fusion Pixel 10px Monospaced zh_hans", "Cubic 11", "Ark Pixel 12px", "SimHei", "Microsoft YaHei UI", "Courier New", monospace;
  --body-font: "Trebuchet MS", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 32px 32px,
    #111;
  color: var(--ink);
  font-family: var(--body-font);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.app {
  position: relative;
  width: min(430px, 100vw);
  height: 100dvh;
  min-height: 640px;
  max-height: 932px;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(180deg, #f8f5ea 0%, #eef4df 100%);
  box-shadow: 0 0 0 1px #f8f8f4, 0 0 0 5px rgba(8, 9, 8, 0.86), 16px 16px 0 rgba(249, 178, 192, 0.28);
}

.app::before {
  content: "TONGJI_MEMORY_POST / SPRING_SAMPLE / 001101";
  position: absolute;
  top: 246px;
  right: -104px;
  z-index: 4;
  width: 250px;
  color: rgba(8, 9, 8, 0.14);
  font-family: var(--pixel-font);
  font-size: 0.72rem;
  line-height: 1.2;
  pointer-events: none;
  transform: rotate(90deg);
}

.app[data-current-page="home"]::before {
  content: "TONGJI MEMORY POST";
  top: 258px;
  right: -112px;
}

.app::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(8, 9, 8, 0.04) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 14% 16%, rgba(249, 178, 192, 0.26), transparent 16%),
    radial-gradient(circle at 86% 74%, rgba(203, 252, 192, 0.24), transparent 18%);
  mix-blend-mode: multiply;
}

.page {
  position: absolute;
  inset: 0;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: max(20px, var(--safe-top)) 18px calc(112px + var(--safe-bottom));
  background:
    linear-gradient(90deg, rgba(8, 9, 8, 0.12) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(rgba(8, 9, 8, 0.12) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(180deg, #f8f5ea 0%, #eef4df 100%);
  -webkit-overflow-scrolling: touch;
}

.page::before {
  content: "";
  position: absolute;
  left: auto;
  right: 24px;
  top: auto;
  bottom: 138px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(8, 9, 8, 0.42);
  background:
    linear-gradient(90deg, transparent 0 18px, rgba(8, 9, 8, 0.14) 18px 20px, transparent 20px),
    linear-gradient(transparent 0 18px, rgba(8, 9, 8, 0.14) 18px 20px, transparent 20px),
    var(--sakura-soft);
  opacity: 0.46;
  pointer-events: none;
}

.page::after {
  content: "TJ_POST_01";
  position: absolute;
  right: 6px;
  top: 248px;
  color: rgba(8, 9, 8, 0.13);
  font-family: var(--pixel-font);
  font-size: 0.66rem;
  font-weight: 900;
  writing-mode: vertical-rl;
  pointer-events: none;
}

.page-home::after {
  display: none;
}

.page.active {
  display: block;
  animation: page-enter 340ms cubic-bezier(0.16, 1, 0.3, 1);
}

.page-loading.active,
.page-success.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.system-label {
  margin: 0;
  color: var(--green-deep);
  font-family: var(--pixel-font);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.home-bg {
  width: calc(100% + 36px);
  height: calc(100% + 36px);
  margin: -18px;
  object-fit: cover;
  image-rendering: pixelated;
  filter: grayscale(0.72) contrast(1.55) brightness(1.18);
  opacity: 0.35;
}

.home-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(248, 245, 234, 0.42) 0%, rgba(248, 245, 234, 0.86) 58%, rgba(248, 245, 234, 0.99) 100%),
    repeating-linear-gradient(90deg, rgba(8, 9, 8, 0.12) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(8, 9, 8, 0.1) 0 1px, transparent 1px 22px);
}

.postmark {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--black);
  font-family: var(--pixel-font);
  pointer-events: none;
}

.postmark-home {
  top: max(22px, calc(var(--safe-top) + 12px));
  left: 112px;
  opacity: 0.72;
}

.postmark-loading {
  top: 28px;
  left: 24px;
}

.postmark-waves {
  width: 86px;
  height: 29px;
  background:
    linear-gradient(currentColor, currentColor) 0 4px / 86px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 14px / 86px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 24px / 86px 2px no-repeat;
}

.postmark-seal {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 2px solid currentColor;
  background: rgba(246, 242, 233, 0.78);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.anniversary-badge {
  position: absolute;
  top: 104px;
  right: 22px;
  z-index: 2;
  width: 126px;
  min-height: 104px;
  padding: 12px 10px 10px;
  border: 1px solid rgba(8, 9, 8, 0.48);
  background:
    linear-gradient(90deg, rgba(8, 9, 8, 0.16) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(rgba(8, 9, 8, 0.16) 1px, transparent 1px) 0 0 / 14px 14px,
    rgba(255, 255, 255, 0.45);
  color: var(--black);
  font-family: var(--pixel-font);
  font-weight: 900;
  text-align: center;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  overflow: visible;
}

.anniversary-badge span {
  position: relative;
  z-index: 2;
  font-size: 3.05rem;
  line-height: 0.9;
  letter-spacing: -0.08em;
  text-shadow:
    2px 0 0 var(--sakura),
    -2px 0 0 var(--green);
}

.anniversary-badge small {
  position: relative;
  z-index: 2;
  display: block;
  width: 7em;
  font-size: 0.62rem;
  line-height: 1.15;
  background: rgba(252, 250, 244, 0.72);
  box-decoration-break: clone;
}

.anniversary-badge::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: -8px;
  z-index: 1;
  width: 16px;
  height: 16px;
  background: var(--green);
  box-shadow:
    -20px -18px 0 var(--sakura),
    -36px 2px 0 rgba(8, 9, 8, 0.24);
}

.home-copy {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: calc(100% - 110px);
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 132px;
}

.home-copy h1 {
  margin: 0 0 16px;
  color: var(--black);
  font-family: var(--pixel-font);
  font-weight: 900;
}

.brand-title {
  display: grid;
  width: min(100%, 350px);
  grid-template-columns: 0.75fr 0.48fr 1.2fr;
  align-items: end;
  gap: 5px;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  font-smooth: never;
  filter: contrast(1.08) saturate(0.9);
}

.brand-title span {
  position: relative;
  display: block;
  padding-bottom: 7px;
  border-bottom: 9px solid rgba(8, 9, 8, 0.94);
  line-height: 0.86;
  letter-spacing: -0.1em;
  text-transform: uppercase;
  transform-origin: bottom left;
  text-shadow:
    3px 0 0 var(--sakura),
    -3px 0 0 var(--green),
    4px 4px 0 rgba(8, 9, 8, 0.18);
}

.brand-title span:nth-child(1) {
  color: var(--black);
  font-size: clamp(4.6rem, 22vw, 7.2rem);
  transform: translateY(4px);
  text-shadow:
    3px 0 0 var(--sakura),
    -3px 0 0 var(--green),
    5px 5px 0 rgba(8, 9, 8, 0.18);
}

.brand-title span:nth-child(2) {
  color: var(--black);
  font-size: clamp(3.4rem, 16vw, 5.4rem);
  text-align: center;
  text-shadow:
    3px 0 0 var(--sakura),
    -3px 0 0 var(--green),
    4px 4px 0 rgba(8, 9, 8, 0.16);
  transform: translateY(-8px);
}

.brand-title span:nth-child(3) {
  color: var(--black);
  font-size: clamp(3.2rem, 15vw, 5.1rem);
  letter-spacing: -0.06em;
  text-shadow:
    3px 0 0 var(--sakura),
    -3px 0 0 var(--green),
    5px 5px 0 rgba(8, 9, 8, 0.18);
}

.brand-title span:nth-child(1)::before {
  content: "";
  position: absolute;
  left: 14px;
  top: -15px;
  width: 9px;
  height: 9px;
  background: var(--sakura);
  box-shadow:
    12px 0 0 var(--green),
    24px 0 0 var(--sakura),
    36px 0 0 var(--green),
    48px 0 0 var(--green);
}

.brand-title span:nth-child(1)::after,
.brand-title span:nth-child(3)::after {
  content: "";
  position: absolute;
  right: 3px;
  top: -11px;
  width: 12px;
  height: 12px;
  background: var(--sakura);
  box-shadow:
    -16px 21px 0 var(--green),
    -28px 9px 0 rgba(8, 9, 8, 0.52);
}

.home-subtitle {
  position: relative;
  display: grid;
  width: min(100%, 302px);
  margin: 0;
  padding: 12px 14px 14px 16px;
  border: 1px solid rgba(8, 9, 8, 0.5);
  border-left: 8px solid var(--sakura);
  box-shadow:
    inset 0 0 0 4px rgba(255, 253, 246, 0.72),
    8px 8px 0 rgba(203, 252, 192, 0.58);
  background:
    linear-gradient(90deg, rgba(8, 9, 8, 0.11) 1px, transparent 1px) 0 0 / 10px 10px,
    linear-gradient(rgba(8, 9, 8, 0.09) 1px, transparent 1px) 0 0 / 10px 10px,
    linear-gradient(90deg, rgba(203, 252, 192, 0.82) 0 24%, rgba(255, 253, 246, 0.94) 24% 76%, rgba(249, 178, 192, 0.82) 76%);
  color: var(--black);
  font-family: var(--pixel-font);
  letter-spacing: 0.03em;
  clip-path: none;
}

.home-subtitle::before {
  content: "";
  position: absolute;
  right: 10px;
  top: -10px;
  width: 70px;
  height: 16px;
  background:
    linear-gradient(90deg, var(--sakura) 0 8px, transparent 8px 14px) 0 0 / 14px 14px;
}

.home-subtitle::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 8px;
  height: 4px;
  background:
    linear-gradient(90deg, var(--green) 0 46%, transparent 46% 54%, var(--sakura) 54% 100%);
}

.home-subtitle span,
.home-subtitle strong,
.home-subtitle i {
  position: relative;
  z-index: 1;
}

.home-subtitle span {
  width: fit-content;
  padding: 1px 4px 2px;
  background: var(--sakura);
  color: var(--black);
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0.12em;
}

.home-subtitle strong {
  margin-top: 7px;
  font-size: 1.42rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  color: #20231f;
  text-shadow: 2px 2px 0 rgba(203, 252, 192, 0.9);
}

.home-subtitle i {
  margin-top: 8px;
  padding-bottom: 5px;
  font-size: 0.54rem;
  font-style: normal;
  letter-spacing: 0.12em;
  color: rgba(8, 9, 8, 0.72);
}

.home-tagline {
  max-width: 24ch;
  margin: 19px 0 0;
  color: var(--black);
  font-family: var(--pixel-font);
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.58;
  letter-spacing: 0.03em;
}

.home-tagline span {
  white-space: nowrap;
}

.bottom-bar {
  position: absolute;
  right: 18px;
  bottom: max(18px, calc(var(--safe-bottom) + 18px));
  left: 18px;
  z-index: 12;
  display: grid;
  gap: 9px;
}

.primary-cta,
.secondary-cta {
  position: relative;
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid var(--black);
  border-radius: 0;
  color: var(--black);
  font-family: var(--pixel-font);
  font-size: 1rem;
  font-weight: 900;
  background: var(--white);
  transition: transform 150ms ease, background-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.primary-cta:not(:disabled) {
  background: var(--green);
}

.secondary-cta {
  background: var(--white);
}

.primary-cta:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.primary-cta::before,
.secondary-cta::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(8, 9, 8, 0.38);
  pointer-events: none;
}

.primary-cta:active:not(:disabled),
.secondary-cta:active {
  transform: translateY(2px);
}

.stamp-mini {
  width: 24px;
  height: 30px;
  background:
    radial-gradient(circle at 0 0, transparent 0 3px, var(--black) 3px 4px, transparent 4px) 0 0 / 8px 8px,
    linear-gradient(90deg, var(--sakura) 0 50%, var(--white) 50%);
  border: 2px solid var(--black);
}

.footer-note {
  margin: 0;
  color: rgba(8, 9, 8, 0.62);
  font-family: var(--pixel-font);
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: center;
}

.sample-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -10px -4px 14px;
  padding: 10px 4px 12px;
  background: rgba(245, 241, 232, 0.9);
  backdrop-filter: blur(8px);
}

.ghost-back {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--graphite);
  font-family: var(--pixel-font);
  font-size: 0.82rem;
  font-weight: 900;
}

.ghost-back:disabled {
  visibility: hidden;
}

.sample-meta {
  display: grid;
  gap: 2px;
  text-align: right;
  font-family: var(--pixel-font);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sample-meta span:first-child {
  color: var(--green-deep);
}

.progress-blocks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-bottom: 16px;
}

.progress-blocks span {
  height: 12px;
  border: 1px solid var(--black);
  background: var(--white);
}

.progress-blocks span.active {
  background: var(--green);
  animation: block-flicker 360ms steps(2);
}

@keyframes block-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.question-stage {
  position: relative;
}

.question-stage.enter-forward {
  animation: question-forward 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.question-stage.enter-back {
  animation: question-back 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes question-forward {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes question-back {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

.question-card {
  min-height: calc(100dvh - 206px);
  padding: 18px 0 130px;
}

.question-card::before {
  content: "SAMPLE_PACKET";
  display: block;
  width: fit-content;
  margin: 0 0 14px auto;
  padding: 4px 7px;
  border: 1px solid var(--black);
  background: var(--green);
  color: var(--black);
  font-family: var(--pixel-font);
  font-size: 0.66rem;
  font-weight: 900;
}

.question-card h2 {
  max-width: 13ch;
  margin: 12px 0 24px;
  color: var(--black);
  font-family: var(--pixel-font);
  font-size: clamp(1.72rem, 7.6vw, 2.75rem);
  font-weight: 900;
  line-height: 1.08;
}

.sample-input-wrap {
  display: block;
  border: 1px solid rgba(8, 9, 8, 0.52);
  background:
    linear-gradient(90deg, rgba(8, 9, 8, 0.12) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(rgba(8, 9, 8, 0.12) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--white);
}

.sample-input {
  width: 100%;
  min-height: 74px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--black);
  font-size: 1.16rem;
}

::placeholder {
  color: #686a66;
  opacity: 1;
}

.input-count {
  margin-top: 9px;
  color: var(--graphite);
  font-family: var(--pixel-font);
  font-size: 0.8rem;
  text-align: right;
}

.option-grid,
.color-grid {
  display: grid;
  gap: 11px;
}

.time-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.time-grid .sample-option {
  min-height: 84px;
  padding-right: 28px;
}

.time-grid .sample-option::before {
  content: "";
  position: absolute;
  right: 10px;
  top: 10px;
  width: 10px;
  height: 10px;
  background: var(--sakura);
  box-shadow: -10px 10px 0 rgba(255, 253, 246, 0.95);
}

.time-grid .option-desc {
  color: var(--green-deep);
  font-family: var(--pixel-font);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.35;
}

.sample-option,
.map-point,
.color-card,
.custom-option {
  position: relative;
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid rgba(8, 9, 8, 0.5);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(8, 9, 8, 0.09) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(rgba(8, 9, 8, 0.09) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--white);
  color: var(--black);
  text-align: left;
  animation: option-in 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--delay);
}

.question-stage.no-option-motion .sample-option,
.question-stage.no-option-motion .map-point,
.question-stage.no-option-motion .color-card,
.question-stage.no-option-motion .custom-option,
.question-stage.no-option-motion .custom-input-wrap {
  animation: none;
}

.question-stage.no-option-motion .sample-option::after,
.question-stage.no-option-motion .map-point::after,
.question-stage.no-option-motion .color-card::after,
.question-stage.no-option-motion .custom-option::after,
.question-stage.no-option-motion .selected-stamp {
  animation: none;
}

@keyframes option-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.sample-option::after,
.color-card::after,
.map-point::after,
.custom-option::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(203, 252, 192, 0.54), transparent);
  opacity: 0;
  transform: translateX(-100%);
}

.sample-option.selected,
.map-point.selected,
.color-card.selected,
.custom-option.selected {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(8, 9, 8, 0.38);
}

.sample-option.selected::after,
.color-card.selected::after,
.map-point.selected::after,
.custom-option.selected::after {
  animation: scan-select 520ms ease-out;
}

@keyframes scan-select {
  0% { opacity: 1; transform: translateX(-100%); }
  100% { opacity: 0; transform: translateX(100%); }
}

.pulse-selected {
  animation: selected-pop 260ms steps(3);
}

@keyframes selected-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.018); }
  100% { transform: scale(1); }
}

.option-title {
  display: block;
  font-family: var(--pixel-font);
  font-size: 1.04rem;
  font-weight: 900;
}

.option-desc {
  display: block;
  margin-top: 5px;
  color: var(--graphite);
  font-size: 0.9rem;
}

.selected-stamp {
  position: absolute;
  right: 10px;
  bottom: 9px;
  display: none;
  padding: 3px 6px;
  background: var(--sakura);
  color: var(--black);
  font-family: var(--pixel-font);
  font-size: 0.66rem;
  font-weight: 900;
}

.selected .selected-stamp {
  display: inline-block;
  animation: stamp-pop 220ms steps(3);
}

.custom-option {
  grid-column: 1 / -1;
  min-height: 68px;
  background:
    linear-gradient(90deg, rgba(8, 9, 8, 0.11) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(rgba(8, 9, 8, 0.11) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--sakura-soft);
}

.custom-option::before {
  content: "+";
  position: absolute;
  right: 13px;
  top: 10px;
  color: var(--green-deep);
  font-family: var(--pixel-font);
  font-size: 1.6rem;
  font-weight: 900;
}

.custom-input-wrap {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(8, 9, 8, 0.48);
  background: var(--white);
  animation: option-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-input-wrap span {
  color: var(--green-deep);
  font-family: var(--pixel-font);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.custom-input-wrap input {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid rgba(8, 9, 8, 0.58);
  outline: 0;
  background: transparent;
  color: var(--black);
  font-size: 1rem;
}

@keyframes stamp-pop {
  from { transform: scale(1.4) rotate(-4deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.campus-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(8, 9, 8, 0.5);
  background:
    linear-gradient(90deg, rgba(8, 9, 8, 0.16) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(rgba(8, 9, 8, 0.16) 1px, transparent 1px) 0 0 / 20px 20px,
    rgba(255, 253, 246, 0.62);
}

.campus-map::before {
  content: "TONGJI LOCATION SYSTEM";
  position: absolute;
  right: 12px;
  top: -11px;
  padding: 2px 6px;
  background: var(--paper);
  color: var(--green-deep);
  font-family: var(--pixel-font);
  font-size: 0.66rem;
  font-weight: 900;
}

.map-point {
  min-height: 84px;
}

.coordinate {
  display: block;
  color: var(--green-deep);
  font-family: var(--pixel-font);
  font-size: 0.68rem;
  font-weight: 900;
}

.map-point > span:nth-child(2) {
  display: block;
  margin-top: 8px;
  font-family: var(--pixel-font);
  font-size: 0.98rem;
  font-weight: 900;
}

.map-point i {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 10px;
  height: 10px;
  background: var(--sakura);
  box-shadow: -10px 10px 0 rgba(8, 9, 8, 0.18);
}

.color-grid {
  grid-template-columns: repeat(3, 1fr);
}

.color-card {
  min-height: 88px;
  padding: 11px 9px;
}

.pixel-swatch {
  display: block;
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  border: 1px solid var(--black);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px) 0 0 / 10px 10px,
    linear-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 1px) 0 0 / 10px 10px,
    var(--swatch);
}

.color-custom {
  grid-column: 1 / -1;
}

.color-custom-panel {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(8, 9, 8, 0.48);
  background:
    linear-gradient(90deg, rgba(8, 9, 8, 0.08) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(rgba(8, 9, 8, 0.08) 1px, transparent 1px) 0 0 / 14px 14px,
    rgba(255, 253, 246, 0.92);
}

.rgb-controls {
  display: grid;
  gap: 7px;
}

.rgb-row {
  display: grid;
  grid-template-columns: 18px 1fr 32px;
  align-items: center;
  gap: 8px;
  color: var(--black);
  font-family: var(--pixel-font);
  font-size: 0.72rem;
  font-weight: 900;
}

.rgb-row input {
  width: 100%;
  accent-color: var(--sakura);
}

.rgb-row b {
  text-align: right;
}

.color-picker-block {
  display: grid;
  gap: 8px;
  align-content: stretch;
}

.color-preview {
  min-height: 82px;
  border: 1px solid var(--black);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.34) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(rgba(255, 255, 255, 0.34) 1px, transparent 1px) 0 0 / 12px 12px,
    var(--picked);
}

.rgb-value {
  color: var(--graphite);
  font-family: var(--pixel-font);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
}

.page-loading {
  padding-bottom: 18px;
}

.render-lab {
  position: absolute;
  inset: 96px 40px auto;
  display: grid;
  place-items: center;
  gap: 18px;
}

.stamp-render-frame {
  position: relative;
  width: 210px;
  height: 150px;
  border: 2px solid var(--black);
  background:
    linear-gradient(90deg, rgba(8, 9, 8, 0.14) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(rgba(8, 9, 8, 0.14) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--white);
  animation: render-border 1.6s steps(6) infinite;
}

.stamp-render-frame::before,
.stamp-render-frame::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 8px;
  background: radial-gradient(circle, var(--black) 0 2px, transparent 2.5px) 0 0 / 12px 8px repeat-x;
}

.stamp-render-frame::before { top: -5px; }
.stamp-render-frame::after { bottom: -5px; }

.stamp-render-frame span {
  position: absolute;
  background: var(--black);
}

.stamp-render-frame span:nth-child(1) { left: 32px; top: 36px; width: 72px; height: 34px; background: var(--sakura); }
.stamp-render-frame span:nth-child(2) { right: 38px; top: 48px; width: 46px; height: 62px; }
.stamp-render-frame span:nth-child(3) { left: 70px; bottom: 28px; width: 88px; height: 20px; background: var(--green); }
.stamp-render-frame span:nth-child(4) { right: 22px; top: 18px; width: 18px; height: 18px; background: var(--white); border: 2px solid var(--black); }

@keyframes render-border {
  0%, 100% { box-shadow: inset 0 0 0 0 var(--green); }
  50% { box-shadow: inset 0 0 0 4px var(--green); }
}

.render-progress {
  width: 210px;
  height: 12px;
  border: 2px solid var(--black);
  background: var(--white);
}

.render-progress i {
  display: block;
  width: 12%;
  height: 100%;
  background: var(--green);
  transition: width 420ms steps(6);
}

.ai-stamp-mark {
  padding: 5px 9px;
  border: 2px solid var(--black);
  color: var(--black);
  font-family: var(--pixel-font);
  font-size: 0.78rem;
  font-weight: 900;
  opacity: 0;
  transform: scale(1.28) rotate(-5deg);
}

.ai-stamp-mark.show {
  opacity: 1;
  transform: scale(1) rotate(-5deg);
  transition: 220ms steps(3);
}

.loading-core {
  position: relative;
  z-index: 2;
  width: min(100%, 334px);
  margin-top: 270px;
  padding: 22px 18px;
  border: 2px solid var(--black);
  background: rgba(255, 253, 246, 0.92);
  text-align: center;
}

.loading-core h2,
.success-core h2 {
  margin: 10px 0;
  color: var(--black);
  font-family: var(--pixel-font);
  font-size: 1.62rem;
  line-height: 1.18;
}

.loading-core > p:not(.system-label) {
  margin: 0;
  color: var(--graphite);
  font-size: 0.88rem;
}

.stamp-card {
  position: relative;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.page-preview {
  justify-content: flex-start;
  gap: 18px;
  padding: 18px 14px 22px;
}

.page-preview .stamp-card {
  width: min(100%, 520px);
}

.page-preview .stamp-layout {
  width: 100%;
  box-shadow: none;
}

.page-preview .preview-actions {
  margin-top: 0;
}

.stamp-card::before,
.stamp-card::after {
  content: none;
}

.stamp-layout {
  --memory-accent: #f9b2c0;
  --memory-soft: color-mix(in srgb, var(--memory-accent), #fffaf3 78%);
  --memory-ink: color-mix(in srgb, var(--memory-accent), #11120f 62%);
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--memory-ink), transparent 38%);
  border-radius: 0 24px 24px 0;
  background:
    linear-gradient(rgba(17, 18, 15, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 18, 15, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #fbfaf4 0 58%, var(--memory-soft) 100%);
  background-size: 22px 22px, 22px 22px, auto;
  color: #11120f;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: 7px 8px 0 color-mix(in srgb, var(--memory-accent), transparent 68%);
}

.layout-render {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.stamp-layout.rendered {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.stamp-layout.rendered .layout-render {
  display: block;
}

.stamp-layout.rendered > :not(.layout-render) {
  visibility: hidden;
}

.stamp-layout.rendered::before,
.stamp-layout.rendered::after {
  content: none;
}

.stamp-layout::before,
.stamp-layout::after {
  content: "";
  position: absolute;
  top: 77.4%;
  z-index: 8;
  width: 7.5%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #d9d9d7;
  box-shadow: inset 0 0 0 1px rgba(17, 18, 15, 0.05);
}

.stamp-layout::before { left: -3.75%; }
.stamp-layout::after { right: -3.75%; }

.layout-title {
  position: absolute;
  z-index: 4;
  left: 7.45%;
  top: 5.55%;
  width: 40%;
  height: 18.5%;
  overflow: hidden;
  color: #050505;
  font-size: clamp(2.55rem, 11.2vw, 3.9rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.layout-side {
  position: absolute;
  z-index: 4;
  left: 16.7%;
  top: 43.4%;
  width: 27%;
  height: 6%;
  overflow: hidden;
  color: #11120f;
  font-size: clamp(0.52rem, 2.1vw, 0.78rem);
  line-height: 0.96;
  transform: rotate(90deg);
  transform-origin: left top;
  white-space: nowrap;
}

.layout-side span {
  display: block;
}

.stamp-image {
  position: absolute;
  left: 24%;
  top: 10.38%;
  z-index: 1;
  width: 65.25%;
  height: 64.16%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.42) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.42) 1px, transparent 1px),
    #d9d9d9;
  background-size: 18px 18px, 18px 18px, auto;
  background-position: center;
  background-size: cover;
  image-rendering: pixelated;
}

.stamp-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 0 56%, color-mix(in srgb, var(--memory-accent), transparent 62%) 56% 100%),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(17, 18, 15, 0.04) 7px 8px);
  opacity: 0.8;
  pointer-events: none;
}

.color-rail {
  position: absolute;
  z-index: 6;
  left: 23.25%;
  bottom: 23.35%;
  width: 21%;
  height: 0.72%;
  background: repeating-linear-gradient(90deg, var(--memory-accent) 0 16px, transparent 16px 24px);
}

.layout-dash {
  position: absolute;
  left: 7.55%;
  right: auto;
  top: 77.9%;
  z-index: 5;
  width: 76%;
  height: 5px;
  background: repeating-linear-gradient(90deg, #050505 0 15px, transparent 15px 32px, var(--memory-accent) 32px 47px, transparent 47px 74px);
}

.layout-name {
  position: absolute;
  left: 9.8%;
  bottom: auto;
  top: 82.15%;
  z-index: 5;
  width: 46%;
  height: 14.4%;
  overflow: hidden;
}

.layout-name span {
  display: block;
  font-size: clamp(0.62rem, 2.35vw, 0.84rem);
  font-weight: 900;
  line-height: 1;
}

.layout-name strong {
  display: block;
  margin-top: 18%;
  color: #050505;
  font-size: clamp(0.94rem, 4.05vw, 1.38rem);
  font-weight: 900;
  line-height: 0.96;
  overflow-wrap: anywhere;
}

.layout-name i {
  display: block;
  width: 110px;
  height: 10px;
  margin-top: 15%;
  background: radial-gradient(circle, #747474 0 5px, transparent 5.5px) 0 0 / 17px 10px repeat-x;
}

.layout-divider {
  position: absolute;
  left: 42.55%;
  bottom: auto;
  top: 80.95%;
  z-index: 5;
  width: 2px;
  height: 14.7%;
  background: color-mix(in srgb, #11120f, var(--memory-accent) 12%);
}

.layout-message {
  position: absolute;
  right: auto;
  left: 50.1%;
  bottom: auto;
  top: 81.45%;
  z-index: 5;
  width: 35.6%;
  height: 14.2%;
  overflow: hidden;
}

.layout-message p {
  min-height: auto;
  max-height: 52%;
  margin: 0 0 18%;
  overflow: hidden;
  color: color-mix(in srgb, #11120f, var(--memory-accent) 15%);
  font-size: clamp(0.58rem, 2.35vw, 0.78rem);
  font-weight: 800;
  line-height: 1.02;
}

.layout-message strong {
  display: block;
  color: #050505;
  font-size: clamp(0.86rem, 3.75vw, 1.22rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/*
 * Legacy preview layout selectors are intentionally overridden above.
 * Keep the class names stable because script.js uses the same DOM nodes for export.
 */

/*
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}

.layout-dash {
  position: absolute;
  left: 7.5%;
  right: 11%;
  top: 77.7%;
  height: 5px;
  background: repeating-linear-gradient(90deg, #000 0 18px, transparent 18px 34px);
}

.layout-name {
  position: absolute;
  left: 9.8%;
  bottom: 7%;
  width: 29%;
}

.layout-name span {
  display: block;
  font-size: clamp(0.78rem, 3.2vw, 1.1rem);
  font-weight: 800;
}

.layout-name strong {
  display: block;
  margin-top: 11%;
  font-size: clamp(1.18rem, 5.7vw, 1.82rem);
  line-height: 1.04;
}

.layout-name i {
  display: block;
  width: 56px;
  height: 12px;
  margin-top: 18%;
  background: radial-gradient(circle, #707070 0 6px, transparent 6.5px) 0 0 / 22px 12px repeat-x;
}

.layout-divider {
  position: absolute;
  left: 42.5%;
  bottom: 4.5%;
  width: 2px;
  height: 16.5%;
  background: #333;
}

.layout-message {
  position: absolute;
  right: 8.6%;
  bottom: 5.8%;
  width: 38%;
}

.layout-message p {
  min-height: 64px;
  margin: 0 0 16%;
  font-size: clamp(0.78rem, 3.2vw, 1.05rem);
  font-weight: 700;
  line-height: 1.28;
}

.layout-message strong {
  display: block;
  font-size: clamp(1.08rem, 5vw, 1.62rem);
  line-height: 1;
}
*/

.stamp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 0;
  border-block: 2px solid var(--black);
  color: var(--black);
  font-family: var(--pixel-font);
  font-weight: 900;
}

.stamp-seal {
  padding: 3px 8px;
  background: var(--sakura);
  color: var(--black);
  font-size: 0.75rem;
}

.preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
}

.page-preview .preview-actions {
  width: min(100%, 520px);
  margin-inline: auto;
}

.preview-actions .primary-cta,
.preview-actions .secondary-cta {
  min-height: 54px;
}

.success-core {
  position: relative;
  z-index: 2;
  width: min(100%, 336px);
  padding: 28px 18px;
  border: 2px solid var(--black);
  background:
    linear-gradient(90deg, rgba(8, 9, 8, 0.13) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(rgba(8, 9, 8, 0.13) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--white);
  text-align: center;
}

.success-mark {
  display: grid;
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
  place-items: center;
  background: var(--green);
}

.success-mark svg {
  width: 72px;
  height: 72px;
  color: var(--black);
  stroke-width: 7;
}

.success-mark circle {
  fill: transparent;
}

.order-number {
  width: fit-content;
  margin: 18px auto;
  padding: 8px 18px;
  background: var(--sakura);
  color: var(--black);
  font-family: var(--pixel-font);
  font-size: 2.25rem;
  font-weight: 900;
}

.pickup-text {
  margin: 0 auto 18px;
  max-width: 24ch;
  color: var(--graphite);
  line-height: 1.55;
}

.restart-cta {
  width: 100%;
}

.success-line-art {
  position: absolute;
  right: -34px;
  bottom: 20px;
  width: 210px;
  opacity: 0.12;
  image-rendering: pixelated;
}

@media (max-height: 720px) {
  .question-card h2 {
    font-size: 1.82rem;
    margin-bottom: 16px;
  }

  .sample-option,
  .map-point,
  .color-card {
    min-height: 64px;
  }

  .home-copy {
    padding-bottom: 112px;
  }
}

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