/* ===== 霍加狓推理岛 · 日系温暖漫画风 ===== */
:root {
  --cream:    #FBF3E8;   /* 背景 */
  --peach:    #FFA98A;   /* 主强调 · 蜜桃 */
  --sky:      #A8D8EA;   /* 天蓝 */
  --grass:    #A9CFA4;   /* 草绿 */
  --brown:    #5D4A3A;   /* 深棕 · 文字 */
  --lemon:    #FFD97D;   /* 柠檬黄 · 星星 */
  --tan:      #8B6F5E;   /* 中棕 · 次文字 */
  --sand:     #D9C7B0;   /* 米棕 · 卡片 */
  --white:    #FFFFFF;
  --ok:       #A9CFA4;
  --no:       #F2A0A0;
  --radius:   24px;
  --shadow:   0 6px 18px rgba(93, 74, 58, 0.12);
  --shadow-soft: 0 3px 10px rgba(93, 74, 58, 0.08);
}

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

html, body {
  height: 100%;
  font-family: "Hiragino Maru Gothic ProN", "Yuanti SC", "Rounded Mplus 1c",
               "Segoe UI", "PingFang SC", "Noto Sans SC", "Noto Sans JP",
               "Noto Sans KR", sans-serif;
  background: var(--cream);
  color: var(--brown);
  -webkit-font-smoothing: antialiased;
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
}

/* ===== 顶部栏 ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--cream);
  border-bottom: 2px solid var(--sand);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-mascot { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--peach); }
.topbar-title { font-weight: 800; font-size: 18px; letter-spacing: 0.5px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.streak-pill {
  background: var(--lemon);
  color: var(--brown);
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-soft);
}
.lang-select {
  background: var(--white);
  border: 2px solid var(--sand);
  border-radius: 12px;
  padding: 6px 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brown);
  outline: none;
}
.sound-btn {
  width: 36px; height: 36px;
  background: var(--white);
  border: 2px solid var(--sand);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.08s ease;
  line-height: 1;
}
.sound-btn:active { transform: scale(0.9); }
.level-wrap {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 0 12px;
}
.level-label {
  font-size: 14px; font-weight: 700; color: var(--tan);
}
.level-select {
  background: var(--white);
  border: 2px solid var(--sand);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brown);
  outline: none;
}

/* ===== 屏幕切换 ===== */
.screen-container { flex: 1; position: relative; overflow: hidden; }
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: flex; animation: screenIn 0.35s ease; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ===== 地图屏 ===== */
.map-wrap { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; }
.map-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.9;
}
.map-overlay {
  position: relative; z-index: 2; width: 100%;
  display: flex; justify-content: center; padding: 20px;
}
.map-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 400px;
  width: 100%;
  backdrop-filter: blur(4px);
}
.map-day-title { font-size: 26px; font-weight: 900; margin-bottom: 6px; }
.map-day-desc { font-size: 15px; color: var(--tan); margin-bottom: 18px; }
.island-badge {
  width: 96px; height: 96px; margin: 0 auto 18px;
  background: linear-gradient(160deg, var(--sky), var(--grass));
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  color: var(--white);
}
.island-num { font-size: 34px; font-weight: 900; line-height: 1; }
.island-label { font-size: 13px; font-weight: 700; opacity: 0.9; }

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  font-size: 16px;
  padding: 12px 24px;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
  font-family: inherit;
}
.btn:active { transform: scale(0.96); }
.btn-big { width: 100%; padding: 16px; font-size: 18px; margin-top: 8px; }
.btn-primary {
  background: var(--peach);
  color: var(--white);
  box-shadow: var(--shadow);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(255, 169, 138, 0.4); }
.btn-ghost {
  background: transparent;
  color: var(--tan);
  border: 2px solid var(--sand);
  margin-top: 8px;
}

