:root {
  --bg: #f2f5f9;
  --card: #ffffff;
  --primary: #2f6fed;
  --primary-dark: #1f57c9;
  --primary-soft: #e8f0fe;
  --text: #1f2937;
  --muted: #6b7280;
  --green: #16a34a;
  --green-soft: #e7f6ec;
  --red: #dc2626;
  --red-soft: #fdecec;
  --border: #e5e7eb;
  --radius: 16px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #dfe5ee;
  color: var(--text);
  line-height: 1.6;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-bottom: 68px;
  position: relative;
}

/* 顶部栏 */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 10px;
}

.brand {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}

.countdown {
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
}

.countdown b {
  color: var(--primary);
  font-size: 15px;
}

/* 视图 */
.view {
  display: none;
  padding: 0 16px 24px;
  flex: 1;
}

.view.active {
  display: block;
}

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(31, 41, 55, 0.05);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 12px;
  letter-spacing: 0.5px;
}

/* 目标条 */
.goal {
  background: linear-gradient(135deg, #2f6fed, #4f8bff);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.goal-label {
  font-size: 12px;
  opacity: 0.85;
}

.goal-score {
  font-size: 34px;
  font-weight: 700;
  margin: 2px 0 4px;
}

.goal-score small {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.9;
}

.goal-note {
  font-size: 12px;
  opacity: 0.85;
}

/* 今日任务 */
.task-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.task-cell {
  flex: 1;
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.task-cell b {
  display: block;
  font-size: 22px;
  line-height: 1.3;
}

.task-cell span {
  font-size: 11px;
  color: var(--muted);
}

/* 进度条 */
.progress {
  height: 9px;
  border-radius: 5px;
  background: var(--border);
  overflow: hidden;
  margin: 8px 0 6px;
}

.progress > i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--green);
  transition: width 0.3s;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* 按钮 */
button {
  font-family: inherit;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  cursor: pointer;
  transition: opacity 0.15s;
}

button:active {
  opacity: 0.8;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  width: 100%;
}

.btn-ghost {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 500;
}

.btn-green {
  background: var(--green);
  color: #fff;
  font-weight: 600;
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row > button {
  flex: 1;
}

/* 学习卡 */
.learn-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin: 6px 2px 10px;
}

.learn-card {
  text-align: center;
  padding: 26px 18px 22px;
}

.word-en {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 6px;
  word-break: break-word;
}

.speak {
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 13px;
  margin-bottom: 10px;
}

.word-cn {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 16px;
}

.detail {
  text-align: left;
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: #374151;
  margin-bottom: 10px;
}

.detail b {
  color: var(--primary);
  font-size: 12px;
  display: block;
  margin-bottom: 2px;
}

.note {
  font-size: 12px;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 8px;
  padding: 6px 10px;
  margin-top: 8px;
}

/* 练习 */
.practice-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin: 6px 2px 10px;
}

.question-type {
  display: inline-block;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 12px;
}

.question-cn {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 4px;
}

.question-en {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  word-break: break-word;
}

.hint {
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 14px;
  word-break: break-word;
}

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

.option {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 16px;
  text-align: left;
  color: var(--text);
}

.option.correct {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
  font-weight: 600;
}

.option.wrong {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red);
}

.answer-input {
  width: 100%;
  font-family: inherit;
  font-size: 17px;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

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

.answer-input:disabled {
  background: var(--bg);
  color: var(--muted);
}

.feedback {
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
  font-size: 14px;
}

.feedback.ok {
  background: var(--green-soft);
  color: #14532d;
}

.feedback.bad {
  background: var(--red-soft);
  color: #7f1d1d;
}

.feedback-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}

.feedback-answer {
  font-size: 17px;
  font-weight: 700;
  margin: 4px 0 8px;
  word-break: break-word;
}

.feedback .detail {
  background: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
}

/* 错题 */
.wrong-item {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.wrong-item:last-child {
  border-bottom: none;
}

.wrong-en {
  font-size: 16px;
  font-weight: 600;
}

.wrong-cn {
  font-size: 13px;
  color: var(--muted);
}

.wrong-count {
  float: right;
  font-size: 12px;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 20px;
  padding: 2px 8px;
}

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 40px 0;
}

/* 底部导航 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}

.tabbar button {
  flex: 1;
  background: none;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0;
  border-radius: 0;
}

.tabbar button.active {
  color: var(--primary);
  font-weight: 600;
}

/* 小工具 */
.muted {
  color: var(--muted);
  font-size: 13px;
}

.center {
  text-align: center;
}

.mt {
  margin-top: 14px;
}
