:root {
  --bg-dark: #090d16;
  --bg-card: #131b2e;
  --bg-card-hover: #1c2742;
  --border-color: #263554;
  --border-focus: #6366f1;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-highlight: #38bdf8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.35);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --warning: #f59e0b;
  --rose: #f43f5e;
  --grid-active-bg: rgba(99, 102, 241, 0.15);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  user-select: none;
  padding-bottom: calc(35vh + 72px);
}

/* 顶部导航 */
header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 9px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 5px;
  box-shadow: 0 0 16px var(--primary-glow);
}
.nav-logo span {
  background: #ffffff;
  border-radius: 1.5px;
  opacity: 0.9;
}
.nav-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  margin-left: 6px;
}

/* 顶部 Logo 与自动学习按钮分组 */
.nav-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-auto-study-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.16));
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 8px;
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  user-select: none;
}
.nav-auto-study-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.32), rgba(6, 182, 212, 0.26));
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}
.nav-auto-study-btn:active {
  transform: translateY(0);
}
.nav-auto-study-btn .auto-study-icon {
  font-size: 0.78rem;
  line-height: 1;
  display: inline-block;
}
/* 运行中：红橙呼吸态（暂停） */
.nav-auto-study-btn.is-running {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(245, 158, 11, 0.2));
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
  animation: autoStudyRunningPulse 2s ease-in-out infinite;
}
.nav-auto-study-btn.is-running:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(245, 158, 11, 0.3));
  border-color: #ef4444;
  color: #ffffff;
}
/* 暂停后待继续：翠绿唤醒态 */
.nav-auto-study-btn.is-paused {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(6, 182, 212, 0.18));
  border-color: rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
}
.nav-auto-study-btn.is-paused:hover {
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

@keyframes autoStudyRunningPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
  }
  50% {
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
  }
}

/* 正在自动朗读的目标元素发光聚焦外框 */
.auto-study-target {
  position: relative;
  outline: 2px solid #38bdf8 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.6) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: autoStudyTargetGlow 1.8s ease-in-out infinite alternate;
}
@keyframes autoStudyTargetGlow {
  0% {
    outline-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
  }
  100% {
    outline-color: #818cf8;
    box-shadow: 0 0 24px rgba(129, 140, 248, 0.7);
  }
}


/* 页头当前用户身份标记与切换控件 (N-9) */
.nav-user-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  flex-shrink: 0;
}
.user-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.user-switch-btn {
  display: none !important; /* 测试专用切换按钮，生产环境默认隐藏 */
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
  align-items: center;
  user-select: none;
}
.user-switch-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}
.user-switch-btn:focus-visible {
  outline: 2px solid rgba(16, 185, 129, 0.7);
  outline-offset: 2px;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 20px;
}
.progress-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
#progressText {
  white-space: nowrap;
  display: inline-block;
}
.progress-bar-bg {
  width: 70px;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 20%;
  transition: width 0.3s ease;
}

.mode-switch-group {
  display: flex;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #1e293b;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.mode-tab {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.mode-tab:hover { color: var(--text-main); }
.mode-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.mode-tab.mode-tab-game {
  color: #fde047;
  font-weight: 700;
  border: 1px solid rgba(250, 204, 21, 0.4);
  background: rgba(234, 88, 12, 0.15);
}
.mode-tab.mode-tab-game:hover {
  background: rgba(245, 158, 11, 0.3);
  color: #ffffff;
  border-color: #fde047;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}
.mode-switch-group::-webkit-scrollbar { display: none; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.action-btn {
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.action-btn:hover {
  background: #334155;
  border-color: var(--primary);
}

/* 主工作区 */
.main-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 24px;
  padding: 20px 32px;
  max-width: 1720px;
  margin: 0 auto;
  width: 100%;
}

.word-detail-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.word-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}
.word-hero-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
}

.word-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.word-spell-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.1;
}
.word-tag-badges {
  display: flex;
  gap: 6px;
}
.tag-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.tag-pill.freq {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
}

.phonetic-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.phonetic-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.phonetic-item:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: #ffffff;
}
.sound-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.meaning-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.meaning-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
}
.meaning-item:hover, .meaning-item.linked-active {
  background: var(--grid-active-bg);
  border-color: var(--primary);
  transform: translateX(4px);
}
.meaning-pos {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(6, 182, 212, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}
.meaning-text {
  color: #e2e8f0;
  line-height: 1.4;
}
.meaning-link-tag {
  display: none !important;
}

.mnemonic-box {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mnemonic-box:hover {
  background: #131d38;
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.15);
}
.mnemonic-title {
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.mnemonic-audio-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
  transition: all 0.2s;
}
.mnemonic-box:hover .mnemonic-audio-tag {
  background: rgba(168, 85, 247, 0.3);
  color: #f3e8ff;
  border-color: rgba(168, 85, 247, 0.5);
}

.sentence-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sentence-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sentence-header h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.play-sentence-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px var(--primary-glow);
  transition: all 0.2s;
}
.play-sentence-btn:hover {
  transform: scale(1.03);
}
.speed-btn {
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
}
.speed-btn.active {
  color: var(--accent);
  border-color: var(--accent);
}

.sentence-en-container {
  font-size: 1rem;
  line-height: 1.6;
  color: #f1f5f9;
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
}
.sentence-word {
  display: inline-block;
  padding: 1px 3px;
  border-radius: 4px;
  transition: all 0.2s;
  cursor: pointer;
}
.sentence-word:hover {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent);
}
.sentence-word.reading-highlight {
  background: #f59e0b !important;
  color: #000000 !important;
  font-weight: 700;
  transform: scale(1.08);
}
.sentence-chunk {
  display: inline-block;
  padding: 2px 6px;
  margin: 1px;
  border-radius: 6px;
  border-bottom: 2px dashed rgba(99, 102, 241, 0.4);
  transition: all 0.25s;
}
.sentence-chunk:hover, .sentence-chunk.linked-active {
  background: var(--grid-active-bg);
  border-bottom-color: var(--accent);
  color: #38bdf8;
  transform: translateY(-2px);
}
.sentence-cn {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  padding-left: 4px;
}

/* 右侧 3×3 九宫格 */
.grid-workspace-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.grid-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 18px;
}
.grid-header-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.grid-tip {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.nine-grid-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 520px;
}
.grid-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.grid-tile:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--primary-light);
  box-shadow: 0 12px 28px var(--primary-glow);
  background: var(--bg-card-hover);
  z-index: 10;
}
.grid-tile.linked-active {
  border-color: var(--accent) !important;
  background: rgba(6, 182, 212, 0.12) !important;
  box-shadow: 0 0 24px var(--accent-glow) !important;
  transform: translateY(-4px) scale(1.03);
  z-index: 15;
}
.tile-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}
.tile-category-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}
.tile-illustration {
  height: 88px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, rgba(99, 102, 241, 0.03) 60%, transparent 80%);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.tile-vivid-img {
  width: 100%;
  height: 100%;
  max-width: 84px;
  max-height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.35s ease;
}
.grid-tile:hover .tile-vivid-img {
  transform: scale(1.18) translateY(-3px);
  filter: drop-shadow(0 12px 24px rgba(56, 189, 248, 0.6));
}
.grid-tile.linked-active .tile-vivid-img {
  transform: scale(1.16) translateY(-2px);
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.8));
}
.mini-tile .tile-vivid-img {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
}
.tile-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}
.tile-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.tile-desc {
  font-size: 0.73rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 底部操作栏 (电脑端常驻悬浮吸底) */
footer.bottom-bar {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding: 12px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}
.shortcut-hints {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.key-badge {
  background: #1e293b;
  border: 1px solid #475569;
  padding: 2px 6px;
  border-radius: 4px;
  color: #e2e8f0;
  font-family: monospace;
  margin-right: 4px;
}
.step-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}
.step-controls .action-btn {
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.nav-step-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: #1e293b;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.nav-step-btn:hover {
  background: #334155;
  border-color: var(--primary);
}
.nav-step-btn.btn-next {
  background: var(--primary);
  border-color: var(--primary-hover);
}
.nav-step-btn.btn-next:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 12px var(--primary-glow);
}

/* 弹窗与训练模式 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
  box-sizing: border-box;
}
.modal-overlay.open, .modal-overlay.active { display: flex; }
.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 720px;
  max-width: 95vw;
  max-height: 95vh;
  overflow-y: auto;
  padding: 20px 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  margin: auto;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* 听音拼写 */
