:root {
  --paper: #ece2c8;
  --paper-strong: #f8efd9;
  --ink: #432f16;
  --ink-soft: #7d6536;
  --gold: #bd9a55;
  --gold-soft: rgba(189, 154, 85, .42);
  --zhu: #9c2f1b;
  --green: #296c67;
  --shadow: 0 10px 28px rgba(69, 48, 20, .24);
  --map-panel-width: 400px;
}

* { box-sizing: border-box; }

html,
body,
#app {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

button {
  font: inherit;
  color: inherit;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #c3d3cf;
}

.paper {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: .72;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='.065'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='280' height='280' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(236, 226, 200, 0) 48%, rgba(92, 68, 30, .25) 100%);
}

#mist {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: .42;
}

.pet-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  transition: opacity .28s ease;
}

.pet-layer.intro-pending {
  opacity: 0;
}

.journey-pet {
  --pet-robe: #8d2d1c;
  --pet-hat: #296c67;
  --pet-skin: #f2d09b;
  --pet-trim: #bd9a55;
  --pet-sprite-image: none;
  --pet-portrait-image: none;
  --pet-portrait-position: 50% 18%;
  position: absolute;
  left: 0;
  top: 0;
  width: 74px;
  height: 104px;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 8px 10px rgba(45, 29, 11, .26));
  transition: filter .2s ease;
}

.pet-sprite {
  display: none;
}

.pet-portrait {
  display: none;
}

.journey-pet.portrait-pet {
  width: 78px;
  height: 104px;
  filter: drop-shadow(0 10px 12px rgba(45, 29, 11, .28));
}

.journey-pet.portrait-pet > span:not(.pet-portrait):not(.pet-shadow) {
  display: none;
}

.journey-pet.portrait-pet .pet-portrait {
  position: absolute;
  left: 3px;
  top: 20px;
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: #efe0bd;
  background-image: var(--pet-portrait-image);
  background-position: var(--pet-portrait-position);
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 0 9px 12px rgba(45, 29, 11, .22);
  overflow: hidden;
}

.journey-pet.portrait-pet .pet-portrait::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 251, 235, .12), rgba(80, 52, 22, .08));
  content: "";
}

.journey-pet.portrait-pet .pet-shadow {
  left: 13px;
  bottom: 0;
  width: 52px;
  height: 10px;
  background: rgba(50, 34, 13, .24);
}

.journey-pet.portrait-pet.walking .pet-portrait {
  animation: petPortraitWalk .42s infinite alternate;
}

.journey-pet.sprite-pet {
  width: 96px;
  height: 104px;
  filter: drop-shadow(0 10px 12px rgba(45, 29, 11, .3));
}

.journey-pet.sprite-pet > span:not(.pet-sprite):not(.pet-shadow) {
  display: none;
}

.journey-pet.sprite-pet .pet-sprite {
  position: absolute;
  inset: 0;
  display: block;
  background-image: var(--pet-sprite-image);
  background-repeat: no-repeat;
  background-size: 768px 936px;
  image-rendering: auto;
  animation: dongpoIdle 1.05s steps(6) infinite;
}

.journey-pet.sprite-pet.walking .pet-sprite {
  animation: dongpoRunRight .72s steps(8) infinite;
}

.journey-pet.sprite-pet.walking.facing-left .pet-sprite {
  animation: dongpoRunLeft .72s steps(8) infinite;
}

.journey-pet.sprite-pet.speaking:not(.walking) .pet-sprite {
  animation: dongpoReview 1.05s steps(6) infinite;
}

.journey-pet.sprite-pet .pet-shadow {
  left: 24px;
  bottom: 0;
  width: 48px;
  height: 10px;
  background: rgba(50, 34, 13, .2);
}

.journey-pet.facing-left {
  direction: rtl;
}

.journey-pet.facing-left > span:not(.pet-badge):not(.pet-shadow):not(.pet-portrait) {
  transform: scaleX(-1);
}

.journey-pet.sprite-pet.facing-left > span.pet-sprite {
  transform: none;
}

.pet-shadow {
  position: absolute;
  left: 17px;
  bottom: -4px;
  width: 40px;
  height: 10px;
  border-radius: 50%;
  background: rgba(50, 34, 13, .22);
  filter: blur(1px);
}

.pet-head {
  position: absolute;
  left: 14px;
  top: 8px;
  width: 46px;
  height: 48px;
  border: 3px solid #372513;
  border-radius: 43% 43% 41% 41%;
  background: var(--pet-skin);
  box-shadow: inset 0 -5px 0 rgba(125, 58, 36, .1);
}

.pet-hat {
  position: absolute;
  left: 17px;
  top: 0;
  width: 40px;
  height: 19px;
  border: 3px solid #372513;
  border-radius: 50% 50% 8px 8px;
  background: var(--pet-hat);
  box-shadow: inset 0 -4px 0 rgba(255, 250, 238, .18);
  z-index: 2;
}

.pet-body {
  position: absolute;
  left: 19px;
  top: 51px;
  width: 36px;
  height: 42px;
  border: 3px solid #372513;
  border-radius: 11px 11px 17px 17px;
  background: linear-gradient(180deg, var(--pet-trim) 0 9px, var(--pet-robe) 9px);
}

