@import url('https://fonts.loli.net/css2?family=ZCOOL+KuaiLe&display=swap');

/* ============================================================
   跳跳学堂 · 设计系统
   色彩语义：珊瑚=主行动 黄=奖励 青=数学 紫=语文 绿=正确 红=求助
   圆角三级：28 / 20 / 14；阴影两级：卡片纸感 / 按钮糖果感
   ============================================================ */
:root {
  --bg: #FBEFD9;
  --bg-soft: #FFF9EE;
  --paper: #FFFFFF;
  --ink: #4A3B2A;
  --ink-soft: #9C8A74;
  --sand: #EBDCC2;
  --sand-deep: #D9C5A2;
  --coral: #FF7B54;  --coral-deep: #E0562F;  --coral-soft: #FFE9DF;
  --yellow: #FFC93C; --yellow-deep: #E8AC14; --yellow-soft: #FFF3D2;
  --teal: #35C0B1;   --teal-deep: #239C8E;   --teal-soft: #DDF4F0;
  --purple: #9B7EDE; --purple-deep: #7C5FC5; --purple-soft: #F0EBFC;
  --green: #58BB6B;  --green-deep: #3E9B51;  --green-soft: #E6F5E9;
  --red: #F26D6D;    --red-deep: #D94F4F;    --red-soft: #FDECEC;
  --r-xl: 28px; --r-lg: 20px; --r-md: 14px;
  --font-display: 'ZCOOL KuaiLe', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  --shadow-card: 0 4px 0 rgba(217, 197, 162, 0.5);
  --shadow-card-hover: 0 7px 0 rgba(217, 197, 162, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { font-size: 18px; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(#F3E2C0 11%, transparent 12%),
    radial-gradient(#F3E2C0 11%, transparent 12%);
  background-size: 52px 52px;
  background-position: 0 0, 26px 26px;
  min-height: 100vh;
  line-height: 1.75;
}

::selection { background: var(--yellow-soft); }

button { font-family: var(--font-display); cursor: pointer; border: none; background: none; }

:focus-visible { outline: 3px dashed var(--coral); outline-offset: 3px; border-radius: 8px; }

/* ============ 图标 ============ */
.icon { width: 1.2em; height: 1.2em; flex: none; display: inline-block; vertical-align: -0.22em; }
.c-coral { color: var(--coral); }
.c-teal { color: var(--teal); }
.c-purple { color: var(--purple); }
.c-yellow { color: var(--yellow-deep); }
.c-red { color: var(--red); }
.star-ico { color: var(--yellow-deep); }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(251, 239, 217, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--sand);
}
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 22px; color: var(--ink); letter-spacing: 1px;
}
.logo .icon { width: 26px; height: 26px; color: var(--coral); }
.logo:active { transform: scale(0.95); }

.star-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--yellow-soft); border: 3px solid var(--yellow);
  border-radius: 999px; padding: 4px 16px 4px 12px;
  font-size: 19px; font-weight: bold; color: var(--ink);
  box-shadow: 0 3px 0 rgba(232, 172, 20, 0.4);
  transition: transform 0.25s;
}
.star-pill .icon { width: 20px; height: 20px; }
.star-pill.bump { transform: scale(1.22) rotate(-5deg); }

.container { max-width: 720px; margin: 0 auto; padding: 26px 18px 64px; }

/* ============ 屏幕切换 ============ */
.screen { display: none; }
.screen.active { display: block; animation: popIn 0.32s ease; }

@keyframes popIn {
  0% { opacity: 0; transform: translateY(14px) scale(0.985); }
  100% { opacity: 1; transform: none; }
}