.spelling-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
  width: 100%;
}
.spell-slots {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2px 0;
}
.spell-slot {
  width: 38px;
  height: 46px;
  background: #1e293b;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  text-transform: lowercase;
  transition: all 0.2s;
}
.spell-slot.active {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.spell-slot.correct {
  border-color: var(--success);
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
}
.spell-slot.shake {
  animation: shake 0.3s ease-in-out;
  border-color: var(--rose);
  background: rgba(244, 63, 94, 0.15);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.spell-input-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.spell-answer-readonly {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 2px auto 0;
  padding: 6px 12px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-family: "Consolas", "Courier New", monospace;
  text-transform: lowercase;
  color: #e2e8f0;
  background: #0f172a;
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  outline: none;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
.spell-answer-readonly::placeholder {
  color: #334155;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* 连词造句 */
.builder-box {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.target-zone {
  min-height: 70px;
  background: #131b2e;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}
.word-chip {
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: #f1f5f9;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.word-chip:hover {
  background: var(--primary);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}
.word-chip.used {
  opacity: 0.35;
  pointer-events: none;
}

/* 九宫格盲配 */
.match-grid-game {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.match-tile {
  background: #1e293b;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.match-tile:hover {
  border-color: var(--accent);
}
.match-tile.selected {
  border-color: var(--accent);
  background: rgba(6, 182, 212, 0.2);
}
.match-tile.matched {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.2);
  pointer-events: none;
}
/* 增强联动动画与音效视觉 */
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.6); transform: scale(1.02); }
  70% { box-shadow: 0 0 0 14px rgba(6, 182, 212, 0); transform: scale(1.04); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); transform: scale(1.02); }
}

.grid-tile.pulse-active {
  animation: pulseGlow 1.2s infinite cubic-bezier(0.66, 0, 0, 1);
  border-color: var(--accent) !important;
}

.sentence-chunk {
  cursor: pointer;
}

.sentence-chunk.pulse-active {
  background: rgba(6, 182, 212, 0.25) !important;
  color: #38bdf8 !important;
  border-bottom: 2px solid var(--accent) !important;
  border-radius: 6px;
  padding: 2px 8px;
}

.target-chip-clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}
.target-chip-clickable:hover {
  background: #f43f5e !important;
  border-color: #fda4af !important;
  transform: translateY(-2px);
}
/* ================= 多视图与附加页面样式 ================= */
.app-view {
  display: none;
  width: 100%;
}
.app-view.active-view {
  display: block;
}

/* 画廊视图 */
.gallery-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 32px;
}
.gallery-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 24px;
}
.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s;
}
.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 32px var(--primary-glow);
}
.mini-9grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 6px;
  height: 180px;
  background: #0b1120;
  padding: 6px;
  border-radius: 10px;
}
.mini-tile {
  background: #1e293b;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  overflow: hidden;
}

/* 学情统计看板 */
.stats-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.stats-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.stat-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-metric-card .num {
  font-size: 2rem;
  font-weight: 800;
  color: #38bdf8;
}
.stat-metric-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.radar-box-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.radar-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.radar-bar-bg {
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}
.radar-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
}


/* ================= 1. 单词悬停即时翻译气泡 ================= */
.sentence-word {
  display: inline-block;
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 4px;
  transition: all 0.15s ease;
  position: relative;
}
.sentence-word:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #38bdf8;
  transform: translateY(-1px);
}
.word-hover-tooltip {
  position: fixed;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 8px 14px;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  min-width: 140px;
  max-width: 280px;
  color: #fff;
  opacity: 0;
  transform: scale(0.95) translateY(4px);
}
.word-hover-tooltip.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.tooltip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}
.tooltip-word {
  font-weight: 700;
  color: #38bdf8;
  font-size: 1.05rem;
}
.tooltip-phonetic {
  color: #94a3b8;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}
.tooltip-body {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}
.tooltip-pos {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tooltip-trans {
  color: #f1f5f9;
  font-weight: 500;
}

/* ================= 2. 听音盲拼槽位光标与软键盘 ================= */
.spell-slots {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
  cursor: text;
}
.spell-slot {
  width: 44px;
  height: 54px;
  background: #0f172a;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  position: relative;
  transition: all 0.2s ease;
}
.spell-slot.active {
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
  transform: scale(1.05);
}
.spell-slot.active::after {
  content: '';
  position: absolute;
  bottom: 8px;
  width: 18px;
  height: 3px;
  background: #38bdf8;
  border-radius: 2px;
  animation: cursorBlink 0.9s infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.spell-slot.correct {
  border-color: var(--secondary);
  background: rgba(16, 185, 129, 0.15);
  color: var(--secondary);
}
.spell-slot.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* 听写虚拟软键盘 */
.spell-soft-keyboard {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  margin: 6px 0;
  width: 100%;
  max-width: 580px;
}
.keyboard-row {
  display: flex;
  gap: 5px;
  justify-content: center;
  width: 100%;
}
.key-btn {
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: #f1f5f9;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  min-width: 30px;
  flex: 1;
  max-width: 44px;
  text-align: center;
  user-select: none;
  box-sizing: border-box;
}
.key-btn:hover {
  background: #334155;
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-2px);
}
.key-btn:active {
  transform: translateY(1px);
  background: #38bdf8;
  color: #0f172a;
}
.key-btn.action-key {
  padding: 7px 10px;
  font-size: 0.82rem;
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}
.key-btn.action-key:hover {
  background: #38bdf8;
  color: #0f172a;
}

/* ==========================================================================
   全端响应式深度适配 (Mobile < 640px, Tablet 641-1024px, Desktop >= 1024px)
   遵循 ui-ux-pro-max + frontend-design 设计工程标准
   ========================================================================== */

/* 移动端底部悬浮操作栏 (默认在桌面端隐藏，与电脑端 footer.bottom-bar 互斥) */
.mobile-bottom-bar {
  display: none !important;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) 12px;
  z-index: 90;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.mobile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  gap: 3px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  min-width: 58px;
  min-height: 48px; /* Touch target >= 48px */
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.mobile-btn .mobile-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.mobile-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.05);
}

.mobile-btn.active, .mobile-btn.favorited {
  color: #f59e0b;
}

.mobile-btn-highlight {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff !important;
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: translateY(-4px);
  border-radius: 12px;
}

.mobile-btn-highlight:active {
  transform: translateY(-2px) scale(0.95);
}

/* ================= 移动端手机断点 (< 640px) ================= */
@media (max-width: 640px) {
  body {
    min-height: 100dvh;
    padding-bottom: calc(40vh + 72px + env(safe-area-inset-bottom, 0px));
  }

  /* 顶部导航极简与横向滑动 */
  header {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-brand {
    gap: 8px;
  }

  .nav-title {
    font-size: 1rem;
  }

  .nav-tag {
    display: none;
  }

  .nav-center {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    margin-top: 4px;
    scrollbar-width: none;
  }
  .nav-center::-webkit-scrollbar { display: none; }

  .progress-box {
    display: none; /* 移动端在副标题或卡片中轻量显示 */
  }

  .mode-switch-group {
    width: max-content;
  }

  .mode-tab {
    padding: 5px 10px;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .nav-actions {
    gap: 6px;
  }

  .action-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  /* 主工作区转为单列流式 */
  .main-workspace {
    grid-template-columns: 1fr;
    padding: 12px 14px;
    gap: 16px;
    width: 100%;
  }

  .word-hero-card {
    padding: 16px;
    border-radius: 14px;
  }

  .word-spell-title {
    font-size: 1.75rem;
  }

  .word-tag-badges {
    flex-wrap: wrap;
  }

  .phonetic-row {
    gap: 10px;
    margin-bottom: 12px;
  }

  .phonetic-item {
    padding: 5px 10px;
    font-size: 0.85rem;
  }

  .meaning-list {
    gap: 8px;
  }

  .meaning-item {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .mnemonic-box {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  /* 例句卡片 */
  .sentence-card {
    padding: 14px;
    border-radius: 14px;
  }

  .sentence-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .sentence-en-container {
    font-size: 0.98rem;
    line-height: 1.6;
  }

  /* 3x3 九宫格在移动端 */
  .grid-workspace-pane {
    gap: 10px;
  }

  .grid-header-bar {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .nine-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .grid-tile {
    min-height: 85px;
    padding: 8px 5px;
    border-radius: 10px;
  }

  .grid-tile-num {
    top: 4px;
    left: 4px;
    font-size: 0.65rem;
    width: 16px;
    height: 16px;
  }

  .grid-tile-category {
    font-size: 0.62rem;
    padding: 1px 4px;
  }

  .grid-tile-icon {
    width: 26px;
    height: 26px;
    margin: 3px 0;
  }

  .grid-tile-title {
    font-size: 0.72rem;
    line-height: 1.2;
    max-width: 100%;
    word-break: break-word;
  }

  .grid-tile-desc {
    display: none; /* 移动端隐藏详细中文以保纯净清晰，点击可朗读/聚焦 */
  }

  /* 底部悬浮操作栏在手机端展示 */
  .mobile-bottom-bar {
    display: flex;
  }

  /* 弹窗抽屉式自适应 */
  .modal-overlay {
    align-items: center;
    padding: 8px;
    overflow-y: auto;
  }

  .modal-card,
  .ai-chat-modal-container {
    width: 100%;
    max-height: 96vh;
    border-radius: 16px;
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0px)) 12px;
    gap: 8px;
    animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* 听写盲拼在移动端 */
  .spell-slots {
    gap: 4px;
    margin: 6px 0;
    flex-wrap: wrap;
  }

  .spell-slot {
    width: 30px;
    height: 38px;
    font-size: 1.15rem;
  }

  .key-btn {
    min-width: 22px;
    padding: 6px 2px;
    font-size: 0.85rem;
  }

  /* 学情雷达看板与画廊 */
  .stats-cards-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .radar-box-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= 平板端断点 (641px ~ 1024px) ================= */
@media (min-width: 641px) and (max-width: 1024px) {
  .main-workspace {
    grid-template-columns: 1fr 1fr;
    padding: 16px 20px;
    gap: 16px;
  }

  .word-hero-card {
    padding: 18px;
  }

  .word-spell-title {
    font-size: 1.95rem;
  }

  .nine-grid {
    gap: 10px;
  }

  .grid-tile {
    min-height: 100px;
    padding: 10px 6px;
  }

  .grid-tile-title {
    font-size: 0.8rem;
  }

  .grid-tile-desc {
    font-size: 0.68rem;
  }

  .stats-cards-row {
    grid-template-columns: repeat(2, 1fr);
  }
}






/* ==========================================================================
   AI 单词私教对话弹窗与 StepAudio 2.5 教学语音交互样式 (ui-ux-pro-max + frontend-design)
   ========================================================================== */

/* 1. 名师词根教学精讲按钮 */
.teach-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15);
}

.teach-audio-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(168, 85, 247, 0.45));
  border-color: #c084fc;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.3);
}

.teach-audio-btn:active {
  transform: translateY(0);
}

.hero-ai-chat-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  word-break: keep-all;
  writing-mode: horizontal-tb;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.hero-ai-chat-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
  transform: translateY(-1px);
}