.pet-face {
  position: absolute;
  left: 11px;
  top: 20px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2d1b0e;
  box-shadow: 17px 0 0 #2d1b0e, 8px 11px 0 -1px #7d3a24;
}

.journey-pet.speaking .pet-face {
  box-shadow: 17px 0 0 #2d1b0e, 8px 12px 0 1px #7d3a24;
}

.pet-sleeve {
  position: absolute;
  top: 60px;
  width: 21px;
  height: 13px;
  border: 3px solid #372513;
  border-radius: 999px;
  background: #f2e3bf;
}

.pet-sleeve-left {
  left: 3px;
  transform: rotate(22deg);
}

.pet-sleeve-right {
  right: 3px;
  transform: rotate(-22deg);
}

.pet-foot {
  position: absolute;
  bottom: 0;
  width: 18px;
  height: 9px;
  border: 3px solid #372513;
  border-radius: 999px;
  background: #2f2a22;
}

.pet-foot-left { left: 17px; }
.pet-foot-right { right: 17px; }

.pet-badge {
  position: absolute;
  right: -4px;
  top: 31px;
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border: 2px solid rgba(255, 244, 220, .92);
  border-radius: 50%;
  background: var(--pet-robe);
  color: #fff4dc;
  font: 700 13px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.pet-prop {
  position: absolute;
  right: -3px;
  top: 68px;
  width: 22px;
  height: 22px;
}

.journey-pet[data-prop="brush"] .pet-prop {
  width: 5px;
  height: 28px;
  border-radius: 3px;
  background: #332313;
  transform: rotate(-22deg);
}

.journey-pet[data-prop="brush"] .pet-prop::after {
  position: absolute;
  left: -3px;
  bottom: -7px;
  width: 11px;
  height: 10px;
  border-radius: 50%;
  background: #6e3b1f;
  content: "";
}

.journey-pet[data-prop="cup"] .pet-prop {
  border: 3px solid #372513;
  border-radius: 3px 3px 8px 8px;
  background: #f3e2bd;
}

.journey-pet[data-prop="sword"] .pet-prop {
  width: 4px;
  height: 34px;
  border-radius: 3px;
  background: #d5d0c2;
  transform: rotate(-32deg);
}

.journey-pet[data-prop="sword"] .pet-prop::before {
  position: absolute;
  left: -7px;
  top: 18px;
  width: 18px;
  height: 4px;
  background: #bd9a55;
  content: "";
}

.journey-pet[data-prop="flower"] .pet-prop,
.journey-pet[data-prop="orchid"] .pet-prop,
.journey-pet[data-prop="chrysanthemum"] .pet-prop {
  border-left: 4px solid #3c6b39;
  transform: rotate(-18deg);
}

.journey-pet[data-prop="flower"] .pet-prop::after,
.journey-pet[data-prop="orchid"] .pet-prop::after,
.journey-pet[data-prop="chrysanthemum"] .pet-prop::after {
  position: absolute;
  left: -10px;
  top: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--pet-trim);
  box-shadow: 8px 2px 0 -2px #fff1c8;
  content: "";
}

.journey-pet[data-prop="qin"] .pet-prop,
.journey-pet[data-prop="scroll"] .pet-prop,
.journey-pet[data-prop="seal"] .pet-prop {
  border: 3px solid #372513;
  border-radius: 5px;
  background: #f1dfb8;
}

.journey-pet.walking .pet-sleeve-left { animation: petArmLeft .42s infinite alternate; }
.journey-pet.walking .pet-sleeve-right { animation: petArmRight .42s infinite alternate; }
.journey-pet.walking .pet-foot-left { animation: petFootLeft .42s infinite alternate; }
.journey-pet.walking .pet-foot-right { animation: petFootRight .42s infinite alternate; }
.journey-pet.walking .pet-head { animation: petBob .42s infinite alternate; }

@keyframes dongpoIdle {
  from { background-position: 0 0; }
  to { background-position: -576px 0; }
}

@keyframes dongpoRunRight {
  from { background-position: 0 -104px; }
  to { background-position: -768px -104px; }
}

@keyframes dongpoRunLeft {
  from { background-position: 0 -208px; }
  to { background-position: -768px -208px; }
}

@keyframes dongpoReview {
  from { background-position: 0 -832px; }
  to { background-position: -576px -832px; }
}

.pet-speech {
  position: absolute;
  left: 0;
  top: 0;
  width: min(310px, calc(100vw - 32px));
  padding: 10px 13px;
  border: 1px solid rgba(189, 154, 85, .48);
  border-radius: 10px;
  background: rgba(255, 250, 238, .94);
  box-shadow: 0 10px 26px rgba(69, 48, 20, .2);
  color: #6b351f;
  font: 700 17px/1.6 "Kaiti SC", "STKaiti", "KaiTi", serif;
  opacity: 0;
  transition: opacity .22s ease, transform .22s ease;
}

.pet-speech.show {
  opacity: 1;
}

@keyframes petArmLeft { to { transform: rotate(-18deg); } }
@keyframes petArmRight { to { transform: rotate(18deg); } }
@keyframes petFootLeft { to { transform: translateX(11px); } }
@keyframes petFootRight { to { transform: translateX(-11px); } }
@keyframes petBob { to { top: 5px; } }
@keyframes petPortraitWalk { to { transform: translateY(-3px) rotate(1deg); } }

