:root {
  --bg: #f3f6ed;
  --paper: #fffdf3;
  --ink: #171717;
  --muted: #6b6f66;
  --line: rgba(23, 23, 23, 0.11);
  --green: #9eea23;
  --yellow: #f4d03f;
  --blue: #2aa8d8;
  --shadow: 0 20px 54px rgba(35, 45, 28, 0.15);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(158, 234, 35, 0.18), rgba(42, 168, 216, 0.12)),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

h1,
h2,
h3,
p,
span,
strong,
button,
blockquote,
em {
  overflow-wrap: anywhere;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdf3 0%, #f3f6ed 100%);
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.05), 0 28px 90px rgba(17, 17, 17, 0.14);
}

.screen {
  display: none;
  min-height: 100svh;
  padding: 18px 20px 24px;
}

.screen.is-active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-screen {
  justify-content: space-between;
}

.topbar,
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar strong {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #111;
  background: var(--green);
  border: 2px solid #111;
  border-radius: 50%;
  box-shadow: 5px 5px 0 #111;
  font-size: 1.04rem;
  font-weight: 950;
}

.text-button,
.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  font-weight: 900;
}

.text-button {
  padding: 10px 14px;
}

.hero-card,
.question-card,
.detail-card,
.collection-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 24px 20px;
}

.eyebrow,
.page-header p,
.section-title span {
  margin: 0;
  color: #368000;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0;
}

.hero-card h1 {
  max-width: 9em;
  margin: 0;
  font-size: 4.15rem;
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 950;
}

.hero-card p:not(.eyebrow) {
  max-width: 21em;
  margin: 0;
  color: #3c4339;
  font-size: 1.06rem;
  line-height: 1.56;
  font-weight: 800;
}

.hero-orbit {
  min-height: 176px;
  position: relative;
  margin-top: 10px;
}

.hero-orbit span {
  width: 82px;
  height: 82px;
  position: absolute;
  display: grid;
  place-items: center;
  background: #fffdf3;
  border: 2px solid #111;
  border-radius: 8px;
  box-shadow: 8px 8px 0 rgba(17, 17, 17, 0.9);
  font-size: 2.7rem;
  transform: rotate(var(--r));
  animation: floaty 3s ease-in-out infinite;
}

.hero-orbit span:nth-child(1) { left: 3%; top: 38px; --r: -8deg; }
.hero-orbit span:nth-child(2) { left: 24%; top: 86px; --r: 6deg; animation-delay: 0.2s; }
.hero-orbit span:nth-child(3) { left: 46%; top: 24px; --r: -4deg; animation-delay: 0.4s; }
.hero-orbit span:nth-child(4) { left: 65%; top: 96px; --r: 8deg; animation-delay: 0.15s; }
.hero-orbit span:nth-child(5) { left: 76%; top: 16px; --r: -10deg; animation-delay: 0.32s; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-grid article {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  background: #111;
  border-radius: 8px;
  color: #fff;
}

.stat-grid span,
.collection-summary span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 850;
}

.stat-grid strong {
  font-size: 1.2rem;
  line-height: 1.1;
  font-weight: 950;
}

.preview-row {
  min-height: 62px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.preview-row p {
  width: 100%;
  margin: 0;
  padding: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-weight: 850;
}

.preview-chip {
  flex: 0 0 auto;
  min-width: 96px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--tone), #111 15%);
  color: #111;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 950;
}

.preview-chip span {
  font-size: 1.36rem;
}

