/* ===== 地图页面 ===== */
.map-top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 12px 8px;
  background: var(--gc-card);
  box-shadow: 0 2px 12px rgba(79,140,255,0.06);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}
.map-logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.map-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.map-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gc-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79,140,255,0.3);
  color: white;
}
.map-logo-text { line-height: 1.2; min-width: 0; }
.map-logo-title { font-size: 15px; font-weight: 800; }
.map-logo-sub { font-size: 11px; color: var(--gc-muted-foreground); }
.map-top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gc-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  color: var(--gc-primary);
  transition: transform 0.1s;
}
.icon-btn:active { transform: scale(0.95); }

.map-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.player-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  flex: 1;
}
.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #A8E6CF 0%, #7ED9A5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid white;
  box-shadow: 0 4px 12px rgba(34,197,94,0.25);
  position: relative;
  flex-shrink: 0;
}
.player-level-badge {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 28px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gc-primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid white;
}
.player-info { min-width: 0; flex: 1; }
.player-name { font-size: 15px; font-weight: 700; }
.player-exp-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.exp-bar {
  width: 64px;
  height: 6px;
  border-radius: 999px;
  background: var(--gc-muted);
  overflow: hidden;
}
.exp-fill {
  height: 100%;
  width: 60%;
  border-radius: 999px;
  background: var(--gc-primary);
}
.exp-text { font-size: 10px; color: var(--gc-muted-foreground); }

.player-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.stat-pill.stars { background: #FFF6E0; color: #B45309; }
.stat-pill.coins { background: #E6F9EF; color: #15803D; }

/* ===== 首页学习阶段状态条 ===== */
.map-stage-bar {
  margin: 10px 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gc-card) 0%, rgba(79,140,255,0.06) 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}
.map-stage-bar:active { transform: scale(0.98); }
.map-stage-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(79,140,255,0.12) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.map-stage-bar:active::before { transform: translateX(100%); }

.map-stage-deer {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  flex-shrink: 0;
  animation: deer-idle-bob 2s ease-in-out infinite;
}
@keyframes deer-idle-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.map-stage-info { flex: 1; min-width: 0; }
.map-stage-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gc-muted-foreground);
  margin-bottom: 3px;
}
.map-stage-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--gc-foreground);
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-stage-value .stage-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gc-muted);
}

.map-stage-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(79,140,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gc-primary);
  transition: transform 0.25s;
}
.map-stage-bar:active .map-stage-arrow { transform: rotate(180deg); }
.map-stage-arrow i { width: 20px; height: 20px; }

/* 切换时状态条晃动反馈 */
.map-stage-bar.shake {
  animation: stage-bar-shake 0.5s ease-in-out;
}
@keyframes stage-bar-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* 每日挑战横幅 */
.daily-banner {
  margin: 12px 12px 0;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #FFB347 0%, #FF8A4C 100%);
  box-shadow: 0 6px 18px rgba(255,138,76,0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  border: none;
  width: calc(100% - 24px);
  transition: transform 0.1s;
}
.daily-banner:active { transform: scale(0.98); }
.daily-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.daily-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}
.daily-text { color: white; text-align: left; min-width: 0; }
.daily-title { font-size: 14px; font-weight: 800; line-height: 1.2; }
.daily-sub { font-size: 11px; color: rgba(255,255,255,0.9); line-height: 1.2; margin-top: 2px; }
.daily-right { display: flex; align-items: center; gap: 6px; color: white; flex-shrink: 0; }
.daily-time-label { font-size: 11px; opacity: 0.85; }
.daily-time { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* 趣味玩法 */
.fun-section { padding: 12px 12px 0; }
.fun-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gc-muted-foreground);
  margin-bottom: 8px;
  padding: 0 2px;
}
.fun-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.fun-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--gc-card);
  border: 1.5px solid;
  box-shadow: var(--gc-shadow-sm);
  cursor: pointer;
  transition: transform 0.1s;
  border-color: rgba(167,139,250,0.18);
}
.fun-card:active { transform: scale(0.97); }
.fun-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--gc-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}
.fun-card-text { text-align: left; min-width: 0; }
.fun-card-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.fun-card-desc { font-size: 10px; color: var(--gc-muted-foreground); line-height: 1.2; margin-top: 2px; }