.titlebar {
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 6;
  width: min(720px, calc(100vw - 32px));
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  color: var(--ink);
}

.titlebar-heading {
  display: inline-grid;
  grid-template-columns: 38px auto;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.brand-logo {
  display: block;
  width: 38px;
  height: 38px;
}

.titlebar h1 {
  margin: 4px 0;
  font: 700 34px/1.08 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 4px;
}

.titlebar p {
  margin: 0;
  font: 600 13px/1.6 "Kaiti SC", "STKaiti", "KaiTi", serif;
  color: var(--ink-soft);
  letter-spacing: 2px;
}

.home-button {
  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  z-index: 12;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 1px solid rgba(156, 47, 27, .38);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 250, 238, .98), rgba(239, 222, 184, .9) 54%, rgba(181, 138, 70, .74)),
    var(--paper-strong);
  box-shadow:
    0 16px 34px rgba(69, 48, 20, .28),
    inset 0 0 0 5px rgba(255, 247, 222, .42),
    inset 0 -8px 16px rgba(109, 69, 24, .16);
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease;
}

.home-button img {
  display: block;
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 2px rgba(45, 29, 11, .18));
}

  .home-button:hover,
  .home-button:focus-visible {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.05);
  outline: none;
}

.catalog-active .home-button {
  display: none;
}

.story-actions button,
.poem-open {
  border: 1px solid var(--gold-soft);
  background: linear-gradient(180deg, rgba(252, 246, 230, .94), rgba(238, 224, 193, .9));
  box-shadow: 0 3px 10px rgba(69, 48, 20, .18);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.story-actions button:hover,
.poem-open:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
}

.music-toggle,
.feedback-toggle,
.terrain-toggle {
  position: absolute;
  right: 0;
  z-index: 12;
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 1px solid rgba(156, 47, 27, .38);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 250, 238, .98), rgba(239, 222, 184, .9) 54%, rgba(181, 138, 70, .74)),
    var(--paper-strong);
  box-shadow:
    0 16px 34px rgba(69, 48, 20, .28),
    inset 0 0 0 5px rgba(255, 247, 222, .42),
    inset 0 -8px 16px rgba(109, 69, 24, .16);
  color: #7d3a24;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.music-toggle {
  bottom: 0;
}

.feedback-toggle {
  bottom: 80px;
}

.terrain-toggle {
  bottom: 160px;
  gap: 1px;
  color: #6a4f22;
}

.music-toggle img {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(45, 29, 11, .2));
  transform: rotate(-3deg);
  transition: transform .22s ease, filter .22s ease;
}

.feedback-toggle svg,
.terrain-toggle svg {
  display: block;
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 2px rgba(45, 29, 11, .18));
  transform: rotate(-2deg);
  transition: transform .22s ease, filter .22s ease;
}

.terrain-toggle svg {
  width: 36px;
  height: 32px;
  margin-top: 4px;
}

.terrain-toggle-text {
  margin-top: -7px;
  color: currentColor;
  font: 800 12px/1 "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

.music-toggle:hover,
.feedback-toggle:hover,
.terrain-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(156, 47, 27, .58);
  box-shadow:
    0 20px 38px rgba(69, 48, 20, .32),
    inset 0 0 0 5px rgba(255, 247, 222, .5),
    inset 0 -8px 16px rgba(109, 69, 24, .18);
}

.music-toggle:hover img,
.feedback-toggle:hover svg,
.terrain-toggle:hover svg {
  transform: rotate(0deg) scale(1.04);
}

.music-toggle.on,
.terrain-toggle.on {
  border-color: rgba(41, 108, 103, .72);
  background:
    radial-gradient(circle at 35% 28%, rgba(250, 255, 240, .98), rgba(226, 238, 211, .9) 58%, rgba(41, 108, 103, .6)),
    var(--paper-strong);
  color: #1f5f59;
  box-shadow:
    0 18px 42px rgba(41, 108, 103, .28),
    0 0 0 8px rgba(41, 108, 103, .12),
    inset 0 0 0 5px rgba(255, 247, 222, .4);
}

.terrain-toggle.on {
  color: #164f4a;
}

.music-toggle.on img {
  animation: musicIconPulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 3px 3px rgba(31, 95, 89, .28));
}

.music-toggle.on::after,
.terrain-toggle.on::after {
  position: absolute;
  right: 9px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2f7770;
  box-shadow: 0 0 0 5px rgba(47, 119, 112, .14);
  content: "";
}

@keyframes musicIconPulse {
  0%,
  100% { transform: rotate(-2deg) scale(1); }
  50% { transform: rotate(3deg) scale(1.06); }
}

.search {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9;
  width: var(--map-panel-width);
  max-width: calc(100vw - 40px);
  padding: 16px;
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  background: rgba(252, 246, 230, .92);
  box-shadow: 0 6px 18px rgba(69, 48, 20, .18);
  backdrop-filter: blur(12px);
}

.search label {
  display: block;
  margin: 0 0 6px 2px;
  color: var(--ink-soft);
  font: 700 15px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 1px;
}

