:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #6b7787;
  --primary: #2f6fed;
  --primary-dark: #2456bd;
  --accent: #e8543f;
  --border: #e4e9f0;
  --shadow: 0 2px 10px rgba(31, 39, 51, 0.07);
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

/* ===== 顶部导航 ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 28px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #2f6fed, #6aa3ff);
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.brand-name { font-weight: 700; font-size: 17px; }
.brand-sub { font-size: 12px; color: var(--muted); }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav button {
  border: none; background: none; padding: 8px 13px; border-radius: 9px;
  font-size: 14px; color: var(--muted); cursor: pointer; font-family: inherit;
}
nav button:hover { background: #eef3fb; color: var(--primary); }
nav button.active { background: var(--primary); color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.streak-badge {
  background: #fff3ee; color: var(--accent); font-weight: 700;
  padding: 5px 12px; border-radius: 999px; font-size: 13px;
}

/* ===== 按钮 ===== */
.btn {
  border: none; cursor: pointer; font-family: inherit; font-size: 15px;
  padding: 11px 22px; border-radius: 10px; font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--text); padding: 7px 14px; font-size: 13px; }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-soft { background: #eef3fb; color: var(--primary); }
.btn-small { padding: 7px 14px; font-size: 13px; }

/* ===== 布局 ===== */
main { max-width: 1080px; margin: 0 auto; padding: 30px 22px 60px; }
.section { display: none; animation: fadeIn 0.3s ease; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero {
  text-align: center; padding: 54px 20px 40px;
  background: linear-gradient(160deg, #eef3ff 0%, #f9fbff 60%, #fff 100%);
  border-radius: 20px; margin-bottom: 34px;
}
.hero h1 { font-size: 34px; letter-spacing: 1px; margin-bottom: 12px; }
.hero h1 em { color: var(--primary); font-style: normal; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 26px; font-size: 16px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.section-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.section-sub { color: var(--muted); margin-bottom: 22px; font-size: 14px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card.clickable { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.card.clickable:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(31,39,51,0.12); }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card .muted { color: var(--muted); font-size: 13px; }

.tag {
  display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px;
  background: #eef3fb; color: var(--primary); margin: 2px 4px 2px 0;
}
.level-bar { height: 5px; border-radius: 3px; margin-bottom: 14px; }

/* ===== 测验 ===== */
.quiz-q { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  text-align: left; padding: 13px 16px; border: 1.5px solid var(--border);
  border-radius: 11px; background: #fff; cursor: pointer; font-size: 15px;
  font-family: inherit; transition: border-color 0.12s, background 0.12s;
}
.option:hover { border-color: var(--primary); background: #f5f8ff; }
.option.correct { border-color: #2fae5f; background: #ecfaf1; }
.option.wrong { border-color: var(--accent); background: #fff1ef; }
.quiz-progress { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.explain-box {
  margin-top: 16px; padding: 14px 16px; border-radius: 10px;
  background: #fff8ec; border: 1px solid #ffe1ae; font-size: 14px;
}

/* ===== 闪卡 ===== */
.flashcard {
  perspective: 1000px; height: 260px; cursor: pointer; margin-bottom: 18px;
}
.flashcard-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.5s; transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; text-align: center;
}
.flash-face.back { transform: rotateY(180deg); background: #f2f7ff; }
.flash-word { font-size: 36px; font-weight: 800; color: var(--primary); }
.flash-example { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.flash-trans { color: var(--muted); }
.srs-info { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* ===== 语音类 ===== */
.speak-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef3fb; color: var(--primary); border: none; border-radius: 9px;
  padding: 8px 16px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.speak-btn:hover { background: #dfe9fb; }
.sentence-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.sentence-card .s-text { font-size: 16px; font-weight: 600; }
.sentence-card .s-tip { width: 100%; font-size: 13px; color: var(--muted); }

/* ===== 阅读 ===== */
.reading-text {
  background: #fffdf7; border: 1px solid #f0e6cd; border-radius: 12px;
  padding: 20px 22px; font-size: 16px; margin-bottom: 20px; line-height: 1.9;
}

/* ===== 港式纠错 ===== */
.hk-item { margin-bottom: 14px; }
.hk-wrong { color: var(--accent); text-decoration: line-through; font-weight: 600; }
.hk-right { color: #2fae5f; font-weight: 700; }
.hk-type { font-size: 12px; background: #fdeceb; color: var(--accent); padding: 2px 8px; border-radius: 999px; margin-left: 8px; }
.hk-note { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ===== 发音 ===== */
.pron-drill { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pron-word {
  background: #eef3fb; padding: 6px 14px; border-radius: 9px; font-size: 15px;
  font-weight: 600; color: var(--primary); cursor: pointer; border: none; font-family: inherit;
}
.pron-word:hover { background: #dfe9fb; }

/* ===== 打卡与进度 ===== */
.check-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  margin-bottom: 10px; cursor: pointer;
}
.check-item.done { background: #f0faf4; border-color: #bfe6cf; }
.check-item .box {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid #c9d3e0;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #fff; font-size: 14px;
}
.check-item.done .box { background: #2fae5f; border-color: #2fae5f; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
  flex: 1; min-width: 140px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; text-align: center;
}
.stat .num { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat .label { font-size: 13px; color: var(--muted); }

.progress-bar { height: 10px; background: #e9edf3; border-radius: 5px; overflow: hidden; }
.progress-bar > div { height: 100%; background: linear-gradient(90deg, #2f6fed, #6aa3ff); border-radius: 5px; transition: width 0.4s; }

/* ===== 方法论 ===== */
.method-card { display: flex; gap: 14px; }
.method-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #eef3fb, #dfe9fb);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.method-src { font-size: 12px; color: var(--primary); font-weight: 600; }

.footer {
  text-align: center; padding: 30px 20px; color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--border); background: #fff;
}
.footer .muted { font-size: 12px; }

/* 语音中心 */
.voice-current { border: 2px solid var(--primary); background: #f5f9ff; }
input[type="range"] { accent-color: var(--primary); height: 6px; cursor: pointer; }

/* 结果页 */
.result-emoji { font-size: 56px; }
.result-level { font-size: 26px; font-weight: 800; color: var(--primary); margin: 8px 0; }

/* 发音提示 Toast */
.ea-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: #26313f; color: #fff; font-size: 14px;
  padding: 11px 20px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; z-index: 99; max-width: 80vw; text-align: center;
}
.ea-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  .hero h1 { font-size: 26px; }
  .topbar { padding: 8px 14px; flex-wrap: wrap; }
  .brand-sub { display: none; }
}
