@font-face {
  font-family: "Mother City Sans";
  src: url("https://mother-city.oss-cn-shanghai.aliyuncs.com/mc-public/354aa0d0794c39e51080d4226bc08e13039fb4a479ec58129a4fede7795e8d71/Sans-Regular.ttf") format("truetype"), url("../assets/scene-ui/v3/fonts/Sans-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Mother City Serif";
  src: url("https://mother-city.oss-cn-shanghai.aliyuncs.com/mc-public/897c36a4ac40b99c70c16c0f327114cd3d2ff0279dc8488063392c1d7190739a/Serif-Semibold.ttf") format("truetype"), url("../assets/scene-ui/v3/fonts/Serif-Semibold.ttf") format("truetype");
  font-display: swap;
  font-weight: 600;
}

:root {
  --ink: #263e35;
  --muted: #5f6d61;
  --paper: #fbf7ea;
  --paper-soft: rgb(251 247 234 / 90%);
  --green: #355441;
  --orange: #c96c43;
  --line: rgb(38 62 53 / 16%);
  --hand: "HanziPen SC", "Kaiti SC", "STKaiti", "KaiTi", "Mother City Serif", serif;
  color: var(--ink);
  background: #cbd2b3;
  font-family: "Mother City Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }

button, a, input, select, textarea { touch-action: manipulation; }

:focus-visible {
  outline: 3px solid #875f30;
  outline-offset: 3px;
}

.entry-room, .entry-room img, .entry-shade, .entry-reveal-veil {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.entry-room img {
  object-fit: cover;
  object-position: center;
}

.entry-reveal-veil {
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 68% 28%, rgb(250 244 207 / 72%), transparent 38%),
    linear-gradient(155deg, #d8e0c5 0%, #c7d4ba 50%, #d9d5ae 100%);
  opacity: 0;
}

.entry-shade {
  z-index: 1;
  background: linear-gradient(90deg, rgb(24 44 34 / 17%), transparent 43%, rgb(30 48 40 / 11%));
}

.entry-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: max(18px, env(safe-area-inset-top)) 28px 12px;
}

.entry-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.entry-brand strong { font: 600 1.35rem/1.2 "Mother City Serif", serif; }
.entry-brand span { color: var(--muted); font-size: .82rem; }

.local-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  background: var(--paper-soft);
  color: var(--green);
  font-size: .78rem;
  backdrop-filter: blur(10px);
}

.entry-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 540px);
  gap: clamp(30px, 6vw, 100px);
  min-height: calc(100svh - 80px);
  align-items: center;
  padding: 24px clamp(28px, 6vw, 100px) 64px;
}