.person-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.person-field select {
  width: 100%;
  height: 46px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--gold-soft);
  border-radius: 9px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #8d6d35 50%) calc(100% - 17px) 15px / 6px 6px no-repeat,
    linear-gradient(135deg, #8d6d35 50%, transparent 50%) calc(100% - 12px) 15px / 6px 6px no-repeat,
    rgba(255, 250, 238, .9);
  color: var(--ink);
  font: 700 18px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 1px;
  outline: none;
}

.person-field select:focus,
.search input:focus {
  border-color: var(--zhu);
}

.search-box {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 6px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.search input {
  min-width: 0;
  height: 44px;
  padding: 0 11px;
  border: 1px solid var(--gold-soft);
  border-radius: 9px;
  background: rgba(255, 250, 238, .86);
  color: var(--ink);
  font-size: 16px;
  outline: none;
}

.search button {
  border: 1px solid var(--gold-soft);
  border-radius: 9px;
  background: rgba(245, 235, 210, .95);
  color: var(--ink-soft);
  cursor: pointer;
}

.quick-actions button {
  height: 42px;
  font-size: 15px;
}

.catalog-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: center;
  overflow: auto;
  padding: 34px;
  background: rgba(40, 52, 35, .32);
}

.catalog-overlay[hidden],
.collection-panel[hidden],
.collection-cards[hidden] {
  display: none;
}

.catalog-active .titlebar,
.catalog-active .search,
.catalog-active .story,
.catalog-active .timeline,
.catalog-active #petLayer {
  display: none;
}

.catalog-shell {
  width: min(1060px, 100%);
  margin: auto;
}

.catalog-head,
.collection-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.catalog-head {
  margin-bottom: 20px;
  color: #fffaf0;
  text-shadow: 0 2px 14px rgba(43, 35, 17, .35);
}

.catalog-head p,
.collection-panel-head p {
  margin: 0 0 5px;
  color: inherit;
  font: 700 13px/1.2 Georgia, serif;
  letter-spacing: 1px;
}

.catalog-head h1,
.collection-panel-head h2 {
  margin: 0;
  font: 700 32px/1.15 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 0;
}

.catalog-head span {
  display: block;
  margin-top: 7px;
  font-size: 14px;
}

.collection-cards,
.collection-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.collection-cards button,
.collection-items button {
  min-height: 126px;
  padding: 17px;
  border: 1px solid rgba(189, 154, 85, .52);
  border-radius: 7px;
  background: rgba(255, 250, 238, .94);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(49, 41, 21, .14);
}

.collection-cards button:hover,
.collection-cards button:focus-visible,
.collection-items button:hover,
.collection-items button:focus-visible {
  border-color: var(--zhu);
  background: #fffdf7;
  outline: none;
}

.collection-cards b,
.collection-items b,
.collection-cards span,
.collection-items span,
.collection-cards small,
.collection-items small {
  display: block;
}

.collection-cards b,
.collection-items b {
  font: 700 20px/1.2 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.collection-cards span,
.collection-items span {
  margin-top: 9px;
  color: var(--zhu);
  font: 700 13px/1.2 Georgia, serif;
}

.collection-cards small,
.collection-items small {
  margin-top: 7px;
  color: #765d33;
  font-size: 13px;
  line-height: 1.5;
}

.collection-panel {
  color: #fffaf0;
}

.collection-panel-head {
  margin-bottom: 18px;
}

.collection-panel-head button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 250, 238, .72);
  border-radius: 6px;
  background: rgba(255, 250, 238, .16);
  color: #fffaf0;
  cursor: pointer;
}

.discover-panel {
  position: absolute;
  top: 166px;
  left: 20px;
  z-index: 10;
  width: 360px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--gold-soft);
  border-radius: 14px;
  background: rgba(252, 246, 230, .96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.discover-panel[hidden] {
  display: none;
}

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

.discover-head strong {
  display: block;
  font: 700 22px/1.1 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 2px;
}

.discover-head span,
.discover-panel label {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.discover-head button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--gold-soft);
  border-radius: 50%;
  background: rgba(255, 250, 238, .76);
  cursor: pointer;
}

.discover-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

.discover-tabs button,
.discover-filters select,
.discover-panel input {
  height: 36px;
  border: 1px solid var(--gold-soft);
  border-radius: 9px;
  background: rgba(255, 250, 238, .88);
  color: var(--ink);
  outline: none;
}

.discover-tabs button {
  cursor: pointer;
  font: 700 13px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.discover-tabs button.on {
  border-color: rgba(156, 47, 27, .48);
  background: rgba(156, 47, 27, .09);
  color: var(--zhu);
}

.discover-panel label {
  display: block;
  margin: 0 0 6px 2px;
  font-weight: 700;
}

.discover-panel input {
  width: 100%;
  padding: 0 11px;
  font-size: 15px;
}

.discover-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 9px 0 12px;
}

.discover-filters select {
  min-width: 0;
  padding: 0 10px;
  font-size: 13px;
}

.discover-results {
  display: grid;
  gap: 7px;
}

.discover-results button,
.discover-results .empty {
  width: 100%;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(189, 154, 85, .28);
  border-radius: 10px;
  background: rgba(255, 252, 244, .72);
  text-align: left;
}

.discover-results button {
  cursor: pointer;
}

.discover-results button:hover {
  border-color: var(--zhu);
}