/* ============ 通用按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border-radius: 999px; padding: 13px 30px;
  font-size: 19px; letter-spacing: 1px; color: #FFF;
  background: var(--coral);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 5px 0 var(--coral-deep);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn .icon { width: 22px; height: 22px; }
.btn:hover { transform: translateY(-2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 7px 0 var(--coral-deep); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 2px 0 var(--coral-deep); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-big { padding: 16px 40px; font-size: 22px; }

.btn-soft { background: var(--paper); color: var(--ink-soft); box-shadow: 0 5px 0 var(--sand-deep); }
.btn-soft:hover { box-shadow: 0 7px 0 var(--sand-deep); }
.btn-soft:active { box-shadow: 0 2px 0 var(--sand-deep); }

.btn-yellow { background: var(--yellow); color: #6B4E00; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 5px 0 var(--yellow-deep); }
.btn-yellow:hover { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 7px 0 var(--yellow-deep); }
.btn-yellow:active { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 2px 0 var(--yellow-deep); }

.btn-purple { background: var(--purple); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 5px 0 var(--purple-deep); }
.btn-purple:hover { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 7px 0 var(--purple-deep); }
.btn-purple:active { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 2px 0 var(--purple-deep); }

/* 小工具按钮 */
.btn-back, .toggle-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-body); font-weight: 600;
  background: var(--paper); border: 3px solid var(--sand);
  border-radius: 999px; padding: 5px 15px;
  font-size: 15px; color: var(--ink-soft);
  box-shadow: 0 3px 0 rgba(217, 197, 162, 0.5);
  transition: transform 0.12s, box-shadow 0.12s, color 0.12s;
}
.btn-back .icon, .toggle-btn .icon { width: 15px; height: 15px; }
.btn-back:hover, .toggle-btn:hover { color: var(--ink); }
.btn-back:active, .toggle-btn:active { transform: translateY(2px); box-shadow: none; }

.tool-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-body); font-weight: 600;
  background: var(--paper); border: 3px solid var(--sand);
  border-radius: 999px; padding: 10px 20px;
  font-size: 16px; color: var(--ink);
  box-shadow: 0 4px 0 rgba(217, 197, 162, 0.5);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.tool-chip .icon { width: 19px; height: 19px; }
.tool-chip:hover { transform: translateY(-2px); border-color: var(--sand-deep); box-shadow: 0 6px 0 rgba(217, 197, 162, 0.5); }
.tool-chip:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(217, 197, 162, 0.5); }
.tool-chip:disabled { opacity: 0.5; transform: none; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); border: 3px solid var(--sand); color: var(--ink-soft);
  box-shadow: 0 3px 0 rgba(217, 197, 162, 0.5);
  transition: transform 0.12s, border-color 0.12s, color 0.12s;
}
.icon-btn .icon { width: 19px; height: 19px; }
.icon-btn:hover { border-color: var(--teal); color: var(--teal-deep); transform: translateY(-2px); }
.icon-btn:active { transform: translateY(2px); box-shadow: none; }

.link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 32px auto 0; padding: 11px 24px;
  font-family: var(--font-display); font-size: 17px; color: var(--ink);
  background: var(--paper); border: 3px solid var(--sand); border-radius: 999px;
  box-shadow: 0 4px 0 rgba(217, 197, 162, 0.5);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.link-btn .icon { width: 18px; height: 18px; color: var(--coral); }
.link-btn:hover { transform: translateY(-2px); border-color: var(--coral); box-shadow: 0 6px 0 rgba(217, 197, 162, 0.5); }
.link-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(217, 197, 162, 0.5); }

.center-actions { text-align: center; margin-top: 26px; }

/* ============ 首页 ============ */
#screen-home { position: relative; text-align: center; padding-top: 12px; }

