:root {
  --bg: #f3f8ff;
  --card: #ffffff;
  --ink: #1f3050;
  --muted: #6b7c93;
  --brand: #ff8a3d;
  --brand-2: #4cc4ff;
  --green: #2bb673;
  --red: #ff5d6c;
  --word: #4cc4ff;
  --chunk: #ffb13d;
  --stem: #a982ff;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(40, 80, 140, .12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #eaf4ff 0%, #f7fbff 280px, #ffffff 100%);
  -webkit-text-size-adjust: 100%;
}
main { max-width: 880px; margin: 0 auto; padding: 0 16px 60px; }

/* Hero */
.hero {
  max-width: 880px; margin: 0 auto; padding: 22px 16px 8px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.hero-art { font-size: 30px; letter-spacing: 6px; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: 13px; margin: 0 0 4px; letter-spacing: .5px; }
.hero h1 { margin: 0; font-size: 26px; }
.hero-sub { margin: 6px 0 10px; color: #51637e; font-size: 14px; line-height: 1.6; }
.progress-pill {
  display: inline-flex; gap: 16px; background: #fff; border-radius: 999px;
  padding: 8px 18px; box-shadow: var(--shadow); font-size: 14px;
}
.progress-pill strong { color: var(--brand); font-size: 17px; }

/* 通用按钮 */
.primary-btn, .ghost-btn, .finish-btn {
  border: none; cursor: pointer; border-radius: 999px; font-weight: 700;
  font-size: 15px; padding: 11px 20px; transition: transform .08s, box-shadow .2s;
  font-family: inherit;
}
.primary-btn:active, .ghost-btn:active, .finish-btn:active { transform: translateY(1px); }
.primary-btn { background: var(--brand); color: #fff; box-shadow: 0 6px 14px rgba(255,138,61,.35); }
.ghost-btn { background: #eef3fb; color: #3a5277; }
.finish-btn { background: var(--green); color: #fff; box-shadow: 0 6px 14px rgba(43,182,115,.3); }

/* 今日卡片 */
.today-card {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  padding: 22px; margin-top: 10px;
}
.lesson-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.lesson-title { margin: 2px 0 6px; font-size: 23px; }
.lesson-goal { margin: 0; color: #51637e; font-size: 15px; line-height: 1.6; }
.scene-card {
  background: linear-gradient(135deg, #fff3e6, #e9f6ff); border-radius: 16px;
  padding: 12px 18px; text-align: center; min-width: 96px;
}
.scene-emoji { font-size: 40px; line-height: 1.1; }
.scene-name { margin: 4px 0 0; font-size: 13px; color: #6b7c93; }

/* 学习板 */
.study-board { margin-top: 20px; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.board-head h3 { margin: 0; font-size: 18px; }
.board-tip { color: #8a9ab2; font-size: 13px; margin: 10px 2px 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.card-grid.collapsed {
  max-height: 216px; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent);
  mask-image: linear-gradient(180deg, #000 62%, transparent);
}
.cards-toggle {
  display: block; margin: 10px auto 0; border: 2px solid #e3ebf7; background: #fff;
  color: #3a5277; border-radius: 999px; padding: 7px 18px; font-size: 13.5px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.cards-toggle[hidden] { display: none; }
.cards-toggle:active { transform: translateY(1px); }

/* 翻面卡 */
.flip-card {
  position: relative; height: 92px; cursor: pointer; perspective: 600px;
  border-radius: 14px;
}
.flip-inner {
  position: relative; width: 100%; height: 100%; transition: transform .45s;
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border-radius: 14px; padding: 22px 10px 10px; font-weight: 700;
  box-shadow: 0 4px 10px rgba(40,80,140,.1);
}
.flip-front { background: #fff; font-size: 16px; }
.flip-back { background: #fff7ee; color: #b5642a; transform: rotateY(180deg); font-size: 15px; }
.type-word .flip-front { border-bottom: 4px solid var(--word); }
.type-chunk .flip-front { border-bottom: 4px solid var(--chunk); }
.type-stem .flip-front { border-bottom: 4px solid var(--stem); }
.card-tag {
  position: absolute; top: 6px; left: 8px; z-index: 2; font-size: 11px;
  background: rgba(0,0,0,.04); color: #7b8aa3; border-radius: 6px; padding: 1px 6px;
}
.speak-mini {
  position: absolute; top: 4px; right: 4px; z-index: 3; border: none;
  background: #eef6ff; color: #2b86c5; width: 30px; height: 30px; border-radius: 50%;
  font-size: 15px; cursor: pointer; line-height: 1;
}
.speak-mini:active { background: #d6ecff; }

/* 练习 */
.practice-card {
  margin-top: 22px; background: #fbfdff; border: 1px solid #e7eefb;
  border-radius: 18px; padding: 18px;
}
.practice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.practice-head h3 { margin: 0; font-size: 18px; }
.practice-tip { margin: 8px 2px 6px; color: #8a9ab2; font-size: 13px; }

/* 玩法标签 */
.mode-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.mode-tab {
  border: 2px solid #e3ebf7; background: #fff; color: #51637e; border-radius: 999px;
  padding: 6px 13px; font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.mode-tab:active { transform: translateY(1px); }
.mode-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.practice-body { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.question {
  background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 3px 8px rgba(40,80,140,.07);
  border: 2px solid transparent;
}
.question.correct { border-color: var(--green); background: #f1fbf6; }
.question.wrong { border-color: var(--red); background: #fff4f5; }
.q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.q-no {
  background: var(--brand-2); color: #fff; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.q-en { font-size: 17px; font-weight: 700; }
.q-speak { position: static; }
.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.opt {
  border: 2px solid #e3ebf7; background: #fff; border-radius: 12px; padding: 11px 8px;
  font-size: 15px; cursor: pointer; font-family: inherit; color: var(--ink); text-align: center;
  transition: border-color .15s, background .15s;
}
.opt:active { transform: translateY(1px); }
.opt.chosen { border-color: var(--brand-2); background: #eaf6ff; }
.question.correct .opt.is-answer,
.question.wrong .opt.is-answer { border-color: var(--green); background: #e7f8ef; }
.question.wrong .opt.chosen:not(.is-answer) { border-color: var(--red); background: #ffe9eb; }

/* 听音大按钮 */
.listen-big {
  border: none; background: linear-gradient(135deg, #4cc4ff, #2b86c5); color: #fff;
  border-radius: 12px; padding: 12px 18px; font-size: 17px; font-weight: 700; cursor: pointer;
  font-family: inherit; box-shadow: 0 4px 10px rgba(43,134,197,.3);
}
.listen-big:active { transform: translateY(1px); }
/* 填空 */
.q-gap { letter-spacing: .5px; }
.q-gap, .gap-cn { font-weight: 700; }
.gap-cn { color: #8a9ab2; font-size: 14px; font-weight: 400; }
.opt-en { font-weight: 700; }

/* 配对连线 */
.match-tip { color: #8a9ab2; font-size: 13px; margin-bottom: 6px; }
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-col { display: flex; flex-direction: column; gap: 8px; }
.match-item {
  border: 2px solid #e3ebf7; background: #fff; border-radius: 12px; padding: 11px 10px;
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; color: var(--ink);
  text-align: center; transition: border-color .15s, background .15s, transform .1s;
}
.match-item .speak-mini { position: static; display: inline-flex; width: 20px; height: 20px; font-size: 12px; vertical-align: middle; margin-right: 4px; background: transparent; }
.match-item:active { transform: translateY(1px); }
.match-item.sel { border-color: var(--brand); background: #fff4ea; }
.match-item.done { border-color: var(--green); background: #e7f8ef; color: #2bb673; cursor: default; opacity: .85; }
.match-item.shake-wrong { border-color: var(--red); background: #ffe9eb; animation: shake .35s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

.lesson-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.feedback { margin-top: 12px; font-size: 15px; font-weight: 700; min-height: 22px; }
.feedback.good { color: var(--green); }
.feedback.try { color: #e08a00; }

/* 地图 */
.map-section { margin-top: 30px; }
.section-title { display: flex; justify-content: space-between; align-items: center; }
.section-title h2 { font-size: 20px; margin: 0; }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; margin-top: 14px; }
.day-card {
  background: #fff; border: 2px solid #e7eefb; border-radius: 16px; padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer;
  font-family: inherit; box-shadow: 0 3px 8px rgba(40,80,140,.06); transition: transform .08s;
}
.day-card:active { transform: translateY(1px); }
.day-card.active { border-color: var(--brand); box-shadow: 0 6px 14px rgba(255,138,61,.25); }
.day-card.done { background: #f1fbf6; border-color: #bfe9d3; }
.day-no { font-size: 12px; color: #8a9ab2; font-weight: 700; }
.day-emoji { font-size: 26px; }
.day-title { font-size: 12.5px; text-align: center; color: var(--ink); line-height: 1.3; }
.stars { font-size: 12px; min-height: 14px; }

@media (max-width: 480px) {
  .hero h1 { font-size: 22px; }
  .opts { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
