/* ===== 小学期末复习Agent 样式表 ===== */

:root {
  --primary: #FF9F43;
  --primary-dark: #E8882A;
  --chinese: #FF6B6B;
  --math: #4ECDC4;
  --english: #54A0FF;
  --success: #5CD85C;
  --soft-error: #FFB6B6;
  --bg: #FFF8F0;
  --card-bg: #FFFFFF;
  --text: #2D3436;
  --text-light: #636E72;
  --border: #F0E6D8;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --radius: 16px;
}

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

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

body.eye-care {
  background: #F5F0E8;
  filter: brightness(0.95) sepia(0.1);
}

body.font-small { font-size: 14px; }
body.font-large { font-size: 18px; }

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

/* ===== 顶部栏 ===== */
#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(255, 159, 67, 0.3);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: bold;
}

.mascot-icon {
  font-size: 24px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stars-display {
  background: rgba(255, 255, 255, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: white;
}

/* ===== 页面切换 ===== */
.page {
  display: none;
  padding: 16px;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

/* ===== 首页 ===== */
.hero {
  text-align: center;
  padding: 20px 0;
}

#greeting-text {
  font-size: 24px;
  margin-bottom: 8px;
}

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

.section-title {
  font-size: 16px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.stats-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.stats-grid {
  display: flex;
  justify-content: space-around;
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary);
}

.stat-num.correct {
  color: var(--success);
}

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

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  border: 2px solid transparent;
}

.mode-card:active {
  transform: scale(0.96);
}

.mode-card:hover {
  border-color: var(--primary);
}

.mode-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.mode-name {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
}

.mode-desc {
  font-size: 11px;
  color: var(--text-light);
}

.weak-section {
  background: #FFF3E0;
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.weak-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weak-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 10px 12px;
  border-radius: 10px;
}

.weak-rate {
  color: var(--chinese);
  font-weight: bold;
  font-size: 14px;
}

.mistake-reminder {
  background: linear-gradient(135deg, #FFE0B2, #FFCC80);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.reminder-icon {
  font-size: 24px;
}

/* ===== 设置页 ===== */
.back-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.back-bar h2 {
  font-size: 18px;
}

.back-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--primary);
  padding: 4px 8px;
}

.settings-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.setting-item {
  margin-bottom: 24px;
}

.setting-item label {
  display: block;
  font-weight: bold;
  margin-bottom: 10px;
}

.setting-item select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  background: white;
}

.option-group {
  display: flex;
  gap: 10px;
}

.opt-btn {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

.opt-btn.active {
  border-color: var(--primary);
  background: #FFF3E0;
  color: var(--primary-dark);
}

.ratio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ratio-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ratio-label {
  width: 50px;
  font-size: 14px;
  font-weight: bold;
}

.ratio-label.chinese { color: var(--chinese); }
.ratio-label.math { color: var(--math); }
.ratio-label.english { color: var(--english); }

.ratio-item input[type="range"] {
  flex: 1;
}

.ratio-val {
  width: 40px;
  text-align: right;
  font-size: 14px;
  color: var(--text-light);
}

.primary-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.1s;
}

.primary-btn:active {
  transform: scale(0.98);
}

.secondary-btn {
  width: 100%;
  padding: 14px;
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
}

/* ===== 答题页 ===== */
.practice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-info {
  display: flex;
  gap: 10px;
  align-items: center;
}

.subject-tag {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: white;
}

.subject-tag.chinese { background: var(--chinese); }
.subject-tag.math { background: var(--math); }
.subject-tag.english { background: var(--english); }

.timer {
  font-size: 14px;
  color: var(--text-light);
  font-family: monospace;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  width: 0%;
  transition: width 0.3s;
}

.mascot-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.mascot {
  font-size: 40px;
  animation: bounce 2s infinite;
}

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

.mascot-bubble {
  background: white;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  box-shadow: var(--shadow);
  position: relative;
  flex: 1;
}

.mascot-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: white;
}

.question-area {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-height: 200px;
}

.question-stem {
  font-size: 20px;
  margin-bottom: 20px;
  line-height: 1.8;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  padding: 14px 16px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  text-align: left;
  transition: all 0.2s;
}

.option-btn.selected {
  border-color: var(--primary);
  background: #FFF3E0;
}

.option-btn.correct {
  border-color: var(--success);
  background: #E8F5E9;
}

.option-btn.wrong {
  border-color: var(--soft-error);
  background: #FFEBEE;
}

