/* ==========================================================================
   Gizmo AI Flashcards - Design System & Modern UI Style
   ========================================================================== */

:root {
  /* Brand Color Palette */
  --gizmo-primary: #00d26a;
  --gizmo-primary-hover: #00b85c;
  --gizmo-primary-light: rgba(0, 210, 106, 0.12);
  --gizmo-dark: #0f172a;
  --gizmo-bg: #f8fafc;
  --gizmo-card-bg: #ffffff;

  /* Accent Colors */
  --accent-flame: #ff5722;
  --accent-heart: #ef4444;
  --accent-xp: #f59e0b;
  --accent-violet: #8b5cf6;
  --accent-blue: #3b82f6;

  /* Category Tag Colors */
  --cat-pinyin: #10b981;
  --cat-chengyu: #f59e0b;
  --cat-gushi: #6366f1;
  --cat-wenyan: #ec4899;
  --cat-bingju: #8b5cf6;
  --cat-all: #3b82f6;

  /* State Colors */
  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-error: #ef4444;
  --color-error-bg: #fef2f2;
  
  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Typography */
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);
  --shadow-primary: 0 8px 20px rgba(0, 210, 106, 0.28);
}

/* Reset & Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--gizmo-bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Base Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  outline: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-gizmo-primary {
  background: var(--gizmo-primary);
  color: #ffffff;
  box-shadow: var(--shadow-primary);
}

.btn-gizmo-primary:hover {
  background: var(--gizmo-primary-hover);
  transform: translateY(-2px);
}

.btn-gizmo-secondary {
  background: #ffffff;
  color: var(--gizmo-dark);
  border: 2px solid #e2e8f0;
}

.btn-gizmo-secondary:hover {
  border-color: var(--gizmo-primary);
  color: var(--gizmo-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.btn-accent {
  background: var(--accent-violet);
  color: #ffffff;
}

.btn-accent:hover {
  background: #7c3aed;
}

.btn-icon {
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
}

.btn-xl {
  padding: 14px 28px;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-ai-hint {
  background: #f0fdf4;
  color: var(--gizmo-primary-hover);
  border: 1.5px solid #bbf7d0;
}

.btn-ai-hint:hover {
  background: #dcfce7;
}

/* Loader */
.global-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--gizmo-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Header HUD Layout
   ========================================================================== */
.app-hud {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 24px;
}

.hud-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.hud-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.hud-stats-group {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #00d26a, #059669);
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-primary);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gizmo-dark);
  line-height: 1.1;
}

.brand-badge {
  font-size: 0.75rem;
  background: #dcfce7;
  color: var(--gizmo-primary-hover);
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 6px;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Subject Switcher Pill */
.subject-toggle-pill {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid #e2e8f0;
  gap: 4px;
}

.sub-pill {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.sub-pill:hover {
  color: var(--gizmo-dark);
}

.sub-pill.active {
  background: #ffffff;
  color: #1e3a8a;
  box-shadow: var(--shadow-sm);
}



/* HUD Stats */
.hud-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.88rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.streak-item .hud-icon { animation: flamePulse 1.5s infinite alternate; }
@keyframes flamePulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.18); }
}

.streak-item { color: var(--accent-flame); border-color: #ffedd5; background: #fff7ed; }
.hearts-item { color: var(--accent-heart); border-color: #fecdd3; background: #fff1f2; }
.xp-item { color: var(--accent-xp); border-color: #fef3c7; background: #fffbeb; }

.hud-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* HUD Audio Pill */
.hud-audio-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #2563eb;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.hud-audio-pill:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: scale(1.04);
}

.hud-audio-pill.has-pack {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

/* Audio Modal Styles */
.audio-modal-box {
  max-width: 620px;
}

.audio-modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.audio-modal-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.audio-status-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.audio-status-card.has-pack {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.status-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.status-detail h4 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gizmo-dark);
  margin-bottom: 4px;
}

.status-detail p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.audio-download-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.progress-bar-wrap {
  width: 100%;
  height: 12px;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.audio-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 0.3s ease;
}

.progress-status-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.audio-features-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.af-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  padding: 12px 16px;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-sm);
}

.af-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.af-item b {
  font-size: 0.9rem;
  color: var(--gizmo-dark);
  display: block;
  margin-bottom: 2px;
}

.af-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* HUD Nav Buttons */
.hud-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  background: #f1f5f9;
  color: var(--gizmo-dark);
}

.nav-btn.active {
  background: #e0e7ff;
  color: #4338ca;
}

.badge {
  background: var(--accent-heart);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Main Application Body & Views
   ========================================================================== */
.app-body {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   View 1: Dashboard
   ========================================================================== */
.hero-card {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 28px;
}

.hero-tag {
  display: inline-block;
  background: rgba(0, 210, 106, 0.2);
  color: #00d26a;
  border: 1px solid rgba(0, 210, 106, 0.4);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}

.hero-desc {
  color: #94a3b8;
  font-size: 1rem;
  margin-bottom: 24px;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.streak-widget-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  text-align: center;
  min-width: 220px;
}

.streak-fire {
  font-size: 3rem;
  margin-bottom: 4px;
}

.streak-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ff5722;
  line-height: 1;
}

.streak-text {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 14px;
}

.streak-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.streak-dots .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.streak-dots .dot.done { background: #ff5722; color: #fff; }
.streak-dots .dot.active { background: var(--gizmo-primary); color: #fff; box-shadow: 0 0 10px var(--gizmo-primary); }

/* SRS Banner Card */
.srs-banner-card {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.srs-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.srs-icon {
  font-size: 2.2rem;
}

.srs-info h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e3a8a;
}

.srs-info p {
  color: #1e40af;
  font-size: 0.95rem;
}

/* Topic Decks Grid */
.section-header {
  margin-bottom: 18px;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.deck-card {
  background: var(--gizmo-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

.deck-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--gizmo-primary);
}

.deck-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: #ffffff;
}

.color-pinyin { background: var(--cat-pinyin); }
.color-chengyu { background: var(--cat-chengyu); }
.color-gushi { background: var(--cat-gushi); }
.color-wenyan { background: var(--cat-wenyan); }
.color-bingju { background: var(--cat-bingju); }
.color-all { background: var(--cat-all); }

.deck-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.deck-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gizmo-dark);
  margin-bottom: 6px;
}

.deck-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex: 1;
}

.deck-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
}

.deck-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================================================
   View 2: Stream Card (Single-Card Swipe/Quiz View)
   ========================================================================== */
#view-stream {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.stream-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.stream-progress-wrap {
  flex: 1;
  height: 12px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.stream-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00d26a, #059669);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.combo-pill {
  background: #fff7ed;
  color: var(--accent-flame);
  border: 1px solid #ffedd5;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.9rem;
  animation: pulse 0.6s ease infinite alternate;
}

.stream-card-container {
  perspective: 1000px;
  margin-bottom: 80px;
}

