:root {
  --green: #58cc02;
  --green-d: #46a302;
  --blue: #1cb0f6;
  --red: #ff4b4b;
  --gold: #ffc800;
  --ink: #3c3c3c;
  --gray: #afafaf;
  --bg: #ffffff;
  --line: #e5e5e5;
  --shadow-line: #d0d0d0;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink); background: #f7f7f7;
  overscroll-behavior: none;
}
body { display: flex; flex-direction: column; }

/* 顶部状态栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-around;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.stat { display: flex; align-items: center; gap: 5px; font-weight: 800; font-size: 16px; }
.stat .ic { font-size: 18px; }
.stat.fire { color: var(--gold); }
.stat.acc { color: var(--green-d); }
.stat.due { color: var(--blue); }

/* 主内容区 */
.main { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.view { display: none; animation: fade .2s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 卡片 */
.card {
  background: #fff; border: 2px solid var(--line); border-bottom: 5px solid var(--line);
  border-radius: 20px; padding: 28px 20px; margin: 12px 0; text-align: center;
}
.pill {
  display: inline-block; background: #ddf4ff; color: #1899d6; font-weight: 800;
  padding: 4px 14px; border-radius: 14px; font-size: 13px; margin-bottom: 6px;
}
.word { font-size: 44px; font-weight: 800; letter-spacing: .5px; }
.phonetic { font-size: 20px; color: var(--gray); margin-top: 4px; }
.pos { color: var(--gray); font-style: italic; }
.meaning { font-size: 30px; font-weight: 800; color: var(--green-d); margin-top: 10px; }
.biz { font-size: 15px; color: #555; background: #fffbe9; border-radius: 12px; padding: 10px 12px; margin-top: 12px; text-align: left; }
.biz b { color: var(--gold); }
.example { font-size: 18px; margin-top: 14px; }
.example-zh { font-size: 14px; color: var(--gray); margin-top: 2px; }

/* 喇叭按钮 */
.speak {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--blue); color: #fff; font-size: 22px; margin: 8px 6px 0;
  box-shadow: 0 3px 0 #1392cf; cursor: pointer;
}
.speak:active { transform: translateY(2px); box-shadow: 0 1px 0 #1392cf; }
.speak.sm { width: 34px; height: 34px; font-size: 16px; box-shadow: 0 2px 0 #1392cf; }

/* 通用按钮 */
.btn {
  display: block; width: 100%; padding: 14px; margin: 8px 0; border: none;
  border-radius: 16px; font-size: 17px; font-weight: 800; cursor: pointer;
  color: #fff; background: var(--green); box-shadow: 0 4px 0 var(--green-d);
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--green-d); }
.btn.blue { background: var(--blue); box-shadow: 0 4px 0 #1392cf; }
.btn.gray { background: #e5e5e5; color: var(--ink); box-shadow: 0 4px 0 #c8c8c8; }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }

/* 评分按钮组 */
.grade-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grade {
  padding: 12px 4px; border: none; border-radius: 14px; font-weight: 800;
  font-size: 14px; color: #fff; cursor: pointer; line-height: 1.3;
}
.grade small { display: block; font-size: 11px; font-weight: 600; opacity: .9; }
.g1 { background: var(--red); box-shadow: 0 4px 0 #d93b3b; }
.g2 { background: #ff9600; box-shadow: 0 4px 0 #e08400; }
.g3 { background: var(--green); box-shadow: 0 4px 0 var(--green-d); }
.g4 { background: var(--blue); box-shadow: 0 4px 0 #1392cf; }
.grade:active { transform: translateY(2px); }

/* 选择题选项 */
.opt {
  display: block; width: 100%; text-align: left; padding: 16px; margin: 8px 0;
  border: 2px solid var(--line); border-bottom: 4px solid var(--line);
  border-radius: 14px; background: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
}
.opt:active { transform: translateY(2px); }
.opt.correct { border-color: var(--green); background: #d7ffb8; color: var(--green-d); }
.opt.wrong { border-color: var(--red); background: #ffdfe0; color: var(--red); }

/* 拼写输入 */
.spell-input {
  width: 100%; padding: 14px; font-size: 22px; text-align: center; font-weight: 800;
  border: 2px solid var(--line); border-radius: 14px; letter-spacing: 2px; outline: none;
}
.spell-input:focus { border-color: var(--blue); }
.hint { color: var(--gray); font-size: 14px; text-align: center; margin: 6px 0; }
.feedback { font-size: 18px; font-weight: 800; text-align: center; margin: 8px 0; }
.feedback.ok { color: var(--green-d); }
.feedback.no { color: var(--red); }

/* 进度条 */
.progress { height: 14px; background: var(--line); border-radius: 10px; overflow: hidden; margin: 4px 0 14px; }
.progress > div { height: 100%; background: var(--green); border-radius: 10px; transition: width .3s; }

/* 统计网格 */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 14px 8px; text-align: center; }
.metric .num { font-size: 26px; font-weight: 800; color: var(--green-d); }
.metric .lbl { font-size: 12px; color: var(--gray); margin-top: 2px; }
.calendar { display: flex; justify-content: space-between; margin-top: 8px; }
.calendar div { text-align: center; font-size: 12px; color: var(--gray); }
.calendar .dot { font-size: 24px; }

/* 词库列表 */
.wlist .row { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 8px 0; }
.wlist .w { font-weight: 800; font-size: 18px; }
.wlist .m { color: var(--green-d); font-weight: 700; }
.wlist .e { color: var(--gray); font-size: 13px; margin-top: 4px; }

/* 表单 */
.field { margin: 8px 0; }
.field label { font-size: 13px; color: var(--gray); font-weight: 700; }
.field input { width: 100%; padding: 11px; border: 2px solid var(--line); border-radius: 12px; font-size: 16px; outline: none; }
.field input:focus { border-color: var(--blue); }

/* 底部导航 */
.tabbar {
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; border: none; background: none; padding: 10px 0 8px;
  font-size: 11px; font-weight: 700; color: var(--gray); cursor: pointer;
}
.tabbar button .ic { display: block; font-size: 22px; margin-bottom: 2px; }
.tabbar button.active { color: var(--green); }

.center { text-align: center; }
.muted { color: var(--gray); }
.section-title { font-size: 18px; font-weight: 800; margin: 16px 0 8px; }
.big-emoji { font-size: 56px; text-align: center; margin: 30px 0 10px; }

/* ============ 视觉优化 v2 ============ */
body { background: linear-gradient(180deg, #eefbe6 0%, #f5f7f4 220px); }

.topbar {
  box-shadow: 0 3px 14px rgba(70, 163, 2, 0.08);
  border-bottom: none;
  border-radius: 0 0 18px 18px;
}
.stat { background: #f4f8f0; padding: 6px 11px; border-radius: 14px; font-size: 15px; }
.stat.fire { background: #fff7e0; }
.stat.acc { background: #eafce0; }
.stat.due { background: #e4f6ff; }

.card {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  border-bottom-width: 2px;
}

.section-title {
  border-left: 4px solid var(--green);
  padding-left: 10px;
  line-height: 1.2;
}

.lesson-card { transition: transform 0.12s ease, box-shadow 0.12s ease; }
.lesson-card:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }

.btn { letter-spacing: 0.5px; transition: transform 0.06s ease; }
.pill { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }

/* 底部导航:激活态加绿色胶囊背景 */
.tabbar { box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.05); }
.tabbar button { transition: color 0.15s ease; }
.tabbar button .ic { transition: transform 0.15s ease; border-radius: 14px; }
.tabbar button.active .ic { background: #e7ffd4; transform: translateY(-2px); padding: 2px 12px; }

/* 单词主体更醒目 */
.word { letter-spacing: 0.5px; }
.meaning { letter-spacing: 0.3px; }

/* 进度条更柔和 */
.progress { height: 12px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06); }
.progress > div { background: linear-gradient(90deg, #58cc02, #7ee03a); }

