:root {
  --paper: rgba(255, 250, 245, 0.9);
  --paper-strong: #fffaf5;
  --ink: #574843;
  --ink-soft: #85746b;
  --line: rgba(118, 99, 88, 0.12);
  --rose: #d98f97;
  --rose-deep: #be6e78;
  --sage: #b5c1b7;
  --shadow: 0 28px 70px rgba(110, 95, 88, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 28%),
    radial-gradient(circle at bottom right, rgba(241, 179, 155, 0.16), transparent 30%),
    linear-gradient(145deg, #d7edf6 0%, #eef6df 52%, #f8ebdb 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(160, 132, 111, 0.12) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 40%, rgba(160, 132, 111, 0.08) 0 1px, transparent 1px);
  background-size: 24px 24px, 18px 18px;
}

.app-shell {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 26px;
  width: min(1240px, calc(100% - 32px));
  margin: 24px auto;
  padding: 8px;
}

.cover-panel,
.story-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.cover-panel {
  padding: 26px 26px 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.62), transparent 26%),
    linear-gradient(180deg, rgba(194, 228, 241, 0.78), rgba(240, 247, 222, 0.84) 58%, rgba(255, 245, 234, 0.88));
}

.mist {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.52;
}

.mist-one {
  top: -46px;
  right: -34px;
  width: 220px;
  height: 220px;
  background: rgba(245, 196, 176, 0.26);
}

.mist-two {
  left: -44px;
  bottom: 112px;
  width: 200px;
  height: 200px;
  background: rgba(194, 223, 174, 0.3);
}

.cover-head,
.story-topbar {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cover-head h1,
.story-topbar h2,
.idiom-card h3,
.pinyin-word {
  margin: 10px 0 0;
  font-family: "STKaiti", "Kaiti SC", "Songti SC", serif;
  font-weight: 600;
}

.cover-head h1 {
  font-size: clamp(2.5rem, 4vw, 4rem);
  line-height: 1.02;
  color: #7c5a54;
}

.deck {
  margin: 12px 0 0;
  max-width: 34ch;
  color: #7f716a;
  font-size: 1rem;
  line-height: 1.7;
}

.comic-stage {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  padding: 22px;
  border-radius: 30px;
  border: 1px solid rgba(125, 102, 88, 0.1);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(180deg, rgba(226, 242, 248, 0.72), rgba(243, 249, 227, 0.8) 60%, rgba(255, 243, 232, 0.88));
}

.stage-label {
  position: absolute;
  top: 16px;
  left: 20px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.96);
  border: 1px solid rgba(111, 92, 79, 0.08);
  color: #8b6961;
  font-size: 0.9rem;
}

.scene-illustration {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
}

.bubble {
  position: absolute;
  max-width: 230px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 251, 247, 0.98);
  border: 1px solid rgba(118, 99, 88, 0.08);
  box-shadow: 0 14px 28px rgba(118, 99, 88, 0.08);
}

.bubble p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.note-left {
  left: 34px;
  bottom: 172px;
}

.note-right {
  right: 28px;
  bottom: 98px;
}

.bubble::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: inherit;
  transform: rotate(45deg);
  border-right: 1px solid rgba(118, 99, 88, 0.08);
  border-bottom: 1px solid rgba(118, 99, 88, 0.08);
}

.note-left::after {
  left: 36px;
  bottom: -10px;
}

.note-right::after {
  right: 42px;
  bottom: -10px;
}

.mood-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.mood-strip span {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.95);
  border: 1px solid rgba(118, 99, 88, 0.08);
  color: #866c62;
  font-size: 0.9rem;
}

.story-panel {
  display: flex;
  flex-direction: column;
  padding: 26px;
}

.story-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.story-topbar h2 {
  font-size: clamp(2rem, 2.5vw, 2.7rem);
  line-height: 1.05;
  color: #57443f;
}

.page-pill {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(181, 193, 183, 0.18);
  color: #6b7a71;
  font-size: 0.92rem;
}

.dialogue-card {
  margin-top: 22px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(111, 92, 79, 0.1);
  background:
    radial-gradient(circle at top right, rgba(217, 143, 151, 0.08), transparent 26%),
    radial-gradient(circle at bottom left, rgba(181, 193, 183, 0.1), transparent 20%),
    rgba(255, 252, 247, 0.96);
}

