/* ═══════════════════════════════════════════════════════════
   Echo — 音素学习模块
   Design: 声光共鸣，极简克制，全年龄段友好
   ═══════════════════════════════════════════════════════════ */

/* ── Echo Overlay ── */
.echo-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out-expo);
}
.echo-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.echo-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 40% at 50% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Echo Header ── */
.echo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}
.echo-back {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: var(--gradient-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
}
.echo-back:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.echo-back svg { width: 20px; height: 20px; }
.echo-title {
  font-size: var(--text-lg); font-weight: var(--font-weight-bold);
  color: var(--text); letter-spacing: var(--tracking-tight);
}
.echo-progress {
  font-size: var(--text-sm); color: var(--text-muted);
  letter-spacing: var(--tracking-wide);
}

/* ── Echo Body (主内容区) ── */
.echo-body {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════
   MODE 1: Discover — 音素星图
   ═══════════════════════════════════════════════════════════ */
.echo-star-map {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  cursor: default;
  display: flex;
  flex-direction: column;
}
.echo-star-svg {
  width: 100%;
  height: 100%;
}

/* ── 仪表盘 ── */
.echo-dashboard {
  flex-shrink: 0;
  padding: 12px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.echo-dash-stats {
  display: flex; gap: 10px;
}
.echo-dash-stat {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--gradient-glass);
  border: 1px solid var(--border-glass);
  text-align: center;
}
.echo-dash-stat-num {
  font-size: 22px; font-weight: var(--font-weight-bold);
  color: var(--white); line-height: 1.2;
}
.echo-dash-stat-label {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
}
.echo-dash-cta {
  display: flex; gap: 8px;
}
.echo-dash-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 15px; font-weight: var(--font-weight-semibold);
  cursor: pointer; transition: all var(--transition-base);
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
}
.echo-dash-btn--primary {
  background: var(--gradient-primary);
  color: var(--white); box-shadow: var(--shadow-btn);
}
.echo-dash-btn--primary:hover {
  box-shadow: var(--shadow-primary-hover); transform: translateY(-1px);
}
.echo-dash-btn--secondary {
  background: var(--gradient-glass); color: var(--text);
  border: 1px solid var(--border-glass);
}
.echo-dash-btn--secondary:hover {
  background: var(--gradient-glass-hover); border-color: var(--border-emphasis);
}
.echo-dash-btn svg { width: 16px; height: 16px; }

/* 同心圆轨道 */
.echo-orbit {
  fill: none;
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 1;
}
.echo-orbit-label {
  font-size: 9px; fill: rgba(255, 255, 255, 0.12);
  letter-spacing: 0.08em;
  pointer-events: none;
}

/* 音素节点 */
.echo-node {
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.echo-node:hover .echo-node-halo {
  filter: brightness(1.6) drop-shadow(0 0 6px currentColor);
}
.echo-node:hover .echo-node-core {
  filter: brightness(1.4) drop-shadow(0 0 8px currentColor);
}
.echo-node--unlocked .echo-node-halo { opacity: 0.25; }
.echo-node--locked { cursor: default; pointer-events: none; }
.echo-node--locked .echo-node-halo { opacity: 0; }

.echo-node-halo {
  fill: currentColor;
  opacity: 0.25;
  transition: opacity 0.4s ease, filter 0.3s ease;
}
.echo-node-core {
  fill: currentColor;
  opacity: 0.9;
  transition: opacity 0.3s ease, filter 0.3s ease;
}
.echo-node--locked .echo-node-core { opacity: 0.15; }
.echo-node-text {
  font-size: 13px; fill: rgba(255, 255, 255, 0.9);
  text-anchor: middle; dominant-baseline: central;
  pointer-events: none;
  font-weight: 500;
}
.echo-node--locked .echo-node-text { opacity: 0.2; }

/* 点击闪烁动画 */
.echo-node--flash .echo-node-halo {
  animation: echoFlash 0.3s ease-out;
}
@keyframes echoFlash {
  0% { opacity: 0.25; filter: brightness(1); }
  40% { opacity: 0.8; filter: brightness(2.5) drop-shadow(0 0 16px currentColor); }
  100% { opacity: 0.25; filter: brightness(1); }
}

/* 已解锁节点呼吸动画 */
.echo-node--unlocked .echo-node-halo {
  animation: echoBreathe 3s ease-in-out infinite;
}
@keyframes echoBreathe {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.45; }
}

/* 提示框 */
.echo-tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(15, 13, 26, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  min-width: 160px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-2xl);
  z-index: 200;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.echo-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.echo-tooltip-symbol {
  display: block; font-size: 24px;
  font-weight: var(--font-weight-bold); margin-bottom: 4px;
}
.echo-tooltip-desc {
  display: block; font-size: 13px;
  color: var(--text-secondary); margin-bottom: 6px;
}
.echo-tooltip-examples {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.echo-tooltip-example {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--primary-overlay);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.echo-tooltip-button {
  margin-top: 10px; padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: var(--white);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  border: none; cursor: pointer;
  pointer-events: auto;
  transition: all var(--transition-fast);
}
.echo-tooltip-button:hover {
  box-shadow: var(--shadow-primary-hover);
}

/* 星图底部操作 */
.echo-star-legend {
  position: absolute;
  bottom: 20px; left: 0; right: 0;
  display: flex; justify-content: center;
  gap: 20px;
}
.echo-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); color: var(--text-muted);
}
.echo-legend-dot {
  width: 8px; height: 8px; border-radius: 50%;
}