.fill-input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 18px;
  outline: none;
}

.fill-input:focus {
  border-color: var(--primary);
}

.fill-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.fill-input-row .fill-input {
  flex: 1;
  min-width: 0;
}

.voice-input-btn {
  min-width: 96px;
  padding: 0 14px;
  border: 2px solid var(--primary);
  border-radius: 12px;
  background: #FFF8F0;
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.voice-input-btn.listening {
  border-color: var(--chinese);
  background: #FFEBEE;
  color: #D63031;
}

.voice-input-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.voice-input-status {
  min-height: 20px;
  margin-top: 6px;
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.5;
}

.voice-input-status.error {
  color: #D63031;
}

.judge-btns {
  display: flex;
  gap: 12px;
}

.judge-btn {
  flex: 1;
  padding: 16px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 12px;
  font-size: 28px;
  cursor: pointer;
}

.judge-btn.selected.correct {
  border-color: var(--success);
  background: #E8F5E9;
}

.judge-btn.selected.wrong {
  border-color: var(--soft-error);
  background: #FFEBEE;
}

.match-items {
  display: flex;
  gap: 20px;
}

.match-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-item {
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  background: white;
}

.match-item.selected {
  border-color: var(--primary);
  background: #FFF3E0;
}

.match-item.matched {
  border-color: var(--success);
  background: #E8F5E9;
}

.order-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-item {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-item.selected {
  border-color: var(--primary);
  background: #FFF3E0;
}

.order-sequence {
  margin-top: 16px;
  padding: 12px;
  background: #F5F5F5;
  border-radius: 10px;
  min-height: 50px;
}

.question-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.action-btn {
  flex: 1;
  padding: 12px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
}

/* ===== 结果弹窗 ===== */
.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: 200;
  padding: 20px;
}

.result-card {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  animation: popIn 0.4s ease;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.result-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: bounce 0.6s ease;
}

.result-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 16px;
}

.result-detail {
  color: var(--text-light);
  margin-bottom: 20px;
  text-align: left;
  background: #F5F5F5;
  padding: 16px;
  border-radius: 12px;
}

.result-detail .correct-answer {
  color: var(--success);
  font-weight: bold;
}

/* ===== 总结页 ===== */
.summary-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.summary-card h2 {
  margin-bottom: 20px;
}

.summary-score {
  margin-bottom: 24px;
}

.score-num {
  font-size: 56px;
  font-weight: bold;
  color: var(--primary);
}

.score-label {
  color: var(--text-light);
}

.summary-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}

.summary-stat .label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
}

.summary-stat .value {
  font-size: 22px;
  font-weight: bold;
}

.summary-stat .value.correct {
  color: var(--success);
}

.subject-scores {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.subject-score-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.subject-score-name {
  width: 50px;
  font-weight: bold;
}

.subject-score-bar {
  flex: 1;
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.subject-score-fill {
  height: 100%;
  border-radius: 6px;
}

.subject-score-rate {
  width: 50px;
  text-align: right;
  font-size: 14px;
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== 错题本 ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.page-header h2 {
  font-size: 20px;
}

.export-btn {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}

.mistake-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  position: relative;
}

.tab-btn.active {
  border-color: var(--primary);
  background: #FFF3E0;
  color: var(--primary-dark);
}

.tab-badge {
  background: var(--chinese);
  color: white;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
  margin-left: 4px;
}

.mistake-filters {
  margin-bottom: 12px;
}

.mistake-filters select {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}

.mistake-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mistake-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.mistake-card:active {
  transform: scale(0.98);
}

.mistake-subject {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  margin-bottom: 8px;
}

.mistake-stem {
  font-size: 16px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.mistake-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-light);
}

.mistake-meta .error-count {
  color: var(--chinese);
  font-weight: bold;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ===== 报告页 ===== */
.report-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.report-card h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.report-stats {
  display: flex;
  justify-content: space-around;
}

.report-stat .num {
  font-size: 26px;
  font-weight: bold;
  color: var(--primary);
  text-align: center;
}

.report-stat .num.correct {
  color: var(--success);
}

.report-stat .label {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
}

.subject-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subject-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.subject-bar-name {
  width: 50px;
  font-weight: bold;
}

.subject-bar-track {
  flex: 1;
  height: 16px;
  background: var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.subject-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.5s;
}

.subject-bar-rate {
  width: 50px;
  text-align: right;
  font-size: 14px;
}

.weak-points-report {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.no-data {
  color: var(--text-light);
  text-align: center;
  padding: 20px;
}

/* ===== 设置面板 ===== */
.settings-list {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-name {
  font-weight: bold;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.switch {
  position: relative;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 28px;
  transition: 0.3s;
}

.slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background: var(--primary);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.font-size-group {
  display: flex;
  gap: 6px;
}

.fs-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
}

.fs-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.setting-row select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.danger-btn {
  padding: 8px 16px;
  background: var(--chinese);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

/* ===== 护眼提醒 ===== */
.eye-care-card {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  max-width: 400px;
}

.eye-care-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.eye-care-card h3 {
  margin-bottom: 12px;
}

.eye-care-card p {
  color: var(--text-light);
  margin-bottom: 20px;
}

.eye-exercise {
  background: #F5F5F5;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.exercise-step {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

.exercise-timer {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary);
  font-family: monospace;
}

/* ===== 底部导航 ===== */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  background: white;
  border-top: 1px solid var(--border);
  padding: 8px 0;
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-light);
}

.nav-btn.active {
  color: var(--primary);
}

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

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

/* ===== 动画 ===== */
@keyframes celebrate {
  0% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1); }
}

.celebrate {
  animation: celebrate 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.3s ease;
}

/* ===== 响应式 ===== */
@media (min-width: 768px) {
  #app {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  }
}

/* ===== 勋章墙入口 ===== */
.badges-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 16px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 165, 0, 0.3);
  transition: transform 0.2s;
}