.deco { position: absolute; pointer-events: none; }
.deco-1 { top: 16px; right: 7%; width: 50px; height: 50px; border-radius: 50%; border: 11px solid #FFE0B5; animation: floaty 5s ease-in-out infinite; }
.deco-2 { top: 158px; left: 4%; width: 20px; height: 20px; border-radius: 50%; background: #C9EEE7; animation: floaty 6s ease-in-out infinite 0.8s; }
.deco-3 { top: 64px; right: 27%; width: 26px; height: 26px; background: #FFD9CB; border-radius: 42% 58% 55% 45%; animation: floaty 5.5s ease-in-out infinite 1.6s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-13px) rotate(5deg); }
}

.hero { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hero-mascot { width: 148px; height: 148px; animation: bounce 2.6s ease-in-out infinite; }
.hero-mascot img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; border: 6px solid #FFF;
  box-shadow: var(--shadow-card);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-11px); }
}

.hero-bubble {
  position: relative;
  background: var(--paper); border: 3px solid var(--sand); border-radius: 22px;
  padding: 10px 26px; font-size: 20px; font-family: var(--font-display);
  box-shadow: var(--shadow-card);
}
.hero-bubble::before {
  content: ''; position: absolute; top: -11px; left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 82px; height: 18px; border-radius: 5px;
  background: rgba(255, 201, 60, 0.5);
}

.hero-sub { margin: 14px 0 20px; font-size: 17px; color: var(--ink-soft); }

/* ============ 小顶栏 ============ */
.screen-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 18px; flex-wrap: wrap;
}
.subject-badge {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; padding: 5px 16px;
  font-size: 16px; font-family: var(--font-display); color: var(--ink);
  background: var(--paper); border: 3px solid var(--sand);
}
.subject-badge::before { content: ''; width: 10px; height: 10px; border-radius: 50%; }
.subject-badge.is-math::before { background: var(--teal); }
.subject-badge.is-chinese::before { background: var(--purple); }
.subject-badge.is-english::before { background: var(--yellow); }
.subject-badge[hidden] { display: none; }

.screen-title {
  text-align: center; font-size: 25px; margin: 6px 0 22px;
  font-family: var(--font-display);
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.screen-title .icon { width: 26px; height: 26px; }
.screen-title.small { font-size: 21px; margin: 0 0 18px; }

/* ============ 输入卡（首页） ============ */
.input-card {
  background: var(--paper); border: 3px solid var(--sand);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color 0.15s;
}
.input-card:focus-within { border-color: var(--coral); }

#questionInput {
  display: block; width: 100%; border: none; outline: none; resize: vertical;
  background: transparent; padding: 18px 20px;
  font-size: 19px; font-family: var(--font-body); color: var(--ink); line-height: 1.7;
  min-height: 118px;
}
#questionInput::placeholder { color: #C9BBA6; }
#questionInput.shake { animation: shake 0.4s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.img-area { padding: 0 16px 14px; text-align: center; animation: popIn 0.3s ease; }
.img-preview { position: relative; display: inline-block; }
.img-preview img {
  max-width: 100%; max-height: 140px; border-radius: var(--r-md);
  border: 3px solid var(--sand); display: block;
}
.img-remove {
  position: absolute; top: -10px; right: -10px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--red); color: #FFF;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--red-deep);
}
.img-remove .icon { width: 13px; height: 13px; }
.img-remove:active { transform: translateY(2px); box-shadow: none; }
.img-status { margin-top: 10px; font-size: 15px; color: var(--ink-soft); }
.img-status.ok { color: var(--green-deep); font-weight: bold; }
.img-status.err { color: var(--red-deep); }

.input-tools {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 13px 14px;
  border-top: 3px dashed var(--sand);
}
.input-tools input[type="file"] { display: none; }
.input-tools .tool-chip { width: 100%; }

.tool-chip.is-mic.recording {
  border-color: var(--red); background: var(--red-soft);
  animation: pulse 1.2s infinite;
}
.tool-chip.is-mic.recording .mic-text { color: var(--red-deep); }

@keyframes pulse {
  0% { box-shadow: 0 4px 0 rgba(217, 197, 162, 0.5), 0 0 0 0 rgba(242, 109, 109, 0.45); }
  70% { box-shadow: 0 4px 0 rgba(217, 197, 162, 0.5), 0 0 0 18px rgba(242, 109, 109, 0); }
  100% { box-shadow: 0 4px 0 rgba(217, 197, 162, 0.5), 0 0 0 0 rgba(242, 109, 109, 0); }
}

