/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #0a0a1a;
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 导航栏 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(10, 10, 26, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-brand {
  font-size: 24px;
  font-weight: bold;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  color: #aaa;
  text-decoration: none;
  font-size: 15px;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #fff;
}

/* 页面切换 */
.page {
  display: none;
  padding-top: 80px;
  min-height: 100vh;
}

.page.active {
  display: block;
}

/* 首页 Hero */
.hero {
  text-align: center;
  padding: 100px 20px 60px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 18px;
  color: #888;
  margin-bottom: 40px;
}

.btn-primary {
  padding: 14px 48px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  padding: 12px 36px;
  font-size: 16px;
  font-weight: 500;
  color: #aaa;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* 特性卡片 */
.features {
  display: flex;
  gap: 30px;
  padding: 40px 60px;
  justify-content: center;
  flex-wrap: wrap;
}

.feature-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 30px;
  width: 300px;
  text-align: center;
  transition: transform 0.3s, border-color 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(102, 126, 234, 0.3);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #fff;
}

.feature-card p {
  font-size: 14px;
  color: #888;
  line-height: 1.6;
}

/* 每周过关 */
.weekly-challenge {
  text-align: center;
  padding: 50px 20px 30px;
  max-width: 700px;
  margin: 0 auto;
}

.weekly-challenge h2 {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.weekly-desc {
  font-size: 16px;
  color: #aaa;
  margin-bottom: 28px;
}

.weekly-days {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-weekly-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 36px;
  background: rgba(240, 147, 251, 0.08);
  border: 1px solid rgba(240, 147, 251, 0.25);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 150px;
}

.btn-weekly-day:hover {
  background: rgba(240, 147, 251, 0.18);
  border-color: #f093fb;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(240, 147, 251, 0.25);
}

.day-label {
  font-size: 14px;
  color: #f093fb;
  font-weight: 600;
  letter-spacing: 1px;
}

.day-date {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.day-info {
  font-size: 12px;
  color: #aaa;
}

/* 课程选择 */
.course-select {
  padding: 40px 60px;
}

.course-select h2 {
  text-align: center;
  font-size: 28px;
  margin-bottom: 30px;
}

.course-grid {
  max-width: 900px;
  margin: 0 auto;
}

.course-group {
  margin-bottom: 36px;
}

.course-group-title {
  font-size: 16px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
  padding-left: 4px;
  border-left: 3px solid #667eea;
  padding-left: 12px;
}

.course-group-title.weekly-title {
  color: #f093fb;
  border-left-color: #f093fb;
}

.course-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.course-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.course-card:hover {
  border-color: #667eea;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.course-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.course-card h3 {
  font-size: 16px;
  color: #fff;
}

.course-badge {
  font-size: 12px;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.weekly-badge {
  color: #f093fb;
  background: rgba(240, 147, 251, 0.15);
}

.course-card .course-desc {
  font-size: 13px;
  color: #888;
  margin-bottom: 12px;
}

.course-actions {
  display: flex;
  gap: 8px;
}

.btn-mode {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sentence {
  color: #a5b4fc;
  background: rgba(165, 180, 252, 0.08);
}

.btn-sentence:hover {
  background: rgba(165, 180, 252, 0.18);
  border-color: #a5b4fc;
}

.btn-word {
  color: #86efac;
  background: rgba(134, 239, 172, 0.08);
}

.btn-word:hover {
  background: rgba(134, 239, 172, 0.18);
  border-color: #86efac;
}

/* 词汇展示区 */
.word-info {
  margin: 20px 0;
  padding: 20px;
  background: rgba(134, 239, 172, 0.05);
  border: 1px solid rgba(134, 239, 172, 0.15);
  border-radius: 12px;
  text-align: center;
}

.word-display {
  font-size: 36px;
  font-weight: 700;
  color: #86efac;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.word-phonetic {
  font-size: 16px;
  color: #888;
  font-style: italic;
}

/* 词汇练习：下划线占位 */
.word-blank {
  font-size: 36px;
  color: #555;
  letter-spacing: 6px;
  font-weight: 300;
}

.word-blank-char {
  display: inline-block;
  font-size: 36px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
  margin: 0 2px;
  border-bottom: 3px solid #555;
  padding-bottom: 4px;
  transition: all 0.15s;
}

.word-blank-char.pending {
  color: #444;
  border-bottom-color: #444;
}

.word-blank-char.correct {
  color: #4ade80;
  border-bottom-color: #4ade80;
}

.word-blank-char.incorrect {
  color: #f87171;
  border-bottom-color: #f87171;
}

.word-revealed {
  font-size: 36px;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 2px;
}

/* 练习区 */
.practice-area {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}

.hidden {
  display: none !important;
}

/* 进度条 */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin-bottom: 30px;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 3px;
  transition: width 0.3s;
  width: 0%;
}

.progress-text {
  position: absolute;
  right: 0;
  top: 12px;
  font-size: 13px;
  color: #666;
}

/* 连击显示 */
.combo-display {
  text-align: center;
  margin-bottom: 30px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s;
}

.combo-display.active {
  opacity: 1;
  transform: scale(1);
}

.combo-count {
  font-size: 72px;
  font-weight: 900;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.combo-label {
  font-size: 16px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 4px;
}

/* 句子卡片 */
.sentence-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 24px;
  text-align: center;
}

.sentence-hint {
  font-size: 20px;
  color: #ccc;
  margin-bottom: 20px;
  line-height: 1.5;
}

.sentence-target {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 1px;
}

.sentence-target .char {
  display: inline-block;
  transition: color 0.1s;
}

.sentence-target .char.correct {
  color: #4ade80;
}

.sentence-target .char.incorrect {
  color: #f87171;
  text-decoration: underline;
}

.sentence-target .char.current {
  color: #fff;
  border-bottom: 2px solid #667eea;
}

.sentence-target .char.pending {
  color: #555;
}

/* 输入区 */
.input-area {
  margin-bottom: 20px;
}

.input-area input {
  width: 100%;
  padding: 16px 24px;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  outline: none;
  transition: border-color 0.3s;
}

.input-area input:focus {
  border-color: #667eea;
}

.input-area input.correct {
  border-color: #4ade80;
}

.input-area input.incorrect {
  border-color: #f87171;
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* 反馈 */
.feedback {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  min-height: 30px;
  margin-bottom: 20px;
}

.feedback.perfect {
  color: #4ade80;
}

.feedback.good {
  color: #fbbf24;
}

.feedback.miss {
  color: #f87171;
}

/* 操作按钮 */
.practice-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn-speak {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

.btn-speak:hover {
  background: rgba(251, 191, 36, 0.18);
  border-color: #fbbf24;
}

.btn-answer {
  color: #a5b4fc;
  background: rgba(165, 180, 252, 0.08);
}

.btn-answer:hover {
  background: rgba(165, 180, 252, 0.18);
  border-color: #a5b4fc;
}

/* 练习结果 */
.practice-result {
  max-width: 500px;
  margin: 0 auto;
  padding: 40px;
  text-align: center;
}

.practice-result h2 {
  font-size: 32px;
  margin-bottom: 30px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 14px;
  color: #888;
  margin-top: 4px;
}

.result-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* 进度页面 */
#progress {
  padding: 80px 60px 40px;
  max-width: 800px;
  margin: 0 auto;
}

#progress h2 {
  font-size: 28px;
  margin-bottom: 30px;
  text-align: center;
}

.stats-overview {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  justify-content: center;
}

.overview-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px 40px;
  text-align: center;
}

.overview-value {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.overview-label {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

.history-section h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 14px 20px;
}

.history-item .history-course {
  font-size: 15px;
  color: #ccc;
}

.history-item .history-date {
  font-size: 12px;
  color: #666;
}

.history-item .history-stats {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: #888;
}

/* 连击特效 */
.combo-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.combo-particle {
  position: absolute;
  font-size: 24px;
  font-weight: 800;
  pointer-events: none;
  animation: particle-float 1s ease-out forwards;
}

@keyframes particle-float {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(1.5);
  }
}

/* Perfect 弹出 */
.perfect-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 48px;
  font-weight: 900;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  z-index: 10000;
  pointer-events: none;
  animation: perfect-pop 0.6s ease-out forwards;
}

@keyframes perfect-pop {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* 屏幕震动 */
.screen-shake {
  animation: screen-shake 0.3s;
}

@keyframes screen-shake {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-3px, 3px); }
  50% { transform: translate(3px, -3px); }
  75% { transform: translate(-3px, -3px); }
}

/* 响应式 */
@media (max-width: 768px) {
  .navbar {
    padding: 0 20px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .features {
    padding: 20px;
    flex-direction: column;
    align-items: center;
  }

  .weekly-challenge {
    padding: 30px 20px 20px;
  }

  .weekly-challenge h2 {
    font-size: 26px;
  }

  .weekly-days {
    flex-direction: column;
    align-items: center;
  }

  .btn-weekly-day {
    width: 100%;
    max-width: 280px;
  }

  .feature-card {
    width: 100%;
    max-width: 400px;
  }

  .course-select {
    padding: 20px;
  }

  .practice-area {
    padding: 20px 16px;
  }

  .sentence-target {
    font-size: 22px;
  }

  .combo-count {
    font-size: 48px;
  }

  #progress {
    padding: 80px 20px 20px;
  }

  .stats-overview {
    flex-direction: column;
    align-items: center;
  }

  .overview-card {
    width: 100%;
    max-width: 300px;
  }
}