.action-stack {
  display: grid;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button {
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 1.08rem;
  font-weight: 950;
}

.primary-button {
  border: 0;
  color: #111;
  background: linear-gradient(180deg, #bdf346, var(--green));
  box-shadow: 0 16px 30px rgba(95, 204, 16, 0.28);
}

.secondary-button {
  border: 1px solid rgba(17, 17, 17, 0.12);
  color: #111;
  background: rgba(255, 255, 255, 0.82);
}

.secondary-button.compact {
  min-height: 46px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.page-header {
  justify-content: flex-start;
}

.page-header > div {
  min-width: 0;
}

.page-header h2 {
  margin: 0;
  font-size: 1.58rem;
  line-height: 1.1;
  font-weight: 950;
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #111;
  background: rgba(255, 255, 255, 0.82);
  font-size: 1.85rem;
  line-height: 1;
  font-weight: 750;
}

.progress-panel {
  display: grid;
  gap: 9px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.progress-panel div {
  display: flex;
  justify-content: space-between;
  color: #358000;
  font-weight: 950;
}

.progress-panel i {
  height: 12px;
  overflow: hidden;
  display: block;
  background: rgba(17, 17, 17, 0.08);
  border-radius: 999px;
}

.progress-panel b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #55c300, var(--green));
  border-radius: inherit;
  transition: width 180ms ease;
}

.question-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px 16px;
  background: #fffef7;
  box-shadow: 10px 10px 0 rgba(244, 208, 63, 0.72), var(--shadow);
}

.card-code {
  width: fit-content;
  padding: 6px 9px;
  color: #111;
  background: rgba(158, 234, 35, 0.3);
  border: 1px solid rgba(85, 195, 0, 0.2);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 950;
}

.question-card h3 {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.14;
  font-weight: 950;
}

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

.option-list.is-locked .option-button:not(.is-selected) {
  opacity: 0.46;
}

.option-button {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 8px 10px;
  align-items: center;
  min-height: 92px;
  padding: 12px;
  text-align: left;
  color: #111;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 8px;
  box-shadow: 0 9px 18px rgba(17, 17, 17, 0.05);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.option-button span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #111;
  background: var(--green);
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 50%;
  font-weight: 950;
}

.option-button strong {
  display: block;
  line-height: 1.42;
  font-weight: 900;
}

.option-button.is-selected {
  transform: translateY(-2px);
  border-color: #55c300;
  background: rgba(158, 234, 35, 0.18);
}

.answer-hint {
  display: none;
  margin: 0;
  padding: 11px;
  color: #111;
  background: rgba(158, 234, 35, 0.2);
  border: 1px solid rgba(85, 195, 0, 0.18);
  border-radius: 8px;
  font-weight: 900;
}

.answer-hint.is-visible {
  display: block;
}

.result-stage {
  display: grid;
  gap: 12px;
}

.result-subline {
  margin: 0;
  padding: 12px 14px;
  color: #394235;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.55;
  font-weight: 850;
}

.result-cards {
  display: grid;
  gap: 12px;
}

.animal-card {
  overflow: hidden;
  position: relative;
  display: grid;
  gap: 11px;
  min-height: 360px;
  padding: 16px;
  color: #111;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent), white 45%), #fffdf6);
  border: 2px solid color-mix(in srgb, var(--tone), #111 20%);
  border-radius: 8px;
  box-shadow: 10px 10px 0 color-mix(in srgb, var(--tone), #111 30%);
}

.reveal-card {
  animation: flipIn 420ms ease both;
}

.card-topline,
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.card-topline span {
  color: color-mix(in srgb, var(--tone), #111 14%);
  font-size: 0.78rem;
  font-weight: 950;
}

.card-topline strong {
  font-size: 0.94rem;
  font-weight: 950;
}

.animal-art {
  height: 118px;
  display: grid;
  place-items: center;
  font-size: 5.7rem;
  text-shadow: 0 10px 18px rgba(17, 17, 17, 0.11);
}

.animal-card h3 {
  margin: 0;
  font-size: 1.68rem;
  line-height: 1.12;
  font-weight: 950;
}

.animal-card blockquote {
  margin: 0;
  padding-left: 12px;
  border-left: 4px solid var(--tone);
  color: #363a35;
  line-height: 1.58;
  font-weight: 850;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span {
  padding: 6px 8px;
  color: #111;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.detail-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.section-title strong {
  font-size: 0.96rem;
  font-weight: 950;
}

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

.reading-list.is-locked {
  max-height: 116px;
  overflow: hidden;
  position: relative;
  filter: blur(1.5px);
  opacity: 0.72;
}

.reading-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.reading-item h3,
.reading-item p {
  margin: 0;
}

.reading-item h3 {
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 950;
}

.reading-item p {
  color: #41463f;
  line-height: 1.66;
  font-size: 0.94rem;
}

.deep-item {
  border-color: color-mix(in srgb, var(--tone), #111 16%);
}

.deep-item div {
  display: grid;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.deep-item strong {
  color: color-mix(in srgb, var(--tone), #111 10%);
  font-size: 0.88rem;
  font-weight: 950;
}

.collection-summary {
  display: grid;
  gap: 4px;
  padding: 14px;
  color: #fff;
  background: #111;
}

.collection-summary strong {
  font-size: 1.7rem;
  font-weight: 950;
}

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

.collection-card {
  min-height: 164px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 12px;
  color: #111;
  background: color-mix(in srgb, var(--accent), white 34%);
  border: 1px solid color-mix(in srgb, var(--tone), #111 18%);
  border-radius: 8px;
  text-align: center;
}

.collection-card span {
  font-size: 3rem;
}

.collection-card strong {
  font-size: 1.05rem;
  line-height: 1.2;
  font-weight: 950;
}

.collection-card em {
  color: #555b51;
  font-size: 0.78rem;
  line-height: 1.35;
  font-style: normal;
  font-weight: 850;
}

.collection-card.is-locked {
  color: rgba(17, 17, 17, 0.48);
  background: rgba(255, 255, 255, 0.5);
  border-style: dashed;
}

.collection-card.is-locked span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 17, 0.08);
  border-radius: 50%;
  font-size: 1.8rem;
}

@keyframes floaty {
  0%, 100% {
    transform: translateY(0) rotate(var(--r));
  }
  50% {
    transform: translateY(-9px) rotate(var(--r));
  }
}

@keyframes flipIn {
  from {
    opacity: 0;
    transform: rotateY(16deg) translateY(12px);
  }
  to {
    opacity: 1;
    transform: rotateY(0) translateY(0);
  }
}

@media (min-width: 840px) {
  .app-shell {
    margin-top: 24px;
    margin-bottom: 24px;
    min-height: calc(100svh - 48px);
    border-radius: 18px;
  }

  .screen {
    min-height: calc(100svh - 48px);
  }
}

@media (max-width: 360px) {
  .screen {
    padding: 14px 14px 20px;
  }

  .hero-card {
    min-height: 386px;
  }

  .hero-card h1 {
    font-size: 2.72rem;
  }

  .hero-orbit span {
    width: 68px;
    height: 68px;
    font-size: 2.18rem;
  }

  .question-card h3 {
    font-size: 1.54rem;
  }

  .collection-grid {
    grid-template-columns: 1fr;
  }
}
