/* 全局基础 */
:root {
  --bg-main: #e8f5e9;
  --bg-card: #ffffff;
  --bg-sidebar: #c8e6c9;
  --primary: #43a047;
  --primary-dark: #2e7d32;
  --accent: #ffca28;
  --accent-dark: #ffb300;
  --danger: #ef5350;
  --hp: #ef5350;
  --energy: #ffca28;
  --mood: #ff6b9d;
  --active: #42a5f5;
  --text: #2e4a2f;
  --text-light: #5a7c5c;
  --shadow: rgba(46, 74, 47, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --sidebar-w: 230px;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg-main);
  color: var(--text);
  overflow: hidden;
}

#app {
  display: flex;
  width: 100%;
  height: 100%;
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, #b9e4bb 0%, #d8f0d9 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  box-shadow: 4px 0 20px var(--shadow);
  z-index: 100;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
}

.logo-area {
  text-align: center;
  margin-bottom: 14px;
}

.logo-icon {
  width: 90px;
  height: 90px;
  margin: 0 auto 8px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.12));
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.25;
  text-shadow: 1px 1px 0 #fff;
}

.nav-menu {
  width: 100%;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.55);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s ease;
  box-shadow: 0 3px 0 rgba(67,160,71,0.12);
}

.nav-item:hover, .nav-item.active {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(67,160,71,0.18);
  color: var(--primary-dark);
}

.nav-icon {
  font-size: 22px;
}

.sidebar-footer {
  width: 100%;
  margin-top: 10px;
}

.bone-display {
  background: #fff;
  border-radius: 50px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
  box-shadow: 0 3px 8px var(--shadow);
}

.bone-icon { font-size: 22px; }

/* 移动端顶部栏 */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: linear-gradient(90deg, #a5d6a7, #c8e6c9);
  align-items: center;
  padding: 0 14px;
  box-shadow: 0 2px 12px var(--shadow);
  z-index: 110;
}

.menu-toggle {
  background: #fff;
  border: none;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 22px;
  color: var(--primary-dark);
  cursor: pointer;
}

.mobile-logo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-dark);
}

.mobile-logo-icon { font-size: 24px; }

.mobile-bones {
  background: #fff;
  border-radius: 50px;
  padding: 6px 12px;
  font-weight: 800;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  height: 100%;
  overflow-y: auto;
  padding: 26px 32px;
  position: relative;
}

.page {
  display: none;
  animation: fadeIn .35s ease;
  max-width: 1100px;
  margin: 0 auto;
}

.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  margin-bottom: 22px;
}

.page-header h1 {
  font-size: 32px;
  color: var(--primary-dark);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.subtitle {
  color: var(--text-light);
  font-size: 16px;
  margin: 0;
}

/* 通用卡片 */
.card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 14px;
}

/* 学习首页 */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.home-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 24px var(--shadow);
}

.pet-summary { grid-column: span 2; }

.pet-status-main {
  display: flex;
  align-items: center;
  gap: 24px;
}

#homePetImg {
  width: 170px;
  height: 170px;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 18px;
  background: #f1f8e9;
  padding: 10px;
  box-shadow: inset 0 0 20px rgba(126,182,76,0.15);
}

.pet-bars {
  flex: 1;
  display: grid;
  gap: 12px;
}

.bar label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  display: block;
  margin-bottom: 4px;
}

.progress {
  height: 18px;
  background: #e8f5e9;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.fill {
  height: 100%;
  border-radius: 20px;
  transition: width .5s ease;
}