/* ── 移动端：轨道环视图 ── */
.echo-rings-wrap {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
}
.echo-ring-section {
  margin-bottom: 4px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.echo-ring-section:last-child { border-bottom: none; }

.echo-ring-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 6px;
  position: sticky; left: 0;
}
.echo-ring-header-left {
  display: flex; align-items: center; gap: 10px;
}
.echo-ring-index {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.2);
  font-size: 11px; font-weight: var(--font-weight-bold);
  color: #a78bfa;
  flex-shrink: 0;
}
.echo-ring-label {
  font-size: var(--text-sm); font-weight: var(--font-weight-semibold);
  color: var(--text);
  letter-spacing: 0.03em;
}
.echo-ring-desc {
  font-size: 11px; color: var(--text-muted);
  margin-top: 1px;
}
.echo-ring-progress {
  font-size: var(--text-xs); color: var(--text-muted);
  flex-shrink: 0;
}

.echo-ring-scroll {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 8px 16px 4px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.echo-ring-scroll::-webkit-scrollbar { display: none; }

/* 星球卡片 */
.echo-ring-planet {
  display: flex; flex-direction: column; align-items: center;
  min-width: 72px; max-width: 72px;
  padding: 10px 4px 8px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  position: relative;
}
.echo-ring-planet:active {
  transform: scale(0.94);
  background: rgba(255,255,255,0.04);
}

.echo-planet-orbit {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
  transition: border-color 0.2s;
}
.echo-planet-core {
  width: 14px; height: 14px;
  border-radius: 50%;
  transition: box-shadow 0.2s;
}
.echo-ring-planet:active .echo-planet-core {
  box-shadow: 0 0 20px var(--planet-color) !important;
}
.echo-planet-symbol {
  font-size: var(--text-xs); font-weight: var(--font-weight-bold);
  line-height: 1.3;
  text-align: center;
  word-break: break-all;
}
.echo-planet-word {
  font-size: 10px; color: var(--text-muted);
  margin-top: 1px;
  text-align: center;
  line-height: 1.2;
}
.echo-planet-check {
  position: absolute; top: 4px; right: 4px;
  font-size: 10px; color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}

.echo-planet--mastered {
  border-color: rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.04);
}
.echo-planet--mastered .echo-planet-symbol { color: #34d399; }
.echo-planet--mastered .echo-planet-orbit { border-color: rgba(52, 211, 153, 0.3); }

/* 桌面端隐藏轨道环（由 JS 控制，这里做兜底） */
@media (min-width: 768px) {
  .echo-rings-wrap { display: none; }
}

/* ── Discover 多视图 ── */
.echo-view-panel.hidden { display: none !important; }
.echo-view-panel { position: relative; }

/* 工具栏行（视图切换器 + 仅发音） */
.echo-discover-toolbar {
  flex-shrink: 0;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 4px 16px 10px;
}

/* 视图切换器 */
.echo-view-switcher {
  display: flex; gap: 4px;
}
.echo-view-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-sm); font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
}
.echo-view-btn svg { width: 16px; height: 16px; opacity: 0.6; }
.echo-view-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.echo-view-btn.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #a78bfa;
}
.echo-view-btn.active svg { opacity: 1; }