/* 2. 浮动 AI 单词私教悬浮球 */
.floating-ai-tutor-trigger {
  position: fixed;
  bottom: 72px;
  right: 32px;
  z-index: 990;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 10px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(168, 85, 247, 0.95));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-ai-tutor-trigger:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 12px 32px rgba(168, 85, 247, 0.5), 0 4px 10px rgba(0, 0, 0, 0.3);
}

.ai-avatar-pulse {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

.ai-label-pill {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* 3. AI 对话模态框与聊天界面 */
.ai-chat-modal-container {
  width: 92%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.2);
  overflow: hidden;
}

.ai-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-badge-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ai-tutor-title {
  color: #f8fafc;
  font-size: 16px;
  font-weight: 700;
}

.ai-tutor-subtitle {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 2px;
}

.ai-tutor-subtitle b {
  color: #a5b4fc;
}

.ai-chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 快捷 Chips 栏 */
.ai-prompt-chips-bar {
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.chips-label {
  font-size: 11px;
  font-weight: 600;
  color: #fbbf24;
  white-space: nowrap;
}

.ai-chip {
  padding: 5px 11px;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.ai-chip:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
  transform: translateY(-1px);
}

/* 消息滚动流 */
.ai-messages-scroll {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 48vh;
  min-height: 260px;
}

.ai-msg-row {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: fadeInMsg 0.25s ease-out;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-msg-assistant {
  align-self: flex-start;
}

.ai-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.ai-msg-user .msg-avatar {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.3);
}

.msg-bubble {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 16px;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ai-msg-user .msg-bubble {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  border: none;
}

.msg-author {
  font-size: 11px;
  font-weight: 600;
  color: #818cf8;
  margin-bottom: 4px;
}

.ai-msg-user .msg-author {
  color: rgba(255, 255, 255, 0.8);
  text-align: right;
}

.msg-content {
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.msg-action-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.4);
}

/* 底部输入框 */
.ai-chat-footer {
  padding: 14px 20px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 4px 6px 4px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-input-wrapper:focus-within {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.ai-text-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 14px;
  outline: none;
  padding: 8px 0;
}

.ai-text-input::placeholder {
  color: #64748b;
}

.ai-voice-input-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.ai-voice-input-btn:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: #c084fc;
  color: #fff;
}

.ai-voice-input-btn.recording {
  background: #ef4444;
  color: #fff;
  animation: pulse-glow 1s infinite;
}

.ai-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-send-btn:hover {
  opacity: 0.92;
  transform: scale(1.02);
}

.ai-footer-tips {
  margin-top: 8px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

/* 速配卡片样式 */
.match-card {
  background: #1e293b;
  border: 2px solid var(--border-color, #334155);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-main, #f8fafc);
  transition: all 0.2s;
  user-select: none;
}
.match-card:hover {
  border-color: var(--accent, #06b6d4);
  background: rgba(6, 182, 212, 0.1);
}
.match-card.selected {
  border-color: var(--accent, #06b6d4);
  background: rgba(6, 182, 212, 0.25);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}
.match-card.matched {
  border-color: var(--success, #10b981);
  background: rgba(16, 185, 129, 0.2);
  pointer-events: none;
  opacity: 0.6;
}
.match-card.shake {
  animation: shake 0.4s ease-in-out;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

/* 名师词根精讲字幕与停顿看板 */
.teach-caption-panel {
  margin: 12px 0;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
  animation: fadeIn 0.3s ease-out;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.teach-caption-panel.active,
.teach-caption-panel.expanded {
  display: flex;
}
.teach-caption-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.teach-badge-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #c084fc;
}
.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 10px #a855f7;
  animation: pulse 1.5s infinite;
}
.teach-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.teach-close-btn:hover {
  color: #fff;
}
.teach-roots-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.teach-root-chip {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.teach-root-chip b {
  color: #38bdf8;
  font-family: ui-monospace, monospace;
}
.teach-pause-tag {
  font-size: 0.72rem;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
}
.teach-script-text {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid #8b5cf6;
}


/* ===== 视觉微调增强：对齐与对比度优化 ===== */
.audio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speed-btn {
  height: 34px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0 12px;
  line-height: 1;
}

.play-sentence-btn {
  height: 34px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
}

.tile-illustration {
  height: 94px;
  max-height: 94px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.tile-vivid-img {
  width: 100%;
  height: 100%;
  max-height: 90px;
  object-fit: contain;
  border-radius: 6px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.teach-root-chip {
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.teach-root-chip b {
  color: #38bdf8;
  font-weight: 700;
}
.teach-pause-tag {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
  font-weight: 600;
}


/* ================= 全真 AI 电话实时语音通话模态框样式 ================= */
.phone-call-modal-container {
  width: 94%;
  max-width: 480px;
  height: 86vh;
  max-height: 760px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #090d16 0%, #0f172a 60%, #080c14 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 50px rgba(16, 185, 129, 0.2);
  overflow: hidden;
  position: relative;
  animation: phoneModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes phoneModalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.phone-header {
  padding: 10px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 12, 20, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 8px;
  flex-shrink: 0;
}

.phone-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.phone-title-text {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
}

.phone-word-pill {
  font-size: 11px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.phone-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.phone-secure-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 11px;
  font-weight: 600;
}

.phone-secure-tag select {
  background: transparent;
  color: #34d399;
  border: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  max-width: 140px;
}
.phone-secure-tag select option {
  background: #0f172a;
  color: #f8fafc;
}

.secure-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 1.5s infinite;
  flex-shrink: 0;
}

.phone-mini-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  transition: color 0.2s;
}
.phone-mini-close-btn:hover { color: #fff; }

.phone-sub-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px;
  background: rgba(15, 23, 42, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
  min-height: 24px;
}

.phone-mic-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #34d399;
  font-size: 11px;
  font-weight: 500;
}
.phone-mic-status-badge.muted {
  color: #f87171;
}

.phone-call-timer {
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  margin-left: auto;
}

.phone-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 14px 6px;
  overflow: hidden;
  box-sizing: border-box;
}

.phone-topic-dropdown-row {
  width: 100%;
  margin-bottom: 4px;
  flex-shrink: 0;
}

#phoneTopicSelect {
  width: 100%;
  height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #cbd5e1;
  font-size: 11.5px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  box-sizing: border-box;
}
#phoneTopicSelect:hover, #phoneTopicSelect:focus {
  border-color: #34d399;
  color: #fff;
  background: rgba(30, 41, 59, 1);
}
#phoneTopicSelect option {
  background: #0f172a;
  color: #f8fafc;
  padding: 4px;
}

/* 底部电话操作盘 */
.phone-keypad-footer {
  padding: 8px 14px 10px;
  background: rgba(8, 12, 20, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.phone-controls-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.phone-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 8px 14px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  height: 42px;
  box-sizing: border-box;
  flex: 1;
  max-width: 150px;
}
.phone-ctrl-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.phone-ctrl-btn.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
}
.phone-ctrl-btn .ctrl-icon { font-size: 16px; line-height: 1; }
.phone-ctrl-btn .ctrl-label { font-size: 12px; font-weight: 600; white-space: nowrap; }

.phone-ctrl-mute-btn {
  flex: 0 0 auto;
  max-width: 90px;
  padding: 8px 12px;
}

/* AI 电话双态录音操作按钮 (开始录音 ↔ 我说完了) */
.phone-record-toggle-btn {
  background: rgba(16, 185, 129, 0.22) !important;
  border: 1px solid rgba(16, 185, 129, 0.5) !important;
  color: #34d399 !important;
  flex: 1.3;
  max-width: 160px;
}

.phone-record-toggle-btn:hover {
  background: rgba(16, 185, 129, 0.32) !important;
  border-color: rgba(16, 185, 129, 0.75) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.phone-record-toggle-btn.recording {
  background: rgba(239, 68, 68, 0.28) !important;
  border: 1px solid rgba(239, 68, 68, 0.8) !important;
  color: #fecaca !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6) !important;
  animation: phoneRecordPulse 1.2s infinite ease-in-out !important;
}

.phone-record-toggle-btn.processing {
  opacity: 0.7;
  cursor: wait !important;
  pointer-events: none;
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
}

@keyframes phoneRecordPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(239, 68, 68, 0);
    transform: scale(1.04);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    transform: scale(1);
  }
}

.phone-hangup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex: 1.1;
  max-width: 135px;
  box-sizing: border-box;
}
.phone-hangup-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.55);
}

/* 实时音频声波律动柱状图容器 - 高度减半至 18px */
.phone-visualizer-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
  width: 100%;
  max-width: 240px;
  margin: 2px auto 0;
  padding: 2px 12px;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
}

.voice-bar {
  width: 3px;
  height: 4px;
  min-height: 3px;
  max-height: 14px;
  background: linear-gradient(180deg, #34d399, #10b981);
  border-radius: 9999px;
  transform-origin: center bottom;
  animation: waveDance 1.2s infinite ease-in-out alternate;
  box-sizing: border-box;
  flex-shrink: 0;
}

.vbar-1 { animation-delay: 0.1s; height: 4px; }
.vbar-2 { animation-delay: 0.3s; height: 7px; }
.vbar-3 { animation-delay: 0.5s; height: 10px; }
.vbar-4 { animation-delay: 0.2s; height: 13px; }
.vbar-5 { animation-delay: 0.4s; height: 8px; }
.vbar-6 { animation-delay: 0.6s; height: 12px; }
.vbar-7 { animation-delay: 0.15s; height: 13px; }
.vbar-8 { animation-delay: 0.35s; height: 9px; }
.vbar-9 { animation-delay: 0.55s; height: 6px; }
.vbar-10 { animation-delay: 0.25s; height: 10px; }
.vbar-11 { animation-delay: 0.45s; height: 7px; }
.vbar-12 { animation-delay: 0.05s; height: 4px; }

@keyframes waveDance {
  0% { transform: scaleY(0.4); opacity: 0.4; }
  100% { transform: scaleY(1.0); opacity: 1; }
}

.hero-ai-phone-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.hero-ai-phone-btn:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: #34d399;
  color: #fff;
  transform: translateY(-1px);
}


/* ==========================================================================
   移动端 2 列九宫格与自适应核心规则
   ========================================================================== */
@media (max-width: 768px) {
  /* 深度精讲卡片移动端/竖屏自适应优化 */
  
/* 嵌入九宫格内部的精讲卡片：横向跨满整行 (自适应换行，避免挤压) */
.nine-grid-matrix .grid-detail-card,
.nine-grid .grid-detail-card {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 8px 0 12px 0 !important;
  z-index: 20;
}

#tile-9,
.grid-tile#tile-9,
.nine-grid-matrix.mode-2col #tile-9,
.nine-grid.mode-2col #tile-9 {
  grid-column: 1 / -1 !important;
}

.grid-detail-card {
    padding: 12px 14px !important;
    margin-bottom: 14px !important;
    border-radius: 12px !important;
  }
  .detail-main-row {
    padding: 6px 10px !important;
    gap: 4px 8px !important;
    margin-bottom: 10px !important;
  }
  .detail-main-en {
    font-size: 0.96rem !important;
  }
  .detail-main-cn {
    font-size: 0.88rem !important;
  }
  .detail-item-row,
  .detail-point-row {
    padding: 5px 8px !important;
    gap: 3px 6px !important;
    font-size: 0.84rem !important;
  }

  .nine-grid-matrix,
  .nine-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto !important;
    gap: 10px !important;
    min-height: unset !important;
    width: 100% !important;
  }

  .grid-tile {
    min-height: 110px !important;
    padding: 10px 8px !important;
    border-radius: 12px !important;
  }

  .grid-tile:nth-child(9) {
    grid-column: 1 / -1 !important;
  }

  .grid-tile:nth-child(9) .tile-illustration {
    max-height: 140px;
  }

  /* 移动端彻底隐藏快捷键底部提示栏，只显示移动端专属浮动导航栏，二者绝对互斥 */
  footer.bottom-bar,
  .bottom-bar {
    display: none !important;
  }
  .mobile-bottom-bar {
    display: flex !important;
  }
}