.fill.hp { background: linear-gradient(90deg, #ef5350, #e57373); }
.fill.energy { background: linear-gradient(90deg, #ffca28, #ffd54f); }
.fill.mood { background: linear-gradient(90deg, #ff6b9d, #ff8fb0); }
.fill.active { background: linear-gradient(90deg, #42a5f5, #64b5f6); }

.pet-message {
  margin-top: 14px;
  background: #fff8e1;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  color: #8d6e63;
  text-align: center;
}

.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.task-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-size: 16px;
  border-bottom: 1px dashed #e0e0e0;
}

.task-list li:last-child { border-bottom: none; }

.task-check { font-size: 20px; }

.quick-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.qbtn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
  background: #e8f5e9;
  color: var(--primary-dark);
  cursor: pointer;
  transition: transform .15s;
}

.qbtn:hover { transform: scale(1.03); background: #dcedc8; }

.mini-stats {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.mini-stats b {
  display: block;
  font-size: 28px;
  color: var(--primary-dark);
}

.mini-stats span { font-size: 13px; color: var(--text-light); }

/* 数据中心 */
.data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.data-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  box-shadow: 0 8px 24px var(--shadow);
}

.data-icon { font-size: 34px; margin-bottom: 8px; }

.data-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--primary-dark);
}

.data-label { font-size: 14px; color: var(--text-light); margin-top: 4px; }

.chart-section, .subject-stats {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px var(--shadow);
}

.simple-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 160px;
  padding: 10px 0;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, #81c784, #66bb6a);
  border-radius: 10px 10px 0 0;
  position: relative;
  min-height: 8px;
  transition: height .5s ease;
}

.chart-bar span {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.subject-item {
  background: #f1f8e9;
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subject-item b { color: var(--primary-dark); }

/* 错题模块 */
.mistake-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.m-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: 0 6px 20px var(--shadow);
}

.m-card div { font-size: 14px; color: var(--text-light); }
.m-card b { font-size: 28px; color: var(--primary-dark); }

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  border: none;
  border-radius: 50px;
  padding: 8px 18px;
  background: #e8f5e9;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
}

.mistake-list {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.mistake-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: 0 4px 14px var(--shadow);
}

.mistake-item .meta {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.mistake-item .q { font-size: 16px; font-weight: 700; margin-bottom: 10px; }

.bulk-review {
  width: 100%;
  padding: 16px;
  font-size: 18px;
}

/* 全科学习 */
.learning-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.learn-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  box-shadow: 0 10px 28px var(--shadow);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  border-top: 6px solid var(--primary);
}

.learn-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 34px var(--shadow);
}

.learn-card.chinese { border-color: #ef5350; }
.learn-card.english { border-color: #42a5f5; }
.learn-card.poem { border-color: #ab47bc; }
.learn-card.math { border-color: #ffca28; }
.learn-card.song { border-color: #ff6b9d; }

.learn-icon { font-size: 48px; margin-bottom: 10px; }
.learn-card h3 { margin: 0 0 6px; color: var(--primary-dark); font-size: 20px; }
.learn-card p { margin: 0 0 16px; color: var(--text-light); font-size: 14px; }
.learn-card button {
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

/* 学习子页 */
.back-btn {
  border: none;
  background: #fff;
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--shadow);
}

.subject-header {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px var(--shadow);
}

.subject-header h2 { margin: 0 0 8px; color: var(--primary-dark); }

.mode-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.mode-tab {
  border: none;
  border-radius: 50px;
  padding: 8px 18px;
  background: #e8f5e9;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.mode-tab.active { background: var(--primary); color: #fff; }

/* 识字/英文卡片 */
.word-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  box-shadow: 0 10px 30px var(--shadow);
  margin-bottom: 20px;
}

.big-char {
  font-size: 110px;
  font-weight: 900;
  color: var(--primary-dark);
  line-height: 1.1;
  margin: 10px 0;
  font-family: "KaiTi", "STKaiti", serif;
}

.big-word {
  font-size: 64px;
  font-weight: 900;
  color: var(--primary-dark);
  margin: 10px 0;
}

.pinyin, .word-mean {
  font-size: 22px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.word-sentence {
  font-size: 18px;
  color: #6d8b6f;
  margin-top: 12px;
  font-style: italic;
}

.action-btns {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn-primary {
  border: none;
  border-radius: 50px;
  padding: 14px 28px;
  font-size: 17px;
  font-weight: 800;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 0 #1b5e20;
  transition: transform .12s;
}

.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #1b5e20; }

.btn-secondary {
  border: 2px solid var(--primary);
  border-radius: 50px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 800;
  background: #fff;
  color: var(--primary-dark);
  cursor: pointer;
}

/* 答题区域 */
.quiz-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 10px 30px var(--shadow);
  margin-bottom: 20px;
}

.quiz-question {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 20px;
  text-align: center;
}

/* 看图题：大图展示 */
.quiz-emoji {
  font-size: 110px;
  line-height: 1.2;
  text-align: center;
  margin: 6px 0 22px;
  animation: popIn .4s ease;
  user-select: none;
}

/* 听音题：再听一遍按钮 */
.quiz-listen {
  display: block;
  margin: 6px auto 24px;
  padding: 16px 36px;
  font-size: 22px;
  font-weight: 800;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #7eb64c, #5a9e3a);
  border: none;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(126,182,76,0.4);
  transition: transform .15s, box-shadow .15s;
}
.quiz-listen:hover { transform: scale(1.05); box-shadow: 0 8px 20px rgba(126,182,76,0.5); }
.quiz-listen:active { transform: scale(0.97); }

@keyframes popIn {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.quiz-options button {
  border: 3px solid #e8f5e9;
  border-radius: var(--radius-sm);
  padding: 18px;
  font-size: 20px;
  font-weight: 800;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}

.quiz-options button:hover { background: #f1f8e9; border-color: var(--primary); }

/* 英文答题：单词 + 中文翻译双行选项 */
.quiz-options-en button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
}
.quiz-options-en .opt-word { font-size: 22px; font-weight: 800; }
.quiz-options-en .opt-mean { font-size: 14px; font-weight: 600; color: var(--text-light, #7a9a6d); }
.quiz-options-en button.correct .opt-mean { color: #1b5e20; }
.quiz-options-en button.wrong .opt-mean { color: #b71c1c; }
.quiz-options button.correct { background: #c8e6c9; border-color: #2e7d32; color: #1b5e20; }
.quiz-options button.wrong { background: #ffcdd2; border-color: #c62828; color: #b71c1c; }
.quiz-options button:disabled { opacity: .8; cursor: default; }

.quiz-feedback {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  margin-top: 16px;
  min-height: 32px;
}

/* 古诗 */
.poem-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 10px 30px var(--shadow);
  margin-bottom: 20px;
  text-align: center;
}

.poem-title { font-size: 26px; font-weight: 900; color: var(--primary-dark); margin-bottom: 6px; }
.poem-author { color: var(--text-light); margin-bottom: 18px; }
.poem-line {
  font-size: 24px;
  line-height: 1.8;
  font-family: "KaiTi", "STKaiti", serif;
}

.poem-meaning {
  background: #f1f8e9;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 20px;
  text-align: left;
  font-size: 16px;
  color: var(--text);
}

/* 算术 */
.math-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  box-shadow: 0 10px 30px var(--shadow);
  margin-bottom: 20px;
}

.math-problem {
  font-size: 56px;
  font-weight: 900;
  color: var(--primary-dark);
  margin: 20px 0;
}

.math-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 400px;
  margin: 0 auto;
}

.math-options button {
  border: 3px solid #e8f5e9;
  border-radius: var(--radius-sm);
  padding: 18px;
  font-size: 28px;
  font-weight: 900;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.math-options button:hover { background: #f1f8e9; border-color: var(--primary); }
.math-options button.correct { background: #c8e6c9; border-color: #2e7d32; }
.math-options button.wrong { background: #ffcdd2; border-color: #c62828; }

/* 儿歌 */
.song-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 10px 30px var(--shadow);
  margin-bottom: 20px;
  text-align: center;
}

.song-title { font-size: 24px; font-weight: 900; color: var(--primary-dark); margin-bottom: 12px; }
.song-lyrics {
  font-size: 20px;
  line-height: 2;
  color: var(--text);
  white-space: pre-line;
  margin-bottom: 20px;
}

.song-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

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

.song-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 14px var(--shadow);
  cursor: pointer;
  transition: transform .12s;
}

.song-item:hover { transform: translateX(6px); }
.song-item.active { background: #e8f5e9; border: 2px solid var(--primary); }

/* 宠物喂养 */
.pet-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
}

.pet-stage {
  background: linear-gradient(180deg, #e1f5e3, #f1f8e9);
  border-radius: var(--radius);
  min-height: 480px;
  height: 60vh;
  max-height: 620px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px 24px 0;
  overflow: visible;
  box-shadow: 0 10px 30px var(--shadow);
}

.stage-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.8) 0%, transparent 25%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.7) 0%, transparent 20%);
  pointer-events: none;
}

/* 喂养互动气泡 */
.pet-action-bubble {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.9);
  background: #fff;
  color: #2e7d32;
  font-size: 20px;
  font-weight: bold;
  padding: 12px 22px;
  border-radius: 24px;
  border: 3px solid #a5d6a7;
  box-shadow: 0 6px 18px rgba(76,175,80,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 5;
  white-space: nowrap;
  max-width: 92%;
}
.pet-action-bubble::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: #fff;
}
.pet-action-bubble.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  animation: bubbleWobble 2.4s ease-in-out;
}
@keyframes bubbleWobble {
  0%, 100% { }
  30% { transform: translateX(-50%) translateY(-4px) scale(1.03); }
  60% { transform: translateX(-50%) translateY(0) scale(1); }
}
@media (max-width: 768px) {
  .pet-action-bubble { font-size: 15px; padding: 8px 14px; white-space: normal; text-align: center; }
}

#petImg {
  width: auto;
  height: auto;
  max-width: 92%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  position: relative;
  z-index: 2;
  transition: transform .3s;
}

#petImg.bounce { animation: bounce .6s ease; }
#petImg.shake { animation: shake .5s ease; }
#petImg.heart { animation: pop .5s ease; }

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

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

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.pet-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.heart-float {
  position: absolute;
  font-size: 28px;
  animation: floatUp 1.2s ease forwards;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-120px) scale(1.4); }
}

.star-spark {
  position: absolute;
  font-size: 24px;
  animation: spark 1s ease forwards;
}

@keyframes spark {
  0% { opacity: 1; transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { opacity: 0; transform: scale(1) translateY(-80px); }
}

.pet-speech {
  position: absolute;
  top: 24px;
  right: 24px;
  background: #fff;
  border-radius: 18px;
  padding: 12px 18px;
  font-weight: 800;
  color: var(--primary-dark);
  box-shadow: 0 6px 18px var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: all .3s;
  z-index: 4;
}

.pet-speech.show { opacity: 1; transform: translateY(0); }

.growth-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  background: linear-gradient(90deg, #ffca28, #ffb300);
  color: #5d4037;
  font-weight: 900;
  padding: 8px 16px;
  border-radius: 50px;
  box-shadow: 0 4px 12px var(--shadow);
  z-index: 4;
}

.pet-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stats-card-pet, .pet-actions, .pet-info {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 24px var(--shadow);
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-row label { width: 60px; font-weight: 700; color: var(--text-light); }
.stat-row .progress { flex: 1; }
.stat-row span { width: 36px; text-align: right; font-weight: 800; }

.pet-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.pact {
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  font-size: 15px;
  font-weight: 800;
  background: #f1f8e9;
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .12s;
}

.pact span { font-size: 22px; }
.pact:hover { transform: translateY(-3px); background: #e8f5e9; }
.pact:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.pet-info p { margin: 6px 0; color: var(--text-light); }
.pet-info b { color: var(--primary-dark); }

/* 积分商城 */
.shop-balance {
  background: var(--bg-card);
  border-radius: 50px;
  padding: 14px 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 20px;
  box-shadow: 0 6px 18px var(--shadow);
}

.bone-big { font-size: 28px; }

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

.shop-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: 0 8px 24px var(--shadow);
  transition: transform .15s;
}

.shop-item:hover { transform: translateY(-5px); }

.shop-icon { font-size: 44px; margin-bottom: 8px; }
.shop-name { font-size: 17px; font-weight: 800; color: var(--primary-dark); margin-bottom: 4px; }
.shop-desc { font-size: 13px; color: var(--text-light); margin-bottom: 10px; min-height: 36px; }
.shop-price { font-size: 16px; font-weight: 800; color: #e65100; margin-bottom: 12px; }
.shop-item button {
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  background: var(--accent);
  color: #5d4037;
  font-weight: 800;
  cursor: pointer;
}
.shop-item button:disabled { background: #e0e0e0; cursor: not-allowed; }

/* 成长体系 */
.growth-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.gtab {
  border: none;
  border-radius: 50px;
  padding: 12px 22px;
  background: #e8f5e9;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.gtab.active { background: var(--primary); color: #fff; }

.growth-panel { display: none; }
.growth-panel.active { display: block; }

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 800;
}

.calendar-header button {
  border: none;
  background: #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 22px;
  color: var(--primary-dark);
  cursor: pointer;
  box-shadow: 0 3px 10px var(--shadow);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 24px var(--shadow);
}

.cal-day-name {
  text-align: center;
  font-weight: 800;
  color: var(--text-light);
  padding: 8px 0;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #f5f5f5;
  font-weight: 700;
  position: relative;
}

.cal-day.done { background: #c8e6c9; color: #1b5e20; }
.cal-day.today { border: 3px solid var(--primary); }
.cal-day.empty { background: transparent; }

.calendar-legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  font-size: 14px;
}

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; }
.dot.done { background: #c8e6c9; }
.dot.today { border: 2px solid var(--primary); background: #fff; }

.streak-box {
  margin-top: 18px;
  background: #fff8e1;
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  font-size: 18px;
  color: #8d6e63;
  font-weight: 700;
}

.streak-box b { color: #e65100; font-size: 26px; }

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

.achievement {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: 0 6px 20px var(--shadow);
  opacity: .55;
  transition: opacity .3s;
}

.achievement.unlocked { opacity: 1; border: 3px solid var(--accent); }

.ach-icon { font-size: 42px; margin-bottom: 8px; }
.ach-name { font-weight: 800; color: var(--primary-dark); margin-bottom: 4px; }
.ach-desc { font-size: 13px; color: var(--text-light); }

.record-list {
  display: grid;
  gap: 12px;
}

.record-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: 0 4px 14px var(--shadow);
  display: flex;
  gap: 12px;
  align-items: center;
}

.record-date { font-size: 13px; color: var(--text-light); white-space: nowrap; }
.record-text { flex: 1; }

/* Toast */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(46,74,47,0.92);
  color: #fff;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
  transition: all .35s ease;
  z-index: 200;
  white-space: nowrap;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 语音开关 */
.voice-control {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 20px var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  z-index: 150;
  transition: transform .2s;
}

.voice-control:hover { transform: scale(1.1); }
.voice-control.muted { background: #ffebee; }

/* 安装到主屏幕提示条 */
.install-pill {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FFE08A, #FF8FB1);
  color: #5a3a00;
  padding: 10px 12px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(255, 143, 177, .45);
  z-index: 200;
  max-width: 92vw;
  font-size: 14px;
  font-weight: 600;
  animation: pillIn .35s ease;
}
@keyframes pillIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.install-pill[hidden] { display: none; }
.install-pill .ip-emoji { font-size: 18px; }
.install-pill .ip-btn {
  border: none;
  background: #fff;
  color: #FF6FA3;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}
.install-pill .ip-close {
  border: none;
  background: rgba(255, 255, 255, .55);
  color: #5a3a00;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 13px;
}

/* 响应式：平板/手机横屏 */
@media (max-width: 1024px) {
  .sidebar { width: 200px; min-width: 200px; }
  .main-content { margin-left: 200px; padding: 18px; }
  .home-grid { grid-template-columns: 1fr; }
  .pet-summary { grid-column: span 1; }
  .learning-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .achievements-grid { grid-template-columns: repeat(2, 1fr); }
  .data-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 响应式：手机竖屏/小屏 */
@media (max-width: 768px) {
  #app { flex-direction: column; }
  .sidebar {
    position: fixed;
    left: -100%;
    width: 75%;
    max-width: 280px;
    transition: left .3s ease;
    border-radius: 0 24px 24px 0;
  }
  .sidebar.open { left: 0; }
  .mobile-header { display: flex; }
  .main-content {
    margin-left: 0;
    margin-top: 56px;
    padding: 14px;
    height: calc(100% - 56px);
  }
  .pet-layout { grid-template-columns: 1fr; }
  #petImg { max-width: 90%; max-height: 100%; width: auto; height: auto; }
  .pet-stage { min-height: 340px; height: 45vh; padding: 16px 16px 0; }
  .learning-grid { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: 1fr; }
  .data-grid { grid-template-columns: repeat(2, 1fr); }
  .achievements-grid { grid-template-columns: 1fr; }
  .subject-grid { grid-template-columns: 1fr; }
  .quiz-options { grid-template-columns: 1fr; }
  .big-char { font-size: 80px; }
  .big-word { font-size: 48px; }
  .math-problem { font-size: 42px; }
  .calendar-grid { gap: 4px; padding: 10px; }
  .cal-day { font-size: 13px; }
  .mistake-summary { grid-template-columns: 1fr; }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-header { height: 48px; }
  .main-content { margin-top: 48px; height: calc(100% - 48px); }
  .pet-stage { min-height: 220px; height: 72vh; padding: 12px 12px 0; }
  #petImg { max-width: 88%; max-height: 100%; width: auto; height: auto; }
  .home-card { padding: 14px; }
}