/* 仅发音切换按钮 */
.echo-pronounce-toggle {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-xs); font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
}
.echo-pronounce-toggle svg { width: 14px; height: 14px; opacity: 0.5; }
.echo-pronounce-toggle:hover { background: var(--surface-hover); color: var(--text); }
.echo-pronounce-toggle.active {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}
.echo-pronounce-toggle.active svg { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   View: 思维导图
   ═══════════════════════════════════════════════════════════ */
.echo-mindmap-tree {
  padding: 8px 16px 24px;
  font-size: var(--text-sm);
  user-select: none;
}

.echo-mm-root {
  display: flex; justify-content: center;
  margin-bottom: 12px;
}
.echo-mm-root-label {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  font-size: var(--text-md); font-weight: var(--font-weight-bold);
  letter-spacing: 0.05em;
}

/* 一级分支 */
.echo-mm-branch {
  margin-bottom: 6px;
  border-left: 1px solid rgba(139, 92, 246, 0.15);
  margin-left: 20px;
  padding-left: 12px;
}

.echo-mm-node {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.echo-mm-node:hover { background: rgba(255,255,255,0.03); }

.echo-mm-l1 {
  font-size: var(--text-md); font-weight: var(--font-weight-bold);
  color: #e2e8f0;
  margin-left: -12px;
}
.echo-mm-l2 {
  font-size: var(--text-sm); font-weight: var(--font-weight-semibold);
  color: #cbd5e1;
  padding-left: 4px;
}

.echo-mm-arrow {
  font-size: 10px; width: 14px; text-align: center;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.echo-mm-label { flex: 1; }
.echo-mm-count {
  font-size: var(--text-xs); color: var(--text-muted);
  flex-shrink: 0;
}
.echo-mm-done { color: #a78bfa; font-weight: var(--font-weight-bold); }

/* 二级收起 */
.echo-mm-sub.echo-mm-collapsed > .echo-mm-l2 .echo-mm-arrow { transform: rotate(-90deg); }
.echo-mm-sub.echo-mm-collapsed .echo-mm-l3 { display: none; }

/* 一级收起 */
.echo-mm-branch.echo-mm-collapsed > .echo-mm-l1 .echo-mm-arrow { transform: rotate(-90deg); }
.echo-mm-branch.echo-mm-collapsed .echo-mm-sub { display: none; }

/* 三级叶子 */
.echo-mm-l3 {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--text-sm);
  transition: background 0.15s;
}
.echo-mm-l3:hover { background: rgba(255,255,255,0.04); }
.echo-mm-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  transition: box-shadow 0.2s;
}
.echo-mm-l3:hover .echo-mm-dot {
  box-shadow: 0 0 10px var(--row-color, currentColor) !important;
}
.echo-mm-symbol {
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  min-width: 52px;
}
.echo-mm-example {
  color: var(--text-muted); font-size: var(--text-xs);
}
.echo-mm-check {
  margin-left: auto; color: #34d399; font-size: 12px;
}
.echo-mm-mastered {
  opacity: 0.85;
}
.echo-mm-mastered .echo-mm-symbol { color: #34d399; }

/* ═══════════════════════════════════════════════════════════
   View: 音素图谱
   ═══════════════════════════════════════════════════════════ */
.echo-chart-wrap {
  padding: 8px 0 24px;
  display: flex; flex-direction: column; gap: 20px;
}
.echo-chart-section {
  padding: 0 12px;
}
.echo-chart-section-title {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-sm); font-weight: var(--font-weight-bold);
  color: var(--text);
  margin-bottom: 8px;
  padding: 0 4px;
}
.echo-chart-section-icon { font-size: 16px; }
.echo-chart-section-sub {
  font-size: 11px; color: var(--text-muted);
  font-weight: var(--font-weight-normal);
  margin-left: auto;
}

/* ── 元音舌位图 ── */
.echo-vowel-space {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 380px;
  margin: 0 auto;
  background: rgba(255,255,255,0.01);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px;
  overflow: hidden;
}
/* aspect-ratio 降级：微信 X5 等旧浏览器 */
@supports not (aspect-ratio: 1 / 1) {
  .echo-vowel-space::before {
    content: '';
    display: block;
    padding-bottom: 100%;
  }
}
.echo-vowel-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.echo-vowel-axis {
  position: absolute;
  font-size: 10px; color: rgba(255,255,255,0.15);
  pointer-events: none;
  font-weight: var(--font-weight-medium);
}
.echo-vowel-axis--left { left: 4px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.echo-vowel-axis--right { right: 4px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.echo-vowel-axis--top { top: 4px; left: 50%; transform: translateX(-50%); }
.echo-vowel-axis--bottom { bottom: 4px; left: 50%; transform: translateX(-50%); }

.echo-vowel-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border: 1px solid color-mix(in srgb, var(--v-color) 20%, transparent);
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 1;
}
.echo-vowel-node:active {
  transform: translate(-50%, -50%) scale(1.15);
  border-color: var(--v-color);
}
.echo-vowel-core {
  position: absolute; inset: 5px;
  border-radius: 50%;
  opacity: 0.25;
  transition: opacity 0.2s;
}
.echo-vowel-node:active .echo-vowel-core { opacity: 0.5; }
.echo-vowel-symbol {
  position: relative; z-index: 1;
  font-size: 11px; font-weight: var(--font-weight-bold);
  line-height: 1;
  text-align: center;
}
.echo-vowel-node--mastered {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.04);
}
.echo-vowel-node--mastered .echo-vowel-symbol { color: #34d399; }
.echo-vowel-check {
  position: absolute; top: -4px; right: -4px;
  font-size: 8px; color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}

/* ── 辅音发音网格 ── */
.echo-cons-grid {
  display: flex; flex-direction: column; gap: 6px;
}
.echo-cons-row {
  display: flex; align-items: center; gap: 4px;
}
.echo-cons-row-label {
  width: 48px; flex-shrink: 0;
  font-size: 10px; color: var(--text-muted);
  text-align: right; padding-right: 6px;
  font-weight: var(--font-weight-medium);
}
.echo-cons-row-cells {
  display: flex; gap: 3px;
  flex-wrap: wrap; flex: 1;
}
.echo-cons-cell {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border: 1px solid color-mix(in srgb, var(--c-color) 15%, transparent);
  cursor: pointer;
  transition: all 0.12s ease;
  position: relative;
  font-size: 12px; font-weight: var(--font-weight-bold);
}
.echo-cons-cell:active {
  transform: scale(0.92);
  border-color: var(--c-color);
  background: rgba(255,255,255,0.04);
  background: color-mix(in srgb, var(--c-color) 10%, transparent);
}
.echo-cons-cell--empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}
.echo-cons-cell--empty:active { transform: none; }
.echo-cons-symbol { line-height: 1; }
.echo-cons-cell--mastered {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.04);
}
.echo-cons-cell--mastered .echo-cons-symbol { color: #34d399; }
.echo-cons-check {
  position: absolute; top: -3px; right: -3px;
  font-size: 7px; color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  width: 12px; height: 12px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════════
   MODE 2: Listen — 声音透镜
   ═══════════════════════════════════════════════════════════ */
.echo-listen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 100%; height: 100%;
  min-height: 0;
  gap: 32px;
}
.echo-lens {
  position: relative;
  width: 180px; height: 180px;
}
.echo-lens-outer {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.6s ease, box-shadow 0.4s ease;
}
.echo-lens-inner {
  position: absolute;
  top: 50%; left: 50%;
  width: 80px; height: 80px;
  margin: -40px 0 0 -40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.4s ease;
}
.echo-lens-wave {
  position: absolute; inset: -20px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0;
  animation: echoWave 1.2s ease-out infinite;
}
.echo-lens-wave:nth-child(2) { animation-delay: 0.4s; }
.echo-lens-wave:nth-child(3) { animation-delay: 0.8s; }

.echo-lens-icon {
  width: 40px; height: 40px;
  color: var(--white);
  opacity: 0.6;
  transition: opacity 0.3s ease;
}
.echo-lens-word {
  position: absolute; bottom: -36px; left: 0; right: 0;
  text-align: center;
  font-size: 20px; font-weight: var(--font-weight-semibold);
  color: var(--text);
  opacity: 0; transform: translateY(8px);
  transition: all 0.4s ease;
}
.echo-lens-word.show {
  opacity: 1; transform: translateY(0);
}

@keyframes echoWave {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* 播放按钮 */
.echo-play-btn {
  padding: 14px 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
  background: var(--gradient-glass);
  color: var(--text);
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex; align-items: center; gap: 8px;
}
.echo-play-btn:hover {
  background: var(--gradient-glass-hover);
  border-color: var(--border-emphasis);
  box-shadow: var(--shadow-primary);
}
.echo-play-btn svg { width: 18px; height: 18px; }

/* 选项按钮 */
.echo-options {
  display: flex; gap: 24px;
}
.echo-option {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 20px 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  background: var(--gradient-glass);
  cursor: pointer;
  transition: all 0.25s ease;
  min-width: 120px;
  position: relative; overflow: hidden;
}
.echo-option:hover {
  background: var(--gradient-glass-hover);
  border-color: var(--border-emphasis);
  transform: translateY(-2px);
}
.echo-option:active { transform: scale(0.96); }
.echo-option--correct {
  border-color: var(--success) !important;
  background: rgba(52, 211, 153, 0.1) !important;
  animation: optionCorrect 0.5s ease;
}
.echo-option--wrong {
  border-color: var(--danger) !important;
  animation: optionShake 0.5s ease;
}
.echo-option-dot {
  width: 36px; height: 36px; border-radius: 50%;
  transition: transform 0.3s ease;
}
.echo-option--correct .echo-option-dot {
  transform: scale(1.2);
  box-shadow: 0 0 24px currentColor;
}
.echo-option-symbol {
  font-size: 22px; font-weight: var(--font-weight-bold);
}
.echo-option-word {
  font-size: 15px; color: var(--text-muted);
}

@keyframes optionCorrect {
  0% { transform: scale(1); }
  30% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes optionShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* 连击提示 */
.echo-combo {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: var(--text-3xl); font-weight: var(--font-weight-bold);
  color: var(--warning);
  pointer-events: none; z-index: 201;
  opacity: 0;
  transition: none;
}
.echo-combo.fire {
  animation: comboPop 1s ease-out forwards;
}
@keyframes comboPop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   MODE 3: Build — 词语引擎
   ═══════════════════════════════════════════════════════════ */
.echo-build {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 100%; height: 100%;
  min-height: 0;
  gap: 18px; padding: 16px;
}
.echo-build-hint {
  font-size: 15px; color: var(--text-muted);
  letter-spacing: var(--tracking-wide);
}
.echo-lanterns {
  display: flex; gap: 14px;
  flex-wrap: wrap; justify-content: center;
}
.echo-lantern {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
}
.echo-lantern-sound {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
}
.echo-lantern-sound:hover {
  transform: scale(1.08);
}
.echo-lantern-sound--filled {
  border-color: currentColor !important;
  box-shadow: 0 0 12px currentColor;
  animation: lanternGlow 1.5s ease-in-out infinite;
}
.echo-lantern-sound--empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.08);
}
.echo-lantern-symbol {
  font-size: 14px; font-weight: var(--font-weight-bold);
  color: var(--white);
}
.echo-lantern-input-wrap {
  display: flex; gap: 4px;
}
.echo-lantern-input {
  width: 42px; height: 42px;
  text-align: center;
  font-size: 20px;
  font-weight: var(--font-weight-bold);
  background: var(--gradient-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xs);
  color: var(--text);
  outline: none;
  caret-color: var(--primary-400);
  transition: all var(--transition-fast);
}
.echo-lantern-input:focus {
  border-color: var(--border-primary);
  box-shadow: 0 0 12px var(--primary-overlay);
}
.echo-lantern-input--correct {
  border-color: var(--success) !important;
  background: rgba(52, 211, 153, 0.1) !important;
}
.echo-lantern-input--wrong {
  border-color: var(--danger) !important;
  animation: optionShake 0.4s ease;
}

@keyframes lanternGlow {
  0%, 100% { box-shadow: 0 0 12px currentColor; }
  50% { box-shadow: 0 0 24px currentColor; }
}

/* ── 灯笼显示区（替代 input）── */
.echo-lantern-display {
  width: 42px; min-height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-glass);
  border: 1.5px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text);
  font-size: 18px; font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.echo-lantern-display--active {
  border-color: var(--border-primary);
  box-shadow: 0 0 10px var(--primary-overlay);
}
.echo-lantern-display--correct {
  border-color: var(--success) !important;
  background: rgba(52, 211, 153, 0.1) !important;
  color: var(--success) !important;
}
.echo-lantern-display--wrong {
  border-color: var(--danger) !important;
  background: rgba(239, 68, 68, 0.08) !important;
  animation: optionShake 0.4s ease;
}
.echo-lantern-display-text {
  line-height: 1;
}
.echo-lantern-display-cursor {
  font-weight: 300; opacity: 0.5;
  animation: cursorBlink 1s step-end infinite;
  margin-left: 1px;
  font-size: 16px;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0; }
}