/* ===== 答题屏 ===== */
.quiz-head { padding: 14px 16px 0; }
.quiz-progress {
  height: 12px; background: var(--sand);
  border-radius: 999px; overflow: hidden;
}
.quiz-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--lemon), var(--peach));
  border-radius: 999px;
  transition: width 0.3s ease;
}
.quiz-meta {
  display: flex; justify-content: space-between;
  margin-top: 8px; font-weight: 800; font-size: 14px; color: var(--tan);
}
.quiz-question {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px 16px;
}
.quiz-prompt { font-size: 17px; font-weight: 800; margin-bottom: 10px; text-align: center; }
.quiz-figure {
  background: var(--white);
  border: 3px solid var(--sand);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-soft);
  display: flex; align-items: center; justify-content: center;
}
.quiz-figure svg, .quiz-option svg { display: block; max-width: 100%; height: auto; }

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 16px 20px;
}
.quiz-option {
  background: var(--white);
  border: 3px solid var(--sand);
  border-radius: var(--radius);
  padding: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.08s ease, border-color 0.15s ease;
  min-height: 80px;
}
.quiz-option:active { transform: scale(0.96); }
.quiz-option.correct { border-color: var(--ok); background: #EFF7EC; animation: pop 0.3s ease; }
.quiz-option.wrong { border-color: var(--no); background: #FBEDED; animation: shake 0.35s ease; }
.quiz-option.disabled { pointer-events: none; }

@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ===== 结算屏 ===== */
.result-card {
  margin: auto; width: 100%; max-width: 420px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow);
}
.result-mascot { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--peach); margin-bottom: 10px; }
.result-title { font-size: 24px; font-weight: 900; margin-bottom: 18px; }
.result-stats { display: flex; gap: 12px; margin-bottom: 18px; }
.result-stat {
  flex: 1; background: var(--cream);
  border-radius: 16px; padding: 14px 8px;
}
.result-stat-value { font-size: 22px; font-weight: 900; }
.result-stat-label { font-size: 12px; color: var(--tan); font-weight: 700; margin-top: 4px; }
.result-breakdown {
  text-align: left; background: var(--cream);
  border-radius: 16px; padding: 14px; margin-bottom: 16px;
  font-size: 14px;
}
.result-breakdown .rb-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0;
}
.result-breakdown .rb-name { font-weight: 700; }
.result-breakdown .rb-bar-wrap { flex: 1; height: 8px; background: var(--sand); border-radius: 999px; margin: 0 10px; overflow: hidden; }
.result-breakdown .rb-bar { height: 100%; border-radius: 999px; background: var(--peach); }
.result-breakdown .rb-pct { font-weight: 800; width: 40px; text-align: right; }

/* ===== 家长面板 ===== */
.parent-card {
  margin: auto; width: 100%; max-width: 460px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 20px;
  box-shadow: var(--shadow);
}
.parent-title { font-size: 22px; font-weight: 900; margin-bottom: 16px; text-align: center; }
.parent-section { margin-bottom: 16px; }
.parent-section h3 { font-size: 15px; color: var(--tan); margin-bottom: 8px; }
.skill-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 14px;
}
.skill-row .sk-name { font-weight: 700; width: 120px; }
.skill-row .sk-bar-wrap { flex: 1; height: 10px; background: var(--sand); border-radius: 999px; overflow: hidden; }
.skill-row .sk-bar { height: 100%; border-radius: 999px; }
.skill-row .sk-level { font-weight: 800; width: 24px; text-align: right; }

/* ===== 横屏适配 ===== */
@media (orientation: landscape) {
  .quiz-options { grid-template-columns: repeat(4, 1fr); }
  .quiz-question { flex-direction: row; gap: 20px; }
  .quiz-figure { flex: 1; }
}

/* ===== 音效/动画增强 ===== */
#quizScore { display: inline-block; }
#quizScore.bump { animation: bump 0.35s ease; }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); color: var(--peach); }
  100% { transform: scale(1); }
}

/* 星星粒子（答对飞向分数栏） */
.star-particle {
  position: fixed;
  z-index: 200;
  font-size: 20px;
  pointer-events: none;
  animation: fly 0.7s ease-out forwards;
}
@keyframes fly {
  0% { transform: translate(0, 0) scale(0.5) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.4) rotate(var(--rot)); opacity: 0; }
}

/* toast 提示 */
.toast {
  position: fixed;
  left: 50%; bottom: 90px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(93, 74, 58, 0.92);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 16px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 结算屏星星逐个弹出 */
.star-pop { display: inline-block; animation: starPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes starPop {
  0% { transform: scale(0) rotate(-40deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* 徽章弹出 */
.badge-pop { animation: badgePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes badgePop {
  0% { transform: scale(0.3); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* 火焰跳动 */
#resultStreak { display: inline-block; animation: flame 0.6s ease infinite; }
@keyframes flame {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