.start-row { text-align: center; margin-top: 24px; }

/* ============ 加载页 ============ */
#screen-loading { text-align: center; padding-top: 56px; }
.loading-mascot { width: 172px; height: 172px; margin: 0 auto; animation: bounce 1.8s ease-in-out infinite; }
.loading-mascot img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; border: 6px solid #FFF; box-shadow: var(--shadow-card);
}
.loading-tip { font-size: 21px; font-family: var(--font-display); margin: 20px 0 18px; }
.loading-dots { display: flex; justify-content: center; gap: 12px; }
.loading-dots span { width: 16px; height: 16px; border-radius: 50%; background: var(--coral); animation: dotJump 1.2s infinite; }
.loading-dots span:nth-child(2) { background: var(--yellow); animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { background: var(--teal); animation-delay: 0.3s; }

@keyframes dotJump {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-14px); }
}

/* ============ 讲解页 ============ */
.question-recap {
  background: var(--bg-soft); border: 3px dashed var(--sand-deep);
  border-radius: var(--r-md);
  padding: 12px 18px; font-size: 15px; color: var(--ink-soft);
  max-height: 96px; overflow-y: auto; margin-bottom: 14px;
}
.question-recap b { color: var(--coral-deep); font-weight: 600; }

.translate-card {
  background: var(--yellow-soft); border: 3px dashed var(--yellow-deep);
  border-radius: var(--r-md);
  padding: 12px 18px; font-size: 16px; line-height: 1.8;
  margin-bottom: 14px; animation: popIn 0.35s ease;
}
.translate-card b { color: #8A6D00; font-family: var(--font-display); font-weight: normal; }

.step-list { display: flex; flex-direction: column; gap: 16px; }
.step-item {
  background: var(--paper); border: 3px solid var(--sand);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: 20px 20px;
  animation: popIn 0.35s ease;
}
.step-head { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.step-num {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  background: var(--coral-soft); color: var(--coral-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-family: var(--font-display); line-height: 1;
}
.step-head h3 { font-size: 22px; font-family: var(--font-display); color: var(--ink); }
.step-content { font-size: 17px; line-height: 1.9; }

.alt-area { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.alt-card {
  background: var(--yellow-soft); border: 3px dashed var(--yellow-deep);
  border-radius: var(--r-md); padding: 14px 16px;
  animation: popIn 0.35s ease;
}
.alt-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--yellow); color: #6B4E00;
  border-radius: 999px; padding: 2px 14px;
  font-size: 14px; margin-bottom: 8px; font-family: var(--font-display);
}
.alt-content { font-size: 17px; line-height: 1.8; }
.alt-ask {
  margin-top: 10px; background: var(--paper); border-radius: 10px;
  padding: 8px 14px; font-size: 15px; color: var(--coral-deep);
}

.parent-hint {
  background: var(--purple-soft); border: 3px solid var(--purple);
  border-radius: var(--r-md); padding: 14px 16px; text-align: center;
  animation: popIn 0.35s ease;
}
.parent-hint p { font-size: 15px; color: var(--purple-deep); margin-bottom: 10px; }

.step-tools { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tool-chip.is-stuck { border-color: #F5C6C6; color: var(--red-deep); }
.tool-chip.is-stuck:hover { border-color: var(--red); background: var(--red-soft); }

/* ============ 知识点页 ============ */
.k-points { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.k-point {
  background: var(--paper); border: 3px solid var(--sand);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: 16px 20px;
  animation: popIn 0.4s ease;
}
.k-point-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.k-point-name { font-size: 20px; font-family: var(--font-display); }
.k-point-stars { display: inline-flex; gap: 2px; }
.k-point-stars .icon { width: 17px; height: 17px; color: var(--yellow-deep); }
.k-point-explain { font-size: 16px; color: var(--ink-soft); line-height: 1.8; }

.k-card {
  background: var(--paper); border: 3px solid var(--sand);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: 18px 22px; margin-bottom: 16px;
}
.k-card h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 20px; margin-bottom: 10px; font-family: var(--font-display);
}
.k-card h3 .icon { width: 21px; height: 21px; }
.k-list { list-style: none; }
.k-list li {
  position: relative; padding: 6px 0 6px 26px;
  font-size: 16px; line-height: 1.7;
  border-bottom: 2px dashed var(--bg-soft);
}
.k-list li:last-child { border-bottom: none; }
.k-list li::before {
  content: ''; position: absolute; left: 4px; top: 15px;
  width: 9px; height: 9px; border-radius: 50%;
}
.k-card.is-tip .k-list li::before { background: var(--yellow); }
.k-card.is-warn .k-list li::before { background: var(--red); }

.practice-chooser { margin-top: 30px; text-align: center; }
.chooser-title { font-size: 20px; margin-bottom: 18px; font-family: var(--font-display); }
.chooser-title::after {
  content: ''; display: block; margin: 5px auto 0;
  width: 118px; height: 7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 4 Q5 0 10 4 T20 4 T30 4 T40 4' fill='none' stroke='%23E8AC14' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
}

.mode-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.mode-card {
  flex: 1; min-width: 150px; max-width: 190px;
  background: var(--paper); border: 3px solid var(--sand);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: 18px 10px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.mode-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card-hover); }
.mode-card:active { transform: translateY(2px); box-shadow: var(--shadow-card); }
.mode-card[data-mode="same"]:hover { border-color: var(--teal); }
.mode-card[data-mode="related"]:hover { border-color: var(--purple); }
.mode-card[data-mode="extend"]:hover { border-color: var(--coral); }
.mode-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.mode-icon .icon { width: 27px; height: 27px; }
.tint-teal { background: var(--teal-soft); color: var(--teal-deep); }
.tint-purple { background: var(--purple-soft); color: var(--purple-deep); }
.tint-coral { background: var(--coral-soft); color: var(--coral-deep); }
.mode-name { font-size: 18px; color: var(--ink); font-family: var(--font-display); }
.mode-tip { font-size: 13px; color: var(--ink-soft); }

.result-more { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.more-label { font-size: 15px; color: var(--ink-soft); }
.mode-row.compact { width: 100%; max-width: 420px; }
.mode-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--paper); border: 3px solid var(--sand);
  font-family: var(--font-display); font-size: 16px; color: var(--ink);
  box-shadow: 0 3px 0 rgba(217, 197, 162, 0.5);
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.mode-chip .icon { width: 17px; height: 17px; }
.mode-chip:hover { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(217, 197, 162, 0.5); }
.mode-chip[data-mode="same"]:hover { border-color: var(--teal); }
.mode-chip[data-mode="related"]:hover { border-color: var(--purple); }
.mode-chip[data-mode="extend"]:hover { border-color: var(--coral); }

/* ============ 练习页 ============ */
.p-progress {
  background: var(--paper); border: 3px solid var(--sand);
  border-radius: 999px; padding: 4px 16px;
  font-size: 15px; font-family: var(--font-display); color: var(--ink);
}
.p-score {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--yellow-soft); border: 3px solid var(--yellow);
  border-radius: 999px; padding: 4px 14px;
  font-size: 16px; font-weight: bold; color: #8A6D00;
  box-shadow: 0 3px 0 rgba(232, 172, 20, 0.4);
}
.p-score .icon { width: 17px; height: 17px; }

.p-question-card {
  background: var(--paper); border: 3px solid var(--sand);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: 18px 22px; margin-bottom: 18px;
  animation: popIn 0.35s ease;
}
.p-question-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.p-question-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 16px; font-family: var(--font-display); color: var(--ink);
}
.p-question-label .icon { width: 17px; height: 17px; }
.p-question { font-size: 18px; line-height: 1.8; }
.p-translate {
  margin-top: 8px; font-size: 15px; color: var(--ink-soft);
  background: var(--yellow-soft); border-radius: 10px;
  padding: 8px 14px; line-height: 1.7; display: inline-block;
}

.p-options { display: flex; flex-direction: column; gap: 12px; }
.option-btn {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--paper); border: 3px solid var(--sand);
  border-radius: var(--r-md); box-shadow: var(--shadow-card);
  padding: 13px 18px; font-family: var(--font-body);
  font-size: 18px; color: var(--ink);
  transition: transform 0.12s, border-color 0.12s, background 0.2s, box-shadow 0.12s;
}
.option-btn:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--yellow); box-shadow: var(--shadow-card-hover); }
.option-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: var(--shadow-card); }
.option-btn:disabled { cursor: default; }
.option-badge {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--yellow-soft); border: 3px solid var(--yellow-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: bold; color: #8A6D00;
}
.option-btn.correct { background: var(--green-soft); border-color: var(--green); animation: popIn 0.3s; }
.option-btn.correct .option-badge { background: var(--green); border-color: var(--green-deep); color: #FFF; }
.option-btn.wrong { background: var(--red-soft); border-color: var(--red); animation: shake 0.4s; }
.option-btn.wrong .option-badge { background: var(--red); border-color: var(--red-deep); color: #FFF; }
.option-btn.fade { opacity: 0.45; }

.p-feedback {
  border-radius: var(--r-md); padding: 16px 20px; margin-top: 16px;
  font-size: 17px; line-height: 1.8; animation: popIn 0.3s ease;
}
.p-feedback.good { background: var(--green-soft); border: 3px solid var(--green); }
.p-feedback.bad { background: var(--red-soft); border: 3px solid var(--red); }
.p-feedback .fb-title { font-size: 20px; font-family: var(--font-display); margin-bottom: 4px; }
.p-feedback.good .fb-title { color: var(--green-deep); }
.p-feedback.bad .fb-title { color: var(--red-deep); }

/* ============ 结果页 ============ */
#screen-result { text-align: center; padding-top: 20px; }
.result-mascot { width: 176px; height: 176px; margin: 0 auto; animation: bounce 2s ease-in-out infinite; }
.result-mascot img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; border: 6px solid #FFF; box-shadow: var(--shadow-card);
}
.result-title { font-size: 30px; margin: 16px 0 8px; font-family: var(--font-display); }
.result-score { font-size: 18px; color: var(--ink-soft); }
.result-stars { font-size: 22px; margin: 10px 0 6px; font-family: var(--font-display); color: var(--yellow-deep); animation: popIn 0.5s ease; }
.result-actions { display: flex; flex-direction: column; gap: 13px; align-items: center; margin-top: 26px; }
.result-actions .btn { min-width: 245px; }

/* ============ 历史页 ============ */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item {
  background: var(--paper); border: 3px solid var(--sand);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 6px;
  animation: popIn 0.35s ease;
}
.history-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.h-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; padding: 2px 12px; border-radius: 999px;
  font-family: var(--font-display);
}
.h-tag .icon { width: 13px; height: 13px; }
.h-tag.is-math { background: var(--teal-soft); color: var(--teal-deep); }
.h-tag.is-chinese { background: var(--purple-soft); color: var(--purple-deep); }
.h-tag.is-english { background: var(--yellow-soft); color: #8A6D00; }
.history-date { font-size: 13px; color: var(--ink-soft); }
.history-question {
  font-size: 16px; line-height: 1.6; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.history-meta { font-size: 14px; color: var(--ink-soft); }
.history-empty { text-align: center; color: var(--ink-soft); padding: 40px 0; font-size: 17px; }

/* ============ 吉祥物图容器 ============ */
.mascot-box { position: relative; display: flex; align-items: center; justify-content: center; }
.mascot-box.img-fallback::before { content: attr(data-emoji); font-size: 82px; line-height: 1.2; }

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(74, 59, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.25s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--paper); border: 4px solid var(--sand);
  border-radius: var(--r-xl); width: 100%; max-width: 520px;
  max-height: 84vh; overflow-y: auto; padding: 22px 26px;
  box-shadow: 0 10px 0 rgba(217, 197, 162, 0.35);
  animation: popIn 0.3s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 3px dashed var(--sand);
}
.modal-title { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-family: var(--font-display); }
.modal-title .icon { width: 20px; height: 20px; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-soft); border: 3px solid var(--sand); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
}
.modal-close .icon { width: 14px; height: 14px; }
.modal-close:hover { border-color: var(--coral); color: var(--coral); }