/* 麦克风状态徽章 */
.phone-mic-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
}
.phone-mic-status-badge.muted {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.mic-icon-anim {
  display: inline-block;
  animation: micPulse 1.5s infinite ease-in-out;
}
@keyframes micPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 6px #34d399); }
}


/* ==========================================================================
   全新九宫格全景背景图文设计 (Full-Bleed Tile Background & Overlay)
   ========================================================================== */
.grid-tile {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  overflow: hidden;
  min-height: 160px;
  aspect-ratio: 1 / 1.05;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.tile-bg-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.tile-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s ease;
  filter: brightness(0.92);
}

.grid-tile:hover .tile-bg-img,
.grid-tile.linked-active .tile-bg-img,
.grid-tile:active .tile-bg-img {
  transform: scale(1.08);
  filter: brightness(1.05);
}

.tile-gradient-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, 
    rgba(15, 23, 42, 0.5) 0%, 
    rgba(15, 23, 42, 0.15) 30%, 
    rgba(15, 23, 42, 0.78) 68%, 
    rgba(15, 23, 42, 0.96) 100%);
  pointer-events: none;
  transition: background 0.3s ease;
}

.grid-tile:hover .tile-gradient-overlay,
.grid-tile.linked-active .tile-gradient-overlay {
  background: linear-gradient(180deg, 
    rgba(14, 165, 233, 0.35) 0%, 
    rgba(15, 23, 42, 0.1) 30%, 
    rgba(15, 23, 42, 0.8) 65%, 
    rgba(15, 23, 42, 0.98) 100%);
}

.tile-content-layer {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 10px 8px 10px;
  box-sizing: border-box;
}

.tile-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.tile-badge {
  position: static;
  min-width: 28px;
  width: auto;
  height: 22px;
  padding: 0 6px;
  background: rgba(14, 165, 233, 0.92);
  color: #ffffff;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.tile-category-tag {
  position: static;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}


.tile-body {
  margin-top: auto;
  width: 100%;
}

.tile-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.8);
  line-height: 1.25;
  margin-bottom: 2px;
}

