/* ============================================
 * 幼儿思维趣味测评 H5 - 全局样式
 * 基于375px设计宽度，rpx≈0.5px换算
 * ============================================ */

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f5f5f5;
  position: relative;
}

@media (min-width: 768px) {
  #app {
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
  }
}

/* ===== 通用组件 ===== */
.container { padding: 15px; min-height: 100vh; background: #f5f5f5; }

.card {
  background: #fff; border-radius: 8px; padding: 20px;
  margin-bottom: 15px; box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

.section-title {
  display: block; font-size: 16px; font-weight: bold; color: #333;
  margin-bottom: 15px; padding-left: 10px; border-left: 3px solid #4CAF50;
}

.back-btn {
  padding: 10px 0; color: #4CAF50; font-size: 14px;
  margin-bottom: 10px; cursor: pointer; display: inline-block;
}

.progress { margin-bottom: 15px; }
.progress-text { font-size: 14px; color: #4CAF50; margin-bottom: 5px; display: block; }
.progress-bar { height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: #4CAF50; border-radius: 3px; transition: width 0.3s; }

.btn-area { margin-top: 20px; display: flex; gap: 10px; }
.btn-primary {
  flex: 1; background: #4CAF50; color: #fff; border: none;
  border-radius: 22px; font-size: 16px; font-weight: 500;
  padding: 12px 0; cursor: pointer;
}
.btn-primary:hover { background: #43A047; }
.btn-secondary {
  flex: 1; background: #fff; color: #4CAF50; border: 2px solid #4CAF50;
  border-radius: 22px; font-size: 14px; padding: 10px 0; cursor: pointer;
}
.btn-save {
  flex: 1; background: #FF9800; color: #fff; border: none;
  border-radius: 22px; font-size: 14px; padding: 10px 0; cursor: pointer;
}
.btn-share {
  flex: 1; background: #fff; color: #4CAF50; border: 2px solid #4CAF50;
  border-radius: 22px; font-size: 16px; padding: 12px 0; cursor: pointer;
}

/* ===== 登录页面 ===== */
.login-header {
  text-align: center; padding: 40px 0 30px;
  background: linear-gradient(180deg, #4CAF50 0%, #81C784 100%);
  border-radius: 0 0 20px 20px; color: #fff; margin-bottom: 20px;
}
.login-logo { font-size: 48px; margin-bottom: 10px; }
.login-title { font-size: 22px; font-weight: bold; margin-bottom: 5px; }
.login-subtitle { font-size: 14px; opacity: 0.85; }

.form-area { background: #fff; border-radius: 10px; padding: 25px 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); margin-bottom: 20px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; color: #333; margin-bottom: 8px; font-weight: 500; }
.form-input {
  width: 100%; height: 44px; border: 1px solid #ddd; border-radius: 8px;
  padding: 0 12px; font-size: 15px; outline: none; transition: border-color 0.2s;
}
.form-input:focus { border-color: #4CAF50; }

.footer { margin-top: 30px; text-align: center; }
.footer-text { font-size: 12px; color: #999; margin-bottom: 5px; }

/* ===== 幼儿清单页面 ===== */
.header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding: 15px 20px; background: #4CAF50;
  border-radius: 10px; color: #fff;
}
.header-info { flex: 1; }
.header-kindergarten { font-size: 18px; font-weight: bold; }
.header-count { font-size: 12px; opacity: 0.8; margin-top: 4px; }

.search-bar { margin-bottom: 15px; }
.search-input {
  width: 100%; height: 40px; border: 1px solid #ddd; border-radius: 20px;
  padding: 0 16px; font-size: 14px; outline: none;
}

.filter-tabs { display: flex; gap: 8px; margin-bottom: 15px; }
.filter-tab {
  padding: 6px 16px; border-radius: 16px; font-size: 13px;
  background: #fff; border: 1px solid #ddd; cursor: pointer;
}
.filter-tab.active { background: #4CAF50; color: #fff; border-color: #4CAF50; }

.child-list { display: flex; flex-direction: column; gap: 12px; }
.child-item {
  background: #fff; border-radius: 10px; padding: 16px 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06); display: flex; align-items: center; justify-content: space-between;
}
.child-info-left { flex: 1; }
.child-name { font-size: 16px; font-weight: bold; color: #333; margin-bottom: 4px; }
.child-meta { font-size: 12px; color: #999; }
.child-status {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; color: #fff; margin-left: 8px;
}
.status-progress { background: #FF9800; }
.status-done { background: #4CAF50; }
.child-actions { display: flex; gap: 8px; }
.child-btn {
  padding: 6px 14px; border-radius: 16px; font-size: 12px;
  border: none; cursor: pointer;
}
.btn-continue { background: #4CAF50; color: #fff; }
.btn-view { background: #2196F3; color: #fff; }
.btn-delete { background: #f44336; color: #fff; }

.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-icon { font-size: 48px; margin-bottom: 15px; }

/* ===== 幼儿信息页面 ===== */
.gender-options { display: flex; gap: 12px; }
.gender-btn {
  flex: 1; padding: 12px; border: 2px solid #ddd; border-radius: 8px;
  text-align: center; font-size: 14px; cursor: pointer; background: #fff;
}
.gender-btn.active { border-color: #4CAF50; color: #4CAF50; background: #f0f9f0; }

/* ===== 游戏分数登记页面 ===== */
.game-header { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.game-title { font-size: 18px; font-weight: bold; color: #333; display: block; margin-bottom: 5px; }
.game-desc { font-size: 13px; color: #999; display: block; }
.score-display {
  display: flex; align-items: center; margin-top: 10px; padding: 10px;
  background: #f0f9f0; border-radius: 4px;
}
.score-label { font-size: 14px; color: #666; margin-right: 10px; }
.score-value { font-size: 18px; font-weight: bold; color: #4CAF50; }

.questions { margin-top: 10px; }
.question-item { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.question-item:last-child { border-bottom: none; }
.question-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.question-num { font-size: 15px; font-weight: bold; color: #333; }
.question-score { font-size: 13px; color: #999; }

.score-buttons { display: flex; gap: 10px; }
.score-btn {
  flex: 1; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 1px solid #ddd; border-radius: 4px; font-size: 14px; color: #666;
  background: #fff; cursor: pointer; transition: all 0.2s;
}
.score-btn:hover { border-color: #4CAF50; }
.score-btn.active { background: #4CAF50; color: #fff; border-color: #4CAF50; }
.score-btn.active-zero { background: #999; color: #fff; border-color: #999; }
.score-btn.active-mid { background: #2196F3; color: #fff; border-color: #2196F3; }
.score-btn.active-two { background: #FF9800; color: #fff; border-color: #FF9800; }

/* ===== 行为观察页面 ===== */
.form-hint { font-size: 12px; color: #999; margin-bottom: 8px; }
.star-rating { display: flex; gap: 8px; }
.star { font-size: 24px; color: #ddd; cursor: pointer; transition: color 0.2s; }
.star.active { color: #FF9800; }

.style-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.style-item {
  padding: 14px; border: 1px solid #e0e0e0; border-radius: 6px;
  text-align: center; cursor: pointer; background: #fff; transition: all 0.2s;
}
.style-item.active { background: #f0f9f0; border-color: #4CAF50; }
.style-name { display: block; font-size: 15px; color: #333; font-weight: 500; }
.style-item.active .style-name { color: #4CAF50; }
.style-desc { display: block; font-size: 11px; color: #999; margin-top: 4px; }

.form-textarea {
  width: 100%; min-height: 80px; border: 1px solid #ddd; border-radius: 8px;
  padding: 10px; font-size: 14px; resize: vertical; outline: none; font-family: inherit;
}
.form-textarea:focus { border-color: #4CAF50; }

/* ===== 报告页面通用 ===== */
.report-header {
  text-align: center; padding: 30px 20px; margin-bottom: 20px;
  background: linear-gradient(180deg, #4CAF50 0%, #81C784 100%);
  border-radius: 10px; color: #fff;
}
.report-title { font-size: 20px; font-weight: bold; margin-bottom: 5px; }
.report-subtitle { font-size: 14px; opacity: 0.85; }

.child-info { display: flex; flex-direction: column; gap: 5px; }
.info-item { display: flex; align-items: flex-start; }
.info-label { font-size: 14px; color: #666; margin-right: 10px; min-width: 100px; flex-shrink: 0; }
.info-value { font-size: 14px; color: #333; font-weight: 500; }

/* TDI */
.tdi-display { text-align: center; padding: 20px; margin: 15px 0; background: #f0f9f0; border-radius: 8px; }
.tdi-score { font-size: 40px; font-weight: bold; margin-bottom: 5px; }
.tdi-label { font-size: 14px; color: #666; }
.tdi-level {
  display: inline-block; padding: 5px 20px; border-radius: 15px;
  color: #fff; font-size: 15px; font-weight: bold; margin: 10px 0;
}
.tdi-desc { font-size: 13px; color: #666; text-align: center; line-height: 1.8; }

/* 雷达图 */
.radar-chart {
  display: flex; justify-content: center; align-items: center;
  height: 300px; margin: 15px 0; background: #f9f9f9; border-radius: 8px;
}
.radar-canvas { width: 300px; height: 300px; }

/* ===== 报告加载步骤 ===== */
.loading-step {
  display: flex; align-items: center; padding: 10px 0; opacity: 0.4;
}
.loading-step.active { opacity: 1; }
.loading-step.done { opacity: 0.7; }
.step-icon {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #ddd;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #999; margin-right: 12px; flex-shrink: 0;
}
.loading-step.active .step-icon { border-color: #4CAF50; color: #4CAF50; }
.loading-step.done .step-icon { background: #4CAF50; border-color: #4CAF50; color: #fff; }
.step-name { font-size: 14px; color: #333; }

/* 能力卡片 */
.ability-list { display: flex; flex-direction: column; gap: 10px; }
.ability-item { padding: 10px; background: #f9f9f9; border-radius: 6px; }
.ability-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.ability-name { font-size: 14px; font-weight: bold; color: #333; }
.ability-score { font-size: 16px; font-weight: bold; }
.ability-level {
  display: inline-block; padding: 3px 10px; border-radius: 10px;
  color: #fff; font-size: 12px;
}
.ability-note {
  margin-top: 10px; padding: 10px; background: #fffbe6; border-radius: 4px;
  font-size: 12px; color: #999; line-height: 1.6;
}

/* 思维特点画像 */
.traits-section { display: flex; flex-direction: column; gap: 15px; margin-top: 10px; }
.trait-row { display: flex; align-items: center; gap: 15px; }
.trait-label { font-size: 14px; font-weight: bold; color: #333; width: 70px; flex-shrink: 0; }
.trait-stars { font-size: 18px; color: #FF9800; letter-spacing: 2px; }
.cognitive-profile {
  display: flex; flex-direction: column; gap: 5px; padding: 10px 12px;
  background: #f0f9f0; border-radius: 6px; flex: 1;
}
.profile-title-row { display: flex; align-items: center; gap: 6px; }
.profile-icon { font-size: 20px; }
.profile-title { font-size: 15px; font-weight: bold; color: #4CAF50; }
.profile-keywords { font-size: 12px; color: #666; }

/* ===== 完整报告专用 ===== */
.game-list { display: flex; flex-direction: column; gap: 20px; }
.game-item {
  padding: 15px; background: #fafafa; border-radius: 6px; border: 1px solid #eee;
}
.game-name { display: block; font-size: 15px; font-weight: bold; color: #333; margin-bottom: 8px; }
.game-intro { display: block; font-size: 12px; color: #999; line-height: 1.6; margin-bottom: 10px; }
.score-line { display: flex; align-items: center; margin-bottom: 8px; }
.score-text { font-size: 14px; color: #666; }
.score-num { font-size: 18px; font-weight: bold; }
.eval-badge { padding: 8px 12px; border-radius: 4px; margin-bottom: 15px; }
.eval-text { font-size: 13px; color: #fff; line-height: 1.6; }

.sub-section { margin-bottom: 15px; }
.sub-title { display: block; font-size: 14px; font-weight: bold; color: #4CAF50; margin-bottom: 8px; }
.sub-card { border-radius: 5px; padding: 12px; margin-bottom: 4px; }
.sub-card-blue { background: #e6f1fb; border-left: 3px solid #2196F3; }
.sub-card-green { background: #e8f5e9; border-left: 3px solid #4CAF50; }
.sub-card-gray { background: #f5f5f5; border-left: 3px solid #999; }
.sub-card-text { font-size: 13px; color: #444; line-height: 1.8; }

.ability-block { margin-top: 8px; padding: 12px; background: #fff; border-radius: 5px; border: 1px solid #e8e8e8; }
.ability-label-row { display: flex; align-items: center; margin-bottom: 6px; }
.ability-emoji { font-size: 16px; margin-right: 6px; }
.ability-label { font-size: 13px; font-weight: bold; color: #333; }
.ability-text { display: block; font-size: 12px; color: #555; line-height: 1.8; text-align: justify; }

.game-suggestion {
  display: flex; align-items: flex-start; padding: 10px;
  background: #fffde7; border-radius: 5px; margin-bottom: 6px; border: 1px solid #fff9c4;
}
.suggestion-num-badge {
  width: 20px; height: 20px; border-radius: 50%; background: #FF9800;
  display: flex; align-items: center; justify-content: center;
  margin-right: 8px; flex-shrink: 0;
}
.suggestion-num-text { font-size: 12px; color: #fff; font-weight: bold; }
.suggestion-text { font-size: 12px; color: #555; line-height: 1.7; flex: 1; }

.tdi-text-box { padding: 14px; background: #f9f9f9; border-radius: 5px; border-left: 3px solid #4CAF50; }
.tdi-full-text { font-size: 13px; color: #444; line-height: 1.9; text-align: justify; }

.behavior-block { margin-bottom: 20px; padding: 12px; background: #fafafa; border-radius: 6px; border: 1px solid #eee; }
.behavior-header { display: flex; align-items: center; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid #e8e8e8; }
.behavior-emoji { font-size: 18px; margin-right: 6px; }
.behavior-title { font-size: 15px; font-weight: bold; color: #333; }
.behavior-stars-row { display: flex; align-items: center; margin-bottom: 10px; }
.behavior-label { font-size: 14px; color: #666; margin-right: 8px; }
.behavior-stars { font-size: 18px; color: #FF9800; letter-spacing: 2px; }
.behavior-tag { font-size: 13px; color: #666; margin-left: 5px; }
.behavior-para-card { padding: 10px; background: #fff; border-radius: 4px; margin-bottom: 6px; border: 1px solid #f0f0f0; }
.behavior-para-text { font-size: 12px; color: #555; line-height: 1.8; text-align: justify; }
.cognitive-card { padding: 12px; background: #e8f5e9; border-radius: 5px; border: 1px solid #c8e6c9; }

.growth-intro-box { padding: 12px; background: #f5f5f5; border-radius: 5px; margin-bottom: 15px; }
.growth-intro { font-size: 12px; color: #777; line-height: 1.7; }
.growth-section { margin-bottom: 15px; }
.growth-sub-title { display: block; font-size: 14px; font-weight: bold; color: #4CAF50; margin-bottom: 8px; }
.growth-direction-card { padding: 12px; border-radius: 5px; margin-bottom: 8px; }
.growth-strength { background: #e8f5e9; border: 1px solid #c8e6c9; }
.growth-weakness { background: #fff3e0; border: 1px solid #ffe0b2; }
.growth-item { display: flex; align-items: center; margin-bottom: 5px; }
.growth-emoji { font-size: 16px; margin-right: 6px; }
.growth-label { font-size: 13px; color: #666; margin-right: 8px; flex-shrink: 0; }
.growth-value { font-size: 13px; color: #333; font-weight: bold; }
.growth-suggestion { display: block; font-size: 12px; color: #555; line-height: 1.7; }
.growth-course-box { padding: 12px; background: #e3f2fd; border-radius: 5px; border: 1px solid #bbdefb; }
.growth-course { font-size: 12px; color: #444; line-height: 1.9; white-space: pre-line; text-align: justify; }

.tips-list { display: flex; flex-direction: column; gap: 8px; }
.tip-item { display: flex; align-items: flex-start; padding: 10px; background: #fffde7; border-radius: 5px; border: 1px solid #fff9c4; }
.tip-num-badge {
  width: 20px; height: 20px; border-radius: 50%; background: #4CAF50;
  display: flex; align-items: center; justify-content: center; margin-right: 8px; flex-shrink: 0;
}
.tip-num-text { font-size: 12px; color: #fff; font-weight: bold; }
.tip-text { font-size: 12px; color: #555; line-height: 1.7; flex: 1; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75); color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 14px; z-index: 9999; transition: opacity 0.3s; max-width: 80%; text-align: center;
}
.toast.hidden { opacity: 0; pointer-events: none; }
.toast.success { background: rgba(76,175,80,0.9); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 9998; display: flex;
  align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-box { background: #fff; border-radius: 12px; width: 80%; max-width: 300px; overflow: hidden; }
.modal-title { font-size: 16px; font-weight: bold; padding: 20px 20px 10px; text-align: center; }
.modal-content { font-size: 14px; color: #666; padding: 0 20px 20px; text-align: center; line-height: 1.6; }
.modal-buttons { display: flex; border-top: 1px solid #eee; }
.modal-btn { flex: 1; padding: 12px 0; border: none; background: none; font-size: 16px; cursor: pointer; }
.modal-btn.cancel { color: #999; border-right: 1px solid #eee; }
.modal-btn.confirm { color: #4CAF50; font-weight: 500; }

/* ===== Loading ===== */
.loading-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.8); z-index: 9997;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.loading-overlay.hidden { display: none; }
.loading-spinner {
  width: 40px; height: 40px; border: 3px solid #f0f0f0;
  border-top-color: #4CAF50; border-radius: 50%; animation: spin 0.8s linear infinite;
}
.loading-text { margin-top: 15px; font-size: 14px; color: #666; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PDF导出按钮 ===== */
.pdf-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; background: #ff5722; color: #fff; border: none;
  border-radius: 22px; font-size: 16px; padding: 12px 0;
  cursor: pointer; margin-top: 10px;
}
.pdf-btn:hover { background: #e64a19; }

/* ===== 响应式 ===== */
@media (max-width: 375px) {
  .style-options { grid-template-columns: 1fr; }
}