.discover-results b {
  display: block;
  font: 700 16px/1.2 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.discover-results span,
.discover-results small,
.discover-results .empty {
  display: block;
  margin-top: 3px;
  color: #765d33;
  font-size: 12px;
  line-height: 1.45;
}

.subject-facts {
  display: grid;
  grid-template-columns: minmax(76px, auto) 1fr;
  gap: 6px 12px;
  margin: 14px 0 0;
  padding: 12px 0;
  border-top: 1px dashed rgba(189, 154, 85, .5);
  border-bottom: 1px dashed rgba(189, 154, 85, .5);
}

.subject-facts dt {
  color: var(--ink-soft);
  font: 700 13px/1.5 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.subject-facts dd {
  margin: 0;
  color: #5e4725;
  font-size: 14px;
  line-height: 1.55;
}

.subject-nodes {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.subject-nodes button {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(189, 154, 85, .32);
  border-radius: 7px;
  background: rgba(255, 252, 244, .68);
  text-align: left;
  cursor: pointer;
}

.subject-nodes button:hover,
.subject-nodes button:focus-visible {
  border-color: var(--zhu);
}

.subject-nodes b,
.subject-nodes span {
  display: block;
}

.subject-nodes b {
  color: var(--ink);
  font: 700 15px/1.25 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.subject-nodes span,
.subject-accuracy {
  margin-top: 3px;
  color: #765d33;
  font-size: 12px;
  line-height: 1.5;
}

.subject-accuracy {
  margin-bottom: 0;
}

.station-learning {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(189, 154, 85, .5);
}

.station-learning[hidden] {
  display: none;
}

.station-learning-figure {
  min-width: 0;
  margin: 0;
}

.station-learning-media {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(189, 154, 85, .58);
  border-radius: 7px;
  background: rgba(110, 84, 39, .12);
  cursor: zoom-in;
}

.station-learning-media:focus-visible {
  outline: 3px solid rgba(41, 108, 103, .48);
  outline-offset: 2px;
}

.station-learning-media:disabled {
  cursor: default;
}

.station-learning-media img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 5px;
  object-fit: contain;
}

.station-image-caption,
.station-map-placement,
.station-video-links,
.station-sources li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.station-image-caption {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  color: #765d33;
  font-size: 12px;
  line-height: 1.5;
}

.station-image-caption a,
.station-video-links a,
.station-sources a {
  color: #1f6660;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.station-map-placement {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-left: 3px solid #296c67;
  background: rgba(41, 108, 103, .08);
}

.station-map-placement strong {
  color: #285852;
  font: 700 14px/1.35 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.station-map-placement p,
.station-sources p {
  margin: 0;
  color: #765d33;
  font-size: 12px;
  line-height: 1.5;
}

.station-video-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.station-video-links a {
  padding: 5px 8px;
  border: 1px solid rgba(41, 108, 103, .3);
  border-radius: 6px;
  background: rgba(41, 108, 103, .06);
  font-size: 13px;
}

.station-sources h2 {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font: 700 14px/1.3 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.station-sources ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.station-sources li {
  color: #5e4725;
  font-size: 13px;
  line-height: 1.45;
}

.search.loading select,
.search.loading input,
.search.loading button {
  opacity: .58;
}

.subject-active .search {
  display: none;
}

.subject-active .story {
  top: 20px;
  bottom: auto;
  max-height: calc(100vh - 40px);
  overflow: hidden;
}

.search-results {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  max-height: 240px;
  overflow: auto;
}

.search-results[hidden] {
  display: none;
}

.search-results button,
.search-results p {
  margin: 0;
  padding: 8px 9px;
  border: 1px solid rgba(189, 154, 85, .25);
  border-radius: 8px;
  background: rgba(255, 252, 244, .72);
  text-align: left;
}

.search-results button:hover {
  border-color: var(--zhu);
}

.search-results b {
  display: block;
  color: var(--ink);
  font: 700 14px/1.2 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.search-results span,
.search-results p {
  color: #765d33;
  font-size: 12px;
  line-height: 1.5;
}

.story {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 8;
  width: var(--map-panel-width);
  max-width: calc(100vw - 48px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  background: rgba(252, 246, 230, .94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transition: opacity .28s ease, transform .28s ease;
}

.story.intro-pending {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

@media (min-width: 901px) {
  body:not(.subject-active) .story {
    top: 272px;
    bottom: 0;
    max-height: calc(100vh - 296px);
    overflow: hidden;
  }
  .subject-active .story {
    top: 50%;
    bottom: auto;
    max-height: calc(100vh - 80px);
    transform: translateY(-50%);
  }
  .home-button {
    right: 232px;
    bottom: 0;
    left: auto;
  }
  .music-toggle {
    right: 0;
    bottom: 0;
  }
  .feedback-toggle {
    right: 72px;
    bottom: 0;
  }
  .terrain-toggle {
    right: 152px;
    bottom: 0;
  }
  .timeline {
    max-height: calc(100vh - 252px);
  }
}

.story-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 24px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 101, 54, .62) transparent;
}

.story-scroll::-webkit-scrollbar {
  width: 8px;
}

.story-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.story-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(125, 101, 54, .58);
  background-clip: padding-box;
}

.story-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(125, 58, 36, .72);
}

.story-footer {
  padding: 10px 24px 16px;
  border-top: 1px solid rgba(189, 154, 85, .38);
  background: rgba(252, 246, 230, .97);
}

.story-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.story-head span {
  color: var(--zhu);
  font: 700 15px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 1px;
}

.story-head strong {
  font: 700 28px/1.2 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 2px;
}

.story p {
  margin: 0;
  color: #5e4725;
  font-size: 16px;
  line-height: 1.75;
}

.works {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.works span {
  padding: 3px 8px;
  border: 1px solid rgba(156, 47, 27, .22);
  border-radius: 999px;
  background: rgba(156, 47, 27, .07);
  color: #7d3a24;
  font: 700 13px/1.4 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.story blockquote {
  margin: 12px 0 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--zhu);
  background: rgba(156, 47, 27, .07);
  color: #6b351f;
  font: 700 19px/1.7 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.poem-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin: 0 0 13px;
  padding: 0 14px;
  border-radius: 999px;
  color: #7d3a24;
  font: 700 15px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 1px;
}

.poem-open[hidden] {
  display: none;
}

.progress {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.progress span {
  color: var(--ink-soft);
  font: 700 13px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 1px;
}

.progress i {
  display: block;
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(189, 154, 85, .42);
  border-radius: 999px;
  background: rgba(216, 194, 149, .34);
}

.progress b {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #296c67, #9c2f1b);
  transform: scaleX(.1);
  transform-origin: left center;
  transition: transform .28s ease;
}

.story-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.story-actions button {
  height: 44px;
  border-radius: 9px;
  font-size: 16px;
}

.progress[hidden],
.story-actions[hidden],
.timeline[hidden],
.story blockquote[hidden] {
  display: none;
}

.timeline {
  position: absolute;
  right: 0;
  top: 116px;
  z-index: 8;
  width: var(--map-panel-width);
  max-height: calc(100vh - 172px);
  margin: 0;
  padding: 16px;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  background: rgba(252, 246, 230, .9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.timeline li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px dashed rgba(189, 154, 85, .5);
  cursor: pointer;
}

.timeline li[hidden] {
  display: none;
}

.timeline li:last-child { border-bottom: 0; }

.timeline li:hover,
.timeline li.on {
  color: var(--zhu);
}

.timeline time {
  color: var(--ink-soft);
  font: 700 14px/1.35 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.timeline b {
  display: block;
  font: 700 19px/1.2 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.timeline span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #765d33;
  font-size: 14px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journey-marker {
  position: absolute;
  width: 58px;
  height: 118px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.journey-marker .flag {
  position: absolute;
  left: 50%;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 70px;
  padding: 7px 4px;
  border-radius: 3px;
  background: #8f2e1b;
  color: #f9ead4;
  box-shadow: 1px 3px 8px rgba(64, 42, 18, .35);
  transform: translateX(-50%);
  transform-origin: bottom center;
  transition: transform .2s ease, opacity .2s ease;
}

.journey-marker .seal {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 244, 220, .85);
  border-radius: 50%;
  background: rgba(255, 249, 235, .16);
  font: 700 12px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.journey-marker .name {
  writing-mode: vertical-rl;
  letter-spacing: 3px;
  font: 700 16px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.journey-marker .pole {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 2px;
  height: 18px;
  margin-left: -1px;
  background: #8f2e1b;
}

.journey-marker .dot {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 250, 235, .92);
  border-radius: 50%;
  background: #c84826;
  box-shadow: 0 1px 5px rgba(69, 48, 20, .4);
  transform: translateX(-50%);
}

.journey-marker:hover .flag,
.journey-marker.active .flag {
  transform: translateX(-50%) scale(1.08) rotate(1.5deg);
}

.journey-marker.active {
  z-index: 50;
}

.journey-marker.active .flag {
  outline: 2px solid var(--zhu);
  outline-offset: 3px;
}

.journey-marker.dim {
  opacity: .18;
  pointer-events: none;
}

.poem-modal[hidden] {
  display: none;
}

.poem-modal {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 24px;
}

.poem-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(ellipse at center, rgba(42, 31, 17, .12), rgba(42, 31, 17, .48)),
    rgba(236, 226, 200, .34);
  cursor: pointer;
  backdrop-filter: blur(3px);
}

.poem-sheet {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 56px));
  overflow: auto;
  padding: 30px 34px 34px;
  border: 1px solid rgba(156, 47, 27, .28);
  border-radius: 14px;
  background:
    linear-gradient(180deg, #fffaf0, #f1e4c7),
    var(--paper-strong);
  box-shadow: 0 24px 70px rgba(38, 25, 10, .42);
}

.poem-sheet::before,
.poem-sheet::after {
  position: absolute;
  top: 20px;
  width: 58px;
  height: 1px;
  background: linear-gradient(90deg, rgba(156, 47, 27, .48), rgba(156, 47, 27, .12));
  content: "";
}

.poem-sheet::before { left: 28px; }
.poem-sheet::after {
  right: 82px;
  width: 42px;
  transform: scaleX(-1);
  transform-origin: center;
}

.poem-close {
  position: absolute;
  top: 13px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(156, 47, 27, .22);
  border-radius: 50%;
  background: rgba(255, 250, 238, .75);
  color: #7d3a24;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.poem-close:hover {
  border-color: var(--zhu);
  background: rgba(156, 47, 27, .08);
}

.poem-author {
  margin: 0 0 8px;
  color: var(--zhu);
  text-align: center;
  font: 700 13px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 3px;
}

.poem-sheet h2 {
  margin: 0 42px 18px;
  text-align: center;
  font: 700 28px/1.2 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 4px;
}

.poem-body {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 18px 24px;
  padding: 16px 0 0;
  border-top: 1px dashed rgba(189, 154, 85, .48);
}

.poem-section {
  min-width: 0;
}

.poem-section h3 {
  margin: 0 0 8px;
  color: var(--zhu);
  font: 700 17px/1.2 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 2px;
}

.poem-section p {
  margin: 0;
  color: #57391d;
  text-align: left;
  font: 700 17px/1.9 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 1px;
}

.poem-section p + p {
  margin-top: 8px;
}

.poem-media {
  grid-row: span 4;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(189, 154, 85, .35);
  border-radius: 10px;
  background: rgba(255, 252, 244, .56);
}

.poem-media-preview {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(189, 154, 85, .24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(67, 47, 22, .06), rgba(255, 250, 238, .72)),
    rgba(255, 250, 238, .8);
  cursor: zoom-in;
}

.poem-media-preview:focus-visible {
  outline: 2px solid var(--zhu);
  outline-offset: 3px;
}

.poem-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 430px;
  object-fit: contain;
  border-radius: 7px;
}

.poem-media figcaption,
.poem-media a {
  display: block;
  margin-top: 8px;
  color: #765d33;
  font-size: 13px;
  line-height: 1.55;
}

.poem-media a,
.poem-links a {
  color: #7d3a24;
  font-weight: 700;
  text-decoration: none;
}

.poem-media.image-missing {
  min-height: 150px;
}

.image-zoom[hidden] {
  display: none;
}

.image-zoom {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-zoom-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(32, 22, 10, .72);
  cursor: zoom-out;
  backdrop-filter: blur(5px);
}

.image-zoom-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(920px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(246, 226, 184, .44);
  border-radius: 12px;
  background: rgba(35, 25, 13, .62);
  box-shadow: 0 26px 80px rgba(20, 13, 5, .58);
}

.image-zoom-sheet img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 250, 238, .88);
}

.image-zoom-sheet figcaption {
  margin: 0;
  color: #f7ead0;
  font-size: 14px;
  line-height: 1.65;
}

.image-zoom-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(246, 226, 184, .5);
  border-radius: 50%;
  background: #fff7e6;
  color: #7d3a24;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.feedback-modal[hidden] {
  display: none;
}

.feedback-modal {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  padding: 24px;
}

.feedback-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(ellipse at center, rgba(42, 31, 17, .08), rgba(42, 31, 17, .42)),
    rgba(236, 226, 200, .28);
  cursor: pointer;
  backdrop-filter: blur(3px);
}

.feedback-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(430px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(156, 47, 27, .28);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 250, 238, .98), rgba(240, 225, 195, .98)),
    var(--paper-strong);
  box-shadow: 0 24px 70px rgba(38, 25, 10, .38);
}

.feedback-kicker {
  margin: 0;
  color: var(--zhu);
  font: 700 13px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 3px;
}

.feedback-sheet h2 {
  margin: 0 42px 4px 0;
  font: 700 26px/1.2 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 2px;
}

.feedback-sheet label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font: 700 14px/1.2 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.feedback-sheet label span {
  font-size: 12px;
  font-weight: 400;
}

.feedback-sheet input,
.feedback-sheet select,
.feedback-sheet textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(189, 154, 85, .45);
  border-radius: 8px;
  background: rgba(255, 252, 244, .82);
  color: var(--ink);
  font: 15px/1.55 "PingFang SC", "Microsoft YaHei", sans-serif;
  outline: none;
}

.feedback-sheet input,
.feedback-sheet select {
  height: 40px;
  padding: 0 10px;
}

.feedback-sheet textarea {
  resize: vertical;
  min-height: 116px;
  padding: 10px;
}

.feedback-sheet input:focus,
.feedback-sheet select:focus,
.feedback-sheet textarea:focus {
  border-color: rgba(156, 47, 27, .55);
  box-shadow: 0 0 0 3px rgba(156, 47, 27, .08);
}

.feedback-close {
  position: absolute;
  top: 13px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(156, 47, 27, .22);
  border-radius: 50%;
  background: rgba(255, 250, 238, .75);
  color: #7d3a24;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.feedback-submit {
  height: 42px;
  border: 1px solid rgba(156, 47, 27, .38);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(252, 246, 230, .98), rgba(226, 204, 162, .94));
  color: #7d3a24;
  font: 700 15px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
  cursor: pointer;
}