.tile-desc {
  font-size: 0.72rem;
  color: rgba(226, 232, 240, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 头部切换按钮 */
.grid-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.grid-header-badge {
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.grid-mode-toggle-group {
  display: none !important;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.grid-mode-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.grid-mode-toggle-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.4);
}

/* ==========================================================================
   移动端 (max-width: 768px) 彻底解决横向溢出与完美自适应
   ========================================================================== */
@media (max-width: 768px) {
  html, body {
    overflow-x: clip !important;
    overflow-y: visible !important;
    max-width: 100vw !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  header {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    row-gap: 8px !important;
    column-gap: 8px !important;
    align-items: center !important;
    padding: 8px 12px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
  }

  .nav-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: auto !important;
  }

  .nav-title {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin-left: 0 !important;
  }

  .nav-tag {
    display: none !important;
  }

  .nav-user-box {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    margin-left: auto !important;
    width: auto !important;
  }

  .user-badge {
    font-size: 0.72rem !important;
    padding: 3px 8px !important;
  }

  .user-switch-btn {
    font-size: 0.70rem !important;
    padding: 3px 8px !important;
  }

  .brand-title {
    font-size: 1.05rem !important;
  }

  .mode-switch-group {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 2px 0 !important;
    justify-content: flex-start !important;
  }

  .mode-switch-group::-webkit-scrollbar {
    display: none !important;
  }

  .mode-tab {
    flex-shrink: 0 !important;
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
  }

  .nav-actions {
    display: none !important;
  }

  .main-workspace {
    display: flex !important;
    flex-direction: column !important;
    padding: 10px !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .word-detail-pane,
  .grid-workspace-pane,
  .nine-grid-pane {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .word-hero-card {
    padding: 12px 10px !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .word-header-row {
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .word-spell-title {
    font-size: 1.7rem !important;
  }

  .phonetic-row {
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .phonetic-item {
    padding: 4px 8px !important;
    font-size: 0.78rem !important;
  }

  .hero-ai-chat-btn {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    writing-mode: horizontal-tb !important;
    flex-shrink: 0 !important;
    padding: 5px 10px !important;
    font-size: 0.76rem !important;
  }

  .meaning-list {
    gap: 6px !important;
    width: 100% !important;
  }

  .meaning-item {
    padding: 8px 10px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .meaning-item .meaning-pos-pill {
    margin-right: 4px !important;
  }

  .meaning-link-tag {
    font-size: 0.65rem !important;
    padding: 2px 6px !important;
  }

  /* 竖屏移动端 (宽 < 高) 默认固定使用双列 (2列) 沉浸卡片模式，第 9 格跨 2 列铺满 */
  .nine-grid-matrix,
  .nine-grid,
  .nine-grid-matrix.mode-2col,
  .nine-grid.mode-2col {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto !important;
    gap: 8px !important;
    min-height: unset !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .grid-tile {
    min-height: 110px !important;
    aspect-ratio: 1 / 0.88 !important;
    border-radius: 10px !important;
  }

  .grid-tile:nth-child(9),
  .grid-tile:last-child {
    grid-column: 1 / -1 !important;
  }

  .tile-content-layer {
    padding: 8px 6px !important;
  }

  .tile-badge {
    min-width: 22px !important;
    width: auto !important;
    height: 18px !important;
    font-size: 0.65rem !important;
    padding: 0 4px !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
  }

  .tile-category-tag {
    font-size: 0.58rem !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
  }

  .tile-title {
    font-size: 0.76rem !important;
    line-height: 1.2 !important;
  }

  .tile-desc {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    font-size: 0.65rem !important;
    color: #94a3b8 !important;
  }

  .grid-header-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .grid-header-actions {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .grid-tip {
    display: none !important;
  }

  .sentence-interactive-card {
    padding: 12px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .sentence-chunks-wrapper {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .sentence-chunk {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  footer.bottom-bar,
  .bottom-bar {
    display: none !important;
  }
}


/* ================= 多轮 AI 电话实时对话气泡流样式 ================= */
.phone-live-transcript-box {
  flex: 1;
  min-height: 0;
  max-height: none;
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px 12px;
  margin-bottom: 6px;
  text-align: left;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.transcript-header {
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.transcript-content {
  flex: 1;
  min-height: 0;
  max-height: none;
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
  overflow-y: auto;
  word-break: break-word;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  scrollbar-width: thin;
}

.transcript-content::-webkit-scrollbar {
  width: 4px;
}
.transcript-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.phone-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: phoneBubbleIn 0.2s ease-out;
}

@keyframes phoneBubbleIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.phone-chat-msg.user {
  align-self: flex-end;
  max-width: 88%;
}

.phone-chat-msg.user .phone-bubble {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border-radius: 14px 14px 2px 14px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.phone-chat-msg.assistant {
  align-self: flex-start;
  max-width: 92%;
}

.phone-chat-msg.assistant .phone-bubble {
  background: rgba(30, 41, 59, 0.9);
  color: #f1f5f9;
  border: 1px solid rgba(129, 140, 248, 0.3);
  border-radius: 14px 14px 14px 2px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.55;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.phone-bubble-sender {
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.phone-chat-msg.user .phone-bubble-sender {
  text-align: right;
  color: #6ee7b7;
}

.phone-chat-msg.assistant .phone-bubble-sender {
  text-align: left;
  color: #a5b4fc;
}

.phone-live-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  margin-left: 4px;
  animation: pulse 1s infinite alternate;
}


/* ==========================================================================
   宽高比强自适应响应式规则 (Aspect Ratio Rules)
   宽 < 高 (竖屏/移动端): 双列 (2 列)，第 9 格跨 2 列铺满
   宽 > 高 (横屏/PC端): 3 列全景经典矩阵
   ========================================================================== */
@media (max-aspect-ratio: 1/1), (orientation: portrait) {
  .nine-grid-matrix,
  .nine-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .grid-tile {
    min-height: 110px !important;
    aspect-ratio: 1 / 0.88 !important;
  }

  .grid-tile:nth-child(9),
  .grid-tile:last-child {
    grid-column: 1 / -1 !important;
  }
}

@media (min-aspect-ratio: 1/1) and (min-width: 769px) {
  .nine-grid-matrix:not(.mode-2col),
  .nine-grid:not(.mode-2col) {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: repeat(3, 1fr) !important;
    gap: 12px !important;
  }

  .nine-grid-matrix:not(.mode-2col) .grid-tile:nth-child(9),
  .nine-grid:not(.mode-2col) .grid-tile:last-child {
    grid-column: auto !important;
  }
}



/* ==========================================================================
   全站所有按键、导航标签、徽章与交互卡片强制横向单行排版标准 (Anti-Vertical Wrap Standard)
   遵循 ui-ux-pro-max + frontend-design 设计规范
   ========================================================================== */
.mode-tab,
.action-btn,
.nav-step-btn,
.hero-ai-chat-btn,
.hero-quiz-game-btn,
.hero-ai-phone-btn,
.teach-audio-btn,
.teach-close-btn,
.grid-mode-toggle-btn,
.tag-pill,
.phonetic-item,
.modal-close,
.modal-close-btn,
.ai-chip,
.phone-topic-chip,
.phone-ctrl-btn,
.phone-hangup-btn,
.mobile-btn,
.key-btn,
.audio-btn,
.grid-tile-badge,
.tile-category-tag,
.speed-btn,
.play-sentence-btn,
.msg-action-btn,
.ai-send-btn,
.ai-voice-input-btn,
.phone-secure-tag,
.phone-mic-status-badge,
.phone-mini-close-btn,
.word-tag-badges span {
  white-space: nowrap !important;
  word-break: keep-all !important;
  writing-mode: horizontal-tb !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
}

header {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 10px 24px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 20px !important;
}

.nav-brand {
  flex-shrink: 0 !important;
}

.nav-center {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 16px !important;
  flex: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
}
.nav-center::-webkit-scrollbar { display: none !important; }

.progress-box {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
  background: rgba(30, 41, 59, 0.6) !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.mode-switch-group {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch !important;
  background: rgba(15, 23, 42, 0.85) !important;
  padding: 4px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  flex-shrink: 1 !important;
  width: auto !important;
  max-width: 100% !important;
  gap: 4px !important;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3) !important;
  box-sizing: border-box !important;
}
.mode-switch-group::-webkit-scrollbar {
  display: none !important;
}

.mode-tab {
  padding: 6px 12px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  cursor: pointer !important;
  border-radius: 7px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  writing-mode: horizontal-tb !important;
  flex-shrink: 0 !important;
  width: auto !important;
  box-sizing: border-box !important;
  user-select: none !important;
  text-align: center !important;
}

.mode-tab:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px var(--primary-glow) !important;
}

.grid-header-bar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  padding: 8px 14px !important;
  gap: 12px !important;
}

.grid-header-bar .nav-tag {
  margin-left: 0 !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  background: rgba(99, 102, 241, 0.15) !important;
  color: #c7d2fe !important;
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 75% !important;
}

.grid-header-bar .action-btn.library-btn,
.grid-header-bar .action-btn {
  padding: 6px 14px !important;
  border-radius: 8px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #1e293b !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
}

.grid-header-bar .action-btn:hover {
  background: #334155 !important;
  border-color: var(--primary) !important;
}

@media (max-width: 1200px) {
  header {
    padding: 8px 16px !important;
    gap: 12px !important;
  }
  .progress-box {
    display: none !important;
  }
  .mode-switch-group {
    max-width: 100% !important;
  }
}

@media (max-width: 768px) {
  header {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    row-gap: 8px !important;
    column-gap: 8px !important;
    align-items: center !important;
    padding: 8px 12px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
  }

  .nav-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: auto !important;
  }

  .nav-title {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin-left: 0 !important;
  }

  .nav-tag {
    display: none !important;
  }

  .nav-user-box {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    margin-left: auto !important;
    width: auto !important;
  }

  .user-badge {
    font-size: 0.72rem !important;
    padding: 3px 8px !important;
  }

  .user-switch-btn {
    font-size: 0.70rem !important;
    padding: 3px 8px !important;
  }

  .nav-center {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    order: 2 !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 2px 0 !important;
    justify-content: flex-start !important;
  }

  .mode-switch-group {
    width: max-content !important;
    max-width: none !important;
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
  }

  .mode-tab {
    flex-shrink: 0 !important;
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    writing-mode: horizontal-tb !important;
    flex-direction: row !important;
    display: inline-flex !important;
    width: auto !important;
  }

  .grid-header-bar {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}


/* ================= 选词书分类树与多选管理面板 ================= */
.library-modal-card {
  max-width: 820px;
  width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.library-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 16px 20px;
}
.library-tree-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.library-tree-node {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.library-tree-node:hover {
  border-color: rgba(99, 102, 241, 0.3);
}
.library-tree-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
}
.library-tree-header:hover {
  background: rgba(255, 255, 255, 0.05);
}
.library-caret {
  transition: transform 0.2s ease;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.library-tree-node.expanded .library-caret {
  transform: rotate(90deg);
}
.library-tree-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  flex: 1;
}
.library-tree-sublist {
  display: none;
  padding: 10px 16px 14px 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.library-tree-node.expanded .library-tree-sublist {
  display: grid;
}
.library-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.library-sub-item:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}
.library-sub-item.selected {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--primary);
}
.library-tree-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.library-sub-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.library-sub-badge {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.library-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}
.library-import-panel {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
}


@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= 阶段 O & R: 第 1/2/3/4/5/6 宫格深度精讲卡片 ================= */
.grid-detail-card {
  background: var(--bg-card, rgba(26, 29, 45, 0.95));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: fadeInDown 0.25s ease-out;
  word-break: break-word;
  overflow-wrap: break-word;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.detail-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.detail-header-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  word-break: break-word;
}

.detail-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.detail-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* 核心主释义行：横向排列 + 自适应换行 */
.detail-main-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--primary, #6366f1);
  border-radius: 6px;
  line-height: 1.5;
}

.detail-main-en {
  font-size: 1.05rem;
  font-weight: 700;
  color: #a5b4fc;
  word-break: break-word;
}

.detail-main-pos {
  font-size: 0.8rem;
  font-weight: 600;
  color: #38bdf8;
  flex-shrink: 0;
}

.detail-main-cn {
  font-size: 0.95rem;
  color: var(--text-primary, #f8fafc);
  word-break: break-word;
  line-height: 1.5;
}

.detail-sub-section {
  margin-top: 10px;
}

.detail-sub-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-items-list,
.detail-points-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 搭配/短语/衍生词/例证行：横向排列 + 自适应换行，彻底消除 14px 挤压与单字纵向排列 */
.detail-item-row,
.detail-point-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  font-size: 0.88rem;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.5;
}

.detail-item-en,
.detail-point-en {
  font-weight: 600;
  color: #e0e7ff;
  word-break: break-word;
}

.detail-item-pos {
  font-size: 0.75rem;
  color: #38bdf8;
  font-style: italic;
  flex-shrink: 0;
}

.detail-item-cn,
.detail-point-cn {
  color: var(--text-secondary, #cbd5e1);
  flex: unset;
  width: auto;
  min-width: 0;
  word-break: break-word;
  line-height: 1.5;
}

.detail-writing-box {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  word-break: break-word;
}

.detail-writing-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #34d399;
  margin-bottom: 4px;
}

.detail-writing-en {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
  line-height: 1.5;
  word-break: break-word;
}

.detail-writing-cn {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
  word-break: break-word;
}

/* ===== 第 1/2/3 宫格深度精讲卡片专属样式 ===== */
.detail-scene-tag {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  color: #fef3c7;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(251, 146, 60, 0.18));
  border: 1px solid rgba(251, 191, 36, 0.4);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  word-break: break-word;
}

.detail-scene-tag .scene-label {
  color: #fbbf24;
}

.detail-scene-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  word-break: break-word;
}

.detail-scene-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 4px;
}

.detail-scene-text {
  font-size: 0.88rem;
  color: var(--text-primary, #f8fafc);
  line-height: 1.5;
  word-break: break-word;
}

.detail-logic-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  word-break: break-word;
}

.detail-logic-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #a78bfa;
  margin-bottom: 4px;
}

.detail-logic-text {
  font-size: 0.88rem;
  color: var(--text-primary, #f8fafc);
  line-height: 1.5;
  word-break: break-word;
}

.detail-trap-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.32);
  border-radius: 8px;
  word-break: break-word;
}

.detail-trap-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fb7185;
  margin-bottom: 4px;
}

.detail-trap-text {
  font-size: 0.88rem;
  color: var(--text-primary, #f8fafc);
  line-height: 1.5;
  word-break: break-word;
}

.detail-points-box {
  margin-top: 10px;
  word-break: break-word;
}

/* ==========================================================================
   生动形象 Icon 与矢量 SVG 徽章排版 (Visual Badges for Kindergarten & Cards)
   ========================================================================== */
.detail-item-text-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  flex: 1;
}

.detail-writing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-writing-text-group {
  flex: 1;
}

.detail-item-visual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.detail-item-visual:hover {
  transform: scale(1.18);
}

.detail-icon-badge {
  font-size: 1.35rem;
  line-height: 1;
  padding: 3px 7px;
  background: rgba(255, 241, 242, 0.12);
  border: 1px solid rgba(255, 182, 193, 0.3);
  border-radius: 8px;
}

.detail-svg-badge svg {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}


/* ==============================================================================
 * 高中英语全词库趣味考点小游戏 (Quiz Games Arena) 剧场舞台样式
 * 严格遵循 AGENTS.md 规范：沉浸式多模态舞台、无阿拉伯数字三维积分看板、移动端与PC双自适应
 * ============================================================================== */

/* 1. 单词详情页与移动端常驻闯关快捷按钮 (飞机/考点闯关小游戏入口) */
.hero-quiz-game-btn {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(234, 88, 12, 0.35)) !important;
  border: 1.5px solid #fbbf24 !important;
  color: #fff !important;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3), inset 0 0 8px rgba(251, 191, 36, 0.2) !important;
  user-select: none;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.hero-quiz-game-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.45), rgba(234, 88, 12, 0.55)) !important;
  border-color: #fef08a !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.5) !important;
}

.mobile-btn-game {
  color: #fbbf24 !important;
}

/* 2. 趣味考点小游戏 (9:16 像素级对齐设计图：全通栏游戏背景 + 悬浮毛玻璃 HUD + 底部 2x2 战术卡)
 * 严格遵循 AGENTS.md 规范：
 * - 规则一：双列/自适应排布
 * - 规则二：消灭阿拉伯数字
 * - 1:1 对齐 swat_mobile_ui_mockup 与 invest_mobile_ui_mockup 设计图
 * ============================================================================== */

.qg-modal-overlay.qg-fullscreen-mode {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(3, 7, 18, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.qg-modal-container.qg-game-frame {
  width: 100%;
  max-width: 480px; /* 严格按照 9:16 手游黄金比例竖屏尺寸 */
  height: 100%;
  max-height: 100dvh;
  border: none;
  border-radius: 0;
  background: #030712;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.95);
  animation: qgModalFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes qgModalFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* PC 端与横屏模式：优雅居中街机展厅质感 */
@media (min-width: 769px) and (min-aspect-ratio: 1/1) {
  .qg-modal-container.qg-game-frame {
    max-width: 460px;
    height: 94vh;
    max-height: 890px;
    border-radius: 26px;
    border: 2px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85), 0 0 50px rgba(56, 189, 248, 0.25);
  }
  .qg-modal-container.qg-game-frame.dynamic-mode-active {
    max-width: 860px;
  }
}

/* ==============================================================================
 * 1. 全通栏单反级沉浸场景舞台 (Full-bleed Background - 贯穿整个画面)
 * ============================================================================== */
.qg-stage-viewport {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  z-index: 1 !important;
  display: block !important;
  transition: transform 0.4s ease, filter 0.4s ease;
}

/* 自然环境光渐变：保留 90% 场景原色通透度，上下端微暗以确保文字极致可读 */
.qg-stage-viewport::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, 
    rgba(8, 14, 28, 0.5) 0%, 
    rgba(8, 14, 28, 0.08) 25%, 
    rgba(8, 14, 28, 0.2) 65%, 
    rgba(8, 14, 28, 0.88) 100%);
  pointer-events: none;
  z-index: 2;
}

/* 保持 DOM 绑定的立绘与道具容器（在画面中隐形，避免挡住场景单反细节） */
.qg-stage-character-box,
.qg-stage-prop-box {
  display: none !important;
}

/* ==============================================================================
 * 2. 顶部悬浮毛玻璃 HUD 卡片 (Floating Glassmorphism Card - 1:1 对齐设计图)
 * ============================================================================== */
.qg-switch-bar,
#qgUniverseSwitchBar,
.qg-mode-switcher,
#qgModeSwitcher {
  display: none !important;
}

.qg-hud-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  background: rgba(11, 18, 33, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 20px;
  padding: 12px 14px 10px 14px;
  z-index: 20;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 24px rgba(56, 189, 248, 0.15);
  box-sizing: border-box;
}

.qg-hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.qg-hud-mid-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.qg-hud-bot-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.qg-hud-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.qg-hud-universe-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  min-width: 0;
}

.qg-hud-mission-badge {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  white-space: nowrap;
}

.qg-hud-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.qg-universe-title {
  font-size: 0.84rem;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qg-universe-sub {
  font-size: 0.62rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qg-exampoint-pill {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  text-align: center;
  font-weight: 500;
}

/* 核心发光目标单词胶囊 (TARGET WORD PILL - 1:1 对齐设计图中心高亮位) */
.qg-target-pill-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(99, 102, 241, 0.25));
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  padding: 4px 14px;
  border-radius: 9999px;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35), inset 0 0 10px rgba(56, 189, 248, 0.2);
  flex-shrink: 0;
}

.qg-target-label {
  font-size: 0.68rem;
  font-weight: 900;
  color: #7dd3fc;
  letter-spacing: 0.8px;
}

.qg-target-word-pill {
  font-size: 0.95rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.qg-hud-status-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 悬浮积分面板胶囊 */
.qg-hud-score-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.qg-hud-score-pill:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(245, 158, 11, 0.4);
}

.qg-score-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
}