/* 灯笼激活态 */
.echo-lantern-sound--active {
  border-color: var(--border-primary) !important;
  box-shadow: 0 0 16px var(--primary-overlay) !important;
  border-style: solid !important;
}

/* ── 虚拟键盘 ── */
.echo-keyboard {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 0 8px;
  flex-shrink: 0;
}
.echo-keyboard.hidden { display: none !important; }
.echo-key-row {
  display: flex; gap: 3px;
  justify-content: center;
}
.echo-key {
  width: 34px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 15px; font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.echo-key:active {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.5);
  transform: scale(0.92);
}
.echo-key--backspace {
  width: 46px;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.echo-key--backspace:active {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
}

/* 隐身 hint 动画 */
@keyframes hintFlash {
  0% { opacity: 0; transform: translateY(-4px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(0); }
}

/* 拼写建议按钮 */
.echo-spell-options {
  display: flex; gap: 8px;
  flex-wrap: wrap; justify-content: center;
}
.echo-spell-opt {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
  background: var(--gradient-glass);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.echo-spell-opt:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-emphasis);
}
.echo-spell-opt--used {
  opacity: 0.3; pointer-events: none;
}

/* 单词完成效果 */
.echo-build-result {
  font-size: var(--text-3xl); font-weight: var(--font-weight-bold);
  color: var(--white); letter-spacing: var(--tracking-wide);
  opacity: 0; transform: translateY(12px);
  transition: all 0.5s var(--ease-out-expo);
  text-align: center;
}
.echo-build-result.show {
  opacity: 1; transform: translateY(0);
}
.echo-build-word-title {
  font-size: var(--text-3xl); font-weight: var(--font-weight-bold);
  margin-bottom: 12px;
  background: var(--text-gradient-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.echo-replay-word-btn {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: var(--gradient-glass);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
  -webkit-text-fill-color: currentColor;
}
.echo-replay-word-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-emphasis);
}
.echo-replay-word-btn svg { width: 14px; height: 14px; }
.echo-build-phoneme-map {
  display: flex; gap: 12px;
  flex-wrap: wrap; justify-content: center;
}
.echo-phoneme-map-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 6px 10px;
  background: var(--gradient-glass);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}
