:root {
  --ink: #432822;
  --ink-soft: #76564d;
  --paper: #fffaf2;
  --paper-strong: #fffdf8;
  --cream: #fff0d5;
  --blush: #ffdce2;
  --peach: #ffcfa9;
  --mint: #d9f2de;
  --sky: #d8efff;
  --butter: #ffe9a9;
  --rose: #ff8fa3;
  --berry: #b8515f;
  --cocoa: #7b4b3f;
  --ring: rgba(184, 81, 95, 0.34);
  --shadow-soft: 0 18px 46px rgba(87, 55, 43, 0.12), 0 2px 0 rgba(255, 255, 255, 0.72) inset;
  --shadow-float: 0 28px 90px rgba(87, 55, 43, 0.2), 0 2px 0 rgba(255, 255, 255, 0.72) inset;
  --radius-sm: 8px;
  --radius-md: 18px;
  --radius-lg: 28px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button {
  font: inherit;
}

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

.app-shell {
  position: relative;
  min-height: 100dvh;
  padding: 24px 20px 28px;
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 220, 226, 0.92), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(216, 239, 255, 0.98), transparent 28%),
    radial-gradient(circle at 78% 86%, rgba(255, 233, 169, 0.82), transparent 28%),
    radial-gradient(circle at 20% 92%, rgba(217, 242, 222, 0.92), transparent 30%),
    linear-gradient(135deg, #fff6ea 0%, #fffaf4 44%, #f0fbf5 100%);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(123, 75, 63, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 75, 63, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 84%);
}

.hero-panel,
.world-map,
.scene-card {
  position: relative;
  border: 1px solid rgba(123, 75, 63, 0.16);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 242, 0.96)),
    var(--paper-strong);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 26px;
  align-items: center;
  overflow: hidden;
}

.hero-cover {
  min-height: 300px;
  border-color: rgba(184, 81, 95, 0.2);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(115deg, rgba(255, 253, 248, 0.96), rgba(255, 244, 231, 0.88) 46%, rgba(238, 250, 246, 0.92)),
    var(--paper-strong);
}

.hero-cover::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(184, 81, 95, 0.2);
  border-radius: 22px;
  pointer-events: none;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: 34px;
  top: 24px;
  width: 116px;
  height: 54px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 22% 50%, #ff9fae 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, #ffd67a 0 18%, transparent 19%),
    radial-gradient(circle at 78% 50%, #9bded1 0 18%, transparent 19%);
  opacity: 0.72;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 6px;
  color: var(--berry);
  font-size: 0.82rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.55rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.65;
}

.cover-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.cover-tags span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid rgba(184, 81, 95, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #7b3440;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(87, 55, 43, 0.08);
}

.cover-photo-stack {
  position: relative;
  z-index: 1;
  min-height: 250px;
}

.cover-photo-main,
.cover-photo-small {
  position: absolute;
  overflow: hidden;
  border: 8px solid #fffdf8;
  background: #fff8ec;
  box-shadow: 0 18px 48px rgba(87, 55, 43, 0.2);
}

.cover-photo-main {
  inset: 0 42px 16px 16px;
  border-radius: 24px;
  transform: rotate(-2deg);
}

.cover-photo-small {
  width: 42%;
  aspect-ratio: 1;
  border-radius: 20px;
}

.cover-photo-park {
  right: 0;
  top: 26px;
  transform: rotate(4deg);
}

.cover-photo-play {
  right: 36px;
  bottom: 0;
  transform: rotate(2deg);
}

.cover-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.world-layout {
  width: min(1180px, 100%);
  margin: 22px auto 0;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.world-map {
  padding: 18px;
  position: sticky;
  top: 18px;
}

.world-map h2,
.scene-header h2,
.album-header h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.map-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.map-button {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 242, 0.9)),
    var(--scene-color);
  border: 1px solid rgba(123, 75, 63, 0.16);
  border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.map-button:hover,
.map-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(184, 81, 95, 0.42);
  box-shadow: 0 12px 28px rgba(87, 55, 43, 0.13);
}

.map-button:active {
  transform: translateY(0) scale(0.99);
}