.qg-score-box .score-label {
  color: #94a3b8;
  font-size: 0.7rem;
}

.score-total .score-val { color: #c084fc; font-weight: 800; }
.score-streak .score-val { color: #f87171; font-weight: 700; }
.score-honor .score-val { color: #fbbf24; }
.score-wealth .score-val { color: #38bdf8; }
.score-happiness .score-val { color: #f472b6; }

.qg-hud-scores-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 8px 12px;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
  z-index: 40;
  min-width: 140px;
}

.qg-hud-score-pill:hover .qg-hud-scores-dropdown,
.qg-hud-score-pill.active .qg-hud-scores-dropdown {
  display: flex;
  animation: qgDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes qgDropdownFade {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.qg-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.qg-close-btn:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #fff;
  transform: rotate(90deg);
}

/* ==============================================================================
 * 3. 动态浮动战果通知 (Toast 动效 - 居中轻量，2.5 秒自动关闭)
 * ============================================================================== */
.qg-floating-toast {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  pointer-events: none;
  animation: qgToastSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  width: 90%;
  max-width: 400px;
}

@keyframes qgToastSlideDown {
  from { opacity: 0; transform: translate(-50%, -14px) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.qg-toast-content {
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.92rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.94);
  border: 1.5px solid #fbbf24;
  box-shadow: 0 12px 36px rgba(245, 158, 11, 0.45), 0 0 20px rgba(245, 158, 11, 0.25);
  color: #fef08a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  white-space: nowrap;
}

.qg-toast-content.toast-defeat {
  border-color: #ef4444;
  box-shadow: 0 12px 36px rgba(239, 68, 68, 0.45), 0 0 20px rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* ==============================================================================
 * 4. 底部悬浮毛玻璃决策底座 (Floating Glass Card - 1:1 对齐设计图)
 * ============================================================================== */
.qg-bottom-deck {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid rgba(56, 189, 248, 0.38);
  border-radius: 20px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.16);
  box-sizing: border-box;
}

.qg-docket-card {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.qg-docket-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qg-docket-tag {
  font-size: 0.72rem;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 0.8px;
}

.qg-terminal-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
}

.qg-docket-content {
  font-size: 0.84rem;
  color: #f1f5f9;
  line-height: 1.35;
  font-weight: 500;
}

/* 四元战术卡片 (2x2 触控网格 - 1:1 对齐设计图：左大图标方块 + 右侧清晰大字) */
.qg-options-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px;
  box-sizing: border-box;
}

.qg-option-btn,
.qg-themed-btn {
  background: rgba(30, 41, 59, 0.72) !important;
  border: 1.5px solid rgba(56, 189, 248, 0.45) !important;
  border-radius: 14px !important;
  padding: 8px 10px !important;
  cursor: pointer;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  text-align: left !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  min-height: 56px !important;
}

.qg-option-btn:hover:not(:disabled),
.qg-themed-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: #38bdf8 !important;
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.6) !important;
}

.qg-option-btn:disabled {
  cursor: default;
}

.qg-option-btn.correct {
  background: rgba(16, 185, 129, 0.35) !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.7) !important;
}

.qg-option-btn.wrong {
  background: rgba(239, 68, 68, 0.35) !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.7) !important;
  animation: qgShake 0.4s ease;
}

.qg-opt-icon-square {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.16);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.qg-opt-meta-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.qg-opt-letter {
  font-size: 1.25rem;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  line-height: 1;
}

.qg-opt-title-line {
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
  white-space: normal !important;
  word-break: break-word !important;
  text-overflow: clip !important;
  overflow: visible !important;
  display: block !important;
}

.qg-opt-ordinal {
  display: none !important;
}

.qg-opt-sub-line {
  display: none !important;
}

.qg-footer-hints {
  font-size: 0.7rem;
  color: #64748b;
  text-align: center;
}

/* ==============================================================================
 * 5. 主题专属质感 (SWAT 青蓝发光 / 商业投资 金蓝奢华)
 * ============================================================================== */
.qg-theme-door {
  border-color: rgba(56, 189, 248, 0.5) !important;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(15, 23, 42, 0.85)) !important;
}
.qg-theme-door:hover { border-color: #38bdf8 !important; box-shadow: 0 0 24px rgba(56, 189, 248, 0.6) !important; }

.qg-theme-blueprint {
  border-color: rgba(245, 158, 11, 0.55) !important;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(15, 23, 42, 0.85)) !important;
}
.qg-theme-blueprint .qg-opt-icon-square {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
}
.qg-theme-blueprint .qg-opt-letter {
  color: #fbbf24 !important;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}
.qg-theme-blueprint:hover { border-color: #fbbf24 !important; box-shadow: 0 0 24px rgba(245, 158, 11, 0.6) !important; }

.qg-theme-lane {
  border-color: rgba(16, 185, 129, 0.55) !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.85)) !important;
}
.qg-theme-lane:hover { border-color: #10b981 !important; box-shadow: 0 0 24px rgba(16, 185, 129, 0.6) !important; }

.qg-theme-memo {
  border-color: rgba(251, 146, 60, 0.55) !important;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.12), rgba(15, 23, 42, 0.85)) !important;
}
.qg-theme-memo:hover { border-color: #fb923c !important; box-shadow: 0 0 24px rgba(251, 146, 60, 0.6) !important; }

.qg-theme-dish {
  border-color: rgba(244, 63, 94, 0.55) !important;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(15, 23, 42, 0.85)) !important;
}
.qg-theme-dish:hover { border-color: #f43f5e !important; box-shadow: 0 0 24px rgba(244, 63, 94, 0.6) !important; }

.qg-theme-sonar {
  border-color: rgba(6, 182, 212, 0.55) !important;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(15, 23, 42, 0.85)) !important;
}
.qg-theme-sonar:hover { border-color: #06b6d4 !important; box-shadow: 0 0 24px rgba(6, 182, 212, 0.6) !important; }

.qg-theme-switch {
  border-color: rgba(234, 179, 8, 0.55) !important;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(15, 23, 42, 0.85)) !important;
}
.qg-theme-switch:hover { border-color: #eab308 !important; box-shadow: 0 0 24px rgba(234, 179, 8, 0.6) !important; }

.qg-theme-keycard {
  border-color: rgba(168, 85, 247, 0.55) !important;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(15, 23, 42, 0.85)) !important;
}
.qg-theme-keycard:hover { border-color: #a855f7 !important; box-shadow: 0 0 24px rgba(168, 85, 247, 0.6) !important; }

.qg-theme-breaker {
  border-color: rgba(239, 68, 68, 0.55) !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(15, 23, 42, 0.85)) !important;
}
.qg-theme-breaker:hover { border-color: #ef4444 !important; box-shadow: 0 0 24px rgba(239, 68, 68, 0.6) !important; }

.qg-theme-airlock {
  border-color: rgba(99, 102, 241, 0.55) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(15, 23, 42, 0.85)) !important;
}
.qg-theme-airlock:hover { border-color: #6366f1 !important; box-shadow: 0 0 24px rgba(99, 102, 241, 0.6) !important; }

@keyframes qgShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@keyframes qgStageShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  15% { transform: translate(-5px, 4px) rotate(-0.6deg); }
  30% { transform: translate(5px, -4px) rotate(0.6deg); }
  45% { transform: translate(-4px, 3px) rotate(-0.4deg); }
  60% { transform: translate(4px, -3px) rotate(0.4deg); }
  75% { transform: translate(-2px, 2px) rotate(0deg); }
}

