/* ===== 备考教练 - 移动优先样式 ===== */
:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --text: #1E1E2E;
  --text-soft: #6B7280;
  --success: #10B981;
  --danger: #EF4444;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* ===== 顶部栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top));
  background: var(--card); box-shadow: var(--shadow);
}
.brand { font-size: 18px; font-weight: 700; }
.icon-btn {
  border: none; background: none; font-size: 20px; padding: 6px 10px;
  border-radius: 8px; cursor: pointer; color: var(--text-soft);
}
.icon-btn:hover { background: var(--bg); }

/* ===== 主区域 ===== */
.main { flex: 1; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.view { display: none; }
.view.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== Hero ===== */
.hero { text-align: center; padding: 20px 8px 24px; }
.hero-icon { font-size: 52px; margin-bottom: 12px; }
.hero h1 { font-size: 24px; line-height: 1.4; font-weight: 800; }
.sub { color: var(--text-soft); font-size: 14px; line-height: 1.7; margin-top: 8px; }

/* ===== 卡片 ===== */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.field-label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 8px; color: var(--text); }
.field-label:first-child { margin-top: 0; }

/* ===== 选择 chips ===== */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid #E5E7EB; background: var(--card); color: var(--text);
  padding: 10px 16px; border-radius: 999px; font-size: 15px; cursor: pointer;
  transition: all .15s; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.chip:hover { border-color: var(--primary); background: #F9FAFF; }
.chip:active { transform: scale(0.96); }
.chip.selected { border-color: var(--primary); background: #EEF2FF; color: var(--primary-dark); font-weight: 600; box-shadow: 0 2px 8px rgba(79,70,229,0.18); }

/* ===== 输入框 ===== */
.input {
  width: 100%; border: 1.5px solid #E5E7EB; border-radius: 10px;
  padding: 12px 14px; font-size: 16px; background: var(--card); color: var(--text);
  outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--primary); }
.textarea { resize: none; line-height: 1.6; }

/* ===== 按钮 ===== */
.btn-primary {
  width: 100%; border: none; border-radius: 12px; background: var(--primary); color: #fff;
  padding: 15px; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s, box-shadow .15s; margin-top: 8px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-primary:not(:disabled) { box-shadow: 0 4px 14px rgba(79,70,229,0.25); }
.btn-ghost {
  width: 100%; border: 1.5px solid #E5E7EB; background: var(--card); color: var(--text);
  padding: 13px; border-radius: 12px; font-size: 15px; cursor: pointer; margin-top: 8px;
  transition: border-color .15s, background .15s;
}
.btn-ghost:hover { border-color: var(--primary); background: #F9FAFF; }
.btn-ghost:active { transform: scale(0.98); }
.hint { text-align: center; color: var(--text-soft); font-size: 12px; margin-top: 10px; }

/* ===== 反问视图 ===== */
.progress-bar { height: 6px; background: #E5E7EB; border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.progress-bar.mini { height: 6px; width: 100%; margin: 0; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s ease; width: 0; }
.q-meta { font-size: 13px; color: var(--text-soft); margin-bottom: 10px; font-weight: 600; }
#question-area .card h3 { font-size: 17px; line-height: 1.5; margin-bottom: 4px; }
.q-desc { font-size: 13px; color: var(--text-soft); margin-bottom: 14px; }
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option-item {
  border: 1.5px solid #E5E7EB; border-radius: 12px; padding: 14px 16px;
  font-size: 15px; line-height: 1.6; cursor: pointer; transition: all .15s; background: var(--card);
}
.option-item:hover { border-color: var(--primary); background: #F9FAFF; }
.option-item:active { transform: scale(0.98); }
.option-item.selected { border-color: var(--primary); background: #EEF2FF; font-weight: 600; box-shadow: 0 2px 8px rgba(79,70,229,0.15); }

/* ===== 生成中 ===== */
.center-view { display: none; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; }
.center-view.active { display: flex; }
.spinner {
  width: 48px; height: 48px; border: 4px solid #E5E7EB; border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 计划视图 ===== */
.plan-header { margin-bottom: 16px; }
.plan-header h2 { font-size: 20px; }
.countdown {
  display: inline-block; margin-top: 8px;
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF); color: var(--primary-dark);
  padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(79,70,229,0.15);
}
.phase {
  background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  margin-bottom: 16px; border-left: 4px solid var(--primary); transition: box-shadow .2s;
}
.phase:nth-child(2) { border-left-color: #8B5CF6; }
.phase:nth-child(3) { border-left-color: #EC4899; }
.phase h4 { font-size: 16px; margin-bottom: 4px; }
.phase .phase-dates { font-size: 12px; color: var(--text-soft); margin-bottom: 10px; }
.phase .phase-goal {
  font-size: 13px; color: var(--text-soft); margin-bottom: 12px;
  background: #F8F9FD; border-radius: 8px; padding: 8px 10px; line-height: 1.6;
}
.task-item { font-size: 14px; padding: 8px 0; border-top: 1px dashed #F0F0F5; display: flex; gap: 8px; align-items: baseline; }
.task-item:first-child { border-top: none; }
.task-num { color: var(--primary); font-weight: 700; flex-shrink: 0; }

/* ===== 执行视图 ===== */
.exec-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 12px; }
.exec-header h2 { font-size: 20px; }
.date-line { font-size: 13px; color: var(--text-soft); margin-top: 4px; }
.exec-stats { text-align: right; min-width: 110px; }
.stat { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.stat-pct { color: var(--primary); font-weight: 800; }
.check-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 12px; padding: 14px 14px;
  box-shadow: var(--shadow); margin-bottom: 12px; transition: opacity .2s, box-shadow .2s;
}
.check-item:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.check-item.done { opacity: .55; }
.check-box {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid #D1D5DB;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  cursor: pointer; flex-shrink: 0; transition: all .15s; background: var(--card);
}
.check-box.checked { background: var(--success); border-color: var(--success); color: #fff; }
.check-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.check-text { font-size: 15px; line-height: 1.5; display: flex; align-items: baseline; gap: 6px; }
.check-item.done .check-text { text-decoration: line-through; color: var(--text-soft); }
.check-sub { font-size: 12px; color: var(--text-soft); margin-top: 3px; }

/* ===== 复盘视图 ===== */
.review-header h2 { font-size: 20px; margin-bottom: 14px; }
.review-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.review-card h4 { font-size: 15px; margin-bottom: 10px; }
.review-card p, .review-card li { font-size: 14px; line-height: 1.8; color: var(--text); }
.review-card ul { padding-left: 18px; margin-top: 6px; }
.review-stat { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #F0F0F5; font-size: 14px; }
.review-stat:last-of-type { border-bottom: none; }
.review-bar { height: 8px; background: #F0F0F5; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.review-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #8B5CF6); border-radius: 999px; transition: width .4s ease; }
.tint-ai { background: linear-gradient(180deg, #F5F3FF, #FFFFFF); border-left: 3px solid #8B5CF6; }
.tint-ok { background: linear-gradient(180deg, #ECFDF5, #FFFFFF); border-left: 3px solid #10B981; }
.tint-warn { background: linear-gradient(180deg, #FEF2F2, #FFFFFF); border-left: 3px solid #EF4444; }
.tint-adjust { background: linear-gradient(180deg, #EFF6FF, #FFFFFF); border-left: 3px solid #3B82F6; }
.badge-ok { color: var(--success); font-weight: 700; }
.badge-warn { color: var(--danger); font-weight: 700; }

/* ===== 页脚 ===== */
.footer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); text-align: center; }
#free-badge { display: inline-block; font-size: 11px; color: #9CA3AF; background: transparent; padding: 5px 14px; border-radius: 999px; }