.feedback-submit:disabled {
  opacity: .58;
  cursor: progress;
}

.feedback-status {
  min-height: 20px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.feedback-status[data-state="success"] {
  color: #296c67;
}

.feedback-status[data-state="error"] {
  color: var(--zhu);
}

.poem-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.poem-links a {
  padding: 7px 11px;
  border: 1px solid rgba(156, 47, 27, .22);
  border-radius: 999px;
  background: rgba(156, 47, 27, .07);
  font-size: 13px;
}

.loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #ece2c8;
  transition: opacity .32s ease;
}

.loader div {
  display: grid;
  gap: 8px;
  min-width: 260px;
  padding: 22px 26px;
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  background: rgba(252, 246, 230, .92);
  box-shadow: var(--shadow);
  text-align: center;
}

.loader strong {
  position: relative;
  display: block;
  max-width: 300px;
  overflow: hidden;
  margin: 0 auto;
  font: 700 22px/1 "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.loader strong::before,
.loader strong::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 34px;
  pointer-events: none;
}

.loader strong::before {
  left: 0;
  background: linear-gradient(90deg, rgba(252, 246, 230, .98), rgba(252, 246, 230, 0));
}

.loader strong::after {
  right: 0;
  background: linear-gradient(270deg, rgba(252, 246, 230, .98), rgba(252, 246, 230, 0));
}