@keyframes qgRedFlash {
  0% { box-shadow: inset 0 0 100px rgba(239, 68, 68, 0.85); }
  100% { box-shadow: inset 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes qgGoldGlow {
  0% { box-shadow: inset 0 0 100px rgba(234, 179, 8, 0.75); }
  100% { box-shadow: inset 0 0 0 rgba(234, 179, 8, 0); }
}

.qg-stage-shake {
  animation: qgStageShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.qg-stage-red-flash {
  animation: qgRedFlash 0.6s ease-out both;
}

.qg-stage-victory-glow {
  animation: qgGoldGlow 0.7s ease-out both;
}

/* ==============================================================================
 * 6. 胜败战报覆盖层
 * ============================================================================== */
.qg-outcome-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 24, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: qgOverlaySlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes qgOverlaySlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.qg-outcome-card {
  width: 100%;
  max-width: 440px;
  background: #111c33;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  max-height: 90vh;
  overflow-y: auto;
}

.qg-outcome-img-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.qg-outcome-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qg-outcome-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qg-outcome-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.outcome-victory .qg-outcome-title {
  color: #34d399;
}

.outcome-failure .qg-outcome-title {
  color: #f87171;
}

.qg-outcome-desc {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.qg-outcome-points {
  display: none !important;
}

.delta-tag {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

.delta-honor { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.delta-wealth { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.delta-happy { background: rgba(244, 114, 182, 0.2); color: #f472b6; border: 1px solid rgba(244, 114, 182, 0.4); }
.delta-streak { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }

.qg-outcome-analysis {
  margin-top: 14px !important;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.94rem;
  color: #f1f5f9;
  line-height: 1.6;
  min-height: 90px;
  max-height: 240px;
  overflow-y: auto;
  box-sizing: border-box;
}

.qg-outcome-analysis .analysis-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qg-outcome-analysis .analysis-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 2px;
}

.qg-outcome-analysis .analysis-mnemonic {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.qg-outcome-analysis code {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92rem;
  font-weight: 600;
}

.qg-outcome-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

.qg-btn-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.qg-btn-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.qg-btn-close {
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.qg-btn-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ==============================================================================
 * 动态小游戏「星际巡航 · 词晶猎兽战」专属响应式视界与 HUD 样式
 * 严格遵循 AGENTS.md 规范：消灭阿拉伯数字、纯中文大写/小写呈现、屏幕宽高比自适应
 * ============================================================================== */

.qg-mode-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 3px;
  margin-left: 12px;
  gap: 4px;
}

.qg-mode-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
}

.qg-mode-btn:hover {
  color: #f1f5f9;
}

.qg-mode-btn.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
}

/* ================= 动态小游戏「星际巡航 · 词晶猎兽战」视界样式 ================= */
.qg-game-frame.dynamic-mode-active .qg-hud-bar,
.qg-game-frame.dynamic-mode-active .qg-stage-viewport,
.qg-game-frame.dynamic-mode-active .qg-bottom-deck {
  display: none !important;
}

.qg-game-frame.dynamic-mode-active {
  padding: 0 !important;
  overflow: hidden !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
}

.qg-game-frame.dynamic-mode-active .dws-root-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block !important;
}

.dws-root-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: auto;
  z-index: 10;
  background: #030712;
}

.dws-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.dws-hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 顶部集群容器：统计条与字母导轨整合置顶 */
.dws-top-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  pointer-events: none;
  z-index: 25;
  background: linear-gradient(180deg, rgba(3, 7, 18, 0.95) 0%, rgba(10, 25, 47, 0.88) 75%, rgba(3, 7, 18, 0) 100%);
  padding-bottom: 10px;
}

/* 顶部第一行：时间、护盾、荣誉分与控制按钮 */
.dws-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 18px 2px 18px;
  pointer-events: auto;
  position: relative;
  z-index: 25;
}

.dws-stat-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.65);
}

.dws-stat-time .dws-stat-val {
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.dws-stat-shield-capsule {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 16px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.78);
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35), inset 0 0 8px rgba(56, 189, 248, 0.2);
  font-size: 0.92rem;
  font-weight: 800;
  color: #e2e8f0;
}

.dws-stat-shield-capsule .dws-stat-val {
  color: #38bdf8;
  font-weight: 900;
}

.dws-top-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dws-stat-honor {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.55);
}

.dws-stat-honor .dws-stat-val {
  color: #facc15;
  letter-spacing: 0.5px;
}

.dws-action-pill-btn {
  padding: 4px 12px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dws-action-pill-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #ffffff;
  border-color: #38bdf8;
}

.dws-action-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dws-action-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: #ef4444;
}

/* 顶部居中：赛博科技字母拼写导轨 */
.dws-spell-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2px;
  pointer-events: auto;
  position: relative;
  z-index: 24;
}

.dws-spell-housing {
  background: rgba(10, 25, 47, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  padding: 6px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65), inset 0 0 16px rgba(56, 189, 248, 0.2);
  max-width: 95%;
  overflow-x: auto;
}

.dws-spell-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-height: 46px;
}

.dws-spell-placeholder {
  color: rgba(148, 163, 184, 0.7);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 12px;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
  animation: dwsPulseText 2s infinite ease-in-out;
}

@keyframes dwsPulseText {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.dws-spell-slot {
  text-transform: lowercase;
  width: 38px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  border-radius: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
}

.dws-spell-slot.slot-pending {
  color: rgba(148, 163, 184, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.4);
}

.dws-spell-slot.slot-collected {
  color: #38bdf8;
  border: 1.5px solid #38bdf8;
  background: rgba(14, 165, 233, 0.22);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.65);
}

.dws-spell-slot.slot-current {
  color: #ffffff;
  border: 2px solid #00f0ff;
  background: rgba(0, 240, 255, 0.28);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.95), inset 0 0 10px rgba(0, 240, 255, 0.5);
  transform: scale(1.15);
  animation: dwsActivePulse 1.2s infinite alternate;
}

.dws-spell-slot.slot-preview-unlocked {
  color: #facc15;
  border: 1.5px solid #facc15;
  background: rgba(250, 204, 21, 0.22);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.85);
  animation: dwsPreviewGlow 1s infinite alternate;
}

.dws-spell-slot.slot-preview-pending {
  color: rgba(254, 240, 138, 0.7);
  border: 1px dashed rgba(250, 204, 21, 0.5);
  background: rgba(30, 41, 59, 0.5);
}

@keyframes dwsPreviewGlow {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(250, 204, 21, 0.5); }
  100% { transform: scale(1.08); box-shadow: 0 0 22px rgba(250, 204, 21, 1); }
}

@keyframes dwsActivePulse {
  0% { box-shadow: 0 0 12px rgba(0, 240, 255, 0.6); transform: scale(1.1); }
  100% { box-shadow: 0 0 28px rgba(0, 240, 255, 1); transform: scale(1.18); }
}