.echo-phoneme-map-sym {
  font-size: 13px; opacity: 0.7;
}
.echo-phoneme-map-arrow {
  font-size: 12px; opacity: 0.4;
}
.echo-phoneme-map-spell {
  font-size: 20px; font-weight: var(--font-weight-bold);
  color: var(--white);
}

/* 拼写提示闪现 */
@keyframes hintFlash {
  0% { opacity: 0; transform: translateY(-4px); }
  15% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(2px); }
}

/* 难度等级标签 */
.echo-build-level {
  display: flex; align-items: center; gap: 8px;
}
.echo-build-level-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary-glass);
  border: 1px solid var(--border-primary);
  color: var(--primary-300);
  font-size: 14px; font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-wide);
}
.echo-build-level-label {
  font-size: 14px; color: var(--text-secondary);
}

/* 拼写按钮容器（Lv.1 引导模式） */
.echo-lantern-spell-btns {
  display: flex; gap: 4px;
  flex-wrap: wrap; justify-content: center;
  margin-top: 4px;
}

/* 下一个按钮 */
.echo-next-btn {
  padding: 12px 32px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--gradient-primary);
  color: var(--white);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-btn);
}
.echo-next-btn:hover {
  box-shadow: var(--shadow-primary-hover);
  transform: translateY(-1px);
}
.echo-next-btn:active { transform: scale(0.96); }