.loader-marquee {
  display: inline-block;
  min-width: 100%;
  padding-inline: 44px;
  white-space: nowrap;
  color: var(--ink);
  animation: loaderMarquee 2.8s linear infinite;
}

@keyframes loaderMarquee {
  from { transform: translateX(36%); }
  to { transform: translateX(-36%); }
}

.loader span {
  color: var(--ink-soft);
  font-size: 13px;
}

.loader .visitor-count {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed rgba(189, 154, 85, .42);
  color: #7d3a24;
  font: 700 14px/1.2 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 1px;
}

.loader.hide {
  opacity: 0;
  pointer-events: none;
}

.maplibregl-ctrl-top-right {
  top: 0;
  right: 0;
}

@media (max-width: 900px) {
  .titlebar h1 { font-size: 28px; }
  .home-button {
    bottom: 240px;
  }
  .search {
    top: 68px;
    left: 0;
    width: calc(100vw - 72px);
    max-width: none;
  }
  .discover-panel {
    top: 190px;
    left: 12px;
    width: calc(100vw - 24px);
    max-width: none;
    max-height: 42vh;
  }
  .timeline {
    right: 0;
    top: auto;
    bottom: 132px;
    width: calc(100vw - 24px);
    max-height: 128px;
    display: none;
  }
  .story {
    left: 0;
    top: 402px;
    bottom: 0;
    width: calc(100vw - 72px);
    max-height: calc(100vh - 402px);
    grid-template-rows: minmax(0, auto) auto;
    align-content: start;
    overflow: hidden;
  }
  .story-scroll {
    max-height: calc(100vh - 520px);
  }
}

