:root {
  color-scheme: light;
  --ink: #1f2528;
  --muted: #667076;
  --paper: #fff9ed;
  --surface: #ffffff;
  --line: rgba(31, 37, 40, .12);
  --green: #276b54;
  --leaf: #78a255;
  --gold: #d7a342;
  --red: #b94d3e;
  --blue: #467a93;
  --shadow: 0 18px 45px rgba(31, 37, 40, .16);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, #e8f0df, #f9ead0 48%, #d9e5eb);
  color: var(--ink);
}

button,
textarea,
input {
  font: inherit;
}

.phone-shell {
  position: relative;
  width: min(430px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(31, 37, 40, .08);
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 16px 16px 88px;
}

.screen.active {
  display: block;
}

.cover-screen {
  min-height: 100vh;
  padding: 0;
}

.cover-screen .hero {
  min-height: 100vh;
  border-radius: 0;
}

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0;
  padding: 16px 18px 26px;
  overflow: hidden;
  border-radius: 0 0 8px 8px;
  background: #ead7b4 url("../cover/huangchu-cover.jpg") center center / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 249, 237, 0) 0 62%, rgba(89, 55, 31, .2) 78%, rgba(48, 29, 17, .52) 100%);
  pointer-events: none;
}

.hero-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: none;
}

.sun {
  position: absolute;
  width: 92px;
  height: 92px;
  right: 34px;
  top: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe7a6 0 42%, #f0bd58 43% 100%);
  box-shadow: 0 0 54px rgba(240, 189, 88, .5);
}

.ridge {
  position: absolute;
  left: -18%;
  right: -18%;
  bottom: 118px;
  height: 230px;
  border-radius: 50% 50% 0 0;
  transform: rotate(-5deg);
}

.ridge-one {
  background: #8dae72;
  bottom: 100px;
}

.ridge-two {
  background: #5f8e68;
  bottom: 58px;
  transform: rotate(8deg);
}

.terraces {
  position: absolute;
  left: -15%;
  right: -15%;
  bottom: -30px;
  height: 260px;
  background:
    repeating-radial-gradient(ellipse at 50% 0%, transparent 0 22px, rgba(255,255,255,.34) 23px 25px, transparent 26px 48px),
    linear-gradient(180deg, #7da35f, #d7b35b 52%, #a76d4e);
  border-radius: 50% 50% 0 0;
}

.top-left {
  position: absolute;
  top: 14px;
  left: 14px;
}

.hero-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.kicker,
.story-header p,
.editor-head p,
.quiz-label {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 8em;
  margin-bottom: 10px;
  font-size: 40px;
  line-height: 1.02;
}

.hero-copy p:last-child {
  max-width: 16em;
  margin-bottom: 0;
  color: #33423e;
  font-size: 17px;
  line-height: 1.5;
}

.primary-action,
.ghost-action,
.icon-button,
.chip,
.editor-tabs button {
  border: 0;
  cursor: pointer;
}

.primary-action {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 52px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(39, 107, 84, .24);
}

.hero .primary-action {
  background: linear-gradient(180deg, #86522f, #5f351f);
  color: #fff5df;
  border: 1px solid rgba(241, 207, 143, .68);
  box-shadow: 0 14px 28px rgba(57, 31, 16, .34);
}

.primary-action.small {
  min-height: 44px;
  padding: 0 16px;
}

.ghost-action {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: #edf2e5;
  color: var(--green);
  font-weight: 800;
}

.ghost-action.mini {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 249, 237, .86);
  color: var(--ink);
  font-size: 24px;
  box-shadow: 0 8px 20px rgba(31, 37, 40, .12);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
}

.map-panel {
  padding: 16px 0 0;
}

.village-map {
  position: relative;
  height: auto;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, .72) 0 36px, transparent 37px),
    linear-gradient(145deg, transparent 0 50%, rgba(70, 122, 147, .18) 51% 55%, transparent 56%),
    repeating-linear-gradient(18deg, rgba(39,107,84,.11) 0 8px, transparent 9px 27px),
    #f8eac4;
  box-shadow: 0 10px 28px rgba(31, 37, 40, .08);
}

.village-map::before {
  content: "";
  position: absolute;
  left: -25%;
  right: -20%;
  bottom: -58px;
  height: 178px;
  border-radius: 50% 50% 0 0;
  background: repeating-radial-gradient(ellipse at center top, transparent 0 17px, rgba(39,107,84,.22) 18px 20px, transparent 21px 39px);
}

