/* ========== 全局样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "KaiTi", sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* ========== 主容器（平板横屏） ========== */
.app-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 25%, #E8F5E9 50%, #C8E6C9 75%, #A5D6A7 100%);
  overflow: hidden;
}

/* ========== 天空装饰 ========== */
.sky-decor {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 35%;
  pointer-events: none;
  z-index: 1;
}

.sun {
  position: absolute;
  top: 40px;
  right: 60px;
  width: 65px;
  height: 65px;
  background: radial-gradient(circle, #FFD54F 0%, #FF8F00 100%);
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(255, 193, 7, 0.6);
  animation: sunPulse 4s ease-in-out infinite;
}

@keyframes sunPulse {
  0%, 100% { box-shadow: 0 0 50px rgba(255, 193, 7, 0.6); transform: scale(1); }
  50% { box-shadow: 0 0 70px rgba(255, 193, 7, 0.8); transform: scale(1.05); }
}

.cloud {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.9;
  animation: cloudDrift 60s linear infinite;
}

.cloud1 {
  width: 90px; height: 35px;
  top: 50px; left: 60px;
  box-shadow: 25px -10px 0 -4px white, 50px -3px 0 -6px white, -15px -3px 0 -5px white;
}

.cloud2 {
  width: 60px; height: 25px;
  top: 100px; left: 350px;
  box-shadow: 18px -6px 0 -2px white, 35px -2px 0 -4px white;
  animation-duration: 80s;
  opacity: 0.8;
}

@keyframes cloudDrift {
  0% { transform: translateX(0); }
  100% { transform: translateX(120vw); }
}

/* ========== 草地装饰 ========== */
.ground-decor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  z-index: 2;
  pointer-events: none;
}

.ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: linear-gradient(180deg, #8BC34A 0%, #689F38 40%, #558B2F 100%);
  border-radius: 50% 50% 0 0 / 20px 20px 0 0;
}

.ground-hill {
  position: absolute;
  bottom: 55px;
  background: #8BC34A;
  border-radius: 50% 50% 0 0;
}

.hill1 { left: 15%; width: 250px; height: 45px; }
.hill2 { right: 20%; width: 200px; height: 38px; bottom: 58px; }
.hill3 { left: 45%; width: 180px; height: 32px; bottom: 60px; }

/* 小花 */
.flower {
  position: absolute;
  bottom: 62px;
  animation: flowerSway 3s ease-in-out infinite;
  z-index: 3;
}

@keyframes flowerSway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.flower-stem {
  width: 2px;
  height: 16px;
  background: #558B2F;
  margin: 0 auto;
}

.flower-head {
  position: relative;
  width: 18px;
  height: 18px;
  margin-bottom: -2px;
}