.gizmo-card {
  background: var(--gizmo-card-bg);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gizmo-card.shake-warning {
  animation: shake 0.4s ease;
  border-color: #fca5a5 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2) !important;
}

.card-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.card-tag {
  background: #f1f5f9;
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.card-tag.tag-year {
  background: #eff6ff;
  color: #2563eb;
}

/* v1.20 AI闪卡角标（紫色系，与App端统一） */
.card-tag.tag-ai {
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}

/* 考试题头AI角标 */
.exam-q-head-web .tag-ai {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.card-question-box {
  margin-bottom: 28px;
}

.card-question {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--gizmo-dark);
  white-space: pre-line;
}

/* Card Input & Choice Area */
.card-input-area {
  margin-bottom: 28px;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.choice-option:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: translateX(4px);
}

.choice-option.selected {
  border-color: var(--gizmo-primary);
  background: var(--gizmo-primary-light);
  color: var(--gizmo-primary-hover);
}

.choice-option.correct {
  border-color: var(--color-success);
  background: var(--color-success-bg);
  color: var(--color-success);
}

.choice-option.incorrect {
  border-color: var(--color-error);
  background: var(--color-error-bg);
  color: var(--color-error);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.choice-key {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.fill-blank-input {
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-family);
  font-size: 1.1rem;
  font-weight: 600;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s;
}

.fill-blank-input:focus {
  border-color: var(--gizmo-primary);
  box-shadow: 0 0 0 3px rgba(0, 210, 106, 0.15);
}

.card-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
}

/* Feedback Banner Bottom Bar */
.feedback-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 2px solid #e2e8f0;
  padding: 18px 32px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.feedback-banner.correct-mode {
  background: #ecfdf5;
  border-top-color: #10b981;
}

.feedback-banner.incorrect-mode {
  background: #fef2f2;
  border-top-color: #ef4444;
}

.feedback-status {
  font-size: 1.2rem;
  font-weight: 800;
}

.feedback-banner.correct-mode .feedback-status { color: #047857; }
.feedback-banner.incorrect-mode .feedback-status { color: #b91c1c; }

.feedback-detail {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.feedback-actions {
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   View 3: Card Flip View (3D Flip Animation & Premium Vocab Layout)
   ========================================================================== */
#view-flip {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.flip-nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flip-counter {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.flip-stage {
  perspective: 1400px;
  margin: 16px 0 24px 0;
}

.flip-card-inner {
  width: 100%;
  min-height: 480px;
  height: 480px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.flip-card-inner.flipped {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: var(--gizmo-card-bg);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 24px 28px 16px 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.flip-card-front:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-lg);
}

.flip-card-back {
  transform: rotateY(180deg);
  border-color: #10b981;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

/* Card Topbar */
.flip-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.flip-tags-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-grade {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 800;
}

.tag-theme {
  background: #f1f5f9;
  color: #475569;
}

.flip-hint-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* Scrollable Card Body */
.flip-card-body-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
  margin-bottom: 8px;
}

.flip-card-body-scroll::-webkit-scrollbar {
  width: 5px;
}

.flip-card-body-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Front Word Hero */
.flip-word-hero {
  margin-bottom: 20px;
}

.flip-word-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 8px;
}

.flip-word-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--gizmo-dark);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Audio Pronunciation Buttons */
.btn-audio-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #059669;
  border: 1.5px solid #a7f3d0;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.btn-audio-icon:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-audio-icon:active {
  transform: scale(0.95);
}

.btn-audio-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.kbd-hint {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  letter-spacing: 0;
  display: inline-block;
  vertical-align: middle;
}

.btn-audio-icon:hover .kbd-hint,
.btn-audio-pill:hover .kbd-hint {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.btn-audio-pill:hover {
  background: #4338ca;
  color: #ffffff;
  border-color: #4338ca;
}

.audio-wave-icon {
  font-size: 1rem;
}

/* Audio Playing Animations */
@keyframes audioPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes sentenceAudioPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(67, 56, 202, 0.5);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 7px rgba(67, 56, 202, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(67, 56, 202, 0);
  }
}

@keyframes waveBar {
  0%, 100% { transform: scaleY(0.7); }
  50% { transform: scaleY(1.3); }
}

.btn-audio-icon.is-playing {
  animation: audioPulse 1s infinite ease-in-out;
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
}

.btn-audio-icon.is-playing .audio-wave-icon {
  display: inline-block;
  animation: waveBar 0.5s infinite alternate ease-in-out;
}

.btn-audio-pill.is-playing {
  animation: sentenceAudioPulse 1s infinite ease-in-out;
  background: #4338ca !important;
  color: #ffffff !important;
  border-color: #3730a3 !important;
}

.btn-audio-pill.is-playing .audio-wave-icon {
  display: inline-block;
  animation: waveBar 0.5s infinite alternate ease-in-out;
}

/* Phonetic & POS Badges - strict height, zero margin and perfect horizontal alignment */
.flip-phonetic-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  line-height: 1;
}

.flip-phonetic-badge,
.flip-pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  padding: 0 12px;
  margin: 0 !important;
  box-sizing: border-box;
  font-size: 0.92rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  vertical-align: middle;
}

.flip-phonetic-badge {
  font-family: var(--font-family);
  color: #4338ca;
  font-weight: 700;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  letter-spacing: 0.02em;
}

.flip-pos-badge {
  font-family: var(--font-family);
  font-weight: 700;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Example Sentence Box (Front of Card) */
.flip-example-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.flip-example-box:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.example-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.example-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.example-sentence-text {
  font-size: 1.02rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.55;
}

/* Card Footer - Rigorously Docked Inside Card */
.flip-card-footer {
  flex-shrink: 0;
  text-align: center;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  margin-top: auto;
  background: inherit;
}

.flip-touch-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

/* Back of Card: Meaning Hero */
.flip-meaning-hero {
  margin-bottom: 16px;
}

.meaning-primary-text {
  font-size: 2rem;
  font-weight: 800;
  color: #047857;
  line-height: 1.2;
  margin-bottom: 6px;
}

.meaning-sub-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meaning-pos-pill {
  font-size: 0.82rem;
  font-weight: 800;
  background: #dcfce7;
  color: #15803d;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}

.meaning-meta-info {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Back Bilingual Box */
.flip-bilingual-box {
  background: #ffffff;
  border: 1.5px solid #d1fae5;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.bilingual-en {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.45;
  margin-bottom: 6px;
}

.bilingual-cn {
  font-size: 0.9rem;
  color: #047857;
  font-weight: 600;
  line-height: 1.45;
}

/* Mnemonic Box */
.flip-mnemonic-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #92400e;
  font-weight: 600;
  margin-bottom: 8px;
}

/* Flip Rating Bar */
.flip-rating-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.btn-rate {
  padding: 14px;
  flex-direction: column;
  gap: 4px;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  background: #ffffff;
  transition: all 0.2s;
}

.rate-emoji { font-size: 1.5rem; }
.rate-text {
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.rate-sub { font-size: 0.75rem; color: var(--text-muted); }

.kbd-sub {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  display: inline-block;
  vertical-align: middle;
}

.btn-rate:hover .kbd-sub {
  background: rgba(0, 0, 0, 0.08);
}

.btn-rate-forgot:hover { border-color: var(--accent-heart); background: #fff1f2; }
.btn-rate-hard:hover { border-color: var(--accent-xp); background: #fffbeb; }
.btn-rate-easy:hover { border-color: var(--gizmo-primary); background: #ecfdf5; }

/* ==========================================================================
   View 4: Magic Import View
   ========================================================================== */
.import-container {
  max-width: 760px;
  margin: 0 auto;
  background: var(--gizmo-card-bg);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.import-header {
  margin-bottom: 24px;
}

.import-header h2 { font-size: 1.5rem; font-weight: 800; }
.import-header p { color: var(--text-muted); }

#import-text-input {
  width: 100%;
  height: 240px;
  padding: 18px;
  font-family: var(--font-family);
  font-size: 1rem;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  outline: none;
  resize: vertical;
  margin-bottom: 20px;
}

#import-text-input:focus {
  border-color: var(--gizmo-primary);
}

.import-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   View 5: Session Summary View
   ========================================================================== */
.summary-card {
  max-width: 560px;
  margin: 40px auto;
  background: var(--gizmo-card-bg);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.summary-badge {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-weight: 800;
  margin-bottom: 16px;
}

.summary-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 28px;
}

.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-icon { font-size: 1.8rem; margin-bottom: 4px; }
.stat-val { font-size: 1.4rem; font-weight: 800; color: var(--gizmo-dark); }
.stat-lbl { font-size: 0.75rem; color: var(--text-muted); }

.summary-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
}

/* ==========================================================================
   AI Tutor Drawer Component
   ========================================================================== */
.ai-drawer {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  justify-content: flex-end;
}

.ai-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
}

.ai-drawer-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100%;
  background: #ffffff;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: slideLeft 0.3s ease;
  z-index: 1000;
}

@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.ai-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.ai-drawer-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gizmo-dark);
}