/* ═══════════════════════════════════════════════════════════
   Nav tabs
   ═══════════════════════════════════════════════════════════ */
.echo-nav {
  display: flex; justify-content: center;
  gap: 0; padding: 10px 20px 14px;
  flex-shrink: 0; position: relative; z-index: 10;
}
.echo-nav-btn {
  padding: 10px 24px;
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: var(--tracking-wide);
}
.echo-nav-btn:first-child { border-radius: var(--radius-full) 0 0 var(--radius-full); }
.echo-nav-btn:last-child { border-radius: 0 var(--radius-full) var(--radius-full) 0; }
.echo-nav-btn:hover { color: var(--text); background: var(--surface-hover); }
.echo-nav-btn.active {
  color: var(--white);
  background: var(--gradient-primary-glass);
  border-color: var(--border-primary);
}

/* ═══════════════════════════════════════════════════════════
   Word badge display (Build mode)
   ═══════════════════════════════════════════════════════════ */
.echo-word-count {
  margin-top: 8px;
  font-size: 14px; color: var(--text-muted);
}
.echo-word-count b { color: var(--text); }

/* ═══════════════════════════════════════════════════════════
   Empty state
   ═══════════════════════════════════════════════════════════ */
.echo-empty {
  text-align: center; color: var(--text-muted);
  font-size: var(--text-base); line-height: 1.6;
}
.echo-empty svg { width: 40px; height: 40px; opacity: 0.3; margin-bottom: 12px; }

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .echo-options { gap: 12px; }
  .echo-option { padding: 14px 20px; min-width: 100px; }
  .echo-lanterns { gap: 10px; }
  .echo-lantern-sound { width: 44px; height: 44px; }
  .echo-lantern-input { width: 36px; height: 36px; font-size: 18px; }
  .echo-lens { width: 150px; height: 150px; }
  .echo-lens-inner { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  .echo-dash-stat-num { font-size: 18px; }
  .echo-dash-btn { font-size: 14px; padding: 10px; }
}

@media (min-width: 768px) {
  .echo-overlay {
    inset: auto;
    top: 50%; left: 50%;
    width: 480px; max-width: 90vw;
    height: 92vh; max-height: 850px;
    transform: translate(-50%, -50%);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
  }
}