/* 动态警告/提示漂浮条 */
.dws-banner-tip {
  position: absolute;
  top: 140px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(56, 189, 248, 0.7);
  padding: 8px 24px;
  border-radius: 24px;
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 700;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
  z-index: 30;
  white-space: nowrap;
}

/* 底部状态条与控制提示 */
.dws-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  pointer-events: none;
  position: relative;
  z-index: 25;
}

.dws-bottom-hp-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
}

.dws-hp-track {
  width: 90px;
  height: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  border-radius: 6px;
  overflow: hidden;
}

.dws-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
  transition: width 0.3s ease;
}

.dws-level-tag {
  color: #94a3b8;
  font-size: 0.78rem;
  margin-left: 4px;
  white-space: nowrap;
}

.dws-bottom-hint {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.dws-bottom-aliens {
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .dws-top-row {
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .dws-stat-time {
    font-size: 0.85rem;
  }
  .dws-stat-shield-capsule {
    padding: 4px 12px;
    font-size: 0.85rem;
  }
  .dws-stat-honor {
    font-size: 0.85rem;
  }
  .dws-action-pill-btn {
    padding: 2px 8px;
    font-size: 0.72rem;
  }
  .dws-action-close-btn {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
  .dws-spell-hud {
    margin-top: 0;
  }
  .dws-spell-housing {
    padding: 4px 10px;
    max-width: 98%;
  }
  .dws-spell-tray {
    gap: 4px;
  }
  .dws-spell-slot {
  text-transform: lowercase;
    width: 28px;
    height: 36px;
    font-size: 1.05rem;
  }
  .dws-bottom-bar {
    padding: 8px 12px;
  }
  .dws-hp-track {
    width: 70px;
  }
  .dws-level-tag {
    display: none;
  }
  .dws-bottom-hint {
    font-size: 0.72rem;
  }
  .dws-bottom-aliens {
    font-size: 0.76rem;
  }
  .dws-banner-tip {
    top: 130px;
    font-size: 0.82rem;
    padding: 6px 16px;
  }
}

/* 战机触屏开火按键 (右下角战术大触控区，按住连发/点击单发) */
.dws-fire-btn-panel {
  position: absolute;
  right: 28px;
  bottom: 60px;
  z-index: 35;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dws-fire-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff5252 0%, #dc2626 50%, #991b1b 100%);
  border: 2.5px solid #fecaca;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.75), 0 4px 14px rgba(0, 0, 0, 0.65), inset 0 2px 4px rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.dws-fire-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.95), 0 6px 18px rgba(0, 0, 0, 0.75);
}

.dws-fire-btn:active,
.dws-fire-btn.active {
  transform: scale(0.92);
  background: radial-gradient(circle at 35% 35%, #ef4444 0%, #b91c1c 50%, #7f1d1d 100%);
  box-shadow: 0 0 35px #ff2222, 0 0 16px #f87171, inset 0 2px 6px rgba(0, 0, 0, 0.7);
  border-color: #ffffff;
}

.dws-fire-btn .dws-fire-icon {
  font-size: 1.45rem;
  line-height: 1;
  color: #fff;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.85));
  animation: dwsFirePulse 1.6s infinite ease-in-out;
}

.dws-fire-btn .dws-fire-label {
  font-size: 0.8rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 8px rgba(255, 255, 255, 0.7);
  margin-top: 1px;
}

@keyframes dwsFirePulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px #fff); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 10px #fef08a); }
}

@media (max-width: 768px) {
  .dws-fire-btn-panel {
    right: 16px;
    bottom: 48px;
  }
  .dws-fire-btn {
    width: 62px;
    height: 62px;
  }
  .dws-fire-btn .dws-fire-icon {
    font-size: 1.25rem;
  }
  .dws-fire-btn .dws-fire-label {
    font-size: 0.72rem;
  }
}

/* ==============================================================================
 * 高中英语趣味小游戏：场景融合切换按钮与考点次元跃迁中心 (Universe Switcher)
 * 严格遵循 AGENTS.md 规范：零阿拉伯数字、单反与场景材质深度融合、自适应响应式
 * ============================================================================== */

/* 1. 基础场景融合切换按钮 (.qg-switch-btn-fusion) */
.qg-switch-btn-fusion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f8fafc;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  user-select: none;
  white-space: nowrap;
}

.qg-switch-btn-fusion:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
  border-color: rgba(56, 189, 248, 0.8);
}

.qg-switch-btn-fusion:active {
  transform: translateY(0) scale(0.96);
}

.qg-switch-btn-fusion .qg-switch-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* 2. 战机小游戏内专属切换按钮 (深空 HUD 全息微光机甲风) */
.qg-theme-fusion-dws,
.dws-action-pill-btn#dwsModeSwitchBtn {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.85), rgba(15, 23, 42, 0.9)) !important;
  border: 1px solid #38bdf8 !important;
  color: #e0f2fe !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45) !important;
}

.qg-theme-fusion-dws:hover,
.dws-action-pill-btn#dwsModeSwitchBtn:hover {
  border-color: #7dd3fc !important;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.75) !important;
}

/* 3. 各小游戏宇宙专属融合风格 */
/* G01 特警破门：战术凯夫拉黑黄风 */
.qg-theme-fusion-G01_SWAT_BREACH {
  background: linear-gradient(135deg, #1e293b, #0f172a) !important;
  border: 1px solid #facc15 !important;
  color: #fef08a !important;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.35) !important;
}

/* G02 摩天大楼投资：华尔街黑金风 */
.qg-theme-fusion-G02_SKYSCRAPER_INVEST {
  background: linear-gradient(135deg, #1c1917, #292524) !important;
  border: 1px solid #eab308 !important;
  color: #fef9c3 !important;
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.35) !important;
}

/* G03 奥运十项全能：巅峰竞技红金风 */
.qg-theme-fusion-G03_OLYMPIC_DECATHLON {
  background: linear-gradient(135deg, #7f1d1d, #450a0a) !important;
  border: 1px solid #f59e0b !important;
  color: #fef3c7 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4) !important;
}

/* G04 战地密电：绝密军绿黄铜风 */
.qg-theme-fusion-G04_BATTLEFIELD_TELEGRAPH {
  background: linear-gradient(135deg, #14532d, #052e16) !important;
  border: 1px solid #84cc16 !important;
  color: #ecfccb !important;
  box-shadow: 0 0 14px rgba(132, 204, 22, 0.35) !important;
}

/* G05 米其林料理：法式暖金红酒风 */
.qg-theme-fusion-G05_MICHELIN_BISTRO {
  background: linear-gradient(135deg, #881337, #4c0519) !important;
  border: 1px solid #f59e0b !important;
  color: #fef3c7 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45) !important;
}

/* G06 深海声呐：碧海深渊声波蓝风 */
.qg-theme-fusion-G06_SUBMARINE_SONAR {
  background: linear-gradient(135deg, #0c4a6e, #082f49) !important;
  border: 1px solid #06b6d4 !important;
  color: #cffafe !important;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.4) !important;
}

/* G07 极限列车：失控钢铁工业橙风 */
.qg-theme-fusion-G07_RUNAWAY_EXPRESS {
  background: linear-gradient(135deg, #3f3f46, #18181b) !important;
  border: 1px solid #f97316 !important;
  color: #ffedd5 !important;
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.4) !important;
}

/* G08 赛博金库：黑客终端代码翠绿风 */
.qg-theme-fusion-G08_CYBER_VAULT {
  background: linear-gradient(135deg, #022c22, #051b14) !important;
  border: 1px solid #10b981 !important;
  color: #d1fae5 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.45) !important;
}

/* G09 史前侏罗纪：电网防御电弧蓝风 */
.qg-theme-fusion-G09_JURASSIC_SANCTUARY {
  background: linear-gradient(135deg, #14532d, #0f172a) !important;
  border: 1px solid #38bdf8 !important;
  color: #e0f2fe !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4) !important;
}

/* G10 天宫空间站：寰宇天宫深空冷蓝风 */
.qg-theme-fusion-G10_SPACE_STATION_DOCK {
  background: linear-gradient(135deg, #0f172a, #030712) !important;
  border: 1px solid #60a5fa !important;
  color: #dbeafe !important;
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.45) !important;
}

/* 4. 结算弹窗动作栏内部切换按钮 */
.qg-outcome-actions .qg-btn-switch-fusion {
  padding: 10px 18px;
  font-size: 0.88rem;
  border-radius: 12px;
}

/* 5. 沉浸式考点次元跃迁中心面板 (抽屉/选择器) */
.qg-universe-picker-sheet {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: qgSheetFadeIn 0.25s ease forwards;
}

.qg-picker-sheet-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.qg-picker-sheet-content {
  position: relative;
  z-index: 10;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px 24px 0 0;
  padding: 20px 18px 24px 18px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  animation: qgSheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes qgSheetFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes qgSheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.qg-picker-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.qg-picker-sheet-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qg-picker-sheet-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 4px;
}

.qg-picker-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qg-picker-close-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.qg-picker-universe-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  overflow-y: auto;
  max-height: calc(82vh - 100px);
  padding-right: 4px;
  padding-bottom: 10px;
}

.qg-picker-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.22s ease;
}

.qg-picker-card:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.qg-picker-card.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3), rgba(15, 23, 42, 0.8));
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

.qg-picker-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.qg-picker-card-icon {
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qg-picker-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.qg-picker-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qg-picker-card-dim {
  font-size: 0.75rem;
  font-weight: 600;
  color: #38bdf8;
}

.qg-picker-card-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.3;
}

.qg-picker-card-action {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  white-space: nowrap;
}

.qg-picker-card.active .qg-picker-card-action {
  background: #0284c7;
  color: #fff;
}

@media (max-width: 480px) {
  .qg-switch-btn-fusion {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
  .qg-picker-sheet-content {
    padding: 16px 12px 20px 12px;
  }
  .qg-picker-card-icon {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }
}