.helper-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(255, 248, 241, 0.96);
  color: #857166;
  font-size: 0.92rem;
  border: 1px solid rgba(111, 92, 79, 0.08);
}

.helper-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 4px rgba(217, 143, 151, 0.12);
}

.story-text {
  margin-top: 22px;
  font-size: 1.18rem;
  line-height: 2.05;
  color: #584844;
}

.story-paragraph {
  margin: 0 0 18px;
}

.word-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0 1px;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
}

.word-btn:hover,
.word-btn:focus-visible {
  outline: none;
  color: #a15d66;
}

.word-btn.is-active {
  color: #a15d66;
}

.word-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 8px;
  background: rgba(217, 143, 151, 0.16);
  border-radius: 999px;
  opacity: 0;
  transition: opacity 160ms ease;
  z-index: -1;
}

.word-btn:hover::after,
.word-btn:focus-visible::after,
.word-btn.is-active::after {
  opacity: 1;
}

.choice-group {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.choice-btn,
.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 20px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.choice-btn {
  padding: 16px 18px;
  text-align: left;
  background: rgba(252, 247, 241, 0.98);
  border: 1px solid rgba(111, 92, 79, 0.08);
  color: #65544d;
  box-shadow: 0 10px 24px rgba(111, 92, 79, 0.06);
}

.choice-btn:hover,
.choice-btn:focus-visible,
.primary-btn:hover,
.primary-btn:focus-visible,
.secondary-btn:hover,
.secondary-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(111, 92, 79, 0.1);
  outline: none;
}

.choice-btn.selected {
  background: linear-gradient(135deg, #d08991, #b96871);
  color: #fffaf6;
}

.choice-btn:disabled {
  cursor: default;
}

.idiom-card {
  margin-top: 18px;
  padding: 18px 18px 20px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 250, 245, 0.98), rgba(246, 236, 226, 0.98));
  border: 1px solid rgba(111, 92, 79, 0.08);
}

.idiom-card h3 {
  font-size: clamp(1.8rem, 2.2vw, 2.4rem);
  color: #5a423c;
}

.idiom-pinyin,
.idiom-description {
  margin: 10px 0 0;
}

.idiom-pinyin {
  color: #95716e;
  letter-spacing: 0.04em;
}

.idiom-description {
  color: var(--ink-soft);
  line-height: 1.8;
}

.pinyin-tray {
  margin-top: 18px;
  padding: 16px 18px;
  min-height: 104px;
  border-radius: 22px;
  border: 1px solid rgba(111, 92, 79, 0.08);
  background: rgba(255, 249, 244, 0.84);
}

.pinyin-empty,
.pinyin-word,
.pinyin-text,
.pinyin-meaning {
  margin: 0;
}

.pinyin-empty {
  color: #9a877b;
  line-height: 1.7;
}

.pinyin-word {
  font-size: 1.5rem;
  color: #614845;
}

.pinyin-text {
  margin-top: 4px;
  color: #8f6a67;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.pinyin-meaning {
  margin-top: 8px;
  color: #8f8177;
  line-height: 1.7;
}

.story-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.primary-btn,
.secondary-btn {
  padding: 15px 18px;
}

.primary-btn {
  min-width: 150px;
  color: #fffaf6;
  background: linear-gradient(135deg, #d08991, #b96a72);
}

.secondary-btn {
  background: rgba(255, 251, 247, 0.9);
  color: #6d5a53;
  border: 1px solid rgba(111, 92, 79, 0.08);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .bubble {
    position: static;
    max-width: none;
    margin-top: 12px;
  }

  .bubble::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100%, calc(100% - 16px));
    margin: 10px auto 16px;
    gap: 14px;
    padding: 0;
  }

  .cover-panel,
  .story-panel {
    border-radius: 24px;
    padding: 18px;
  }

  .comic-stage,
  .dialogue-card {
    padding: 16px;
    border-radius: 22px;
  }

  .story-controls {
    flex-direction: column-reverse;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }
}
