:root {
  --bg-top: #fff1d9;
  --bg-bottom: #ffd3bf;
  --paper: rgba(255, 250, 241, 0.86);
  --paper-strong: rgba(255, 251, 245, 0.96);
  --ink: #2b1b13;
  --muted: #7c645b;
  --line: rgba(63, 32, 18, 0.08);
  --orange: #ff8d5a;
  --coral: #ff6e64;
  --sky: #62b4ff;
  --mint: #66c8a6;
  --yellow: #f6c55e;
  --shadow: 0 18px 54px rgba(132, 74, 35, 0.14);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --safe-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 255, 255, 0.72), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(255, 171, 96, 0.32), transparent 26%),
    radial-gradient(circle at 86% 78%, rgba(98, 180, 255, 0.24), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
}

.page-shell {
  min-height: 100vh;
  padding: 18px 16px var(--safe-bottom);
}

.app-frame {
  width: min(100%, 480px);
  margin: 0 auto;
}

.screen {
  display: none;
  animation: rise-in 280ms ease;
}

.screen.is-active {
  display: block;
}

.hero-card,
.catalog-card,
.note-card,
.quiz-card,
.result-card,
.poster-card,
.overlay-panel,
.result-hero {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card,
.catalog-card,
.note-card,
.quiz-card,
.result-card,
.poster-card {
  padding: 22px;
}

.hero-card {
  position: relative;
  overflow: hidden;
}

.hero-card::before,
.hero-card::after,
.result-hero::before,
.result-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-card::before,
.result-hero::before {
  width: 188px;
  height: 188px;
  right: -54px;
  top: -36px;
  background: radial-gradient(circle, rgba(255, 143, 76, 0.4), transparent 68%);
}

.hero-card::after,
.result-hero::after {
  width: 168px;
  height: 168px;
  left: -52px;
  bottom: -70px;
  background: radial-gradient(circle, rgba(98, 180, 255, 0.28), transparent 64%);
}

.hero-badge,
.section-overline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral);
}

.hero-kicker,
.hero-subtitle,
.overlay-text,
.overlay-tip,
.share-hint-text,
.result-copy,
.catalog-copy {
  line-height: 1.7;
  color: var(--muted);
}

.hero-kicker {
  margin: 0;
  font-size: 14px;
}

.hero-title {
  margin: 10px 0 12px;
  font-size: clamp(34px, 10vw, 54px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-subtitle {
  margin: 0;
  font-size: 15px;
}

.share-teaser {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 110, 100, 0.14);
  color: var(--ink);
  line-height: 1.7;
}

.hero-stats,
.hero-stickers,
.action-stack,
.metrics-grid,
.insight-grid,
.note-list,
.animal-catalog,
.options-list {
  display: grid;
}

.hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.stat-pill {
  padding: 14px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(43, 27, 19, 0.05);
}

.stat-number {
  display: block;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.hero-stickers {
  grid-template-columns: repeat(3, minmax(0, max-content));
  gap: 10px;
  margin-top: 18px;
}

.sticker {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  transform: rotate(-4deg);
}

.sticker-coral {
  background: rgba(255, 110, 100, 0.16);
}

.sticker-blue {
  background: rgba(98, 180, 255, 0.18);
}

.sticker-mint {
  background: rgba(102, 200, 166, 0.18);
  transform: rotate(3deg);
}

.action-stack {
  gap: 12px;
  margin-top: 22px;
}

.action-stack.compact {
  margin-top: 16px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.option-button {
  min-height: 54px;
  border-radius: 20px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 0 18px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--coral));
  box-shadow: 0 14px 30px rgba(255, 110, 100, 0.28);
}

.secondary-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(43, 27, 19, 0.08);
}

.ghost-button {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.46);
  border: 1px dashed rgba(43, 27, 19, 0.16);
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.icon-button:active,
.option-button:active {
  transform: scale(0.98);
}

.catalog-card,
.note-card,
.result-card,
.poster-card {
  margin-top: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.animal-catalog {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.catalog-item,
.metric-card,
.insight-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(43, 27, 19, 0.06);
}

.catalog-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.catalog-item::before {
  content: "";
  position: absolute;
  inset: auto -24px -26px auto;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  opacity: 0.22;
  background: var(--card-glow, rgba(255, 140, 90, 0.18));
}

.catalog-badge,
.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
}

.catalog-name,
.result-name {
  margin: 12px 0 6px;
  font-size: 22px;
  line-height: 1.15;
  word-break: break-word;
}

.catalog-copy {
  margin: 0;
  font-size: 13px;
}

.note-list {
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.note-list li {
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(43, 27, 19, 0.05);
  line-height: 1.65;
}

.quiz-topbar {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
}

.icon-button {
  width: 56px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(43, 27, 19, 0.08);
  font-size: 24px;
}

.icon-button[disabled] {
  opacity: 0.42;
  cursor: default;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.progress-track {
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--yellow), var(--sky));
  transition: width 220ms ease;
}

.quiz-card {
  margin-top: 18px;
}

.options-list {
  gap: 12px;
  margin-top: 20px;
}

.option-button {
  padding: 18px 18px 18px 20px;
  text-align: left;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(43, 27, 19, 0.08);
  line-height: 1.55;
}

.option-button.is-selected {
  background: linear-gradient(135deg, rgba(255, 143, 90, 0.18), rgba(98, 180, 255, 0.16));
  border-color: rgba(255, 110, 100, 0.24);
  box-shadow: 0 12px 24px rgba(255, 110, 100, 0.12);
}

.result-hero {
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.result-kicker {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.result-headline {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
}

.result-title-wrap {
  position: relative;
  z-index: 1;
}

.result-name {
  margin: 0;
  font-size: clamp(28px, 8vw, 42px);
}

.result-tagline {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tag-chip {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(43, 27, 19, 0.06);
  font-size: 12px;
  font-weight: 700;
}

.result-copy {
  margin: 18px 0 0;
  font-size: 15px;
}

.metrics-grid,
.insight-grid {
  gap: 12px;
  margin-top: 18px;
}

.metric-title,
.insight-title {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.metric-value,
.insight-body {
  margin: 10px 0 0;
  line-height: 1.7;
}

.metric-track {
  margin-top: 14px;
  height: 12px;
  border-radius: 999px;
  background: rgba(245, 228, 214, 0.96);
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  border-radius: 999px;
}

.metric-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.share-hint-text {
  margin: 12px 0 0;
  font-size: 15px;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(30, 13, 7, 0.54);
  z-index: 40;
}

.overlay[hidden],
.toast[hidden] {
  display: none !important;
}

.overlay-panel {
  width: min(100%, 460px);
  padding: 24px;
  background: var(--paper-strong);
}

.poster-panel {
  max-height: min(88vh, 920px);
  overflow: auto;
}

.poster-image {
  display: block;
  width: 100%;
  margin-top: 16px;
  border-radius: 24px;
  border: 1px solid rgba(43, 27, 19, 0.08);
}

.hidden-canvas {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(43, 27, 19, 0.88);
  color: #fff;
  font-size: 13px;
  z-index: 60;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@media (max-width: 420px) {
  .page-shell {
    padding-inline: 12px;
  }

  .hero-card,
  .catalog-card,
  .note-card,
  .quiz-card,
  .result-card,
  .poster-card,
  .result-hero {
    padding: 18px;
    border-radius: 28px;
  }

  .animal-catalog {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

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