.parent-card .pc-block { margin-bottom: 14px; }
.parent-card .pc-block h4 {
  display: flex; align-items: center; gap: 7px;
  font-size: 16px; color: var(--ink); margin-bottom: 4px;
}
.parent-card .pc-block h4::before {
  content: ''; width: 9px; height: 9px; border-radius: 3px;
  background: var(--purple); transform: rotate(45deg);
}
.parent-card .pc-block p { font-size: 15px; line-height: 1.8; color: var(--ink); }
.parent-card .pc-block ul { list-style: none; }
.parent-card .pc-block li { position: relative; padding: 5px 0 5px 26px; font-size: 15px; line-height: 1.7; }
.parent-card .pc-block li::before { content: '👉'; position: absolute; left: 0; font-size: 13px; }
.parent-card .pc-encourage {
  background: var(--yellow-soft); border-radius: var(--r-md);
  padding: 12px 16px; font-size: 15px; text-align: center;
}

.error-card { text-align: center; padding: 30px 26px; }
.error-emoji { font-size: 58px; margin-bottom: 10px; }
.error-card p { font-size: 18px; margin-bottom: 20px; color: var(--ink); }

/* ============ Toast / 撒花 / 飞星 ============ */
#toast {
  position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%);
  z-index: 200; background: rgba(74, 59, 42, 0.92); color: #FFF;
  padding: 12px 26px; border-radius: 999px; font-size: 16px;
  animation: toastIn 0.3s ease; max-width: 86vw; text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