.ai-drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.98rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* Import Cards Preview Section */
.import-preview-section {
  margin-top: 32px;
  border-top: 2px dashed #e2e8f0;
  padding-top: 24px;
  animation: fadeIn 0.3s ease;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.preview-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gizmo-dark);
}

.preview-actions {
  display: flex;
  gap: 10px;
}

.preview-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-card-item {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
}

.preview-card-item:hover {
  border-color: var(--gizmo-primary);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.preview-card-q {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.preview-badge-q {
  background: #e0e7ff;
  color: #4338ca;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.preview-card-a {
  font-size: 0.92rem;
  font-weight: 600;
  color: #047857;
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: #ecfdf5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #d1fae5;
}

.preview-badge-a {
  background: #10b981;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   Custom Vocab Deck Generator Card & Deck Preview Modal
   ========================================================================== */
.custom-generator-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-generator-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-lg);
}

.generator-header {
  margin-bottom: 20px;
}

.gen-title-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gen-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.gen-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gizmo-dark);
}

.gen-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.generator-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
}

.grade-checkbox-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.custom-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.custom-check-pill input {
  display: none;
}

.custom-check-pill.active {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

.custom-check-pill .check-box-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #e2e8f0;
  color: transparent;
  font-size: 0.75rem;
  font-weight: 900;
  transition: all 0.2s;
}

.custom-check-pill.active .check-box-icon {
  background: #10b981;
  color: #ffffff;
}

.size-pill-group, .diff-pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-size-pill, .btn-diff-pill, .btn-ai-pill {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.btn-size-pill:hover, .btn-diff-pill:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.btn-size-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.btn-diff-pill.active {
  background: var(--gizmo-dark);
  color: #ffffff;
  border-color: var(--gizmo-dark);
}

.btn-diff-pill.pill-easy.active {
  background: #059669;
  border-color: #059669;
}

.btn-diff-pill.pill-medium.active {
  background: #d97706;
  border-color: #d97706;
}

.btn-diff-pill.pill-hard.active {
  background: #dc2626;
  border-color: #dc2626;
}

/* v1.20 AI闪卡三档选项胶囊（紫色系） */
.btn-ai-pill {
  background: #f5f3ff;
  border: 1.5px solid #ddd6fe;
  color: #7c3aed;
}

.btn-ai-pill:hover {
  background: #ede9fe;
}

.btn-ai-pill.active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #ffffff;
}

.custom-size-input-wrap input {
  width: 76px;
  padding: 6px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  background: #ffffff;
}