.map-button[aria-pressed="true"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.28)),
    var(--scene-color);
  border-color: rgba(184, 81, 95, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 14px 32px rgba(87, 55, 43, 0.15);
}

.map-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--scene-color);
  border: 2px solid rgba(123, 75, 63, 0.55);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.68);
}

.map-button strong,
.map-button small {
  display: block;
}

.map-button strong {
  font-size: 0.98rem;
}

.map-button small {
  margin-top: 4px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.scene-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.scene-header {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(123, 75, 63, 0.12);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.78), rgba(255, 250, 242, 0.48));
}

.scene-header p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.mood-pill {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff2f4;
  border: 1px solid rgba(184, 81, 95, 0.2);
  color: #7b3440;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(87, 55, 43, 0.08);
}

.photo-stage {
  position: relative;
  min-height: 590px;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 220, 226, 0.54), transparent 22%),
    radial-gradient(circle at 86% 78%, rgba(216, 239, 255, 0.56), transparent 24%),
    linear-gradient(90deg, rgba(255, 220, 226, 0.2) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 220, 226, 0.2) 1px, transparent 1px),
    linear-gradient(135deg, #fff4e7, #eef8f5);
  background-size: auto, auto, 30px 30px, 30px 30px, auto;
}

.photo-stage::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(123, 75, 63, 0.18);
  pointer-events: none;
}

.scene-photo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: min(74vh, 760px);
  object-fit: contain;
  border: 12px solid rgba(255, 253, 248, 0.96);
  border-radius: 26px;
  background: #fff8ec;
  box-shadow: 0 30px 76px rgba(87, 55, 43, 0.22), 0 2px 0 rgba(255, 255, 255, 0.84) inset;
  animation: photo-in 260ms ease both;
}

.hotspot-layer {
  position: absolute;
  inset: 18px;
  z-index: 4;
}

.hotspot-button {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}

.hotspot-button span {
  max-width: min(180px, 92%);
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(184, 81, 95, 0.2);
  box-shadow: 0 12px 30px rgba(87, 55, 43, 0.16), 0 0 0 4px rgba(255, 255, 255, 0.34);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.hotspot-button:hover span,
.hotspot-button:focus-visible span {
  transform: translateY(-2px) scale(1.03);
  background: #fff;
  box-shadow: 0 16px 34px rgba(87, 55, 43, 0.2);
}

.hotspot-button:active span {
  transform: scale(0.97);
}

.hotspot-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.interaction-toast {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 8;
  display: grid;
  gap: 4px;
  min-width: 220px;
  max-width: min(420px, calc(100% - 44px));
  padding: 14px 16px;
  border: 1px solid rgba(123, 75, 63, 0.18);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 18px 48px rgba(87, 55, 43, 0.18);
  transform: translateX(-50%);
  animation: toast-pop 240ms ease both;
}

.interaction-toast strong {
  font-size: 1rem;
}

.interaction-toast span {
  color: var(--ink-soft);
  line-height: 1.45;
}

.effect-hearts::before,
.effect-sparkles::before,
.effect-petals::before,
.effect-sleep::before,
.effect-bounce::before {
  position: absolute;
  left: 14px;
  top: -18px;
  color: var(--berry);
  font-size: 1.25rem;
  font-weight: 900;
}

.effect-hearts::before {
  content: "love";
}

.effect-sparkles::before {
  content: "shine";
  color: #b27728;
}

.effect-petals::before {
  content: "soft";
  color: #9b7146;
}

.effect-sleep::before {
  content: "zz";
  color: #637ca3;
}

.effect-bounce::before {
  content: "pop";
  color: #a24c5b;
}

.album-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 220, 226, 0.2), transparent 28%),
    rgba(67, 40, 34, 0.46);
  backdrop-filter: blur(10px);
}

.album-dialog {
  width: min(720px, 100%);
  max-height: min(780px, calc(100dvh - 36px));
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(123, 75, 63, 0.2);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 237, 0.98)),
    var(--paper-strong);
  box-shadow: var(--shadow-float);
  animation: album-in 240ms ease both;
}