@media (max-width: 640px) {
  .catalog-overlay {
    align-items: start;
    padding: 18px 14px;
  }
  .catalog-head,
  .collection-panel-head {
    align-items: flex-start;
  }
  .catalog-head h1,
  .collection-panel-head h2 {
    font-size: 27px;
  }
  .collection-cards,
  .collection-items {
    grid-template-columns: 1fr;
  }
  .collection-cards button,
  .collection-items button {
    min-height: 104px;
  }
  .titlebar {
    top: 16px;
    width: calc(100vw - 92px);
  }
  .titlebar h1 { font-size: 24px; }
  .titlebar p { font-size: 11px; }
  .titlebar-heading {
    grid-template-columns: 30px auto;
    gap: 7px;
  }
  .brand-logo {
    width: 30px;
    height: 30px;
  }
  .search {
    top: 64px;
    width: calc(100vw - 70px);
  }
  .discover-panel {
    top: 186px;
  }
  .story {
    top: auto;
    bottom: 0;
    width: calc(100vw - 70px);
    max-height: 300px;
    overflow: hidden;
    padding: 0;
  }
  .story-scroll {
    max-height: 198px;
  }
  .subject-active .story {
    top: 86px;
    bottom: auto;
    max-height: calc(100vh - 198px);
  }
  .station-learning {
    gap: 10px;
    margin-top: 11px;
    padding-top: 11px;
  }
  .story-scroll {
    padding: 13px 14px 10px;
  }
  .story-footer {
    padding: 9px 14px 13px;
  }
  .timeline {
    bottom: 92px;
    max-height: 132px;
  }
  .music-toggle,
  .feedback-toggle,
  .terrain-toggle {
    right: 0;
    width: 58px;
    height: 58px;
  }
  .music-toggle {
    bottom: 0;
  }
  .feedback-toggle {
    bottom: 70px;
  }
  .terrain-toggle {
    bottom: 140px;
  }
  .home-button {
    bottom: 210px;
    width: 58px;
    height: 58px;
  }
  .home-button img {
    width: 30px;
    height: 30px;
  }
  .music-toggle img,
  .feedback-toggle svg {
    width: 38px;
    height: 38px;
  }
  .terrain-toggle svg {
    width: 32px;
    height: 28px;
  }
  .terrain-toggle-text {
    margin-top: -6px;
    font-size: 11px;
  }
  .feedback-sheet {
    padding: 20px;
  }
  .story blockquote {
    margin: 9px 0 11px;
  }
  .poem-sheet {
    padding: 26px 20px 28px;
  }
  .poem-sheet h2 {
    margin-inline: 36px;
    font-size: 24px;
  }
  .poem-body {
    grid-template-columns: 1fr;
  }
  .poem-media {
    grid-row: auto;
  }
  .poem-section p {
    font-size: 16px;
    line-height: 1.85;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