#confetti { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

.fly-star {
  position: fixed; z-index: 300; font-size: 30px; pointer-events: none;
  transition: top 0.8s cubic-bezier(0.5, -0.3, 0.7, 1), left 0.8s cubic-bezier(0.5, -0.3, 0.7, 1), transform 0.8s, opacity 0.8s;
}

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--sand-deep); border-radius: 3px; }

/* ============ 响应式 ============ */
@media (max-width: 480px) {
  html { font-size: 16px; }
  .container { padding: 18px 12px 52px; }
  .topbar { padding: 8px 14px; }
  .hero-mascot { width: 124px; height: 124px; }
  .deco { display: none; }
  .result-actions .btn { min-width: 0; width: 100%; max-width: 320px; }
  .step-head h3 { font-size: 19px; }
  .step-num { width: 44px; height: 44px; font-size: 22px; }
  .input-tools { grid-template-columns: 1fr 1fr; }
  .tool-chip.is-mic { grid-column: 1 / -1; }
  .mode-row:not(.compact) { flex-direction: column; align-items: stretch; gap: 10px; }
  .mode-card {
    flex: none; min-width: 0; max-width: none;
    display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto;
    column-gap: 14px; row-gap: 2px; align-items: center;
    padding: 12px 16px;
  }
  .mode-icon { width: 52px; height: 52px; grid-row: 1 / 3; }
  .mode-icon .icon { width: 25px; height: 25px; }
  .mode-card .mode-name { font-size: 17px; }
}

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