.flower-head .petal {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.flower-head .p1 { top: 0; left: 5px; background: #FF80AB; }
.flower-head .p2 { top: 5px; left: 0; background: #FF4081; }
.flower-head .p3 { top: 5px; right: 0; background: #FF4081; }
.flower-head .p4 { bottom: 0; left: 5px; background: #FF80AB; }
.flower-head .p5 { top: -1px; left: 2px; background: #FF6090; transform: rotate(-30deg); }
.flower-head .p6 { top: -1px; right: 2px; background: #FF6090; transform: rotate(30deg); }

.flower-head .center {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #FFD54F;
  border-radius: 50%;
  top: 5px;
  left: 5px;
  z-index: 2;
}

/* 黄色花 */
.flower.yellow .p1, .flower.yellow .p4 { background: #FFEB3B; }
.flower.yellow .p2, .flower.yellow .p3 { background: #FFC107; }
.flower.yellow .p5, .flower.yellow .p6 { background: #FFD54F; }

/* 蘑菇 */
.mushroom {
  position: absolute;
  bottom: 58px;
  z-index: 3;
}

.mushroom-cap {
  width: 25px;
  height: 16px;
  background: linear-gradient(180deg, #EF5350 0%, #E53935 100%);
  border-radius: 50% 50% 0 0;
  position: relative;
}

.mushroom-cap::before {
  content: '';
  position: absolute;
  width: 5px; height: 4px;
  background: white;
  border-radius: 50%;
  top: 3px; left: 5px;
}

.mushroom-cap::after {
  content: '';
  position: absolute;
  width: 7px; height: 5px;
  background: white;
  border-radius: 50%;
  top: 5px; right: 4px;
}

.mushroom-stem {
  width: 11px;
  height: 13px;
  background: linear-gradient(90deg, #EFEBE9, #FFF8E1, #EFEBE9);
  margin: 0 auto;
  border-radius: 0 0 3px 3px;
}

/* ========== 顶部导航栏 ========== */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.8));
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  z-index: 100;
  border-bottom: 3px solid rgba(109, 76, 65, 0.15);
}

.back-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8D6E63, #6D4C41);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  border: 2px solid #5D4037;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.back-btn:active {
  transform: scale(0.9);
}

.back-arrow {
  width: 14px;
  height: 14px;
  border-left: 4px solid #FFD54F;
  border-bottom: 4px solid #FFD54F;
  transform: rotate(45deg);
  margin-left: 4px;
  margin-bottom: 2px;
}

.page-title {
  font-size: 22px;
  font-weight: bold;
  color: #5D4037;
  text-align: center;
}

.page-subtitle {
  font-size: 13px;
  color: #8D6E63;
  text-align: center;
}

.top-stats {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  padding: 6px 14px;
  border-radius: 20px;
  border: 2px solid #FFB74D;
  font-weight: bold;
  font-size: 14px;
  color: #5D4037;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.star-icon {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #FFD54F, #FF8F00);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* ========== 底部导航 ========== */
.bottom-nav {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: linear-gradient(180deg, #8D6E63 0%, #6D4C41 100%);
  border-radius: 25px;
  padding: 8px 18px;
  z-index: 100;
  border: 3px solid #5D4037;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 16px;
  border-radius: 15px;
  cursor: pointer;
  color: #BCAAA4;
  transition: all 0.2s;
  min-width: 60px;
}

.nav-item.active {
  background: rgba(255, 213, 79, 0.2);
  color: #FFD54F;
}

.nav-item:active {
  transform: scale(0.95);
}

.nav-icon {
  width: 26px;
  height: 26px;
  margin-bottom: 3px;
  position: relative;
}

/* 首页图标 */
.nav-home {
  position: relative;
  width: 24px;
  height: 22px;
}
.nav-home::before {
  content: '';
  position: absolute;
  width: 0; height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 11px solid currentColor;
  top: 0; left: 50%; transform: translateX(-50%);
}
.nav-home::after {
  content: '';
  position: absolute;
  width: 19px; height: 11px;
  background: currentColor;
  bottom: 0; left: 50%; transform: translateX(-50%);
  border-radius: 2px 2px 0 0;
  opacity: 0.9;
}

/* 学习图标 */
.nav-book {
  position: relative;
  width: 24px;
  height: 22px;
}
.nav-book::before, .nav-book::after {
  content: '';
  position: absolute;
  width: 9px; height: 17px;
  background: currentColor;
  bottom: 0;
  border-radius: 3px 3px 0 0;
}
.nav-book::before { left: 3px; transform: perspective(20px) rotateY(-8deg); }
.nav-book::after { right: 3px; transform: perspective(20px) rotateY(8deg); }

/* 游戏图标 */
.nav-game {
  position: relative;
  width: 26px;
  height: 18px;
  background: currentColor;
  border-radius: 6px 6px 10px 10px;
  top: 4px;
}
.nav-game::before {
  content: '';
  position: absolute;
  width: 5px; height: 5px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  top: 5px; left: 4px;
}
.nav-game::after {
  content: '';
  position: absolute;
  width: 7px; height: 2px;
  background: rgba(255,255,255,0.3);
  border-radius: 1px;
  top: 7px; right: 4px;
  box-shadow: 0 3px 0 rgba(255,255,255,0.3);
}

/* 家长图标 */
.nav-parent {
  position: relative;
  width: 22px;
  height: 24px;
}
.nav-parent::before {
  content: '';
  position: absolute;
  width: 11px; height: 11px;
  background: currentColor;
  border-radius: 50%;
  top: 0; left: 50%; transform: translateX(-50%);
}
.nav-parent::after {
  content: '';
  position: absolute;
  width: 17px; height: 11px;
  background: currentColor;
  border-radius: 50% 50% 30% 30%;
  bottom: 0; left: 50%; transform: translateX(-50%);
}

.nav-label {
  font-size: 11px;
  font-weight: bold;
}

/* ========== 主内容区 ========== */
.main-content {
  position: absolute;
  top: 65px;
  left: 0;
  right: 0;
  bottom: 80px;
  overflow: hidden;
  z-index: 10;
}

/* ========== 按钮通用样式 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  border: 3px solid;
  box-shadow: 0 5px 0 rgba(0,0,0,0.2);
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #66BB6A 0%, #388E3C 100%);
  border-color: #1B5E20;
  color: white;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.btn-secondary {
  background: linear-gradient(135deg, #FFB74D 0%, #F57C00 100%);
  border-color: #E65100;
  color: white;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
  border-radius: 30px;
  padding: 30px;
  border: 4px solid #8D6E63;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  max-width: 500px;
  width: 90%;
  text-align: center;
  transform: scale(0.8);
  transition: transform 0.3s;
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

/* ========== 动画工具类 ========== */
.bounce {
  animation: bounce 2s ease-in-out infinite;
}

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

.pop-in {
  animation: popIn 0.4s ease-out;
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
}

/* ========== 小猫咪助手 ========== */
.helper-cat {
  position: absolute;
  bottom: 90px;
  left: 25px;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.cat-bubble {
  background: white;
  padding: 12px 18px;
  border-radius: 18px 18px 18px 4px;
  font-size: 14px;
  color: #5D4037;
  font-weight: bold;
  box-shadow: 0 3px 15px rgba(0,0,0,0.15);
  border: 2px solid #FFB74D;
  max-width: 200px;
  position: relative;
  animation: bubbleBounce 2s ease-in-out infinite;
}

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

.mini-cat {
  width: 60px;
  height: 55px;
  position: relative;
  animation: miniCatBounce 1.5s ease-in-out infinite;
}

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

.mini-cat-body {
  position: absolute;
  bottom: 0;
  left: 10px;
  width: 40px;
  height: 35px;
  background: linear-gradient(135deg, #FFB74D, #FF9800);
  border-radius: 50% 50% 42% 42%;
}

.mini-cat-head {
  position: absolute;
  top: 5px;
  left: 8px;
  width: 44px;
  height: 40px;
  background: linear-gradient(135deg, #FFB74D, #FFA726);
  border-radius: 50%;
}

.mini-ear {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 18px solid #FFA726;
  top: -5px;
}

.mini-ear.left { left: 3px; transform: rotate(-15deg); }
.mini-ear.right { right: 3px; transform: rotate(15deg); }

.mini-eye {
  position: absolute;
  width: 7px;
  height: 9px;
  background: #2C1810;
  border-radius: 50%;
  top: 15px;
}

.mini-eye.left { left: 10px; }
.mini-eye.right { right: 10px; }

.mini-eye::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
}

.mini-nose {
  position: absolute;
  width: 6px;
  height: 4px;
  background: #FF8A65;
  border-radius: 50%;
  top: 23px;
  left: 50%;
  transform: translateX(-50%);
}

.mini-mouth {
  position: absolute;
  top: 27px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 5px;
}

.mini-mouth::before, .mini-mouth::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 3px;
  border: 1.5px solid #5D4037;
  border-top: none;
}

.mini-mouth::before { left: 1px; border-right: none; border-radius: 0 0 0 4px; }
.mini-mouth::after { right: 1px; border-left: none; border-radius: 0 0 4px 0; }