.map-route {
  position: absolute;
  inset: 28px;
  border: 2px dashed rgba(185, 77, 62, .38);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 42% 58% 44% 56%;
  transform: rotate(-10deg);
}

.map-node {
  position: absolute;
  width: 82px;
  min-height: 62px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 253, 248, .94);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(31, 37, 40, .15);
  text-align: left;
}

.map-node::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin-bottom: 5px;
  border-radius: 50% 50% 50% 0;
  background: var(--red);
  transform: rotate(-45deg);
}

.map-node.done::after {
  content: "已打卡";
  display: inline-block;
  margin-top: 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.map-node strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.map-node span {
  color: var(--muted);
  font-size: 10px;
}

.map-node:nth-child(2) {
  left: 20px;
  top: 162px;
}

.map-node:nth-child(3) {
  left: 50px;
  top: 62px;
}

.map-node:nth-child(4) {
  right: 24px;
  top: 82px;
}

.map-node:nth-child(5) {
  right: 56px;
  top: 176px;
}

.map-node:nth-child(6) {
  left: 132px;
  top: 222px;
}

.node-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 0;
}

.node-card {
  position: relative;
  min-height: 122px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(31, 37, 40, .08);
  text-align: left;
}

.node-card.done::after {
  content: "✓";
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-weight: 900;
}

.scan-strip {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: #fff7e2;
  color: #5f5236;
  font-size: 12px;
  line-height: 1.45;
}

.qr-mark {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 4px;
  background:
    linear-gradient(90deg, var(--ink) 0 6px, transparent 7px 13px, var(--ink) 14px 20px, transparent 21px),
    linear-gradient(0deg, transparent 0 6px, var(--ink) 7px 13px, transparent 14px 20px, var(--ink) 21px);
  opacity: .72;
}

.story-audio {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  background: #f6fbef;
}

.audio-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.audio-art {
  position: relative;
  display: block;
  width: 72px;
  height: 72px;
  overflow: visible;
}

.audio-icon-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  object-position: center;
}

.audio-icon-original {
  z-index: 1;
}

.audio-layer {
  opacity: 0;
}

.audio-static-layer {
  z-index: 1;
}

.audio-disc-layer {
  z-index: 2;
  transform-origin: 44.1% 59.1%;
}

.audio-arm-layer {
  z-index: 3;
}

.audio-notes-layer {
  z-index: 4;
}