.entry-context {
  max-width: 540px;
  align-self: center;
  padding: 30px;
  color: #1f3a2e;
  text-shadow: 0 1px 16px rgb(251 247 234 / 92%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  font-family: var(--hand);
  font-size: .83rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.entry-context h1 {
  margin: 0;
  font: 600 clamp(3rem, 6vw, 6.5rem)/.98 var(--hand);
}

.entry-context > p:last-child {
  max-width: 29rem;
  margin: 24px 0 0;
  color: #3f5549;
  font-family: var(--hand);
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  line-height: 1.7;
}

.entry-card {
  min-height: 600px;
  border: 1px solid rgb(255 255 255 / 65%);
  border-radius: 30px;
  padding: clamp(24px, 4vw, 44px);
  background: var(--paper-soft);
  box-shadow: 0 24px 80px rgb(30 46 38 / 22%);
  backdrop-filter: blur(20px);
}

.entry-progress { display: grid; gap: 8px; margin-bottom: 42px; color: var(--muted); font-size: .76rem; }
.progress-track { width: 100%; height: 3px; overflow: hidden; border-radius: 99px; background: rgb(53 84 65 / 12%); }
.progress-track i { display: block; width: 8%; height: 100%; background: var(--orange); transition: width 180ms ease; }

.entry-step h2 {
  margin: 0 0 17px;
  font: 600 clamp(2rem, 3.4vw, 3rem)/1.08 var(--hand);
}

.entry-step > p:not(.eyebrow):not(.status):not(.form-note):not(.honest-seam) {
  color: var(--muted);
  line-height: 1.75;
}

.entry-step label {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  color: #334b3e;
  font-weight: 650;
}

input, select, textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgb(255 253 246 / 82%);
  color: var(--ink);
  font-size: 16px;
}

textarea { min-height: 150px; resize: vertical; line-height: 1.65; }

.check-row {
  grid-template-columns: 24px 1fr;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px;
  background: rgb(231 238 220 / 60%);
}

.check-row input { width: 20px; min-height: 20px; margin: 2px 0 0; }
.check-row span { display: grid; gap: 4px; }
.check-row small { color: var(--muted); font-weight: 400; line-height: 1.45; }

.truth-card, .connection-state, .honest-seam {
  display: grid;
  gap: 5px;
  margin: 24px 0;
  border-left: 3px solid var(--orange);
  border-radius: 8px 14px 14px 8px;
  padding: 14px 16px;
  background: rgb(255 251 236 / 70%);
}

.truth-card span, .connection-state, .honest-seam { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.truth-card.soft { border-left-color: #8ba48a; }
.form-note { color: var(--muted); font-size: .82rem; }
.state-guide { margin: 18px 0; color: var(--muted); font-size: .83rem; }
.state-guide summary { min-height: 44px; cursor: pointer; color: var(--green); }
.state-guide dl { display: grid; gap: 8px; margin: 0; }
.state-guide dl div { display: grid; grid-template-columns: 72px 1fr; gap: 8px; }
.state-guide dt { color: var(--ink); font-weight: 700; }
.state-guide dd { margin: 0; }
.status { min-height: 24px; color: var(--green); font-size: .86rem; }
.status[data-state="error"] { color: #8b4437; }

.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 30px; }
button { min-height: 46px; border-radius: 999px; padding: 11px 20px; cursor: pointer; }
button.primary { border: 1px solid var(--green); background: var(--green); color: #fbf5df; }
button.secondary { border: 1px solid var(--line); background: transparent; color: var(--ink); }
button:disabled { cursor: wait; opacity: .55; }

.room-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 25px 0; }
.room-facts p { display: grid; gap: 5px; margin: 0; border: 1px solid var(--line); border-radius: 14px; padding: 13px; background: rgb(255 253 246 / 66%); }
.room-facts strong { font-family: var(--hand); font-size: 1.05rem; }
.room-facts span { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.room-result .room-city-title { margin-bottom: 12px; font-size: clamp(2.7rem, 5vw, 4.6rem); }
.room-welcome { margin: 0; color: var(--ink); font-family: var(--hand); font-size: clamp(1.35rem, 2.2vw, 1.8rem); line-height: 1.35; }
.room-lamp { margin: 6px 0 0; color: var(--muted); font-family: var(--hand); font-size: 1.05rem; }
.room-result .room-facts { grid-template-columns: repeat(2, 1fr); }
.room-result .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.room-result .actions .primary { grid-column: 1 / -1; grid-row: 1; }
.seed-readback { margin-top: 18px; border-radius: 18px; padding: 18px; background: rgb(231 238 220 / 60%); }
.seed-readback blockquote { margin: 0; white-space: pre-wrap; color: var(--ink); line-height: 1.65; }
.demo-response { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.demo-response strong { color: var(--orange); font-size: .78rem; }
.demo-response p { margin-bottom: 0; font-family: var(--hand); font-size: 1.1rem; }
.honest-seam { border-left-color: #8ba48a; }
.fatal-status { margin-top: 20px; border-radius: 12px; padding: 14px; background: #f8ded7; color: #733a30; }

footer {
  position: fixed;
  z-index: 4;
  left: 24px;
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: 420px;
  color: #365044;
  font-size: .75rem;
}

footer details { border-radius: 14px; padding: 8px 12px; background: var(--paper-soft); }
footer p { margin-bottom: 8px; }
footer nav { display: flex; gap: 14px; }
footer a { color: var(--green); }

[hidden] { display: none !important; }

@media (max-width: 1023px) {
  .entry-layout { grid-template-columns: minmax(220px, .8fr) minmax(400px, 1fr); gap: 24px; padding-inline: 28px; }
  .entry-context { padding: 18px; }
  .entry-card { min-height: 570px; }
}

@media (max-width: 640px), (orientation: portrait) and (max-width: 1023px) {
  body { overflow: auto; }
  .entry-room img { object-position: center 58%; }
  .entry-reveal-veil {
    opacity: 1;
    transition: opacity 640ms ease 120ms;
  }
  body[data-reveal-state="verified"] .entry-reveal-veil { opacity: 0; }
  .entry-shade { background: linear-gradient(180deg, rgb(21 43 32 / 4%), rgb(29 45 37 / 20%)); }
  .entry-topbar { padding-inline: 16px; }
  .entry-brand span { display: none; }
  .local-badge { padding: 7px 10px; }
  .entry-layout { display: block; min-height: 100svh; padding: 17svh 12px 92px; }
  .entry-context { max-width: 92%; padding: 10px 16px 28px; }
  .entry-context .eyebrow { color: #496052; }
  .entry-context h1 { font-size: clamp(2.45rem, 12vw, 4rem); }
  .entry-context > p:last-child { display: none; }
  .entry-card { min-height: 0; border-radius: 26px; padding: 25px 22px max(28px, env(safe-area-inset-bottom)); }
  .entry-progress { margin-bottom: 27px; }
  .entry-step h2 { font-size: clamp(2rem, 9vw, 2.8rem); }
  .room-result .room-city-title { font-size: clamp(2.65rem, 13vw, 4rem); }
  .room-facts { grid-template-columns: 1fr; }
  .actions { position: sticky; bottom: 0; padding-top: 12px; background: linear-gradient(transparent, var(--paper) 26%); }
  .room-result .actions { position: static; background: none; }
  .actions button { flex: 1; }
  .stack-mobile { flex-wrap: wrap; }
  .stack-mobile button { flex: 1 1 44%; }
  .stack-mobile .primary { flex-basis: 100%; }
  footer { position: relative; left: auto; bottom: auto; z-index: 3; margin: -72px 18px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
