/* ============================================================
   启明·五年级冲刺学习系统 —— 样式
   移动端优先 · 明亮护眼 · 卡片式布局
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --green: #16a34a;
  --red: #dc2626;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
}
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 70px;
}
.app { max-width: 640px; margin: 0 auto; padding: 12px; }

/* 顶部标题 */
.header {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  padding: 18px 16px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(37,99,235,.25);
}
.header h1 { font-size: 18px; font-weight: 700; }
.header .sub { font-size: 12px; opacity: .9; margin-top: 2px; }

/* 日期栏 */
.date-bar {
  background: var(--card);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.date-main { font-size: 17px; font-weight: 700; }
.date-sub { font-size: 13px; color: var(--text-light); margin-top: 3px; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.card.highlight { border: 2px solid var(--primary); background: #f8faff; }
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.card-body { font-size: 14px; color: var(--text); }
.hint { font-size: 12px; color: var(--text-light); }
.quote { font-style: italic; color: var(--text); }

/* 警告提示 */
.alert {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}

/* 时间块 */
.time-block {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
  border: 1px solid var(--border);
}
.time-label { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.time-content { font-size: 14px; margin-bottom: 8px; }

/* 按钮 */
.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all .15s;
}
.btn:hover { background: #1d4ed8; }
.btn:active { transform: scale(.97); }
.btn-line { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-warn { background: var(--red); }

/* 计算题区 */
.calc-grid { display: grid; gap: 10px; margin: 10px 0; }
.calc-item { display: flex; align-items: center; gap: 10px; }
.calc-q { flex: 0 0 60%; font-size: 14px; font-family: "Consolas", monospace; }
.calc-input {
  flex: 1; padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 14px; outline: none;
}
.calc-input:focus { border-color: var(--primary); }
.calc-input.ok { border-color: var(--green); background: #f0fdf4; }
.calc-input.wrong { border-color: var(--red); background: #fef2f2; }

.result {
  padding: 10px 14px; border-radius: 8px; margin-top: 10px;
  font-weight: 700; font-size: 15px;
}
.result.good { background: #f0fdf4; color: var(--green); }
.result.mid { background: #fffbeb; color: #d97706; }
.result.bad { background: #fef2f2; color: var(--red); }

/* 思维题 */
.think-q {
  font-size: 15px; line-height: 1.7; padding: 12px;
  background: #f8fafc; border-radius: 8px; margin: 8px 0;
  border-left: 3px solid var(--accent);
}
.think-a { margin-top: 10px; padding: 12px; background: #f0fdf4; border-radius: 8px; font-size: 14px; }
.think-a .solve { margin: 6px 0; color: var(--text-light); }
.think-a .tip { color: var(--accent); margin-top: 6px; font-weight: 600; }

/* 单词 */
.word-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.word {
  background: var(--primary-light); color: var(--primary);
  padding: 3px 10px; border-radius: 12px; font-size: 13px;
}
.example { font-size: 13px; color: var(--green); margin-top: 4px; }

/* 错题 */
.err-item {
  padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 10px; background: #fff;
}
.err-q { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.err-a { font-size: 13px; color: var(--green); margin-bottom: 4px; }
.err-meta { font-size: 12px; color: var(--text-light); }
.solve { font-size: 13px; color: var(--text-light); margin: 4px 0; }

/* 表单 */
.form-row { margin-bottom: 8px; }
.form-row input, .form-row select {
  width: 100%; padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 14px;
}
.form-row select { width: 48%; margin-right: 2%; }

.empty { text-align: center; color: var(--text-light); padding: 20px; font-size: 14px; }

/* 进度页 */
.rate-bar {
  display: flex; align-items: flex-end; gap: 3px; height: 120px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.rate-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.rate-fill { width: 80%; background: linear-gradient(180deg, var(--primary), #60a5fa); border-radius: 3px 3px 0 0; min-height: 2px; }
.rate-val { font-size: 10px; color: var(--text-light); margin-top: 2px; }
.type-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.type-row span { flex: 0 0 80px; }
.type-bar { flex: 1; background: var(--border); height: 14px; border-radius: 7px; overflow: hidden; }
.type-bar div { height: 100%; background: var(--accent); }
.stat-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.stat-row b { color: var(--primary); font-size: 16px; }

/* 底部导航 */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; max-width: 640px; margin: 0 auto;
  z-index: 100;
}
.nav-item {
  flex: 1; text-align: center; padding: 10px 0 8px;
  font-size: 12px; color: var(--text-light); cursor: pointer;
  transition: color .15s;
}
.nav-item.active { color: var(--primary); }
.nav-item .icon { font-size: 20px; display: block; margin-bottom: 2px; }

/* === 智能错题本新增样式 === */
.err-img { width: 100%; max-width: 260px; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--border); }
.cap-preview { margin: 8px 0; }
.cap-img { width: 100%; max-width: 320px; border-radius: 8px; border: 1px solid var(--border); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.btn-row .btn { margin-top: 0; }
textarea {
  width: 100%; padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical;
}
textarea:focus { border-color: var(--primary); outline: none; }
.form-row label { font-size: 12px; color: var(--text-light); display: block; margin-bottom: 3px; }

/* 解题步骤列表 */
.step-list { padding-left: 18px; margin: 6px 0; }
.step-list li { margin: 4px 0; line-height: 1.6; }
.ex-source { font-size: 12px; color: var(--accent); margin-bottom: 6px; font-weight: 600; }
.ai-text { white-space: pre-wrap; word-break: break-word; line-height: 1.9; font-size: 14px; }

/* 讲解弹层 */
.modal {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 200;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  background: #fff; border-radius: 14px; padding: 16px;
  max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.modal-close { background: none; border: none; font-size: 18px; color: var(--text-light); cursor: pointer; }

/* 变式训练 */
.variant-box { border: 1.5px solid var(--border); border-radius: 10px; padding: 12px; margin: 12px 0; background: #fafbff; }
.v-level { display: inline-block; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 10px; margin-bottom: 8px; }
.variant-box .calc-input { width: 100%; margin: 8px 0; }
.variant-box .btn { margin-top: 6px; }

/* 图片标注画板 */
.ann-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ann-toolbar .btn { padding: 6px 12px; font-size: 13px; }
.ann-canvas-wrap { background: #f0f0f3; border-radius: 10px; padding: 8px; overflow: auto; text-align: center; }
#annCanvas { max-width: 100%; height: auto; border: 1px dashed #c8ccd6; border-radius: 6px; cursor: crosshair; touch-action: none; background: #fff; }

/* 儿童版 OKR 打卡 */
.okr-label { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.okr-goal { background: linear-gradient(135deg, #fef3c7, #fff7ed); border: 2px solid #fcd34d; }
.okr-big { font-size: 19px; font-weight: 800; color: #b45309; margin: 4px 0; line-height: 1.4; }
.okr-small { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.okr-month { background: #f0f9ff; border-left: 4px solid #0ea5e9; }
.okr-progress { height: 12px; background: var(--border); border-radius: 6px; overflow: hidden; margin: 8px 0 6px; }
.okr-progress-fill { height: 100%; background: linear-gradient(90deg, #4ade80, #16a34a); border-radius: 6px; transition: width .3s; }
.okr-praise { font-size: 13px; font-weight: 700; color: var(--green); margin-bottom: 10px; }
.okr-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; margin-bottom: 8px; cursor: pointer; background: #fff; transition: all .15s; }
.okr-item:active { transform: scale(.98); }
.okr-item.done { background: #f0fdf4; border-color: var(--green); }
.okr-item.done .okr-title { text-decoration: line-through; color: var(--text-light); }
.okr-icon { font-size: 24px; flex: 0 0 36px; text-align: center; }
.okr-body { flex: 1; }
.okr-title { font-size: 14px; font-weight: 700; }
.okr-how { font-size: 12px; color: var(--green); margin-top: 2px; }
.okr-sub { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.okr-check { font-size: 20px; font-weight: 800; color: var(--green); flex: 0 0 24px; text-align: center; }


/* 古诗卡片 / 阅读卡片（每日出题·具体内容） */
.poem-card, .reading-card { font-size: 14px; }
.poem-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.poem-content { line-height: 1.9; font-size: 1.02em; padding: 10px 12px; background: #f8fafc; border-left: 3px solid var(--accent); border-radius: 8px; margin-bottom: 6px; }
.poem-trans { font-size: 13px; color: var(--text); margin: 6px 0; }
.poem-trans summary { cursor: pointer; color: var(--primary); font-weight: 600; padding: 4px 0; }
.poem-trans div { padding: 6px 10px; background: #f0fdf4; border-radius: 8px; line-height: 1.7; }
.reading-text { line-height: 1.85; padding: 10px 12px; background: #f8fafc; border-left: 3px solid var(--green); border-radius: 8px; margin-bottom: 6px; }
.en-text { font-size: .95em; letter-spacing: .2px; }
.reading-q { margin-top: 8px; }
.rq { margin: 8px 0; padding: 8px 10px; background: #f8fafc; border-radius: 8px; }
.rq b { color: var(--primary); }
.rq-a { margin-top: 5px; padding: 5px 8px; background: #f0fdf4; border-radius: 6px; color: var(--green); font-weight: 600; }
.btn-mini { padding: 2px 10px; font-size: 12px; margin-left: 6px; }
.vocab-box, .grammar-box { margin-bottom: 10px; }
.grammar-box { padding: 8px 10px; background: #fffbeb; border-left: 3px solid var(--accent); border-radius: 8px; }
.example { font-size: 13px; color: var(--text); font-style: italic; }

/* 单词点击发音（标准美音 MP3） */
.word { cursor: pointer; user-select: none; display: inline-block; transition: transform .12s, background .12s; }
.word:active { transform: scale(1.18); background: var(--primary-light); }

/* 东辰题库·应用题 */
.dc-item { margin: 10px 0; padding: 10px; background: #f8fafc; border-radius: 8px; border-left: 3px solid var(--red); }
.dc-tag { display: inline-block; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 8px; margin-right: 6px; }
.dc-a { margin-top: 8px; padding: 8px 10px; background: #fef2f2; border-radius: 8px; }
.dc-a .solve { margin-top: 4px; }

/* 学习统计看板 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-cell { background: #f8fafc; border-radius: 10px; padding: 10px 6px; text-align: center; }
.stat-num { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.stat-num.streak { color: var(--accent); }
.stat-num.warn { color: var(--red); }
.stat-sub { font-size: 13px; color: var(--text-light); font-weight: 600; }
.stat-label { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.rate-day { font-size: 10px; color: var(--text-light); margin-top: 2px; text-align: center; }
.stat-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.stat-row:last-child { border-bottom: none; }

/* 考试倒计时 */
.exam-tip { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--red); background: #fef2f2; border: 1px dashed #fca5a5; border-radius: 8px; padding: 6px 10px; }

/* 考试日历列表 */
.exam-list { margin-top: 8px; }
.exam-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #f8fafc; border-radius: 8px; margin-bottom: 5px; font-size: 13px; }
.exam-row.done { opacity: .55; }

/* 集训营/重要日程提示 */
.event-card { background: linear-gradient(135deg, #fef3c7, #fff7ed); border: 2px solid #fcd34d; font-size: 14px; font-weight: 700; color: #92400e; }

/* 语文闯关打卡 */
.recite-list { }
.recite-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff; transition: all .15s; }
.recite-item.done-good { background: #f0fdf4; border-color: var(--green); }
.recite-item.done-mid { background: #fffbeb; border-color: var(--accent); }
.recite-main { flex: 1; font-size: 14px; line-height: 1.5; }
.recite-action { display: flex; align-items: center; gap: 4px; }
.recite-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: #e0f2fe; color: var(--primary); margin-right: 4px; }