.audio-pause-bars {
  position: absolute;
  left: 47%;
  top: 58%;
  z-index: 5;
  display: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.audio-pause-bars {
  width: 10px;
  height: 13px;
  background:
    linear-gradient(90deg, rgba(31,37,40,.92) 0 3px, transparent 3px 7px, rgba(31,37,40,.92) 7px 10px);
  border-radius: 1px;
}

.audio-action-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.story-audio.audio-playing .audio-icon-original {
  opacity: 0;
}

.story-audio.audio-playing .audio-layer {
  opacity: 1;
}

.story-audio.audio-playing .audio-disc-layer {
  opacity: 1;
  animation: audioDiscTurn 6s linear infinite;
}

.story-audio.audio-playing .audio-notes-layer {
  opacity: 1;
  animation: audioNoteTremble .48s ease-in-out infinite alternate;
}

.story-audio.audio-playing .audio-pause-bars {
  display: block;
}

@keyframes audioDiscTurn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes audioNoteTremble {
  from {
    transform: translateY(0) rotate(0deg);
  }
  to {
    transform: translateY(-1px) rotate(.7deg);
  }
}

.story-audio strong,
.story-audio span {
  display: block;
}

.story-audio strong {
  font-size: 13px;
}

.story-audio span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.story-audio audio {
  display: none;
}

.audio-progress-row {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.audio-progress {
  width: 100%;
  accent-color: var(--green);
  cursor: pointer;
}

.audio-time {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.story-audio.audio-missing {
  background: #fbfaf5;
}

.story-audio.audio-missing .audio-toggle {
  background: transparent;
  color: inherit;
}

.story-audio.audio-missing .audio-progress-row {
  opacity: .45;
}

.node-index {
  display: block;
  margin-bottom: 14px;
  color: var(--blue);
  font-weight: 900;
}

.node-card strong {
  display: block;
  margin-bottom: 8px;
  line-height: 1.25;
}

.node-card span:last-child {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.culture-block {
  padding: 16px 0 0;
}

.culture-block h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

.culture-block p {
  color: var(--muted);
  line-height: 1.55;
}

.culture-list {
  display: grid;
  gap: 10px;
}

.culture-item {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.culture-mark {
  height: 58px;
  border-radius: 8px;
  background: conic-gradient(from 40deg, var(--red), var(--gold), var(--leaf), var(--blue), var(--red));
}

.culture-item strong {
  display: block;
  margin-bottom: 5px;
}

.culture-item p {
  margin: 0;
  font-size: 13px;
}

.fixed-slogan {
  position: sticky;
  bottom: 12px;
  margin: 16px auto 0;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(31, 37, 40, .78);
  color: #fff;
  font-size: 13px;
  backdrop-filter: blur(10px);
}

.story-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 10px;
  align-items: center;
  padding: 4px 0 12px;
  background: linear-gradient(180deg, var(--paper) 76%, rgba(255,249,237,0));
}

.story-header h2 {
  margin: 0;
  font-size: 22px;
}

.comic-card,
.quiz-panel,
.mailbox-card,
.passport-card,
.special-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.comic-card {
  overflow: hidden;
}

.comic-visual {
  height: 210px;
  background:
    linear-gradient(140deg, rgba(255,255,255,.35), transparent 38%),
    radial-gradient(circle at 78% 22%, #f5cf78 0 32px, transparent 33px),
    linear-gradient(160deg, #d8ead0, #89af6a 48%, #c48d52);
}

.visual-square {
  background:
    radial-gradient(circle at 22% 30%, #f4efd4 0 24px, transparent 25px),
    linear-gradient(135deg, #b94d3e, #d7a342 42%, #276b54);
}

.visual-tree {
  background:
    radial-gradient(circle at 50% 35%, #496b3e 0 72px, transparent 73px),
    linear-gradient(90deg, transparent 45%, #65462f 46% 54%, transparent 55%),
    linear-gradient(180deg, #dbe9dd, #8caf68);
}

.visual-space {
  background:
    linear-gradient(90deg, rgba(39,107,84,.78), rgba(31,37,40,.2)),
    repeating-linear-gradient(0deg, #b98455 0 12px, #c99a6d 13px 24px);
}

.visual-peak {
  background:
    radial-gradient(circle at 75% 26%, #ffdf8e 0 28px, transparent 29px),
    linear-gradient(145deg, transparent 0 52%, #276b54 53% 100%),
    linear-gradient(215deg, transparent 0 48%, #467a93 49% 100%),
    #dbe8ea;
}

.comic-card > :not(.comic-visual) {
  padding-left: 16px;
  padding-right: 16px;
}

.chapter {
  margin: 18px 0 6px;
  color: var(--red);
  font-weight: 800;
}

.lead {
  color: #3e4c48;
  font-size: 17px;
  line-height: 1.55;
  text-indent: 2em;
}

.story-body {
  color: var(--ink);
  line-height: 1.8;
  white-space: pre-wrap;
  text-indent: 2em;
}

.summary {
  margin: 0 16px 16px;
  padding: 12px;
  border-left: 4px solid var(--gold);
  background: #fff7e2;
  color: #59472d;
  line-height: 1.55;
  text-indent: 2em;
}

.text-paragraph {
  display: block;
  text-indent: 2em;
}

.text-paragraph + .text-paragraph {
  margin-top: .55em;
}

.comic-gallery {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.comic-gallery img {
  display: block;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f4f1df;
}

.comic-panel-placeholder {
  min-height: 126px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(39, 107, 84, .35);
  border-radius: 8px;
  background: #fbfaf5;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.special-panel {
  margin-top: 12px;
  padding: 14px;
}

.special-panel.hidden,
.reply-card.hidden {
  display: none;
}

.special-panel button {
  margin-top: 8px;
}

.quiz-panel,
.mailbox-card,
.passport-card {
  margin-top: 14px;
  padding: 14px;
}

.quiz-panel.pulse {
  animation: answerPulse .7s ease;
}

@keyframes answerPulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.025);
    box-shadow: 0 0 0 7px rgba(215, 163, 66, .18), var(--shadow);
  }
  100% {
    transform: scale(1);
  }
}

.quiz-panel h3 {
  font-size: 17px;
  line-height: 1.45;
}

textarea,
input {
  width: 100%;
  border: 1px solid rgba(31, 37, 40, .16);
  border-radius: 8px;
  padding: 12px;
  background: #fbfaf5;
  color: var(--ink);
  resize: vertical;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.chip-row {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.chip {
  flex: 1;
  height: 38px;
  border-radius: 999px;
  background: #edf2e5;
  color: var(--green);
  font-weight: 800;
}

.chip.active {
  background: var(--green);
  color: #fff;
}

.reply-card {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #eef6f3;
  color: #2f5148;
  line-height: 1.55;
}

.ai-guide-panel {
  margin-top: 14px;
  padding: 14px;
  border-top: 2px dashed rgba(39, 107, 84, .28);
  border-bottom: 2px dashed rgba(215, 163, 66, .26);
}

.ai-guide-panel .section-head {
  margin-bottom: 8px;
}

.ai-guide-copy {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ai-guide-messages {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.ai-guide-message {
  max-width: 92%;
  margin-top: 0;
  word-break: break-word;
  white-space: pre-wrap;
}

.ai-guide-message.user {
  justify-self: end;
  background: #fff4dd;
  color: #66492b;
}

.ai-guide-message.assistant {
  justify-self: start;
}

.ai-guide-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}

.ai-guide-input-row textarea {
  min-height: 58px;
}

.ai-guide-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ai-guide-quick .ghost-action {
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.stamp-ring {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.avatar-maker {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}

.upload-tile {
  display: grid;
  place-items: center;
  min-height: 112px;
  border: 1px dashed rgba(39, 107, 84, .35);
  border-radius: 8px;
  background: #f4f1df;
  color: var(--green);
  font-weight: 800;
  text-align: center;
}

.upload-tile input {
  display: none;
}

.cartoon-avatar {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 112px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, #ffd8a8 0 30px, transparent 31px),
    radial-gradient(circle at 38% 38%, #1f2528 0 3px, transparent 4px),
    radial-gradient(circle at 62% 38%, #1f2528 0 3px, transparent 4px),
    linear-gradient(135deg, #b94d3e 0 28%, #d7a342 29% 64%, #276b54 65%);
  overflow: hidden;
}

.cartoon-avatar::before {
  content: "";
  position: absolute;
  width: 72px;
  height: 34px;
  top: 18px;
  border-radius: 50% 50% 20% 20%;
  background: #25322b;
}

.cartoon-avatar::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 14px;
  top: 62px;
  border-bottom: 3px solid #b94d3e;
  border-radius: 50%;
}

.cartoon-avatar span {
  position: absolute;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.name-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.name-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.passport-name {
  margin-bottom: 10px;
  color: var(--red);
  font-size: 18px;
  font-weight: 900;
}

.stamp {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px dashed rgba(31, 37, 40, .18);
  border-radius: 50%;
  color: rgba(31, 37, 40, .35);
  font-weight: 900;
}

.stamp.done {
  border-color: var(--red);
  background: #fff0e5;
  color: var(--red);
  transform: rotate(-8deg);
}

.passport-note {
  font-size: 20px;
  line-height: 1.55;
}

.passport-sign,
.redeem-text {
  color: var(--muted);
  text-align: right;
}

.redeem-text {
  margin-top: 12px;
  text-align: center;
}

.editor-drawer {
  position: fixed;
  z-index: 20;
  inset: auto 0 0;
  width: min(430px, 100vw);
  max-height: 88vh;
  margin: auto;
  padding: 14px;
  background: #fffdf8;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -18px 40px rgba(31, 37, 40, .22);
  transform: translateY(105%);
  transition: transform .28s ease;
}

.editor-drawer.open {
  transform: translateY(0);
}

.editor-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.editor-head h2 {
  margin: 0 0 12px;
}

.editor-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.editor-tabs button {
  height: 38px;
  border-radius: 8px;
  background: #edf2e5;
  color: var(--green);
  font-weight: 800;
}

.editor-tabs button.active {
  background: var(--green);
  color: #fff;
}

.editor-body {
  max-height: 56vh;
  overflow: auto;
  padding-right: 2px;
}

.editor-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.editor-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.editor-field textarea {
  min-height: 72px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 30;
  width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(31, 37, 40, .88);
  color: #fff;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: .22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 700px) {
  body {
    padding: 24px 0;
  }

  .phone-shell {
    min-height: calc(100vh - 48px);
    border-radius: 26px;
  }
}

/* 2026-06 content and interaction refresh */
.hero-copy {
  width: 100%;
  padding: 0 8px;
  text-align: center;
}

h1 {
  max-width: 9em;
  margin: 0 auto 10px;
  font-size: 38px;
  line-height: 1.12;
}

.hero h1 {
  display: grid;
  width: min(8em, 100%);
  gap: 4px;
  justify-items: center;
  font-size: 38px;
  line-height: 1.16;
  white-space: nowrap;
}

.hero h1 span {
  display: block;
  width: 100%;
  text-align: center;
}

.hero-copy p:last-child {
  margin: 0 auto;
}

.prologue-block {
  position: relative;
  margin-top: 18px;
  padding: 18px 16px 16px;
  border-top: 3px solid var(--red);
  background: #fffdf8;
  box-shadow: 0 10px 28px rgba(73, 53, 35, .08);
}

.prologue-block h2 {
  margin-bottom: 10px;
  font-size: 22px;
}

.prologue-block > p:not(.kicker) {
  color: #454b48;
  line-height: 1.75;
  text-indent: 2em;
}

.prologue-block blockquote {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: #fff5da;
  color: #6b5125;
  font-family: KaiTi, STKaiti, serif;
  line-height: 1.6;
}

.prologue-media {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.prologue-media .story-audio {
  padding: 12px;
  border: 1px dashed rgba(39, 107, 84, .32);
  border-radius: 8px;
}

.prologue-media .comic-gallery {
  margin: 0;
}

.map-photo {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.map-node,
.map-route {
  z-index: 1;
}

.map-node.locked,
.node-card.locked {
  opacity: .52;
  filter: grayscale(.45);
}

.characters-block,
.journey-block {
  padding-top: 22px;
}

.swipe-hint,
.progress-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.character-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 76%;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.character-track.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.character-nav {
  display: flex;
  gap: 6px;
}

.small-icon {
  width: 34px;
  height: 34px;
  font-size: 20px;
}

.character-track::-webkit-scrollbar {
  display: none;
}

.character-card {
  overflow: hidden;
  min-height: 336px;
  border: 1px solid rgba(185, 77, 62, .18);
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: 0 10px 24px rgba(73, 53, 35, .1);
  scroll-snap-align: start;
}

.character-card > div:last-child {
  padding: 12px 14px 14px;
  text-align: center;
}

.character-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
}

.character-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.character-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.character-portrait {
  height: 235px;
  padding: 0 !important;
  background-image: url("../characters/role-overview.webp");
  background-repeat: no-repeat;
  background-position: var(--portrait-position);
  background-size: 400% auto;
  background-color: #f7ead3;
}

.character-overview img {
  display: block;
  width: 100%;
  height: 235px;
  object-fit: cover;
}

.node-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0;
}

.node-grid::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 28px;
  bottom: 28px;
  border-left: 1px dashed rgba(185, 77, 62, .32);
}

.node-card {
  z-index: 1;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 12px 12px 12px 8px;
}

.node-index {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--red);
}

.node-copy strong {
  display: block;
  margin-bottom: 4px;
  line-height: 1.25;
}

.node-copy small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.node-state {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.culture-block {
  margin-top: 24px;
  padding: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.culture-block summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 2px;
  cursor: pointer;
  list-style: none;
}

.culture-block summary::-webkit-details-marker {
  display: none;
}

.culture-block summary strong,
.culture-block summary small {
  display: block;
}

.culture-block summary small {
  margin-top: 5px;
  color: var(--muted);
}

.comic-visual {
  position: relative;
  height: auto;
  aspect-ratio: 16 / 10;
}

.comic-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.keyword-hint {
  margin: 9px 0 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.locked-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.quiz-feedback {
  min-height: 22px;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.quiz-feedback.error { color: var(--red); }
.quiz-feedback.success { color: var(--green); }

button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.passport-card.reveal {
  transform-origin: 50% 0;
  animation: passportReveal .72s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes passportReveal {
  0% { opacity: 0; transform: translateY(26px) rotateX(-12deg) scale(.94); }
  65% { opacity: 1; transform: translateY(-4px) rotateX(2deg) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}

.cartoon-avatar.generating {
  animation: portraitGenerating .55s ease-in-out infinite alternate;
}

.ai-scan {
  position: absolute;
  z-index: 3;
  left: 8px;
  right: 8px;
  top: -24px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 239, 180, .72);
  box-shadow: 0 0 18px 8px rgba(255, 214, 96, .36);
  opacity: 0;
  pointer-events: none;
}

.cartoon-avatar.generating .ai-scan {
  opacity: 1;
  animation: portraitScan 1.35s ease-in-out infinite;
}

@keyframes portraitScan {
  0% { top: -24px; transform: scaleX(.75); }
  50% { transform: scaleX(1); }
  100% { top: calc(100% + 4px); transform: scaleX(.75); }
}

@keyframes portraitGenerating {
  from { filter: saturate(.8); transform: scale(.98); }
  to { filter: saturate(1.3) blur(1px); transform: scale(1.02); }
}

.cartoon-avatar.portrait-ready {
  background-position: center;
  background-size: cover;
  filter: none;
}

.cartoon-avatar.portrait-ready::before,
.cartoon-avatar.portrait-ready::after {
  display: none;
}

.portrait-styles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.portrait-styles .chip {
  min-width: 0;
  padding: 0 6px;
  font-size: 12px;
}

.portrait-status {
  min-height: 20px;
  margin: 9px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.privacy-note {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.redeem-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(215, 163, 66, .38);
  border-radius: 8px;
  background: #fff5d9;
  box-shadow: 0 12px 28px rgba(102, 73, 31, .12);
  text-align: center;
}

.redeem-panel h3 {
  margin-bottom: 8px;
  color: #684d1f;
  font-size: 19px;
  line-height: 1.4;
}

.redeem-panel .redeem-text {
  margin: 0 0 12px;
  color: #6b604d;
  text-align: center;
  line-height: 1.6;
}

.village-map .map-route {
  display: none;
}

.village-map .map-node {
  left: var(--map-x);
  right: auto;
  top: var(--map-y);
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 3px solid rgba(255,255,255,.92);
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 5px 14px rgba(67, 35, 24, .28);
  text-align: center;
}

.village-map .map-node::before,
.village-map .map-node span {
  display: none;
}

.village-map .map-node strong {
  display: block;
  font-size: 14px;
  line-height: 30px;
}

.village-map .map-node.done::after {
  content: "✓";
  position: absolute;
  right: -5px;
  top: -7px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 10px;
}

.map-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.map-legend-item span {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 11px;
}

.map-legend-item.locked {
  opacity: .5;
}

.hidden {
  display: none !important;
}

.completion-modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(26, 31, 28, .56);
  opacity: 0;
  transition: opacity .22s ease;
}

.completion-modal.show {
  opacity: 1;
}

.completion-sheet {
  width: min(398px, 100%);
  padding: 24px 18px 18px;
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  text-align: center;
  transform: translateY(32px) scale(.96);
  transition: transform .32s cubic-bezier(.2,.8,.2,1);
}

.completion-modal.show .completion-sheet {
  transform: translateY(0) scale(1);
}

.completion-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border: 2px dashed var(--red);
  border-radius: 50%;
  background: #fff0e5;
  color: var(--red);
  font-size: 28px;
  font-weight: 900;
  animation: completionStamp .58s ease both;
}

@keyframes completionStamp {
  from { opacity: 0; transform: scale(1.5) rotate(18deg); }
  to { opacity: 1; transform: scale(1) rotate(-5deg); }
}

.completion-sheet h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.completion-sheet > p:not(.kicker) {
  color: var(--muted);
  line-height: 1.65;
}

.text-action {
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.easter-egg {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 4px 0 8px auto;
  border: 0;
  border-radius: 50%;
  background: #fff0cf;
  color: var(--gold);
  cursor: pointer;
  animation: eggGlow 1.8s ease-in-out infinite;
}

@keyframes eggGlow {
  50% { box-shadow: 0 0 0 7px rgba(215,163,66,.14); transform: rotate(12deg); }
}

.egg-note {
  min-height: 20px;
  margin-bottom: 8px;
  color: var(--red);
  font-family: KaiTi, STKaiti, serif;
  line-height: 1.6;
}

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

