/* ===== ED Platform - Kids Economics ===== */
:root {
  --primary: #4ECDC4;
  --primary-dark: #38B5AC;
  --secondary: #FFE66D;
  --accent: #FF6B6B;
  --purple: #A78BFA;
  --orange: #F97316;
  --pink: #F472B6;
  --blue: #60A5FA;
  --green: #34D399;
  --bg: #F0F9FF;
  --card-bg: #FFFFFF;
  --text: #1E293B;
  --text-light: #64748B;
  --radius: 16px;
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ===== Top Bar ===== */
.top-bar {
  background: linear-gradient(135deg, var(--primary), #45B7AA);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(78, 205, 196, 0.3);
}

.avatar-row { display: flex; align-items: center; gap: 10px; }
.avatar-emoji {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.user-name { font-weight: 700; font-size: 15px; }
.user-level { font-size: 12px; opacity: 0.9; }

.top-stats { display: flex; align-items: center; gap: 8px; }
.stat-badge {
  background: rgba(255,255,255,0.2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.progress-track {
  width: 50px; height: 6px;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: white;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ===== Navigation ===== */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 6px 4px;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
  z-index: 100;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-btn {
  background: none;
  border: none;
  font-size: 20px;
  padding: 6px 4px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  min-width: 36px;
}
.nav-btn.active {
  background: var(--primary);
  transform: scale(1.1);
}
.nav-btn:active { transform: scale(0.9); }

/* ===== Pages ===== */
.page {
  display: none;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
.page.active { display: block; }

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

.page-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}
.page-desc {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
}

/* ===== Home ===== */
.home-hero {
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  border-radius: var(--radius);
  color: white;
  margin-bottom: 20px;
}
.hero-emoji { font-size: 56px; margin-bottom: 8px; }
.home-hero h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.hero-sub { font-size: 14px; opacity: 0.9; }

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.home-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.home-card:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-lg);
}
.home-card-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.home-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.home-card p { font-size: 12px; color: var(--text-light); }

/* ===== Level Cards ===== */
.level-list { display: flex; flex-direction: column; gap: 12px; }
.level-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
  border-left: 5px solid var(--primary);
}
.level-card:active { transform: scale(0.98); }
.level-card.locked { opacity: 0.5; cursor: not-allowed; }
.level-card.completed { border-left-color: var(--green); }

.level-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.level-info { flex: 1; }
.level-name { font-size: 16px; font-weight: 700; }
.level-desc { font-size: 13px; color: var(--text-light); }
.level-status {
  font-size: 12px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 4px;
}
.level-status.completed { background: #D1FAE5; color: #059669; }
.level-status.active { background: #DBEAFE; color: #2563EB; }
.level-status.locked { background: #F1F5F9; color: #94A3B8; }
.stars { font-size: 14px; margin-top: 2px; }

/* ===== Level Detail ===== */
.back-btn {
  background: var(--card-bg);
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.concept-card {
  border-radius: var(--radius);
  padding: 20px;
  color: white;
  margin-bottom: 16px;
}
.concept-card h3 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.concept-text {
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-line;
}
.start-quiz-btn {
  display: block;
  margin-top: 16px;
  background: rgba(255,255,255,0.25);
  border: 2px solid white;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.quiz-progress { display: flex; gap: 8px; margin-bottom: 16px; }
.quiz-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #E2E8F0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.quiz-dot.current { background: var(--primary); color: white; }
.quiz-dot.done-correct { background: var(--green); color: white; }
.quiz-dot.done-wrong { background: var(--accent); color: white; }

.quiz-question {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.7;
  white-space: pre-line;
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  background: var(--card-bg);
  border: 2px solid #E2E8F0;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}
.quiz-option:active { transform: scale(0.98); }
.quiz-option.correct { border-color: var(--green); background: #D1FAE5; }
.quiz-option.wrong { border-color: var(--accent); background: #FEE2E2; }

.quiz-feedback {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.7;
}
.quiz-feedback.correct { background: #D1FAE5; color: #065F46; }
.quiz-feedback.wrong { background: #FEE2E2; color: #991B1B; }

.next-level-btn, .retry-btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-top: 12px;
}
.next-level-btn { background: var(--primary); color: white; }
.retry-btn { background: var(--orange); color: white; }

/* ===== Checkin ===== */
.checkin-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.checkin-today { text-align: center; margin-bottom: 16px; }
.checkin-big-btn {
  background: linear-gradient(135deg, var(--primary), var(--blue));
  border: none;
  padding: 20px 40px;
  border-radius: 20px;
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s;
}
.checkin-big-btn:active { transform: scale(0.95); }
.checkin-big-btn.checked {
  background: var(--green);
  pointer-events: none;
}
.checkin-emoji { font-size: 28px; }

.checkin-streak-big {
  text-align: center;
  padding: 16px;
  margin-bottom: 16px;
}
.streak-fire { font-size: 36px; }
.streak-num {
  font-size: 48px;
  font-weight: 900;
  color: var(--orange);
  margin: 0 4px;
}
.streak-label { font-size: 14px; color: var(--text-light); }

.checkin-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-header {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  padding: 4px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}
.cal-day.empty { visibility: hidden; }
.cal-day.checked { background: var(--green); color: white; font-weight: 700; }
.cal-day.today { border: 2px solid var(--primary); font-weight: 700; }

/* ===== Card Stack (Cases / Decisions) ===== */
.card-stack { display: flex; flex-direction: column; gap: 16px; }
.story-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.story-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.story-text {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-line;
  margin-bottom: 14px;
  color: var(--text);
}
.story-question {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  padding: 10px;
  background: #F8FAFC;
  border-radius: 10px;
}
.story-options { display: flex; flex-direction: column; gap: 8px; }
.story-option {
  background: #F1F5F9;
  border: 2px solid transparent;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}
.story-option:active { transform: scale(0.98); }
.story-option.selected-correct { border-color: var(--green); background: #D1FAE5; }
.story-option.selected-wrong { border-color: var(--accent); background: #FEE2E2; }
.story-option:disabled { cursor: default; }

.story-feedback {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
}
.story-feedback.correct { background: #D1FAE5; color: #065F46; }
.story-feedback.wrong { background: #FEF3C7; color: #92400E; }

/* ===== Allowance ===== */
.allowance-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.jar-visual {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}
.jar {
  width: 80px;
  height: 140px;
  background: #F1F5F9;
  border-radius: 8px 8px 20px 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.jar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  transition: height 0.3s ease, background 0.3s;
}
#spendFill { background: linear-gradient(to top, #F97316, #FBBF24); }
#saveFill { background: linear-gradient(to top, #3B82F6, #60A5FA); }
#donateFill { background: linear-gradient(to top, #EC4899, #F472B6); }
.jar-icon { font-size: 24px; margin-bottom: 4px; z-index: 1; }
.jar-label { font-size: 11px; font-weight: 600; z-index: 1; color: var(--text-light); }
.jar-val { font-size: 18px; font-weight: 800; z-index: 1; margin-bottom: 8px; }

.jar-sliders { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.slider-row label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.slider-row input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  -webkit-appearance: none;
  background: #E2E8F0;
  outline: none;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.total-bar {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.total-bar.ok { background: #D1FAE5; color: #059669; }
.total-bar.over { background: #FEE2E2; color: #DC2626; }
.total-bar.under { background: #FEF3C7; color: #D97706; }

.action-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}
.action-btn.big {
  background: linear-gradient(135deg, var(--primary), var(--blue));
  color: white;
  font-size: 18px;
  padding: 16px;
}
.action-btn:active { transform: scale(0.97); }

.compound-preview {
  margin-top: 16px;
  padding: 16px;
  background: #D1FAE5;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.7;
  display: none;
}
.compound-preview strong { color: #059669; }

.allowance-history { margin-top: 16px; }
.allowance-history table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.allowance-history th, .allowance-history td {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid #F1F5F9;
}
.allowance-history th { font-weight: 700; color: var(--text-light); }

/* ===== Encyclopedia ===== */
.ency-search {
  margin-bottom: 12px;
}
.ency-search input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.ency-search input:focus { border-color: var(--primary); }

.ency-progress {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 12px;
  text-align: center;
}
.ency-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.ency-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
}
.ency-card:active { transform: scale(0.98); }
.ency-card.mastered { border-left: 4px solid var(--green); }
.ency-icon { font-size: 28px; flex-shrink: 0; }
.ency-name { font-size: 15px; font-weight: 700; }
.ency-def { font-size: 12px; color: var(--text-light); }

/* ===== News ===== */
.news-stack { display: flex; flex-direction: column; gap: 16px; }
.news-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
}
.news-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.news-date { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.news-summary {
  font-size: 14px;
  padding: 10px;
  background: #F8FAFC;
  border-radius: 8px;
  margin-bottom: 12px;
  line-height: 1.7;
}
.news-economics {
  font-size: 14px;
  padding: 14px;
  background: #EEF2FF;
  border-radius: 10px;
  line-height: 1.7;
  border-left: 3px solid var(--purple);
}
.news-concept {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  background: var(--purple);
  color: white;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

/* ===== Badges ===== */
.badge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.badge-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}
.badge-card.unlocked {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 2px solid #F59E0B;
}
.badge-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}
.badge-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.badge-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.badge-desc { font-size: 12px; color: var(--text-light); }

/* ===== Parent ===== */
.pin-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.pin-emoji { font-size: 48px; display: block; margin-bottom: 12px; }
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}
.pin-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid #CBD5E1;
  transition: all 0.2s;
}
.pin-dot.filled { background: var(--primary); border-color: var(--primary); }
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 240px;
  margin: 0 auto;
}
.pin-pad button {
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  background: #F1F5F9;
  cursor: pointer;
  transition: all 0.15s;
}
.pin-pad button:active { background: var(--primary); color: white; }
.pin-clear { background: #FEE2E2 !important; color: #DC2626 !important; }
.pin-ok { background: var(--green) !important; color: white !important; }
.pin-error { color: #DC2626; font-size: 13px; margin-top: 10px; }

.parent-dashboard { display: flex; flex-direction: column; gap: 16px; }
.parent-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.parent-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat-box {
  text-align: center;
  padding: 12px 8px;
  background: #F8FAFC;
  border-radius: 12px;
}
.stat-value { font-size: 22px; font-weight: 800; }
.stat-label { font-size: 11px; color: var(--text-light); margin-top: 2px; }

.progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #F1F5F9;
}
.progress-item:last-child { border-bottom: none; }
.level-badge {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.progress-item .level-info { flex: 1; }
.progress-item .name { font-size: 14px; font-weight: 600; }
.progress-item .status { font-size: 12px; color: var(--text-light); }
.mini-bar {
  height: 6px;
  background: #E2E8F0;
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}
.mini-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}

/* ===== Modals ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay.show { display: flex; }

.cele-box {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 30px;
  text-align: center;
  max-width: 340px;
  animation: popIn 0.3s ease;
}
@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.cele-emoji { font-size: 64px; margin-bottom: 12px; }
.cele-box h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.cele-box p { font-size: 14px; color: var(--text-light); margin-bottom: 16px; line-height: 1.6; }
.cele-stars { font-size: 28px; margin-bottom: 16px; }

.modal-body {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 24px;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: popIn 0.3s ease;
  width: 100%;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #F1F5F9;
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.concept-modal-icon { font-size: 48px; text-align: center; margin-bottom: 8px; }
.concept-modal-title { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 16px; }
.concept-section {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 12px;
  line-height: 1.7;
  font-size: 14px;
}
.concept-section.def { background: #DBEAFE; }
.concept-section.detail { background: #F0F9FF; }
.concept-section.example { background: #D1FAE5; }
.concept-section h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }

.related-level-tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: #F1F5F9;
  color: var(--text-light);
}
.related-level-tag.learned { background: #D1FAE5; color: #059669; }

/* ===== Confetti ===== */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 300;
}

/* ===== Utility ===== */
.hidden { display: none !important; }

/* ===== Case Cards ===== */
.case-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-left: 4px solid var(--accent);
}
.case-card h3 { font-size: 18px; margin: 0 0 10px; color: var(--primary); }
.case-story { font-size: 15px; line-height: 1.6; color: var(--text); margin-bottom: 12px; }
.case-question { font-size: 15px; font-weight: 600; color: var(--orange); margin-bottom: 12px; }
.case-option {
  display: block; width: 100%; padding: 12px 16px; margin-bottom: 8px;
  background: #F8FAFC; border: 2px solid #E2E8F0; border-radius: 12px;
  font-size: 15px; text-align: left; cursor: pointer; transition: all 0.2s;
}
.case-option:hover { background: #EEF2FF; border-color: var(--primary); }
.case-option:disabled { cursor: default; }
.case-option.selected-correct { background: #D1FAE5; border-color: #059669; color: #059669; }
.case-option.selected-wrong { background: #FEE2E2; border-color: #DC2626; color: #DC2626; }
.case-feedback {
  padding: 12px; border-radius: 12px; margin-top: 12px; font-size: 14px; line-height: 1.5;
}
.case-feedback.correct { background: #D1FAE5; color: #059669; }
.case-feedback.wrong { background: #FEF3C7; color: #D97706; }

/* ===== Decision Cards ===== */
.decision-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-left: 4px solid var(--orange);
}
.decision-card h3 { font-size: 18px; margin: 0 0 10px; color: var(--orange); }
.decision-text { font-size: 15px; line-height: 1.6; color: var(--text); margin-bottom: 14px; }
.decision-option {
  display: block; width: 100%; padding: 14px 16px; margin-bottom: 8px;
  background: #F8FAFC; border: 2px solid #E2E8F0; border-radius: 12px;
  font-size: 15px; text-align: left; cursor: pointer; transition: all 0.2s;
}
.decision-option:hover { background: #FFF7ED; border-color: var(--orange); }
.decision-option:disabled { cursor: default; }
.decision-option.selected { background: #DBEAFE; border-color: #3B82F6; }
.decision-option.is-optimal { background: #D1FAE5; border-color: #059669; }
.decision-outcome {
  padding: 14px; border-radius: 12px; margin-top: 12px; font-size: 14px; line-height: 1.5;
}
.decision-outcome.optimal { background: #D1FAE5; color: #059669; }
.decision-outcome.not-optimal { background: #FEF3C7; color: #D97706; }

/* ===== News Cards ===== */
.news-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-left: 4px solid #8B5CF6;
}
.news-card h3 { font-size: 18px; margin: 0 0 10px; color: #8B5CF6; }
.news-story { font-size: 15px; line-height: 1.6; color: var(--text); margin-bottom: 12px; }
.news-econ {
  font-size: 14px; line-height: 1.5; padding: 12px;
  background: #F5F3FF; border-radius: 10px; color: #6D28D9;
}

/* ===== Sandbox Cards ===== */
.sandbox-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-left: 4px solid var(--green);
}
.sandbox-card h3 { font-size: 18px; margin: 0 0 10px; color: var(--green); }
.sandbox-card p { font-size: 15px; line-height: 1.6; color: var(--text); margin-bottom: 8px; }
.sandbox-result {
  font-size: 16px; font-weight: 700; padding: 12px;
  background: #D1FAE5; border-radius: 10px; color: #059669; text-align: center;
}

/* ===== XP 成就系统 ===== */
.xp-level-card {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 16px; padding: 20px; color: white; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.xp-level-card::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.xp-level-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; position: relative; z-index: 1; }
.xp-level-icon { font-size: 40px; }
.xp-level-name { font-size: 18px; font-weight: 700; }
.xp-level-detail { font-size: 13px; opacity: 0.9; margin-top: 2px; }
.xp-progress-bar { height: 10px; background: rgba(255,255,255,0.2); border-radius: 5px; overflow: hidden; margin-bottom: 8px; position: relative; z-index: 1; }
.xp-progress-fill { height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); border-radius: 5px; transition: width 0.5s ease; }
.xp-total { font-size: 14px; opacity: 0.8; position: relative; z-index: 1; }
.xp-total strong { font-size: 22px; opacity: 1; }
.xp-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: #333; }
.xp-achievement-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.xp-badge {
  background: white; border-radius: 12px; padding: 14px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); border: 2px solid #e2e8f0;
  transition: all 0.2s; cursor: pointer;
}
.xp-badge.unlocked { border-color: #f59e0b; background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.xp-badge.unlocked:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245,158,11,0.3); }
.xp-badge.locked { opacity: 0.5; filter: grayscale(1); }
.xp-badge-icon { font-size: 32px; margin-bottom: 6px; }
.xp-badge-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.xp-badge-xp { font-size: 11px; color: #f59e0b; font-weight: 700; }
.xp-badge-locked-text { font-size: 24px; color: #ccc; }