.badges-entry:active {
  transform: scale(0.98);
}

.badges-icon {
  font-size: 28px;
}

.badges-text {
  font-weight: bold;
  color: #5D4037;
  flex: 1;
}

.badges-count {
  background: rgba(255, 255, 255, 0.5);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: bold;
  color: #5D4037;
}

.badges-arrow {
  font-size: 22px;
  color: #5D4037;
  font-weight: bold;
}

/* ===== 闯关模式 ===== */
.adventure-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.adventure-grade label {
  font-weight: bold;
  margin-right: 8px;
}

.adventure-grade select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}

.adventure-stars {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 20px;
  font-weight: bold;
  color: #FFA500;
}

.adventure-stars-total {
  font-size: 14px;
  color: var(--text-light);
}

.level-map {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px 0;
}

.level-node {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.level-node:active {
  transform: scale(0.98);
}

.level-node.unlocked {
  border-color: var(--primary);
}

.level-node.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.level-node.completed {
  border-color: var(--success);
  background: #F1F8E9;
}

.level-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: white;
  margin-right: 12px;
  flex-shrink: 0;
}

.level-node.unlocked .level-number {
  background: var(--primary);
}

.level-node.locked .level-number {
  background: #BDBDBD;
}

.level-node.completed .level-number {
  background: var(--success);
}

.level-info {
  flex: 1;
}

.level-name {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 2px;
}

.level-subject {
  font-size: 12px;
  color: var(--text-light);
}

.level-stars {
  display: flex;
  gap: 2px;
  font-size: 16px;
}

.level-stars .star-empty {
  filter: grayscale(1);
  opacity: 0.3;
}

/* ===== 勋章页 ===== */
.badges-summary {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.badges-progress {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 12px;
}

.badges-progress-num {
  font-size: 36px;
  font-weight: bold;
  color: #FFA500;
}

.badges-progress-total {
  font-size: 16px;
  color: var(--text-light);
}

.badges-progress-bar {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.badges-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFD700, #FFA500);
  width: 0%;
  transition: width 0.5s;
}

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

.badge-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
}

.badge-item.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.badge-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.badge-name {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 4px;
}

.badge-desc {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.4;
}

.badge-item.unlocked .badge-name {
  color: #E65100;
}

/* ===== 勋章解锁弹窗 ===== */
.badge-unlock-card {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  max-width: 350px;
  width: 100%;
  animation: popIn 0.4s ease;
}

.badge-unlock-icon {
  font-size: 72px;
  margin-bottom: 12px;
  animation: celebrate 0.6s ease;
}

.badge-unlock-title {
  font-size: 20px;
  font-weight: bold;
  color: #E65100;
  margin-bottom: 8px;
}

.badge-unlock-name {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 8px;
}

.badge-unlock-desc {
  color: var(--text-light);
  margin-bottom: 20px;
  font-size: 14px;
}

/* ===== 雷达图 ===== */
.radar-container {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

#radar-canvas {
  max-width: 100%;
  height: auto;
}

.radar-tip {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-top: 8px;
}