.custom-size-input-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.generator-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gen-info-tag {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: #f1f5f9;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

/* ==========================================================================
   Deck Preview Modal (弹窗与掌握度可视化)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
}

.preview-modal-box {
  position: relative;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  animation: modalScaleIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalScaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.preview-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px 16px 28px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.preview-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-badge-pill {
  font-size: 0.78rem;
  font-weight: 800;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.preview-title-group h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gizmo-dark);
}

.preview-meta-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-modal-close {
  background: #e2e8f0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-modal-close:hover {
  background: #cbd5e1;
  color: var(--gizmo-dark);
}

/* Mastery Stats Card in Modal */
.mastery-stats-card {
  padding: 16px 28px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.mastery-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.stats-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stats-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mastery-progress-bar {
  display: flex;
  height: 10px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: #e2e8f0;
  margin-bottom: 12px;
}

.progress-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.seg-mastered { background: #10b981; }
.seg-review { background: #f59e0b; }
.seg-new { background: #ef4444; }

.mastery-indicators-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mastery-ind-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.item-mastered { border-color: #d1fae5; background: #f0fdf4; }
.item-review { border-color: #fef3c7; background: #fffbeb; }
.item-new { border-color: #fee2e2; background: #fef2f2; }

.ind-info {
  display: flex;
  flex-direction: column;
}

.ind-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ind-value {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Words Table / Scroll List */
.preview-words-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 28px;
  background: #f8fafc;
}

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

.preview-word-row {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s;
}

.preview-word-row:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.pw-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.pw-index {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 24px;
}

.pw-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pw-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pw-word {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gizmo-dark);
}

.pw-phonetic {
  font-size: 0.85rem;
  color: #4338ca;
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.pw-pos {
  font-size: 0.78rem;
  color: #15803d;
  background: #dcfce7;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.pw-meaning {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 600;
}

.pw-example {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

.pw-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pw-mastery-tag {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.pw-tag-mastered { background: #d1fae5; color: #047857; }
.pw-tag-review { background: #fef3c7; color: #b45309; }
.pw-tag-new { background: #fee2e2; color: #b91c1c; }

.btn-pw-audio {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  width: 30px;
  height: 30px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-pw-audio:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

/* Modal Footer */
.preview-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-left-actions, .footer-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   Header Dropdowns & User Profile Styles
   ========================================================================== */
.nav-dropdown-wrap, .user-profile-wrap {
  position: relative;
}

.nav-dropdown-btn {
  cursor: pointer;
  white-space: nowrap;
}

.nav-dropdown-menu, .user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 6px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-menu-item, .user-menu-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}

.nav-menu-item:hover, .user-menu-action:hover {
  background: #f1f5f9;
  color: var(--gizmo-primary-hover);
}

.user-menu-action.logout-action {
  color: #ef4444;
}

.user-menu-action.logout-action:hover {
  background: #fee2e2;
}

.user-menu-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

.user-avatar-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--gizmo-dark);
  transition: all 0.2s;
  white-space: nowrap;
}

.user-avatar-pill:hover {
  border-color: var(--gizmo-primary);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.user-role-badge {
  font-size: 0.95rem;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
}

.user-menu-avatar {
  font-size: 1.4rem;
}

.user-menu-name {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--gizmo-dark);
}

.user-menu-role {
  font-size: 0.75rem;
  color: var(--gizmo-primary-hover);
  font-weight: 700;
}

/* ==========================================================================
   Auth Forms & Modals Styles
   ========================================================================== */
.login-modal-box, .user-edit-box {
  max-width: 460px;
}

.auth-modal-body {
  padding: 24px;
}

.auth-form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-input, .auth-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font-family);
  outline: none;
  transition: border-color 0.2s;
}

.auth-input:focus, .auth-select:focus {
  border-color: var(--gizmo-primary);
  box-shadow: 0 0 0 3px var(--gizmo-primary-light);
}

.quick-login-hints {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed #cbd5e1;
  margin-bottom: 16px;
}

.quick-login-hints .hint-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.quick-user-pill {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gizmo-dark);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.quick-user-pill:hover {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
}

.auth-error-msg {
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid #fecdd3;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   User Management & Study Records Tables
   ========================================================================== */
.user-mgmt-box, .records-modal-box {
  max-width: 960px;
  width: 95vw;
}

.user-mgmt-body, .records-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: 70vh;
}

.user-mgmt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.mgmt-summary-stats {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.user-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.user-table th {
  background: #f8fafc;
  padding: 10px 14px;
  font-weight: 800;
  color: var(--text-secondary);
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.user-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  vertical-align: middle;
}

.user-table tbody tr:hover {
  background: #f8fafc;
}

.user-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
}

.status-active { background: #dcfce7; color: #15803d; }
.status-disabled { background: #fee2e2; color: #b91c1c; }

.table-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-table-sm {
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-table-sm:hover {
  background: #f1f5f9;
}

.btn-table-del {
  color: #ef4444;
  border-color: #fca5a5;
}

.btn-table-del:hover {
  background: #fee2e2;
}

/* Records Summary Grid */
.records-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

/* v1.19 个人学习百分制战报表格：固定列宽，防长文本撑爆 */
.records-modal-box .user-table {
  table-layout: fixed;
}
.records-modal-box .user-table th,
.records-modal-box .user-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.records-modal-box .user-table th:nth-child(1), .records-modal-box .user-table td:nth-child(1) { width: 17%; } /* 学习时间 */
.records-modal-box .user-table th:nth-child(2), .records-modal-box .user-table td:nth-child(2) { width: 11%; } /* 模式 */
.records-modal-box .user-table th:nth-child(3), .records-modal-box .user-table td:nth-child(3) { width: 14%; } /* 词包主题 */
.records-modal-box .user-table th:nth-child(4), .records-modal-box .user-table td:nth-child(4) { width: 13%; } /* 规划/已做 */
.records-modal-box .user-table th:nth-child(5), .records-modal-box .user-table td:nth-child(5) { width: 9%; }  /* 答对数 */
.records-modal-box .user-table th:nth-child(6), .records-modal-box .user-table td:nth-child(6) { width: 10%; } /* 完成率 */
.records-modal-box .user-table th:nth-child(7), .records-modal-box .user-table td:nth-child(7) { width: 12%; } /* 百分制得分 */
.records-modal-box .user-table th:nth-child(8), .records-modal-box .user-table td:nth-child(8) { width: 14%; } /* 状态 */
.records-modal-box .user-table td b {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.rec-stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rec-stat-icon {
  font-size: 1.8rem;
}

.rec-stat-val {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--gizmo-dark);
  line-height: 1.1;
}

.rec-stat-lbl {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.color-green { color: #16a34a !important; }
.color-blue { color: #2563eb !important; }
.color-orange { color: #d97706 !important; }

/* ==========================================================================
   Early Exit Confirmation Modal Styles
   ========================================================================== */
.early-exit-box {
  max-width: 520px;
}

.early-exit-header {
  padding: 24px 28px 12px;
  text-align: center;
}

.early-exit-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.early-exit-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gizmo-dark);
  margin-bottom: 6px;
}

.early-exit-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.early-exit-body {
  padding: 12px 28px 20px;
}

.early-exit-stat-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.ee-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ee-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ee-stat b {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--gizmo-dark);
}

.early-exit-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.early-exit-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 28px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-wrap: wrap;
}

.btn-ghost-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid transparent;
}

.btn-ghost-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

/* ==========================================================================
   Responsive & Mobile Adaptation Rules (Ultra Touch-Friendly)
   ========================================================================== */
.dash-quick-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.mistake-banner-card {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border: 2px solid #fecdd3;
}

.mistake-banner-card .srs-icon {
  background: #ffe4e6;
  color: #e11d48;
}

.btn-gizmo-danger {
  background: #e11d48;
  color: #ffffff;
  border: 2px solid #be123c;
  font-weight: 800;
  border-radius: 14px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-gizmo-danger:hover {
  background: #be123c;
  transform: translateY(-1px);
}

.badge-danger {
  background: #e11d48 !important;
  color: #ffffff !important;
}

@media (max-width: 1024px) {
  .hud-stats-group .streak-item, .hud-stats-group .hearts-item { display: none; }
  .records-summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Clean HUD for mobile */
  .app-hud {
    padding: 8px 12px;
    height: auto;
    min-height: 56px;
  }
  
  .hud-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }
  
  .hud-brand .brand-sub {
    display: none;
  }
  
  .hud-brand .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 10px;
  }
  
  .hud-brand .brand-title {
    font-size: 1.1rem;
  }
  
  .hud-center {
    display: none;
  }

  .hud-nav {
    display: flex;
    gap: 4px;
  }

  .nav-btn {
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 10px;
  }

  .user-avatar-pill {
    padding: 4px 8px;
    font-size: 12px;
  }

  .user-name-text {
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Keyboard shortcut cleaners for mobile touch */
  .kbd-hint,
  .kbd-sub,
  .flip-hint-pill,
  .flip-touch-hint kbd {
    display: none !important;
  }

  .flip-touch-hint {
    font-size: 12px;
    color: #64748b;
  }

  /* Dashboard mobile layout */
  .dash-quick-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hero-card {
    flex-direction: column;
    padding: 20px 16px;
    border-radius: 20px;
    text-align: center;
  }

  .hero-title {
    font-size: 1.35rem;
    line-height: 1.35;
  }

  .hero-desc {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero-actions .btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
  }

  .srs-banner-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
  }

  .srs-banner-card .btn {
    width: 100%;
    padding: 12px;
  }

  .generator-controls {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .grade-checkbox-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .diff-pill-group {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .deck-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .deck-card {
    padding: 18px 16px;
    border-radius: 18px;
  }

  /* Flashcard Screen on Mobile */
  .stream-card-container {
    padding: 8px 0;
    width: 100%;
  }

  .gizmo-card {
    padding: 20px 16px;
    border-radius: 22px;
    width: 100%;
    box-sizing: border-box;
  }

  .card-question {
    font-size: 1.35rem;
    line-height: 1.4;
  }

  .card-options-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .choice-option-btn {
    padding: 14px 16px !important;
    font-size: 15px !important;
    min-height: 52px;
    border-radius: 14px;
    width: 100%;
    box-sizing: border-box;
  }

  /* 3D Flip Card on Mobile */
  .flip-stage {
    min-height: 360px;
    padding: 4px 0;
  }

  .flip-card-inner {
    width: 100%;
    max-width: 100%;
    min-height: 360px;
    border-radius: 22px;
  }

  .flip-card-front,
  .flip-card-back {
    padding: 20px 16px;
    border-radius: 22px;
  }

  .flip-word-title {
    font-size: 1.85rem;
  }

  .flip-rating-bar {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    padding: 10px 0;
  }

  .btn-rate {
    padding: 10px 4px;
    border-radius: 14px;
  }

  .rate-emoji {
    font-size: 20px;
  }

  .rate-text {
    font-size: 11px;
    font-weight: 700;
  }

  .rate-sub {
    display: none;
  }

  /* Modals on Mobile */
  .preview-modal-box {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 20px 16px !important;
    border-radius: 22px !important;
  }

  .mastery-indicators-grid {
    grid-template-columns: 1fr;
  }

  .preview-modal-footer {
    flex-direction: column;
    gap: 10px;
  }

  .preview-modal-footer .btn {
    width: 100%;
  }

  .records-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Independent Blocking Login Gate Screen
   ========================================================================== */
.login-gate-container {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: radial-gradient(circle at top right, #312e81 0%, #0f172a 50%, #030712 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  backdrop-filter: blur(20px);
}

.login-gate-container.hidden {
  display: none !important;
}

.login-gate-card {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.15);
  padding: 36px 32px;
  margin: auto;
  position: relative;
  animation: modalPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-gate-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-gate-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 20px;
  margin-bottom: 12px;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.5);
  position: relative;
}

.login-logo-icon {
  font-size: 32px;
}

.login-gate-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.login-gate-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 16px;
}

.login-gate-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.gate-feat-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
}

.login-gate-body {
  margin-bottom: 20px;
}

.gate-form-group {
  margin-bottom: 18px;
}

.gate-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.gate-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.gate-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.gate-input:focus {
  background: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  user-select: none;
  opacity: 0.6;
}

.btn-toggle-pwd:hover {
  opacity: 1;
}

.gate-quick-hints {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
}

.gate-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 0 4px;
}

.gate-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.gate-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #4f46e5;
  cursor: pointer;
}

.gate-error-msg {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  text-align: center;
  animation: fadeIn 0.2s ease;
}

.gate-actions .btn-block {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: 14px;
}

.login-gate-footer {
  text-align: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}

.gate-version-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.gate-safe-tip {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

/* ==========================================================================
   App OTA Update Modal & Progress Bar
   ========================================================================== */
.app-update-box {
  max-width: 480px;
}

.update-info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
}

.update-version-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.update-ver-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.update-ver-val {
  font-size: 16px;
  font-weight: 800;
  color: #4f46e5;
}

.update-size-badge {
  font-size: 11px;
  font-weight: 700;
  background: #eef2ff;
  color: #4f46e5;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}

.update-notes-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.update-notes-content {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
  white-space: pre-line;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
}

.update-progress-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
  animation: fadeIn 0.2s ease;
}

.update-progress-bar-bg {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.update-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #10b981);
  border-radius: 8px;
  transition: width 0.15s ease-out;
}

.update-progress-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.app-update-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

/* ==========================================================================
   Spaced Repetition + Cyber Gamification Subsystem Styles
   ========================================================================== */

/* Fullscreen Particle & Screen FX Layer */
.game-canvas-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99998;
}

.game-screen-flash {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99990;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.game-screen-flash.flash-red {
  opacity: 1;
  background: rgba(239, 68, 68, 0.22);
  box-shadow: inset 0 0 100px rgba(220, 38, 38, 0.85);
  animation: flashShakeAnim 0.4s ease-out forwards;
}

.game-screen-flash.flash-green {
  opacity: 1;
  background: rgba(16, 185, 129, 0.2);
  box-shadow: inset 0 0 90px rgba(16, 185, 129, 0.8);
  animation: flashGreenAnim 0.6s ease-out forwards;
}

.game-screen-flash.flash-domain {
  opacity: 1;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow: inset 0 0 150px rgba(168, 85, 247, 0.9);
  animation: domainBurstAnim 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes flashShakeAnim {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 6px); }
  40% { transform: translate(8px, -6px); }
  60% { transform: translate(-5px, 3px); }
  80% { transform: translate(4px, -2px); }
  100% { transform: translate(0, 0); opacity: 0; }
}

@keyframes flashGreenAnim {
  0% { opacity: 0.9; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1); }
}

@keyframes domainBurstAnim {
  0% { opacity: 0; transform: scale(0.9); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}

/* Golden Slash Effect (5 Combo - Blade Wave) */
#game-golden-slash,
.game-golden-slash {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 0;
  height: 8px;
  background: linear-gradient(90deg, transparent 0%, rgba(251, 191, 36, 0.4) 15%, #ffffff 50%, rgba(251, 191, 36, 0.4) 85%, transparent 100%);
  box-shadow: 0 0 40px #fbbf24, 0 0 80px #f59e0b, 0 0 120px #ffffff;
  transform: translate(-50%, -50%) rotate(-30deg);
  pointer-events: none !important;
  z-index: 99995 !important;
  opacity: 0;
}

#game-golden-slash.slash-active,
.game-golden-slash.slash-active {
  animation: slashAnimation 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slashAnimation {
  0% { width: 0; opacity: 0; transform: translate(-50%, -50%) rotate(-30deg) scaleY(0.5); }
  25% { width: 160vw; opacity: 1; transform: translate(-50%, -50%) rotate(-30deg) scaleY(1.8); }
  70% { width: 180vw; opacity: 0.9; transform: translate(-50%, -50%) rotate(-30deg) scaleY(1); }
  100% { width: 200vw; opacity: 0; transform: translate(-50%, -50%) rotate(-30deg) scaleY(0.2); }
}

/* Milestone Central Bouncing Popup (Cyber Neon Card) */
#game-milestone-banner,
.game-milestone-banner {
  position: fixed !important;
  top: 45% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) scale(1);
  z-index: 99999 !important;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.98) 0%, rgba(3, 7, 18, 0.99) 100%) !important;
  border: 3px solid #fbbf24 !important;
  border-radius: 32px !important;
  padding: 32px 56px !important;
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 0 100px rgba(245, 158, 11, 0.85), 0 30px 80px rgba(0, 0, 0, 0.95), inset 0 0 30px rgba(251, 191, 36, 0.25) !important;
  backdrop-filter: blur(28px) !important;
  pointer-events: none !important;
  min-width: 340px !important;
  max-width: 92vw !important;
}

#game-milestone-banner.hidden,
.game-milestone-banner.hidden {
  display: none !important;
}

.milestone-glow-ring {
  position: absolute;
  inset: -12px;
  border-radius: 40px;
  background: conic-gradient(from 0deg, #fbbf24, #ec4899, #6366f1, #06b6d4, #fbbf24);
  filter: blur(16px);
  opacity: 0.65;
  z-index: -1;
  animation: glowRingRotate 3s linear infinite;
}

@keyframes glowRingRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.milestone-badge-icon {
  font-size: 58px;
  line-height: 1;
  margin-bottom: 8px;
  animation: badgePopAnim 1.2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.8));
}

.milestone-combo-num {
  font-size: 3.2rem;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff 0%, #fbbf24 45%, #f59e0b 80%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 25px rgba(245, 158, 11, 0.8));
}

.milestone-title {
  font-size: 1.65rem;
  font-weight: 900;
  color: #ffffff;
  margin-top: 6px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.milestone-sub {
  font-size: 1.05rem;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes milestoneBounceAnim {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(-10deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.18) rotate(3deg); }
  30% { transform: translate(-50%, -50%) scale(0.96) rotate(-1deg); }
  42% { transform: translate(-50%, -50%) scale(1.04); }
  52% { transform: translate(-50%, -50%) scale(1); }
  85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.85); }
}

@keyframes badgePopAnim {
  0% { transform: scale(1) rotate(-8deg); }
  100% { transform: scale(1.25) rotate(8deg); }
}

/* 4-Combo Pulsing Breathing Anticipation */
.combo-pulsing {
  animation: comboPulsingAnim 0.65s infinite alternate ease-in-out !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.85) !important;
}

@keyframes comboPulsingAnim {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.14); filter: brightness(1.4); }
}

/* 50-Combo Aurora Legend Dynamic Background Theme */
body.theme-aurora {
  background: linear-gradient(-45deg, #030712, #0f172a, #1e1b4b, #042f2e, #1e1b4b) !important;
  background-size: 400% 400% !important;
  animation: auroraFlowAnim 12s ease infinite !important;
}

@keyframes auroraFlowAnim {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Cyber HUD Capsules (Level, XP, Lives, Coins) */
.hud-level-capsule {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 4px 10px;
}

.level-badge {
  font-size: 0.82rem;
  font-weight: 900;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.18);
  padding: 2px 6px;
  border-radius: 6px;
}

.xp-mini-wrap {
  width: 75px;
  height: 8px;
  background: #334155;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.xp-mini-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.xp-mini-text {
  font-size: 10px;
  color: #cbd5e1;
  font-weight: 700;
}

.lives-item {
  display: flex;
  align-items: center;
  gap: 2px;
}

.heart-icon {
  font-size: 18px;
  display: inline-block;
  transition: transform 0.25s, opacity 0.25s, filter 0.25s;
}

.heart-icon.heart-lost {
  opacity: 0.25;
  transform: scale(0.8);
  filter: grayscale(1);
}

.heart-icon.heart-gain {
  animation: heartPulseGain 0.6s ease-out;
}

@keyframes heartPulseGain {
  0% { transform: scale(0.5); opacity: 0.2; }
  50% { transform: scale(1.45); opacity: 1; filter: drop-shadow(0 0 10px #10b981); }
  100% { transform: scale(1); opacity: 1; }
}

.coins-item {
  background: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #f59e0b !important;
}

/* Life Recovery HUD Card inside Flashcard View */
.life-recovery-card {
  margin-top: 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 16px;
  width: 100%;
  box-sizing: border-box;
}

.recovery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.recovery-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recovery-count b {
  color: #10b981;
  font-size: 1rem;
}

.recovery-bar-bg {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.recovery-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 4px;
  transition: width 0.35s ease-out;
}

/* Mistake Buyback Modal & Cards */
.mistakes-modal-box {
  max-width: 640px !important;
}

.buyback-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #fcd34d;
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.account-coin-badge {
  font-size: 34px;
  margin-right: 12px;
}

.account-info {
  flex: 1;
}

.account-title {
  font-size: 0.8rem;
  color: #92400e;
  font-weight: 700;
}

.account-balance b {
  font-size: 1.6rem;
  font-weight: 900;
  color: #78350f;
}

.account-balance .unit {
  font-size: 0.9rem;
  color: #92400e;
}

.mistakes-list-scroll {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 16px;
}

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

.mistake-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1.5px solid #fecdd3;
  border-radius: 16px;
  padding: 14px 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mistake-item-card:hover {
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.12);
  transform: translateY(-1px);
}

.mistake-word-info .m-word {
  font-size: 1.2rem;
  font-weight: 800;
  color: #e11d48;
}

.mistake-word-info .m-pho {
  font-size: 0.85rem;
  color: #64748b;
  margin-left: 6px;
}

.mistake-word-info .m-mean {
  font-size: 0.9rem;
  color: #334155;
  margin-top: 3px;
}

.mistake-word-info .m-example {
  font-size: 0.8rem;
  color: #64748b;
  font-style: italic;
  margin-top: 2px;
}

.mistake-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-buyback-item {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-buyback-item:hover {
  background: #b45309;
  transform: scale(1.05);
}

/* ==========================================================================
   Full Mobile Responsive Overhaul (Smart HUD, Anti-Overflow, Fluid Cards)
   ========================================================================== */
/* Dropdown Menu Items and Badges */
.nav-menu-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 6px 0;
}

.nav-menu-item .badge {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
}

.badge-info {
  background: #e0f2fe;
  color: #0284c7;
}

.badge-success {
  background: #dcfce7;
  color: #16a34a;
}

.badge-danger {
  background: #fee2e2;
  color: #dc2626;
}

/* ==========================================================================
   Full Mobile Responsive Overhaul (Strict Anti-Overflow, Smart Mobile HUD)
   ========================================================================== */
@media (max-width: 768px) {
  *, *::before, *::after {
    box-sizing: border-box !important;
  }

  html, body {
    max-width: 100vw !important;
    width: 100% !important;
    overflow-x: hidden !important;
    position: relative !important;
  }

  #app, .app-layout, .app-hud, .main-content, .container, .view, .dashboard-grid {
    max-width: 100vw !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .app-hud {
    padding: 6px 10px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .hud-inner {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 6px !important;
    box-sizing: border-box !important;
  }

  /* Row 1: Brand & Actions (Logo + Level + 更多 + 用户) */
  .hud-top-bar {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .hud-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .hud-brand {
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .logo-icon {
    width: 30px !important;
    height: 30px !important;
    font-size: 1rem !important;
    border-radius: 8px !important;
  }

  .brand-title {
    font-size: 0.92rem !important;
  }

  .brand-badge {
    font-size: 0.62rem !important;
    padding: 1px 4px !important;
    margin-left: 2px !important;
  }

  .brand-sub {
    display: none !important;
  }

  .hud-level-capsule {
    display: inline-flex !important;
    padding: 2px 5px !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
  }

  .level-badge {
    font-size: 0.70rem !important;
    padding: 1px 3px !important;
  }

  .xp-mini-wrap {
    width: 34px !important;
    height: 5px !important;
  }

  .xp-mini-text {
    font-size: 8.5px !important;
  }

  /* Right Buttons in Row 1: 【📑 更多 ▾】 + 【👤 用户】 */
  .hud-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }

  .nav-dropdown-wrap {
    position: relative !important;
  }

  .nav-dropdown-btn {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    border-radius: 8px !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
  }

  .nav-dropdown-menu {
    position: fixed !important;
    top: 50px !important;
    right: 10px !important;
    left: auto !important;
    width: 250px !important;
    max-width: 90vw !important;
    z-index: 99999 !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2) !important;
    padding: 8px !important;
  }

  .hud-user-area {
    position: relative !important;
    max-width: 105px !important;
    flex-shrink: 0 !important;
  }

  .user-avatar-pill {
    padding: 3px 6px !important;
    font-size: 0.72rem !important;
  }

  .user-name-text {
    max-width: 50px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .user-menu-dropdown {
    position: fixed !important;
    top: 50px !important;
    right: 8px !important;
    left: auto !important;
    width: 220px !important;
    max-width: 90vw !important;
    z-index: 99999 !important;
  }

  /* Row 2: Stats Row (Lives + Combo + Coins) */
  .hud-center {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    padding-top: 2px !important;
  }

  .hud-stats-group {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    gap: 6px !important;
    box-sizing: border-box !important;
  }

  .hud-item {
    padding: 3px 8px !important;
    font-size: 0.72rem !important;
    border-radius: 7px !important;
    flex: 1 !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .heart-icon {
    font-size: 13px !important;
  }

  /* Main Container & Cards on Mobile */
  .main-content, .container, .app-container {
    padding: 10px 8px !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .hero-card {
    padding: 16px 14px !important;
    flex-direction: column !important;
    text-align: center !important;
    gap: 14px !important;
  }

  .hero-content h1 {
    font-size: 1.22rem !important;
    line-height: 1.3 !important;
  }

  .hero-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .hero-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .custom-generator-card {
    padding: 14px !important;
  }

  .generator-controls {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .grade-checkbox-group {
    flex-direction: column !important;
    gap: 6px !important;
  }

  .custom-check-pill {
    width: 100% !important;
  }

  .generator-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .generator-actions .btn {
    width: 100% !important;
  }

  .deck-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .srs-banner-card {
    padding: 16px 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .srs-banner-card .btn {
    width: 100% !important;
  }

  .gizmo-card {
    padding: 16px 12px !important;
  }

  .card-question {
    font-size: 1.05rem !important;
    line-height: 1.5 !important;
  }

  .choice-option {
    padding: 10px 12px !important;
    font-size: 0.92rem !important;
  }

  .feedback-banner {
    padding: 12px 14px !important;
    flex-direction: column !important;
    gap: 8px !important;
    text-align: center !important;
  }

  .feedback-actions {
    width: 100% !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  .feedback-actions .btn {
    width: 100% !important;
  }

  .flip-stage {
    height: auto !important;
    min-height: 360px !important;
  }

  .flip-card-front, .flip-card-back {
    padding: 16px 12px !important;
  }

  .flip-word-title {
    font-size: 1.7rem !important;
  }

  .flip-rating-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .btn-rate {
    padding: 8px 4px !important;
    font-size: 0.8rem !important;
    width: 100% !important;
  }

  .modal-box, .audio-modal-box, .mistakes-modal-box, .records-modal-box, .user-manager-box, .early-exit-card {
    width: 94vw !important;
    max-width: 94vw !important;
    padding: 16px !important;
    margin: 10px auto !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .game-milestone-banner {
    width: 88vw !important;
    padding: 20px 16px !important;
  }

  .milestone-combo-num {
    font-size: 2rem !important;
  }

  .milestone-title {
    font-size: 1.15rem !important;
  }
}


/* ==========================================================================
   v1.17 Web 端在线考试大厅 (Exam Hall) — 对齐移动端考试系统
   ========================================================================== */
#view-exam { max-width: 860px; margin: 0 auto; }

/* ---- 管理员试卷定制区 ---- */
.exam-hall-gen { margin-bottom: 20px; }
.exam-gen-card { border: 2px dashed rgba(0, 210, 106, 0.45); }
.exam-gen-result-bar {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--color-success-bg);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #047857;
  font-size: 0.9rem;
  line-height: 1.7;
  font-weight: 600;
}

/* ---- 考试大厅头部 ---- */
.exam-hall-head { text-align: center; margin: 6px 0 18px; }
.exam-hall-head h2 { font-size: 1.5rem; font-weight: 900; color: var(--text-primary); }
.exam-hall-head p { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }
.exam-hall-records-head {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 26px 0 12px;
  padding-left: 10px;
  border-left: 4px solid var(--gizmo-primary);
}

/* ---- 试卷卡片列表 ---- */
.exam-paper-list-web,
.exam-records-list-web {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.exam-paper-card-web {
  background: var(--gizmo-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.exam-paper-card-web:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.exam-paper-title-web { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); }
.exam-paper-code-web { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; font-family: ui-monospace, Consolas, monospace; }
.exam-paper-meta-web { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.exam-meta-chip-web {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-secondary);
}
.exam-meta-chip-web.hl { background: var(--gizmo-primary-light); color: #047857; }
.exam-meta-chip-web.score { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.exam-paper-foot-web {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px dashed #e2e8f0;
  padding-top: 10px;
}
.exam-paper-creator-web { font-size: 0.72rem; color: var(--text-muted); }

/* ---- 我的考试记录 ---- */
.exam-record-item-web {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--gizmo-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 16px;
}
.exam-record-score-web {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--gizmo-primary);
  min-width: 72px;
  text-align: center;
}
.exam-record-info-web { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.exam-record-info-web b { font-size: 0.88rem; color: var(--text-primary); }
.exam-record-sub-web { font-size: 0.72rem; color: var(--text-muted); }

/* ---- 考试运行区 ---- */
.exam-run-top-web {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.exam-run-title-web { font-size: 1rem; font-weight: 800; color: var(--text-primary); flex: 1; text-align: center; min-width: 140px; }
.exam-timer-web {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 900;
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-radius: var(--radius-md);
  padding: 6px 16px;
  letter-spacing: 1px;
}
.exam-timer-web.danger { color: #dc2626; background: rgba(239, 68, 68, 0.1); animation: examTimerBlink 1s infinite; }
@keyframes examTimerBlink { 50% { opacity: 0.55; } }

.exam-progress-row-web { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.exam-progress-bar-web {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}
.exam-progress-fill-web {
  height: 100%;
  background: linear-gradient(90deg, var(--gizmo-primary), #34d399);
  border-radius: var(--radius-full);
  transition: width 0.3s;
}
.exam-progress-text-web { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }

/* ---- 题目卡片 ---- */
.exam-q-card-web {
  background: var(--gizmo-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.exam-q-head-web {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.exam-q-type-web {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}
.exam-q-type-web.t-blank { background: rgba(139, 92, 246, 0.12); color: #6d28d9; }
.exam-q-type-web.t-trans { background: rgba(236, 72, 153, 0.1); color: #be185d; }
.exam-q-score-web { font-size: 0.78rem; font-weight: 800; color: #b45309; }
.exam-q-stem-web { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); line-height: 1.6; margin-bottom: 4px; }
.exam-q-sub-web { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }
.exam-q-sub-web.stem-cn-web { font-size: 1.02rem; font-weight: 700; }
.blank-slot-web {
  display: inline-block;
  min-width: 84px;
  border-bottom: 2.5px solid var(--gizmo-primary);
  text-align: center;
  color: var(--gizmo-primary);
  font-weight: 900;
  letter-spacing: 2px;
}

/* ---- 选项与翻译输入 ---- */
.exam-choices-web { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.exam-choice-web {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  font-family: var(--font-family);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.exam-choice-web:hover { border-color: var(--gizmo-primary); background: var(--gizmo-primary-light); }
.exam-choice-web.selected {
  border-color: var(--gizmo-primary);
  background: var(--gizmo-primary-light);
  color: #047857;
  font-weight: 800;
}
.exam-choice-web.selected b { color: var(--gizmo-primary); }
.exam-trans-input-web {
  width: 100%;
  font-family: var(--font-family);
  font-size: 1rem;
  padding: 13px 16px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  outline: none;
  margin-top: 10px;
  background: #f8fafc;
  color: var(--text-primary);
  transition: border-color 0.15s;
}
.exam-trans-input-web:focus { border-color: var(--gizmo-primary); background: #fff; }

/* ---- 切题导航 & 答题卡 ---- */
.exam-nav-btns-web { display: flex; gap: 10px; margin: 16px 0 6px; }
.exam-nav-btns-web .btn { flex: 1; justify-content: center; }
.exam-kbd-tip { text-align: center; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 10px; }
.exam-nav-dots-web { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 4px; }
.exam-nav-dot-web {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}
.exam-nav-dot-web.answered { background: var(--gizmo-primary-light); border-color: rgba(0, 210, 106, 0.5); color: #047857; }
.exam-nav-dot-web.current { outline: 2.5px solid var(--gizmo-primary); outline-offset: 1px; transform: scale(1.06); }
.exam-run-actions-web { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.exam-run-actions-web .btn { flex: 1; justify-content: center; min-width: 140px; }
.exam-empty-tip {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 30px 12px;
  background: var(--gizmo-card-bg);
  border: 1px dashed #e2e8f0;
  border-radius: var(--radius-md);
}

/* ---- 考试结果区 ---- */
.exam-result-hero-web {
  text-align: center;
  background: var(--gizmo-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  margin-bottom: 18px;
}
.exam-result-emoji-web { font-size: 3rem; }
.exam-result-score-web { font-size: 2.6rem; font-weight: 900; color: var(--gizmo-primary); line-height: 1.15; }
.exam-result-full-web { font-size: 1rem; color: var(--text-secondary); font-weight: 700; }
.exam-result-percent-web {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  background: rgba(0, 210, 106, 0.12);
  color: #047857;
  margin: 8px 0 10px;
}
.exam-result-percent-web.mid { background: rgba(245, 158, 11, 0.13); color: #b45309; }
.exam-result-percent-web.low { background: rgba(239, 68, 68, 0.13); color: #dc2626; }
.exam-result-meta-web { font-size: 0.75rem; color: var(--text-muted); line-height: 1.8; }
.exam-auto-flag { color: #dc2626; }
.exam-section-title-web { font-size: 1rem; font-weight: 800; color: var(--text-primary); margin: 18px 0 10px; }
.exam-section-list-web { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.exam-section-stat-web {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gizmo-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.exam-section-stat-web span:last-child { color: var(--gizmo-primary); font-weight: 900; }
.exam-detail-list-web { display: flex; flex-direction: column; gap: 8px; }
.exam-detail-item-web {
  background: var(--gizmo-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.exam-detail-item-web.correct { border-left: 4px solid #10b981; }
.exam-detail-item-web.wrong { border-left: 4px solid #ef4444; }
.exam-detail-item-web.partial { border-left: 4px solid #f59e0b; }
.exam-detail-q-web { font-weight: 800; color: var(--text-primary); }
.exam-detail-ans-web b { color: #047857; }
.exam-detail-mark-web {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}
.exam-detail-mark-web.correct { background: rgba(16, 185, 129, 0.14); color: #047857; }
.exam-detail-mark-web.wrong { background: rgba(239, 68, 68, 0.14); color: #dc2626; }
.exam-detail-mark-web.partial { background: rgba(245, 158, 11, 0.14); color: #b45309; }

@media (max-width: 768px) {
  .exam-q-card-web { padding: 16px 14px !important; }
  .exam-q-stem-web { font-size: 1.08rem !important; }
  .exam-nav-dot-web { width: 30px !important; height: 30px !important; }
  .exam-nav-dots-web { gap: 5px !important; }
  .exam-record-item-web { flex-wrap: wrap; }
}


/* ==========================================================================
   v1.17 Web 端暗黑主题 (html[data-theme="dark"]，由 WebSettings 切换)
   ========================================================================== */
html[data-theme="dark"] {
  --gizmo-bg: #0b1120;
  --gizmo-card-bg: #131c31;
  --gizmo-dark: #e2e8f0;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-error-bg: rgba(239, 68, 68, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--gizmo-bg); }
html[data-theme="dark"] .gizmo-card,
html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .srs-banner-card,
html[data-theme="dark"] .custom-generator-card,
html[data-theme="dark"] .life-recovery-card { background: var(--gizmo-card-bg) !important; border-color: rgba(148, 163, 184, 0.2) !important; }
html[data-theme="dark"] .exam-paper-card-web,
html[data-theme="dark"] .exam-record-item-web,
html[data-theme="dark"] .exam-q-card-web,
html[data-theme="dark"] .exam-result-hero-web,
html[data-theme="dark"] .exam-section-stat-web,
html[data-theme="dark"] .exam-detail-item-web,
html[data-theme="dark"] .exam-empty-tip { background: var(--gizmo-card-bg); border-color: rgba(148, 163, 184, 0.2); }
html[data-theme="dark"] .exam-choice-web,
html[data-theme="dark"] .exam-trans-input-web,
html[data-theme="dark"] .exam-nav-dot-web { background: rgba(148, 163, 184, 0.08); border-color: rgba(148, 163, 184, 0.25); color: var(--text-primary); }
html[data-theme="dark"] .exam-trans-input-web:focus { background: rgba(148, 163, 184, 0.05); }
html[data-theme="dark"] .exam-meta-chip-web { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary); }
html[data-theme="dark"] .exam-progress-bar-web,
html[data-theme="dark"] .recovery-bar-bg { background: rgba(148, 163, 184, 0.18); }
html[data-theme="dark"] .exam-choice-web.selected,
html[data-theme="dark"] .exam-nav-dot-web.answered { background: rgba(0, 210, 106, 0.15); color: #34d399; }
html[data-theme="dark"] .exam-choice-web.selected b { color: #34d399; }
html[data-theme="dark"] .exam-q-type-web { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
html[data-theme="dark"] .exam-detail-ans-web b,
html[data-theme="dark"] .exam-section-stat-web span:last-child,
html[data-theme="dark"] .exam-result-score-web,
html[data-theme="dark"] .exam-record-score-web { color: #34d399; }


/* ==========================================================================
   v1.17 Web 首页底部：在线考试入口卡片（平铺 ≤4 张，超出折叠「更多...」）
   ========================================================================== */
.home-exam-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 26px;
}
.home-exam-tip {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 26px 12px;
  background: var(--gizmo-card-bg);
  border: 1px dashed #e2e8f0;
  border-radius: var(--radius-md);
}
.home-exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.home-exam-card {
  position: relative;
  background: var(--gizmo-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 18px 16px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.home-exam-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(0, 210, 106, 0.45);
}
.home-exam-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--gizmo-primary-light);
  color: #047857;
}
.home-exam-icon { font-size: 1.6rem; }
.home-exam-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.45;
}
.home-exam-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.home-exam-best {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}
.home-exam-best.new { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.home-exam-cta {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--gizmo-primary);
}
.home-exam-more {
  align-self: center;
  min-width: 200px;
  justify-content: center;
}
html[data-theme="dark"] .home-exam-card,
html[data-theme="dark"] .home-exam-tip { background: var(--gizmo-card-bg); border-color: rgba(148, 163, 184, 0.2); }
html[data-theme="dark"] .home-exam-card:hover { border-color: rgba(52, 211, 153, 0.5); }
html[data-theme="dark"] .home-exam-badge { background: rgba(0, 210, 106, 0.15); color: #34d399; }
html[data-theme="dark"] .home-exam-cta { color: #34d399; }
html[data-theme="dark"] .home-exam-best { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
html[data-theme="dark"] .home-exam-best.new { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }


/* ==========================================================================
   v1.17 Web 设置中心（独立设置页，替代顶部下拉菜单收纳）
   ========================================================================== */
#view-settings { max-width: 720px; margin: 0 auto; }
.settings-wrap { display: flex; flex-direction: column; gap: 18px; }
.settings-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 6px;
}
.settings-page-title { flex: 1; text-align: center; font-size: 1.35rem; font-weight: 900; color: var(--text-primary); margin: 0; }
.settings-head-spacer { width: 96px; }
.settings-card {
  background: var(--gizmo-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.settings-card-title {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--text-secondary);
  letter-spacing: 1px;
  padding: 14px 18px 10px;
  text-transform: uppercase;
}
.settings-card-body { display: flex; flex-direction: column; }
.settings-row-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font-family: var(--font-family);
  background: transparent;
  border: none;
  border-top: 1px solid #f1f5f9;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.15s;
}
.settings-row-btn:first-child { border-top: none; }
.settings-row-btn:hover { background: var(--gizmo-primary-light); }
.settings-row-icon {
  font-size: 1.35rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.settings-row-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-row-text b { font-size: 0.92rem; font-weight: 800; color: var(--text-primary); }
.settings-row-text small { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }
.settings-row-arrow { font-size: 1.2rem; color: var(--text-muted); }
.settings-version-info {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
  border-top: 1px solid #f1f5f9;
}
html[data-theme="dark"] .settings-card { background: var(--gizmo-card-bg); border-color: rgba(148, 163, 184, 0.2); }
html[data-theme="dark"] .settings-row-btn:hover { background: rgba(148, 163, 184, 0.08); }
html[data-theme="dark"] .settings-row-btn { border-top-color: rgba(148, 163, 184, 0.12); }
html[data-theme="dark"] .settings-row-icon { background: rgba(148, 163, 184, 0.1); }
html[data-theme="dark"] .settings-version-info { border-top-color: rgba(148, 163, 184, 0.12); }


/* ==========================================================================
   AI 闪卡生成器（v1.19，管理员专属）
   ========================================================================== */
.ai-gen-box { max-width: 860px; }
.ai-gen-body {
  padding: 18px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(90vh - 130px);
  overflow-y: auto;
}
.ai-gen-form {
  display: grid;
  grid-template-columns: 1fr 160px 130px 180px;
  gap: 14px;
  align-items: end;
  padding: 16px;
  background: var(--gizmo-card-bg, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: var(--radius-lg, 16px);
}
.ai-gen-field { display: flex; flex-direction: column; gap: 6px; }
.ai-gen-field .control-label { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary, #64748b); }
.ai-gen-field-btn .btn { width: 100%; }
@media (max-width: 720px) {
  .ai-gen-form { grid-template-columns: 1fr 1fr; }
  .ai-gen-field-topic { grid-column: 1 / -1; }
  .ai-gen-field-btn { grid-column: 1 / -1; }
}
.ai-gen-stats {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
  border: 1px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md, 12px);
  padding: 10px 14px;
}
.ai-gen-result-head { font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; color: var(--text-primary); }
.ai-gen-skip-tip { font-size: 0.72rem; font-weight: 500; color: var(--text-muted, #94a3b8); }
.ai-gen-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.ai-gen-card {
  background: #fff;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}
html[data-theme="dark"] .ai-gen-card { background: var(--gizmo-card-bg); border-color: rgba(148, 163, 184, 0.2); }
.ai-gen-card-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ai-gen-word { font-size: 1.05rem; font-weight: 800; color: var(--color-primary, #6366f1); }
.ai-gen-phonetic { font-size: 0.72rem; color: var(--text-muted, #94a3b8); }
.ai-gen-tag {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary, #6366f1);
}
.ai-gen-tag-diff { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.ai-gen-meaning { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.ai-gen-ex { font-size: 0.76rem; color: var(--text-secondary, #64748b); line-height: 1.5; font-style: italic; }
.ai-gen-ex-cn { font-size: 0.72rem; color: var(--text-muted, #94a3b8); line-height: 1.4; }
.ai-gen-empty {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  padding: 18px;
}
.ai-gen-lib-head { font-size: 0.8rem; font-weight: 800; margin-bottom: 8px; color: var(--text-primary); }
.ai-gen-lib-list { display: flex; flex-direction: column; gap: 6px; }
.ai-gen-lib-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: var(--gizmo-card-bg, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  font-size: 0.78rem;
}
.ai-gen-lib-item b { color: var(--color-primary, #6366f1); min-width: 72px; }
.ai-gen-lib-meaning { flex: 1; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-gen-lib-topic {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}




