/* style.css —— 母语思维英语（手机优先） */
:root {
  --bg: #f5f2ec;
  --card: #ffffff;
  --ink: #233030;
  --muted: #7b8a8b;
  --accent: #0f766e;
  --accent-soft: #e0f0ee;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --line: #e8e3d8;
  --radius: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: rgba(245, 242, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-weight: 700; font-size: 17px; flex: 1; text-align: center; }
.icon-btn {
  border: 1px solid var(--line); background: var(--card);
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 16px; cursor: pointer; color: var(--ink);
}
.hidden { display: none !important; }

/* ---------- 布局 ---------- */
.screen { padding: 16px 16px 48px; }
.screen > * { animation: fadeUp .25s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(35, 48, 48, .06), 0 4px 14px rgba(35, 48, 48, .05);
}

/* ---------- 首页 ---------- */
.hero {
  background: linear-gradient(135deg, #0f766e, #115e59 60%, #134e4a);
  color: #fff;
  border-radius: 22px;
  padding: 26px 20px;
  margin-bottom: 14px;
}
.hero h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: .5px; }
.hero-sub { margin: 0 0 14px; opacity: .88; font-size: 14px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-block; padding: 3px 10px;
  border-radius: 999px; font-size: 12.5px;
  background: var(--accent-soft); color: var(--accent);
}
.chip-light { background: rgba(255, 255, 255, .16); color: #fff; }

.card-mix { border: 1.5px solid #0f766e33; }
.replay-card { border: 1.5px solid #c2410c44; background: #fffaf6; }
.replay-title { font-weight: 700; font-size: 15.5px; margin-bottom: 10px; }
.replay-frame {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  border: 0; border-radius: 14px; background: #10201f;
}
.replay-poster {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 14px; cursor: pointer;
  background:
    radial-gradient(120% 160% at 20% 0%, #14514c 0%, #0d2f2c 55%, #0a1f1d 100%);
  display: flex; align-items: center; justify-content: center;
}
.replay-play {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  border: 2px solid rgba(255, 255, 255, .75);
  color: #fff; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  padding-left: 5px;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, .08);
}
.replay-poster:active { transform: scale(.99); }
.replay-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-top: 8px; font-size: 12.5px; color: var(--muted);
}
.replay-open { color: var(--accent); text-decoration: none; font-weight: 600; flex: none; }
.card-warn { border: 1.5px solid #b4530933; }
.day-head { display: flex; gap: 12px; align-items: flex-start; }
.day-badge {
  flex: none; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 4px 9px; border-radius: 10px; margin-top: 2px;
}
.card-title { font-weight: 700; font-size: 17px; }
.card-desc { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card-info { flex: 1; }
.card:not(.day-head) { display: block; }
.card-mix, .card-warn { display: flex; align-items: center; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }

.progress {
  height: 8px; border-radius: 99px; background: #ede9df; overflow: hidden;
}
.progress-in { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #14b8a6, #0f766e); transition: width .4s; }
.progress-label { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.btn {
  border: none; border-radius: 14px;
  padding: 11px 18px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .08s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-solid { background: var(--accent); color: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-ghost { background: var(--accent-soft); color: var(--accent); }
.btn-big { width: 100%; padding: 14px; font-size: 16px; margin-top: 6px; }

.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 10px 0; }
.foot.icp { padding-top: 6px; padding-bottom: 20px; }
.foot.icp a { color: var(--muted); text-decoration: none; }

/* ---------- 学习页 ---------- */
.card-intro h2 { margin: 0 0 8px; font-size: 19px; }
.intro-core { margin: 0; color: var(--accent); font-weight: 600; }
.intro-img { width: 100%; border-radius: 14px; margin-top: 12px; cursor: zoom-in; display: block; }
.intro-img-note { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 6px; }
.group-pics {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 2px 4px; scrollbar-width: none;
}
.group-pics::-webkit-scrollbar { display: none; }
.pic-thumb {
  height: 84px; border-radius: 12px; flex: none;
  border: 1px solid var(--line); object-fit: cover; cursor: zoom-in;
}
.sec-title { font-size: 15px; color: var(--muted); margin: 22px 4px 10px; font-weight: 700; }
.img-word { font-size: 24px; font-weight: 800; color: var(--accent); }
.img-picture {
  display: inline-block; margin-top: 4px;
  background: var(--warn-soft); color: var(--warn);
  font-size: 13.5px; padding: 3px 10px; border-radius: 8px;
}
.group-name { margin-top: 14px; font-weight: 700; font-size: 14px; color: var(--muted); }
.pairs { margin-top: 6px; }
.pair {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
}
.pair:last-child { border-bottom: none; }
.pair-txt { flex: 1; }
.pair-en { font-size: 15px; font-weight: 600; }
.pair-cn { font-size: 13px; color: var(--muted); }
.spk {
  flex: none; border: none; background: var(--accent-soft);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px;
}
.contrast-scene { font-weight: 700; margin-bottom: 8px; }
.vs { padding: 8px 10px; border-radius: 10px; font-size: 14px; margin-bottom: 6px; }
.vs-bad { background: var(--bad-soft); }
.vs-good { background: var(--ok-soft); }
.why { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.card-sum h2 { margin: 0 0 8px; font-size: 18px; }
.sum-line { margin: 6px 0; font-size: 14.5px; }

/* ---------- 练习页 ---------- */
.quiz-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.quiz-count { font-weight: 700; flex: 1; }
.badge {
  font-size: 12px; padding: 3px 9px; border-radius: 99px;
  background: #fff; border: 1px solid #c9bfa8; color: #5f6f70; font-weight: 600;
}
.badge-type { background: var(--accent); color: #fff; }
.qcard .q-title { font-size: 19px; font-weight: 700; margin-bottom: 6px; white-space: pre-line; }
.q-img {
  width: 100%; max-height: 190px; object-fit: cover;
  border-radius: 14px; margin: 4px 0 8px; cursor: zoom-in; display: block;
}
.qcard .q-sub { color: var(--muted); font-size: 14px; margin-top: 8px; white-space: pre-line; }
.qcard .btn { margin-top: 14px; }

.options { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 13px 15px;
  font-size: 15.5px; cursor: pointer; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.option:active { border-color: var(--accent); }
.option:disabled { cursor: default; }
.opt-tag { font-size: 12px; color: var(--muted); }
.tag-good { color: var(--ok); }
.tag-bad { color: var(--bad); }
.option.is-ok { border-color: var(--ok); background: var(--ok-soft); }
.option.is-no { border-color: var(--bad); background: var(--bad-soft); }

/* 连词成句 */
.order { margin-top: 14px; }
.order-answer {
  min-height: 58px; border: 1.5px dashed #c9c2b2; border-radius: 14px;
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; align-items: center;
  background: #fbfaf6; margin-bottom: 12px;
}
.order-hint { color: var(--muted); font-size: 13px; }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.tchip {
  border: 1.5px solid var(--accent); background: #fff; color: var(--accent);
  border-radius: 10px; padding: 7px 13px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.tchip:active { transform: scale(.95); }
.tchip:disabled { opacity: .5; }
.tchip-picked { background: var(--accent); color: #fff; }

/* 解析 */
.feedback { border-left: 5px solid var(--line); }
.fb-ok { border-left-color: var(--ok); }
.fb-no { border-left-color: var(--bad); }
.fb-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.fb-reveal { font-size: 15.5px; font-weight: 700; white-space: pre-line; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.fb-explain { font-size: 14px; color: var(--muted); white-space: pre-line; margin-bottom: 12px; }

/* ---------- 结果页 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 99;
  background: rgba(15, 23, 23, .9);
  display: none; align-items: center; justify-content: center;
  padding: 20px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 14px; }

.result-card { text-align: center; padding: 30px 18px; }
.result-face { font-size: 52px; }
.result-score { font-size: 34px; font-weight: 800; margin: 6px 0; }
.result-msg { color: var(--muted); font-size: 14.5px; }
.result-sub { margin-top: 8px; color: var(--ok); font-weight: 700; font-size: 14px; }
.wrong-item .wrong-title { font-weight: 700; font-size: 15px; margin: 4px 0; white-space: pre-line; }

@media (min-width: 560px) {
  body { background: #ecead3; }
  #app { box-shadow: 0 0 40px rgba(0,0,0,.08); background: var(--bg); }
}
