/* ===== EnglishPath - 零基础学英语 ===== */
:root {
  --green: #58cc02;
  --green-dark: #46a302;
  --green-light: #89e219;
  --blue: #1cb0f6;
  --blue-dark: #1899d6;
  --purple: #ce82ff;
  --orange: #ff9600;
  --red: #ff4b4b;
  --gold: #ffc800;
  --bg: #f7f7f7;
  --card: #fff;
  --text: #3c3c3c;
  --text-light: #777;
  --border: #e5e5e5;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --radius: 16px;
}
* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(88,204,2,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-left { display:flex; align-items:center; gap:12px; }
.header-left a { text-decoration:none; color:#fff; display:flex; align-items:center; gap:12px; }
.logo { font-size:28px; }
.brand { font-size:20px; font-weight:800; letter-spacing:-0.5px; }
.header-right { display:flex; align-items:center; gap:16px; }
.stat-item { display:flex; align-items:center; gap:6px; font-size:15px; font-weight:700; }
.stat-item .icon { font-size:20px; }
.streak-flame { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }

/* Main Layout */
.container { max-width: 800px; margin:0 auto; padding: 20px; }

/* Unit Path */
.unit { margin-bottom: 40px; }
.unit-header {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: transform .15s;
}
.unit-header:hover { transform: translateY(-2px); }
.unit-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.unit-icon.u1 { background: #e3f8ff; }
.unit-icon.u2 { background: #ffe8cc; }
.unit-icon.u3 { background: #e8f5e9; }
.unit-icon.u4 { background: #f3e5f5; }
.unit-icon.u5 { background: #fce4ec; }
.unit-icon.u6 { background: #e0f2f1; }
.unit-icon.u7 { background: #fff3e0; }
.unit-icon.u8 { background: #ede7f6; }

.unit-info { flex:1; }
.unit-title { font-size:18px; font-weight:700; }
.unit-desc { font-size:13px; color: var(--text-light); margin-top:2px; }
.unit-progress-bar {
  height:6px; background:#e5e5e5; border-radius:3px;
  margin-top:8px; overflow:hidden;
}
.unit-progress-fill { height:100%; background:var(--green); border-radius:3px; transition:width .5s; }
.unit-arrow { font-size:20px; color:#ccc; transition:transform .3s; }
.unit.open .unit-arrow { transform: rotate(90deg); }

/* Lessons */
.unit-lessons { display:none; padding:0 0 0 20px; }
.unit.open .unit-lessons { display:block; }
.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 4px 0;
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.lesson-row:hover { background: #fff; box-shadow: var(--shadow); }
.lesson-row.completed { opacity: 0.7; }
.lesson-row.active { background: #fff; box-shadow: 0 2px 12px rgba(88,204,2,0.2); border: 2px solid var(--green); }
.lesson-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
  border: 2px solid #ddd;
  color: #aaa;
  background: #fff;
}
.lesson-dot.completed { background: var(--green); color:#fff; border-color:var(--green); }
.lesson-dot.current { border-color: var(--green); color: var(--green); background:#e8f5e9; }
.lesson-dot.locked { background:#f0f0f0; color:#ccc; border-color:#e0e0e0; }
.lesson-name { font-size:15px; font-weight:600; flex:1; }
.lesson-tag { font-size:11px; padding:3px 8px; border-radius:10px; font-weight:600; }
.lesson-tag.new { background:#e8f5e9; color:var(--green); }
.lesson-tag.review { background:#fff3e0; color:var(--orange); }
.lesson-tag.bonus { background:#f3e5f5; color:var(--purple); }

/* Home special */
.home-hero { text-align:center; padding:40px 20px 20px; }
.home-hero h1 { font-size:32px; margin-bottom:8px; }
.home-hero .subtitle { color:var(--text-light); font-size:16px; }
.total-stats {
  display: flex; gap:16px; justify-content:center;
  margin: 16px 0 32px; flex-wrap: wrap;
}
.stat-card {
  background: var(--card); border-radius:14px; padding:16px 20px;
  box-shadow: var(--shadow); text-align:center; min-width:90px;
}
.stat-card .val { font-size:22px; font-weight:800; color:var(--green-dark); }
.stat-card .lbl { font-size:12px; color:var(--text-light); margin-top:2px; }

/* Lesson View */
.lesson-view { display:none; }
.lesson-view.active { display:block; }
.back-btn {
  display: inline-flex; align-items: center; gap:6px;
  padding: 8px 16px; border-radius: 20px;
  background: #fff; border: 2px solid #e5e5e5;
  cursor: pointer; font-size:14px; font-weight:600;
  margin-bottom: 16px; transition: all .15s;
}
.back-btn:hover { background:#f0f0f0; }

/* Video */
.video-section {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.video-section video { width: 100%; display: block; max-height: 450px; }
.video-placeholder {
  background: #1a1a2e;
  color: #fff;
  padding: 60px 20px;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.video-placeholder .play-icon { font-size:60px; margin-bottom:16px; cursor:pointer; }
.video-placeholder p { color:#aaa; font-size:14px; }

/* Exercise */
.exercise-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.exercise-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.exercise-type { font-size:12px; font-weight:700; text-transform:uppercase; color: var(--text-light); letter-spacing:1px; }
.exercise-progress { font-size:13px; color:var(--text-light); }
.exercise-prompt { font-size:18px; font-weight:600; margin-bottom:20px; line-height:1.6; }
.exercise-word { font-size:28px; font-weight:800; color:var(--blue-dark); margin:12px 0; }

/* Options */
.options { display:flex; flex-direction:column; gap:10px; }
.option-btn {
  display:flex; align-items:center; gap:12px;
  padding: 14px 18px; border-radius:12px;
  border: 2px solid var(--border);
  background: #fff;
  cursor: pointer; font-size:16px;
  transition: all .2s;
  text-align: left;
}
.option-btn:hover { border-color: var(--blue); background: #f0f8ff; }
.option-btn.correct { border-color: var(--green); background: #e8f5e9; }
.option-btn.wrong { border-color: var(--red); background: #ffebee; animation: shake .4s; }
.option-btn:disabled { cursor: default; }
@keyframes shake {
  0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)}
}
.option-icon { font-size:22px; }

/* Input */
.input-group { display:flex; gap:10px; }
.exercise-input {
  flex:1; padding:14px 18px; border-radius:12px;
  border:2px solid var(--border); font-size:18px;
  outline:none; transition: border-color .2s;
}
.exercise-input:focus { border-color: var(--blue); }
.exercise-input.correct { border-color: var(--green); background:#e8f5e9; }
.exercise-input.wrong { border-color: var(--red); background:#ffebee; }
.check-btn {
  padding: 14px 24px; border-radius:12px;
  background: var(--green); color:#fff; font-size:16px;
  font-weight:700; border:none; cursor:pointer;
  transition: all .15s;
}
.check-btn:hover { background: var(--green-dark); }
.check-btn:disabled { opacity:.5; cursor:default; }

/* Feedback */
.feedback {
  padding:14px 18px; border-radius:12px;
  margin-top:12px; font-size:15px; font-weight:600;
  display:none;
}
.feedback.correct { background:#e8f5e9; color:var(--green-dark); display:block; }
.feedback.wrong { background:#ffebee; color:var(--red); display:block; }
.feedback .correct-answer { font-weight:800; margin-left:8px; }

/* Continue Button */
.continue-btn {
  display:none; width:100%; padding:16px;
  border-radius:12px; background:var(--green);
  color:#fff; font-size:17px; font-weight:700;
  border:none; cursor:pointer; margin-top:12px;
  transition: all .15s;
}
.continue-btn.show { display:block; }
.continue-btn:hover { background:var(--green-dark); }

/* Lesson Complete */
.complete-section { display:none; text-align:center; padding:40px 20px; }
.complete-section.show { display:block; }
.complete-icon { font-size:80px; animation: bounce .6s; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-20px)} }
.complete-title { font-size:28px; font-weight:800; margin:16px 0 8px; }
.complete-xp { font-size:18px; color:var(--gold); font-weight:700; }
.stats-row {
  display: flex; gap:16px; justify-content:center;
  margin: 24px 0; flex-wrap: wrap;
}
.stat-card2 {
  background: #fff; border-radius:12px; padding:16px 24px;
  box-shadow: var(--shadow); text-align:center; min-width:100px;
}
.stat-card2 .val { font-size:24px; font-weight:800; color:var(--green-dark); }
.stat-card2 .lbl { font-size:12px; color:var(--text-light); margin-top:4px; }

/* XP Toast */
.xp-toast {
  position: fixed; top:80px; right:20px;
  background: var(--green); color:#fff;
  padding: 12px 24px; border-radius:30px;
  font-weight:700; font-size:16px;
  transform: translateX(120%);
  transition: transform .4s;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(88,204,2,0.4);
}
.xp-toast.show { transform: translateX(0); }

/* Hearts */
.hearts { display:flex; gap:4px; margin-bottom:16px; }
.heart {
  font-size:24px; transition: all .3s;
}
.heart.lost { filter:grayscale(1); opacity:.3; transform:scale(.8); }

/* Match */
.match-container { display:flex; gap:20px; }
.match-item {
  padding:10px; margin:6px 0;
  background:#f0f0f0; border-radius:8px;
  text-align:center; font-weight:600;
  cursor:pointer; transition: all .15s;
}
.match-item:hover { filter: brightness(0.95); }

/* Responsive */
@media (max-width: 600px) {
  .container { padding:10px; }
  .exercise-card { padding:20px; }
  .header { padding:10px 14px; }
  .brand { font-size:16px; }
  .match-container { flex-direction:column; gap:8px; }
}