.album-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(184, 81, 95, 0.22);
  border-radius: 999px;
  background: #fff2f4;
  color: #7b3440;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  transition: transform 180ms ease, background 180ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  transform: scale(1.04);
  background: #ffe2e8;
}

.album-photo-frame {
  position: relative;
  overflow: hidden;
  border: 12px solid #fffdf8;
  border-radius: 24px;
  background: #fff8ec;
  box-shadow: 0 20px 48px rgba(87, 55, 43, 0.16);
}

.album-image {
  display: block;
  width: 100%;
  max-height: 610px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: #fff8ec;
}

.album-caption-overlay {
  position: absolute;
  z-index: 2;
  max-width: min(88%, 440px);
  margin: 0;
  padding: 11px 16px;
  border: 1px solid rgba(255, 253, 248, 0.78);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(123, 75, 63, 0.68), rgba(67, 40, 34, 0.66));
  box-shadow: 0 14px 32px rgba(67, 40, 34, 0.24), 0 0 0 5px rgba(255, 255, 255, 0.2);
  color: #fffdf8;
  font-size: clamp(1rem, 3.2vw, 1.35rem);
  font-weight: 850;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 2px 8px rgba(67, 40, 34, 0.34);
  animation: album-caption-in 220ms ease both;
}

.album-caption-overlay-top {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.album-caption-overlay-bottom-left {
  left: clamp(78px, 15vw, 132px);
  bottom: 16px;
  max-width: calc(100% - clamp(134px, 28vw, 236px));
  text-align: left;
}

.asset-fallback {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 180px;
  padding: 18px;
  border: 2px dashed rgba(184, 81, 95, 0.28);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  text-align: center;
}

.asset-fallback span {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

@keyframes photo-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes album-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes album-caption-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 10px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .hero-panel::after {
    display: none;
  }

  .cover-photo-stack {
    min-height: 230px;
  }

  .world-layout {
    margin-top: 12px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .world-map {
    padding: 12px;
    position: relative;
    top: auto;
  }

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

  .scene-header {
    display: grid;
  }

  .photo-stage {
    min-height: 420px;
    padding: 12px;
  }

  .scene-photo {
    height: min(66vh, 620px);
    border-width: 7px;
  }

  .hotspot-layer {
    inset: 12px;
  }

  .album-caption-overlay-bottom-left {
    left: clamp(58px, 16vw, 92px);
    max-width: calc(100% - clamp(98px, 28vw, 154px));
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 8px;
  }

  h1 {
    font-size: 2rem;
  }

  .intro {
    font-size: 0.95rem;
    margin-top: 8px;
  }

  .hero-panel {
    border-radius: 16px;
  }

  .cover-tags {
    margin-top: 14px;
  }

  .cover-photo-stack {
    min-height: 190px;
  }

  .cover-photo-main {
    inset: 0 28px 12px 8px;
    border-width: 6px;
  }

  .cover-photo-small {
    border-width: 6px;
  }

  .world-map,
  .scene-card {
    border-radius: 16px;
  }

  .map-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .map-button {
    min-height: 60px;
    padding: 10px;
  }

  .photo-stage {
    min-height: 340px;
    padding: 8px;
  }

  .scene-photo {
    height: min(54vh, 480px);
    border-width: 6px;
    border-radius: 18px;
  }

  .hotspot-layer {
    inset: 8px;
  }

  .hotspot-button {
    min-width: 56px;
    min-height: 56px;
  }

  .hotspot-button span {
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .interaction-toast {
    bottom: 16px;
    min-width: 0;
  }

  .album-dialog {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 12px;
  }

  .album-header {
    margin-bottom: 10px;
  }

  .album-image {
    max-height: calc(100dvh - 138px);
  }

  .album-photo-frame {
    border-width: 7px;
    border-radius: 18px;
  }

  .album-caption-overlay {
    padding: 9px 12px;
    font-size: 0.95rem;
  }

  .album-caption-overlay-bottom-left {
    left: clamp(50px, 18vw, 76px);
    bottom: 12px;
    max-width: calc(100% - clamp(86px, 32vw, 126px));
  }
}

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