/* 译路 · 暖色压色设计系统 */
:root {
  --bg: #f5efe4;
  --surface: #fffdf7;
  --surface-2: #faf5ea;
  --ink: #2e2a24;
  --ink-2: #5c554a;
  --muted: #8a7f6f;
  --border: #e3d9c6;
  --terracotta: #b4593a;
  --terracotta-soft: #f3e2d9;
  --green: #41584a;
  --green-soft: #e4ebe2;
  --wood: #6b4f3b;
  --gold: #8a6d3b;
  --gold-soft: #f0e9d8;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.75;
}

::selection { background: var(--terracotta-soft); }

/* ---------- 顶部 ---------- */
header {
  padding: 56px 24px 36px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
header .eyebrow {
  font-size: 12px;
  letter-spacing: 0.35em;
  color: var(--terracotta);
  text-transform: uppercase;
  margin-bottom: 14px;
}
header h1 {
  font-family: Georgia, "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
header p.sub {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 14px;
}
header .meta {
  margin-top: 18px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
header .meta input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  font-family: inherit;
}

/* ---------- 导航 ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 239, 228, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 10px 16px;
  flex-wrap: wrap;
}
nav a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13.5px;
  padding: 6px 14px;
  border-radius: 999px;
  transition: all 0.18s ease;
  white-space: nowrap;
}
nav a:hover { background: var(--terracotta-soft); color: var(--terracotta); }
nav a.active { background: var(--terracotta); color: #fff; }

/* ---------- 布局 ---------- */
main { max-width: 920px; margin: 0 auto; padding: 40px 24px 90px; }
section { margin-bottom: 64px; scroll-margin-top: 70px; }

.sec-head { margin-bottom: 26px; }
.sec-head .no {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--terracotta);
  font-size: 14px;
  letter-spacing: 0.1em;
}
.sec-head h2 {
  font-family: Georgia, "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 24px;
  font-weight: 600;
  margin-top: 4px;
}
.sec-head p { color: var(--ink-2); font-size: 14px; margin-top: 6px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

/* ---------- 仪表盘 ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.stat .num {
  font-family: Georgia, serif;
  font-size: 30px;
  color: var(--terracotta);
  line-height: 1.2;
}
.stat .lbl { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.timeline { display: flex; flex-direction: column; gap: 14px; }
.stage-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  transition: border-color 0.2s;
}
.stage-row.current { border-color: var(--terracotta); border-width: 1.5px; }
.stage-row .when {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.stage-row .when .stage-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.stage-row h3 { font-size: 16px; font-weight: 600; }
.stage-row .goal { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.stage-row ul { margin: 10px 0 0 18px; font-size: 13px; color: var(--ink-2); }
.stage-row ul li { margin-bottom: 4px; }
.stage-row .milestone {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 8px;
  padding: 6px 12px;
  display: inline-block;
}
.badge-now {
  position: absolute;
  top: -9px;
  right: 16px;
  background: var(--terracotta);
  color: #fff;
  font-size: 11px;
  padding: 2px 12px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.checkin-bar {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.18s ease;
}
.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: #9d4c30; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--terracotta); color: var(--terracotta); }
.btn:disabled { opacity: 0.45; cursor: default; }
.checkin-note { font-size: 13px; color: var(--muted); }

.week-dots { display: flex; gap: 6px; align-items: center; }
.week-dots .d {
  width: 14px; height: 14px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.week-dots .d.on { background: var(--terracotta); border-color: var(--terracotta); }

/* ---------- 练习卡 ---------- */
.level-tag {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.lv1 { background: var(--green-soft); color: var(--green); }
.lv2 { background: var(--gold-soft); color: var(--gold); }
.lv3 { background: var(--terracotta-soft); color: var(--terracotta); }

.practice-card { margin-bottom: 18px; overflow: hidden; }
.practice-card .pc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.practice-card .pc-head h3 { font-size: 16px; font-weight: 600; flex: 1; }
.practice-card .pc-head .meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.practice-card .pc-head .arrow {
  color: var(--muted);
  transition: transform 0.2s;
  font-size: 13px;
}
.practice-card.open .pc-head .arrow { transform: rotate(90deg); }
.pc-body { display: none; margin-top: 18px; }
.practice-card.open .pc-body { display: block; }

.lang-block {
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 12px;
  position: relative;
}
.lang-block .tag {
  position: absolute;
  top: -9px; left: 14px;
  font-size: 11px;
  padding: 1px 10px;
  border-radius: 999px;
  letter-spacing: 0.08em;
}
.lang-en { background: var(--surface-2); border: 1px solid var(--border); font-family: Georgia, "Times New Roman", serif; }
.lang-en .tag { background: var(--green); color: #fff; }
.lang-zh { background: var(--terracotta-soft); border: 1px solid #e8cfc0; display: none; }
.lang-zh .tag { background: var(--terracotta); color: #fff; }
.practice-card.reveal .lang-zh { display: block; }

.pc-points { display: none; }
.practice-card.reveal .pc-points { display: block; }
.pc-points h4 {
  font-size: 13px;
  color: var(--green);
  margin: 16px 0 8px;
  letter-spacing: 0.05em;
}
.pc-points ul { margin-left: 18px; font-size: 13px; color: var(--ink-2); }
.pc-points li { margin-bottom: 5px; }

.pc-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.done-mark {
  font-size: 12.5px;
  color: var(--green);
  align-self: center;
}

.howto {
  background: var(--green-soft);
  border: 1px solid #cfdccf;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 24px;
  font-size: 13.5px;
  color: var(--green);
}
.howto b { font-weight: 600; }

/* ---------- CATTI / 接单 ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 680px) { .two-col { grid-template-columns: 1fr; } }

.subject-card h3 { font-size: 15px; font-weight: 600; color: var(--green); }
.subject-card .dur { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; }
.subject-card p { font-size: 13.5px; color: var(--ink-2); }
.subject-card .tip {
  margin-top: 10px;
  font-size: 12.5px;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink-2);
}

.list-plain { margin-left: 18px; font-size: 13.5px; color: var(--ink-2); }
.list-plain li { margin-bottom: 8px; }

.book-row {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
  align-items: baseline;
}
.book-row:last-child { border-bottom: none; }
.book-row .name { font-weight: 600; font-size: 14px; min-width: 220px; }
.book-row .why { font-size: 13px; color: var(--ink-2); }

.channel-card { margin-bottom: 14px; }
.channel-card .tier {
  font-size: 11px;
  background: var(--wood);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
}
.channel-card h3 { display: inline; font-size: 16px; margin-left: 10px; }
.channel-card .price {
  float: right;
  font-family: Georgia, serif;
  color: var(--terracotta);
  font-size: 15px;
}
.channel-card .ex { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.channel-card .pc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; font-size: 12.5px; }
@media (max-width: 680px) { .channel-card .pc { grid-template-columns: 1fr; } }
.channel-card .pc .pros, .channel-card .pc .cons { border-radius: 8px; padding: 8px 12px; }
.channel-card .pc .pros { background: var(--green-soft); color: var(--green); }
.channel-card .pc .cons { background: var(--terracotta-soft); color: var(--terracotta); }
.channel-card .action {
  margin-top: 10px;
  font-size: 13px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  color: var(--ink-2);
}
.channel-card .action b { color: var(--wood); }

.warn-box {
  border: 1px solid #e0c3b2;
  background: #faf0e9;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-top: 18px;
}
.warn-box h4 { color: var(--terracotta); font-size: 14px; margin-bottom: 8px; }
.warn-box ul { margin-left: 18px; font-size: 13px; color: var(--ink-2); }
.warn-box li { margin-bottom: 5px; }

/* ---------- 术语库 ---------- */
.term-tools { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.term-tools input {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.term-tools input:focus { border-color: var(--terracotta); }
.cat-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.cat-chip.on { background: var(--green); border-color: var(--green); color: #fff; }

.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.term-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.term-card .en { font-weight: 600; font-size: 14px; font-family: Georgia, serif; }
.term-card .en .abbr { color: var(--terracotta); font-size: 12px; margin-left: 6px; }
.term-card .zh { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.term-card .note { color: var(--muted); font-size: 12px; margin-top: 6px; }
.term-card .cat { float: right; font-size: 11px; color: var(--muted); }

.term-count { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }

/* ---------- 页脚 ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 30px 24px 46px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
}
footer .heart { color: var(--terracotta); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  header h1 { font-size: 26px; }
  .stage-row { grid-template-columns: 1fr; gap: 6px; }
  main { padding: 28px 16px 70px; }
}

/* ================= 句场 play.html ================= */
.play-body { background: var(--bg); min-height: 100vh; }

.play-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 50;
}
.play-nav .back { text-decoration: none; color: var(--terracotta); font-size: 14px; }
.play-nav .play-title {
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2em;
}
.play-nav .today-count { margin-left: auto; font-size: 12.5px; color: var(--muted); }

.play-main { max-width: 760px; margin: 0 auto; padding: 34px 20px 80px; }

/* ---- 模式卡 ---- */
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .mode-grid { grid-template-columns: 1fr; } }
.mode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}
.mode-card:hover { border-color: var(--terracotta); transform: translateY(-2px); }
.mode-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--terracotta-soft);
  color: var(--terracotta);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.mode-card:nth-child(2) .mode-icon { background: var(--green-soft); color: var(--green); }
.mode-card:nth-child(3) .mode-icon { background: var(--gold-soft); color: var(--gold); }
.mode-card h3 { font-size: 16px; font-weight: 600; }
.mode-card p { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.6; }
.mode-tag {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
}

.level-picker { display: flex; align-items: center; gap: 8px; margin: 20px 0; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.lv-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-2);
  transition: all 0.15s;
}
.lv-chip.on { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }

/* ---- 首页统计 ---- */
.home-stats { padding: 20px 22px; }
.hs-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; }
@media (max-width: 640px) { .hs-row { grid-template-columns: repeat(2, 1fr); } }
.hs-item .num { font-family: Georgia, serif; font-size: 26px; color: var(--terracotta); }
.hs-item .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

.heatmap-wrap { margin-top: 18px; border-top: 1px dashed var(--border); padding-top: 14px; }
.hm-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.heatmap { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 3px; }
.hm-cell { width: 11px; height: 11px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); }
.hm-cell.l1 { background: #edd3c4; border-color: #edd3c4; }
.hm-cell.l2 { background: #dba58b; border-color: #dba58b; }
.hm-cell.l3 { background: #c4765a; border-color: #c4765a; }
.hm-cell.l4 { background: var(--terracotta); border-color: var(--terracotta); }

/* ---- 游戏屏 ---- */
.game-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.btn-quit { padding: 6px 14px; font-size: 12.5px; }
.progress-track { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--terracotta); border-radius: 999px; transition: width 0.3s ease; }
.combo-badge {
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 14px;
  white-space: nowrap;
  transition: all 0.2s;
}
.combo-badge.hot { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }

.game-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 12.5px; color: var(--muted); }
.game-meta .g-count { margin-left: auto; }

.prompt-card { padding: 20px 22px; position: relative; }
.prompt-label { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.prompt-text { font-size: 17px; line-height: 1.8; font-weight: 500; }
.btn-speak {
  position: absolute;
  top: 14px; right: 14px;
  padding: 6px 14px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---- 连词成句 ---- */
.answer-zone {
  min-height: 64px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--surface);
}
.az-hint { color: var(--muted); font-size: 13px; }
.chunk-pool { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.chunk {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14.5px;
  font-family: Georgia, serif;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--ink);
}
.chunk:hover { border-color: var(--terracotta); color: var(--terracotta); }
.chunk.picked { background: var(--green-soft); border-color: #c4d4c4; color: var(--green); }
.chunk-hint { animation: hintPulse 0.9s ease; }
@keyframes hintPulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 4px var(--terracotta-soft); border-color: var(--terracotta); }
}

/* ---- 输入区 ---- */
#area-type { margin-top: 16px; }
#type-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 15px;
  font-family: Georgia, serif;
  line-height: 1.7;
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
  outline: none;
}
#type-input:focus { border-color: var(--terracotta); }

.game-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---- 反馈 ---- */
.feedback { margin-top: 18px; border-radius: var(--radius); padding: 18px 22px; border: 1px solid; }
.feedback.fb-ok { background: var(--green-soft); border-color: #c4d4c4; }
.feedback.fb-bad { background: var(--terracotta-soft); border-color: #e8cfc0; }
.fb-verdict { font-weight: 600; font-size: 15px; }
.fb-ok .fb-verdict { color: var(--green); }
.fb-bad .fb-verdict { color: var(--terracotta); }
.fb-correct { margin-top: 10px; }
.fb-en { display: block; font-family: Georgia, serif; font-size: 15.5px; line-height: 1.7; }
.fb-zh { display: block; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.fb-note { margin-top: 10px; font-size: 12.5px; color: var(--ink-2); border-top: 1px dashed rgba(0,0,0,0.12); padding-top: 10px; }
.feedback .btn { margin-top: 14px; }

/* ---- 结算 ---- */
.result-card { text-align: center; padding: 36px 28px; }
.result-grade { font-family: Georgia, serif; font-size: 64px; line-height: 1; color: var(--muted); }
.result-grade.g-ss { color: #c0392b; }
.result-grade.g-s { color: var(--terracotta); }
.result-grade.g-a { color: var(--gold); }
.result-grade.g-b { color: var(--green); }
.result-title { font-size: 16px; font-weight: 600; margin-top: 8px; }
.result-stats { display: flex; justify-content: center; gap: 36px; margin-top: 20px; }
.result-stats .num { font-family: Georgia, serif; font-size: 24px; color: var(--ink); display: block; }
.result-stats .lbl { font-size: 12px; color: var(--muted); }
.result-wrong { margin-top: 24px; text-align: left; }
.rw-title { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.rw-title.perfect { text-align: center; color: var(--green); }
.rw-item { border-top: 1px dashed var(--border); padding: 10px 0; }
.rw-en { font-family: Georgia, serif; font-size: 14px; line-height: 1.6; }
.rw-zh { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.result-actions { display: flex; justify-content: center; gap: 12px; margin-top: 26px; }

/* 首页导航卡（index 用） */
.nav-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 26px; }
@media (max-width: 640px) { .nav-cards { grid-template-columns: 1fr; } }
.nav-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  color: var(--ink);
  transition: all 0.18s ease;
}
.nav-card:hover { border-color: var(--terracotta); transform: translateY(-2px); }
.nav-card .nc-title { font-weight: 600; font-size: 15px; }
.nav-card .nc-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.nav-card.hot { border-color: var(--terracotta); }
.nav-card.hot .nc-title { color: var(--terracotta); }
