/* ========== 基础重置与变量 ========== */
:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #a855f7;
  --accent-green: #22c55e;
  --accent-blue: #3b82f6;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --bg-dark: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --bg-surface: #16162a;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.15);
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }
button { cursor: pointer; border: none; font-family: inherit; }
input { font-family: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ========== 渐变文字 ========== */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(99,102,241,0.4); }
.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary-light); background: rgba(99,102,241,0.08); }
.btn-glass {
  background: rgba(255,255,255,0.08); color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(255,255,255,0.15); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ========== 导航栏 ========== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(15,15,26,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.navbar.scrolled { background: rgba(15,15,26,0.95); box-shadow: var(--shadow); }
.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.logo-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-size: 16px; color: white;
}
.logo-text { background: linear-gradient(135deg, var(--primary-light), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 32px; }
.nav-link { font-size: 14px; color: var(--text-secondary); transition: var(--transition); position: relative; padding: 4px 0; }
.nav-link::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px; background: var(--primary); border-radius: 1px; transition: var(--transition); }
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; color: var(--text-primary); font-size: 20px; padding: 8px; }

/* ========== Hero ========== */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  position: relative; padding-top: 64px; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-circle {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.4;
  animation: float 8s ease-in-out infinite;
}
.hero-circle-1 { width: 400px; height: 400px; background: var(--primary); top: -100px; right: -100px; }
.hero-circle-2 { width: 300px; height: 300px; background: var(--secondary); bottom: -50px; left: -50px; animation-delay: -3s; }
.hero-circle-3 { width: 200px; height: 200px; background: var(--accent-green); top: 50%; left: 50%; animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-content { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; position: relative; z-index: 1; }
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 20px;
  background: rgba(99,102,241,0.15); color: var(--primary-light);
  font-size: 13px; font-weight: 500; margin-bottom: 20px;
  border: 1px solid rgba(99,102,241,0.2);
}
.hero-title { font-size: 56px; font-weight: 900; line-height: 1.2; margin-bottom: 20px; letter-spacing: -1px; }
.hero-desc { font-size: 17px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 32px; max-width: 500px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 40px; }
.stat-item { display: flex; flex-direction: column; }
.stat-num { font-size: 28px; font-weight: 700; color: var(--primary-light); }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* Hero 卡片 */
.hero-visual { display: flex; justify-content: center; }
.hero-card {
  width: 380px; border-radius: var(--radius-lg);
  background: rgba(26,26,46,0.8); border: 1px solid var(--border-light);
  backdrop-filter: blur(20px); box-shadow: var(--shadow-lg);
  overflow: hidden; transform: perspective(1000px) rotateY(-5deg) rotateX(3deg);
  transition: var(--transition);
}
.hero-card:hover { transform: perspective(1000px) rotateY(0deg) rotateX(0deg); }
.card-header {
  display: flex; gap: 6px; padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-dot { width: 10px; height: 10px; border-radius: 50%; }
.card-dot-red { background: #ef4444; }
.card-dot-yellow { background: #f59e0b; }
.card-dot-green { background: #22c55e; }
.card-body { padding: 24px; }
.card-wave { margin-bottom: 20px; border-radius: var(--radius-sm); overflow: hidden; }
.card-wave canvas { display: block; width: 100%; }
.card-text { text-align: center; margin-bottom: 24px; }
.card-english { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.card-chinese { font-size: 14px; color: var(--text-secondary); }
.card-score { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.score-circle { position: relative; width: 80px; height: 80px; }
.score-circle svg { width: 100%; height: 100%; }
.score-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: var(--accent-green); }
.score-label { font-size: 13px; color: var(--text-muted); }

/* ========== 通用 Section 样式 ========== */
section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-tag {
  display: inline-block; padding: 4px 14px; border-radius: 20px;
  background: rgba(99,102,241,0.12); color: var(--primary-light);
  font-size: 13px; font-weight: 500; margin-bottom: 16px;
  border: 1px solid rgba(99,102,241,0.2);
}
.section-title { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.section-desc { font-size: 16px; color: var(--text-secondary); max-width: 600px; margin: 0 auto; }

/* ========== 功能特色 ========== */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
  padding: 32px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: var(--transition); cursor: pointer;
}
.feature-card:hover { transform: translateY(-6px); border-color: var(--primary); box-shadow: 0 8px 32px rgba(99,102,241,0.15); }
.feature-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 20px;
}
.feature-icon-blue { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.feature-icon-purple { background: rgba(168,85,247,0.15); color: var(--secondary); }
.feature-icon-green { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.feature-card h3 { font-size: 20px; font-weight: 600; margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.feature-link { font-size: 14px; color: var(--primary-light); font-weight: 500; }
.feature-link i { transition: var(--transition); }
.feature-card:hover .feature-link i { transform: translateX(4px); }

/* ========== 精听 ========== */
.section-listening { background: var(--bg-surface); }

.listening-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }
.listening-item {
  padding: 24px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: var(--transition);
}
.listening-item:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: 0 6px 24px rgba(99,102,241,0.12); }
.listening-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.listening-item-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59,130,246,0.15); color: var(--accent-blue); font-size: 18px;
}
/* 语料标的是考试档位（CET4 / 考研 / 托福 / GRE），没有难易三色可套，统一中性底 */
.listening-item-level, .player-level {
  padding: 3px 10px; border-radius: 12px; font-size: 12px;
  background: rgba(99,102,241,0.15); color: var(--primary-light);
}
.listening-item h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.listening-item p { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.6; }
.listening-item-meta { display: flex; align-items: center; gap: 10px; }
.listening-item-meta i { margin-left: 4px; }

/* 精听播放器 */
.listening-player {
  border-radius: var(--radius-lg); background: var(--bg-card);
  border: 1px solid var(--border); padding: 32px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.player-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.player-title { flex: 1; font-size: 18px; font-weight: 600; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 16px; }
.player-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-surface); color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: var(--transition);
}
.player-btn:hover { background: var(--bg-card-hover); }
.player-btn-main {
  width: 52px; height: 52px; font-size: 18px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.player-btn-main:hover { transform: scale(1.05); }
.player-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.player-progress span { font-size: 12px; color: var(--text-muted); min-width: 36px; }
.progress-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; cursor: pointer; position: relative; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 2px; width: 0%; transition: width 0.1s; }
.player-speed { display: flex; align-items: center; gap: 8px; justify-content: center; }
.player-speed span { font-size: 13px; color: var(--text-muted); }
.speed-btn {
  padding: 4px 10px; border-radius: 6px; font-size: 12px;
  background: var(--bg-surface); color: var(--text-secondary);
  transition: var(--transition);
}
.speed-btn.active, .speed-btn:hover { background: var(--primary); color: white; }

.player-hint { text-align: center; font-size: 13px; color: var(--accent-orange); min-height: 20px; margin-top: 8px; }
.player-hint:empty { display: none; }

.player-transcript { margin-top: 20px; padding: 20px; border-radius: var(--radius-sm); background: rgba(0,0,0,0.2); }
.player-transcript h4 { font-size: 16px; margin-bottom: 12px; color: var(--accent-green); }
.player-transcript h4 i { margin-right: 6px; }
.transcript-line { font-size: 14px; line-height: 2; color: var(--text-secondary); }
.transcript-line.active { color: var(--text-primary); background: rgba(99,102,241,0.1); padding: 2px 8px; border-radius: 4px; }
.listening-player > .btn { margin-top: 20px; }

/* ========== 口语练习 ========== */
.speaking-container { max-width: 800px; margin: 0 auto; }
.speaking-scenes { display: flex; gap: 10px; justify-content: center; margin-bottom: 32px; flex-wrap: wrap; }
.scene-btn {
  padding: 8px 20px; border-radius: 20px;
  background: var(--bg-card); color: var(--text-secondary);
  border: 1px solid var(--border); font-size: 14px;
  transition: var(--transition);
}
.scene-btn.active, .scene-btn:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; border-color: transparent;
}

.speaking-card {
  border-radius: var(--radius-lg); background: var(--bg-card);
  border: 1px solid var(--border); padding: 40px;
}
.speaking-prompt { text-align: center; margin-bottom: 32px; }
.speaking-scene-tag {
  display: inline-block; padding: 3px 12px; border-radius: 12px;
  background: rgba(99,102,241,0.12); color: var(--primary-light);
  font-size: 12px; margin-bottom: 16px;
}
.speaking-english { font-size: 22px; font-weight: 600; margin-bottom: 10px; line-height: 1.5; }
.speaking-chinese { font-size: 15px; color: var(--text-secondary); }

.speaking-demo { text-align: center; margin-bottom: 32px; }

.speaking-record { text-align: center; margin-bottom: 32px; }
.record-btn {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  color: white; font-size: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 24px rgba(239,68,68,0.3);
}
.record-btn:hover { transform: scale(1.05); }
.record-btn.recording {
  animation: pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 8px rgba(239,68,68,0.2), 0 4px 24px rgba(239,68,68,0.3);
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.record-hint { font-size: 14px; color: var(--text-muted); margin-top: 12px; }
.record-wave { margin-top: 16px; border-radius: var(--radius-sm); overflow: hidden; }
.record-wave canvas { display: block; margin: 0 auto; }

/* 评分结果 */
.speaking-result {
  display: grid; grid-template-columns: auto 1fr; gap: 32px;
  padding: 24px; border-radius: var(--radius);
  background: rgba(0,0,0,0.2); border: 1px solid var(--border);
  animation: slideUp 0.3s ease;
}
.result-score { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.result-score-circle { position: relative; width: 120px; height: 120px; }
.result-score-circle svg { width: 100%; height: 100%; }
.result-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; }
.result-label { font-size: 13px; color: var(--text-muted); }
.result-details { display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.result-item { display: flex; align-items: center; gap: 12px; }
.result-item-label { font-size: 14px; color: var(--text-secondary); min-width: 80px; }
.result-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.result-bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.result-bar-fill { background: linear-gradient(90deg, var(--primary), var(--accent-green)); }
.result-item-score { font-size: 14px; font-weight: 600; min-width: 30px; text-align: right; }
.result-words { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.result-word {
  padding: 3px 10px; border-radius: 6px; font-size: 14px;
  border: 1px solid var(--border);
}
.result-word.good { border-color: rgba(34,197,94,0.3); color: var(--accent-green); background: rgba(34,197,94,0.08); }
.result-word.ok { border-color: rgba(249,115,22,0.3); color: var(--accent-orange); background: rgba(249,115,22,0.08); }
.result-word.bad { border-color: rgba(239,68,68,0.3); color: var(--accent-red); background: rgba(239,68,68,0.08); }
.result-legend { flex-basis: 100%; font-size: 12px; color: var(--text-muted); line-height: 1.7; margin-top: 6px; }
.player-body { padding: 4px 0 8px; }
.demo-note { display: block; margin-top: 6px; font-size: 12px; color: var(--text-muted); font-weight: 400; }

.speaking-nav { display: flex; justify-content: space-between; margin-top: 24px; }

/* ========== 区块说明文字 ========== */
.section-progress { background: var(--bg-surface); }
.section-note {
  max-width: 780px; margin: 28px auto 0; text-align: center;
  font-size: 13px; color: var(--text-muted); line-height: 1.8;
}
.section-note a { color: var(--primary-light); text-decoration: underline; }
.empty-state { font-size: 13px; color: var(--text-muted); line-height: 1.8; margin-top: 16px; }
.empty-state a { color: var(--primary-light); }

/* ========== 学习进度 ========== */
.progress-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.dash-today, .dash-chart {
  padding: 28px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border);
}
.dash-today h3, .dash-chart h3 {
  font-size: 16px; font-weight: 600; margin-bottom: 20px;
  color: var(--text-secondary);
}
.dash-today h3 i, .dash-chart h3 i { margin-right: 8px; color: var(--primary-light); }

.today-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.today-item {
  padding: 16px; border-radius: var(--radius);
  background: rgba(0,0,0,0.2); text-align: center;
}
.today-icon { font-size: 20px; color: var(--primary-light); margin-bottom: 8px; }
.today-num { display: block; font-size: 28px; font-weight: 700; }
.today-label { font-size: 12px; color: var(--text-muted); }

.dash-copy { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.dash-links { display: flex; gap: 10px; margin: 18px 0; }

/* ========== Toast ========== */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease;
  max-width: 360px;
}
.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.success i { color: var(--accent-green); }
.toast.info { border-color: rgba(59,130,246,0.3); }
.toast.info i { color: var(--accent-blue); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.error i { color: var(--accent-red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ========== 页脚 ========== */
.footer { padding: 60px 0 30px; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { font-size: 14px; color: var(--text-muted); margin-top: 12px; line-height: 1.6; }
.footer-links h4 { font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.footer-links a { display: block; font-size: 13px; color: var(--text-muted); padding: 4px 0; transition: var(--transition); }
.footer-links a:hover { color: var(--primary-light); }
.footer-links a i { margin-right: 6px; }
.footer-note { font-size: 12px; color: var(--text-muted); line-height: 1.7; margin-bottom: 10px; }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid var(--border); }
.footer-bottom p { font-size: 13px; color: var(--text-muted); }

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero-desc { margin: 0 auto 32px; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { display: none; }
  .features-grid { grid-template-columns: 1fr; max-width: 500px; margin: 0 auto; }
  .listening-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-dashboard { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-dark); padding: 20px; flex-direction: column; gap: 16px; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  /* 「进入应用」是手机上唯一的导航入口，不能跟着旧登录按钮一起隐藏 */
  .nav-actions .btn { padding: 6px 12px; font-size: 12px; }
  .hero-title { font-size: 36px; }
  .section-title { font-size: 28px; }
  .listening-grid { grid-template-columns: 1fr; }
  .speaking-result { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 28px; }
  .hero-actions { flex-direction: column; }
  .hero-stats { flex-wrap: wrap; gap: 20px; justify-content: center; }
  .speaking-card { padding: 20px; }
  .speaking-english { font-size: 18px; }
  /* 移动端优化：收紧区块留白、防控件溢出、保证触控目标 */
  section { padding: 64px 0; }
  .container { padding: 0 16px; }
  .player-speed { flex-wrap: wrap; row-gap: 8px; }
  .player-controls { gap: 14px; }
  .speed-btn, .scene-btn { min-height: 36px; }
}