/* 学科选项卡：大图标卡片式，完全平铺左右无间隙 */
.subject-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 0;
}
.subject-tabs::-webkit-scrollbar { display: none; }
.subject-tab {
  flex: 1 1 0;
  min-width: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.85);
  color: var(--gc-muted-foreground);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.subject-tab:hover {
  transform: translateY(-3px);
  border-color: rgba(0,0,0,0.1);
}
.subject-tab:active {
  transform: translateY(0) scale(0.97);
}
.subject-tab.active {
  color: white;
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.15);
}
.subject-tab.active:hover {
  transform: translateY(-6px);
}
/* 学科图标背景 */
.subject-tab .subject-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
}
.subject-tab.active .subject-icon-wrap {
  background: rgba(255,255,255,0.25);
  box-shadow: 0 4px 12px rgba(255,255,255,0.2);
}
.subject-tab .subject-icon-wrap i,
.subject-tab .subject-icon-wrap svg {
  width: 24px;
  height: 24px;
  transition: all 0.25s ease;
}
.subject-tab .subject-name {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}
.subject-tab .subject-sub {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.6;
  line-height: 1;
}
.subject-tab.active .subject-sub {
  opacity: 0.85;
}
/* 数学 - 蓝色主题 */
.subject-tab[data-subject="math"] .subject-icon-wrap { color: var(--gc-math); }
.subject-tab[data-subject="math"].active {
  background: linear-gradient(160deg, #4F8CFF 0%, #3B82F6 100%);
}
/* 语文 - 红色主题 */
.subject-tab[data-subject="chinese"] .subject-icon-wrap { color: var(--gc-chinese); }
.subject-tab[data-subject="chinese"].active {
  background: linear-gradient(160deg, #FF6B6B 0%, #EF4444 100%);
}
/* 英语 - 橙色主题 */
.subject-tab[data-subject="english"] .subject-icon-wrap { color: var(--gc-english); }
.subject-tab[data-subject="english"].active {
  background: linear-gradient(160deg, #FFB347 0%, #F59E0B 100%);
}
/* 选中时底部高亮条 */
.subject-tab.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.6);
}

/* 地图区域 */
.map-section { padding: 8px 12px 12px; }
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}
/* 通关规则提示 */
.map-rule-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 4px 8px;
  padding: 5px 10px;
  background: rgba(79,140,255,0.08);
  border-radius: 8px;
  font-size: 11px;
  color: var(--gc-primary);
  font-weight: 600;
}
.map-rule-hint i { flex-shrink: 0; }
.map-chapter-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chapter-indicator {
  width: 6px;
  height: 20px;
  border-radius: 3px;
  background: var(--gc-math);
}
.chapter-name { font-size: 16px; font-weight: 800; }
.map-progress-text { font-size: 11px; color: var(--gc-muted-foreground); }

.map-container {
  position: relative;
  width: 100%;
  height: var(--gc-map-height, 560px);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 2px solid rgba(0,0,0,0.06);
}
.map-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #BFE3FF 0%, #E8F4FF 38%, #DCF1E1 60%, #C8EBC9 100%);
}
.map-sun {
  position: absolute;
  top: 16px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFE680 0%, #FFD64A 70%, rgba(255,214,74,0) 100%);
  box-shadow: 0 0 28px rgba(255,214,74,0.6);
}
.map-cloud {
  position: absolute;
  display: flex;
}
.map-cloud span {
  background: rgba(255,255,255,0.85);
  border-radius: 999px;
}
.map-hill {
  position: absolute;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.map-grass {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(180deg, #A8E0A8 0%, #8ACB8A 100%);
}
.map-bush {
  position: absolute;
  bottom: 60px;
  display: flex;
}
.map-bush span { border-radius: 50%; }
.map-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.map-hint {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--gc-muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.level-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.level-node:disabled { cursor: not-allowed; }
.level-node-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  color: white;
  position: relative;
}
.level-node.completed .level-node-circle {
  background: var(--gc-success);
  box-shadow: 0 4px 12px rgba(34,197,94,0.35);
}
.level-node.current .level-node-circle {
  background: var(--gc-warning);
  box-shadow: 0 0 20px rgba(245,158,11,0.55);
}
.level-node.locked .level-node-circle {
  background: #C4CFDA;
  box-shadow: 0 4px 12px rgba(107,122,141,0.25);
}
.level-node.current .level-node-glow {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(245,158,11,0.35);
  animation: node-pulse 2s ease-in-out infinite;
  z-index: -1;
}
@keyframes node-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 0.3; }
}
.level-node-label {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  color: var(--gc-foreground);
}
.level-node.current .level-node-label {
  background: var(--gc-warning);
  color: white;
  font-size: 11px;
}
.level-node.boss .level-node-circle {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #FF8A4C 0%, #EF4444 100%);
  box-shadow: 0 6px 16px rgba(239,68,68,0.32);
  font-size: 28px;
}
.level-node.boss.locked .level-node-circle {
  background: #C4CFDA;
}
.boss-lock {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  color: var(--gc-danger);
}

/* ===== 响应式：平板竖屏（小米平板竖屏等，>=768px） ===== */
@media (min-width: 768px) {
  /* 首页"趣味玩法"卡片：2列 -> 3列 */
  .fun-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  /* 学科选项卡：取消横向滚动，平铺为5列 */
  .subject-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    justify-content: center;
  }
  .subject-tab { flex: 0 1 calc(20% - 10px); }
}

/* ===== 响应式：平板横屏（小米平板横屏等，>=1024px） ===== */
@media (min-width: 1024px) {
  /* 首页"趣味玩法"卡片：3列 -> 4列 */
  .fun-grid { grid-template-columns: repeat(4, 1fr); }
  /* 关卡节点圆圈在宽屏略放大 */
  .level-node-circle { width: 56px; height: 56px; }
  .level-node.boss .level-node-circle { width: 72px; height: 72px; }
}

/* ===== 响应式：小屏手机（<=360px）紧凑优化 ===== */
@media (max-width: 360px) {
  /* 学科选项卡紧凑：减小内边距 */
  .subject-tab { padding: 10px 6px 8px; }
  .subject-tab .subject-icon-wrap { width: 38px; height: 38px; }
  /* 趣味玩法卡片紧凑 */
  .fun-card { padding: 10px; gap: 8px; }
  .fun-card-icon { width: 36px; height: 36px; }
  /* 顶部状态栏紧凑 */
  .map-top-bar { padding: 10px 10px 6px; }
  .map-stage-bar { margin: 8px 10px 10px; padding: 12px 14px; }
  .subject-tabs { padding: 8px 0 12px; }
  .map-header { padding: 0 4px; }
}
