/* ============================================
   CodeLaunch CSS Variables & Custom Styles
   ============================================ */

/* --- CSS Variables (Light Mode Default) --- */
:root {
  --coral: #FF6B4A;
  --coral-light: #FF8A6F;
  --navy: #1A1A2E;
  --navy-light: #16213E;
  --cream: #FFF8F0;
  --cream-dark: #F0E6D8;
  --mint: #4ECDC4;

  --bg: var(--cream);
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFFAF6;
  --text: var(--navy);
  --text-secondary: #5A5A72;
  --text-muted: #9A9AB0;
  --border: #E8E0D6;
  --shadow: rgba(26, 26, 46, 0.08);
  --shadow-lg: rgba(26, 26, 46, 0.14);

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --bg: #0F0F1A;
  --bg-card: #1C1C30;
  --bg-card-hover: #24243C;
  --text: #EAEAF0;
  --text-secondary: #A0A0BA;
  --text-muted: #6A6A84;
  --border: #2E2E48;
  --shadow: rgba(0, 0, 0, 0.25);
  --shadow-lg: rgba(0, 0, 0, 0.4);
  --cream: #0F0F1A;
  --cream-dark: #1C1C30;
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes confetti {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(600px) rotate(720deg); opacity: 0; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

@keyframes progressFill {
  from { stroke-dashoffset: var(--progress-offset-start, 283); }
  to { stroke-dashoffset: var(--progress-offset-end, 0); }
}

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

/* Utility classes */
.animate-fade-in { animation: fadeIn 0.4s ease both; }
.animate-slide-up { animation: slideUp 0.5s ease both; }
.animate-slide-down { animation: slideDown 0.5s ease both; }
.animate-pulse { animation: pulse 2s ease infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-shake { animation: shake 0.4s ease; }
.animate-count-up { animation: countUp 0.6s ease both; }

/* ============================================
   Terminal Simulation
   ============================================ */

.terminal {
  background: #0D1117;
  color: #39FF14;
  font-family: 'Fira Code', 'Courier New', monospace;
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.7;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.terminal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.015) 2px,
    rgba(255, 255, 255, 0.015) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.terminal-header {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #21262D;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal-dot.red { background: #FF5F56; }
.terminal-dot.yellow { background: #FFBD2E; }
.terminal-dot.green { background: #27C93F; }

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background: #39FF14;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

.terminal-line {
  position: relative;
  padding-left: 20px;
}

.terminal-line::before {
  content: '$';
  position: absolute;
  left: 0;
  color: #8B949E;
}

.terminal-output {
  color: #C9D1D9;
  padding-left: 20px;
}

/* ============================================
   Badge Cards
   ============================================ */

.badge-card {
  width: 100px;
  text-align: center;
  padding: 16px 8px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 2px solid var(--border);
  transition: all var(--transition);
  cursor: default;
}

.badge-card.unlocked {
  border-color: var(--coral);
  box-shadow: 0 4px 16px rgba(255, 107, 74, 0.2);
}

.badge-card.unlocked:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 107, 74, 0.3);
}

.badge-card.locked {
  opacity: 0.45;
  filter: grayscale(1);
}

.badge-card .badge-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.badge-card .badge-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.badge-card.locked .badge-icon::after {
  content: '';
  display: block;
  font-size: 16px;
  margin-top: 4px;
}

/* ============================================
   SVG Progress Ring
   ============================================ */

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring__bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.progress-ring__fill {
  fill: none;
  stroke: var(--coral);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  animation: progressFill 1.2s ease forwards;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-card);
  color: var(--text);
  border-left: 4px solid var(--coral);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  box-shadow: 0 6px 24px var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
  font-size: 14px;
  animation: toastIn 0.35s ease both;
}

.toast.toast-exit {
  animation: toastOut 0.3s ease both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast.toast-success { border-left-color: var(--mint); }
.toast.toast-error { border-left-color: #E74C3C; }
.toast.toast-info { border-left-color: #3498DB; }

/* ============================================
   Page Transitions
   ============================================ */

.page {
  animation: fadeIn 0.35s ease both;
}

.page-enter {
  animation: slideUp 0.4s ease both;
}

.page-exit {
  animation: fadeOut 0.25s ease both;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ============================================
   Card Hover Lift
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow-lg);
  background: var(--bg-card-hover);
}

.card-clickable {
  cursor: pointer;
}

/* ============================================
   Responsive Helpers
   ============================================ */

.hide-mobile { display: block; }
.show-mobile { display: none; }

@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ============================================
   Custom Scrollbar
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}

/* ============================================
   Confetti Canvas Overlay
   ============================================ */

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

/* ============================================
   Skeleton Loading Shimmer
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--border) 25%,
    var(--cream-dark) 50%,
    var(--border) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 10px;
  width: 80%;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 60%; }

.skeleton-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-card {
  height: 160px;
  border-radius: var(--radius);
}

/* ============================================
   Mobile Drawer Overlay
   ============================================ */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 8000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--bg);
  z-index: 8001;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.drawer-overlay.open + .drawer,
.drawer.open {
  transform: translateX(0);
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ============================================
   Misc Utilities
   ============================================ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.no-select {
  user-select: none;
}

/* ============================================
   Glossary Component
   ============================================ */

.glossary-page {
  padding: 80px 20px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

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

.glossary-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
}
.glossary-title__zh { }
.glossary-title__separator { color: var(--text-muted); }
.glossary-title__en { font-weight: 400; color: var(--text-secondary); font-size: 1.5rem; }

.glossary-wotd {
  background: linear-gradient(135deg, var(--coral), var(--coral-light, #FF8A6F));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
}
.glossary-wotd__label { font-size: 0.85rem; font-weight: 600; opacity: 0.85; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.glossary-wotd__star { font-size: 1.1rem; }
.glossary-wotd__term { font-size: 1.8rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.glossary-wotd__zh { font-size: 1.1rem; margin-top: 4px; }
.glossary-wotd__pinyin { font-style: italic; opacity: 0.7; font-size: 0.9rem; margin-top: 2px; }
.glossary-wotd__def { margin-top: 10px; font-size: 0.95rem; line-height: 1.5; }
.glossary-wotd__example { margin-top: 10px; }
.glossary-wotd__example code {
  background: rgba(255,255,255,0.15);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  display: inline-block;
}

.glossary-controls { margin-bottom: 24px; }

.glossary-search {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
  margin-bottom: 16px;
}
.glossary-search:focus { border-color: var(--coral); }

.glossary-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.glossary-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.glossary-tab:hover { border-color: var(--coral); color: var(--coral); }
.glossary-tab--active { background: var(--coral); color: #fff; border-color: var(--coral); }

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

.glossary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
}
.glossary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--shadow);
}
.glossary-card__term {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--coral);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 4px;
}
.glossary-card__zh { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.glossary-card__pinyin { font-size: 0.8rem; font-style: italic; color: var(--text-muted); margin-bottom: 8px; }
.glossary-card__def { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }
.glossary-card__example {
  background: var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.glossary-card__example code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text);
}

.glossary-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .glossary-grid { grid-template-columns: 1fr; }
  .glossary-title { font-size: 1.5rem; }
  .glossary-title__en { font-size: 1.1rem; }
}

/* ============================================
   Gallery Component
   ============================================ */

.gallery-page {
  padding: 80px 20px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.gallery-header { margin-bottom: 24px; }
.gallery-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
}
.gallery-title__en { font-weight: 400; color: var(--text-secondary); font-size: 1.5rem; }
.gallery-subtitle { color: var(--text-secondary); margin-top: 8px; font-size: 1.05rem; }

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.gallery-filter {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.gallery-filter:hover { border-color: var(--coral); color: var(--coral); }
.gallery-filter--active { background: var(--coral); color: #fff; border-color: var(--coral); }

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

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}
.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow-lg);
}
.gallery-card__thumb {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-card__icon { font-size: 3rem; }
.gallery-card__body { padding: 20px; }
.gallery-card__title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.gallery-card__desc { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.gallery-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.gallery-tag {
  background: var(--cream-dark);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}
.gallery-card__btn {
  width: 100%;
  padding: 10px;
  background: var(--coral);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--transition);
}
.gallery-card__btn:hover { background: #e55a3a; }

.gallery-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.gallery-inspiration { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.gallery-inspiration__title { font-size: 1.5rem; font-weight: 700; color: var(--text); text-align: center; }
.gallery-inspiration__sub { display: block; font-weight: 400; color: var(--text-muted); font-size: 1rem; }
.gallery-inspiration__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.gallery-idea-card {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  transition: all var(--transition);
}
.gallery-idea-card:hover { border-color: var(--coral); transform: translateY(-2px); }
.gallery-idea-card__icon { font-size: 2rem; margin-bottom: 8px; }
.gallery-idea-card__title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.gallery-idea-card__desc { font-size: 0.85rem; color: var(--text-muted); }

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Lesson Component (extracted from lesson.js)
   ============================================ */

.lesson-page { min-height: 100vh; background: var(--bg); padding-top: 0; }

/* Progress Bar */
.lesson-progress-bar { position: fixed; top: 56px; left: 0; right: 0; height: 3px; background: var(--border); z-index: 45; }
.lesson-progress-bar__fill { height: 100%; background: linear-gradient(90deg, var(--coral), var(--coral-light)); transition: width 0.3s ease; border-radius: 0 2px 2px 0; }

/* Header */
.lesson-header { padding: 80px 20px 24px; background: var(--bg); border-bottom: 1px solid var(--border); }
.lesson-header__inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.lesson-back-link { color: var(--text-muted); transition: color var(--transition); flex-shrink: 0; }
.lesson-back-link:hover { color: var(--coral); }
.lesson-day-badge { display: inline-block; background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: var(--radius-full); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px; }
.lesson-title { margin: 0; line-height: 1.3; }
.lesson-title__zh { display: block; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.lesson-title__en { display: block; font-size: 0.95rem; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.lesson-completed-badge { font-size: 24px; margin-left: auto; flex-shrink: 0; }

/* Split Layout */
.lesson-layout { display: flex; max-width: 1200px; margin: 0 auto; gap: 0; min-height: calc(100vh - 200px); }
.lesson-content { flex: 0 0 60%; max-width: 60%; padding: 32px 32px 120px; overflow-y: auto; }
.lesson-terminal-panel { flex: 0 0 40%; max-width: 40%; padding: 32px 24px 32px 0; }
.terminal-panel-wrapper { position: sticky; top: 80px; max-height: calc(100vh - 120px); overflow-y: auto; border-radius: var(--radius); background: #0D1117; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); }

/* Terminal Panel Chrome */
.terminal-panel__topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #21262D; background: #161B22; border-radius: var(--radius) var(--radius) 0 0; }
.terminal-panel__dots { display: flex; gap: 6px; }
.terminal-panel__label { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #8B949E; margin-left: 4px; }
.terminal-panel__body { padding: 16px; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.7; min-height: 200px; display: flex; flex-direction: column; gap: 20px; }
.terminal-panel__empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 200px; padding: 32px; }

/* Terminal Block */
.terminal-block { position: relative; }
.terminal-block__copy-row { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.terminal-copy-btn { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: #8B949E; font-size: 11px; padding: 3px 8px; border-radius: 4px; cursor: pointer; transition: all var(--transition); font-family: inherit; }
.terminal-copy-btn:hover { background: rgba(255,255,255,0.12); color: #C9D1D9; }
.terminal-copy-btn.copied { color: var(--mint); border-color: var(--mint); }
.terminal-prompt { color: #C9D1D9; white-space: pre-wrap; word-break: break-all; }
.terminal-prompt__symbol { color: var(--mint); user-select: none; }
.terminal-prompt__cmd { color: #39FF14; }
.terminal-output-text { color: #8B949E; white-space: pre-wrap; word-break: break-all; margin-top: 4px; padding-left: 16px; }

/* Inline Terminal (mobile) */
.lesson-section--terminal-inline .terminal-block { background: #0D1117; border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.lesson-section--terminal-inline .terminal-block__header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #161B22; border-bottom: 1px solid #21262D; }
.lesson-section--terminal-inline .terminal-block__dots { display: flex; gap: 6px; }
.lesson-section--terminal-inline .terminal-block__title { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #8B949E; }
.lesson-section--terminal-inline .terminal-copy-btn { margin-left: auto; }
.lesson-section--terminal-inline .terminal-block__body { padding: 14px 16px; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.7; }

/* Section base */
.lesson-section { margin-bottom: 28px; }
.section-title { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 14px; }

/* Text */
.lesson-text-zh { font-size: 1.05rem; line-height: 1.8; color: var(--text); margin-bottom: 6px; }
.lesson-text-en { font-size: 0.88rem; line-height: 1.6; color: var(--text-muted); }
.lesson-zh { color: var(--text); }
.lesson-en { display: block; font-size: 0.85em; color: var(--text-muted); margin-top: 2px; }

/* Concept Card */
.concept-card { background: var(--cream); border: 1px solid var(--border); border-left: 4px solid var(--coral); border-radius: var(--radius); padding: 20px 24px; }
[data-theme="dark"] .concept-card { background: var(--bg-card); }
.concept-term { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; font-weight: 700; color: var(--coral); margin-bottom: 10px; padding: 4px 10px; background: rgba(255, 107, 74, 0.08); border-radius: var(--radius-sm); display: inline-block; }
.concept-zh { font-size: 1rem; line-height: 1.7; color: var(--text); margin-bottom: 6px; }
.concept-en { font-size: 0.85rem; line-height: 1.5; color: var(--text-muted); }

/* Steps List */
.step-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.step-item { display: flex; gap: 14px; align-items: flex-start; }
.step-number { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--coral); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.step-content { flex: 1; }
.step-zh { font-size: 1rem; line-height: 1.7; color: var(--text); margin-bottom: 4px; }
.step-en { font-size: 0.83rem; line-height: 1.5; color: var(--text-muted); }

/* Callouts */
.callout { display: flex; gap: 14px; padding: 16px 20px; border-radius: var(--radius); align-items: flex-start; }
.callout__icon { font-size: 22px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.callout__content { flex: 1; }
.callout__zh { font-size: 0.95rem; line-height: 1.7; color: var(--text); margin-bottom: 4px; }
.callout__en { font-size: 0.82rem; line-height: 1.5; color: var(--text-muted); }
.callout--tip { background: #FEF9E7; border: 1px solid #F4D35E; }
[data-theme="dark"] .callout--tip { background: rgba(244, 211, 94, 0.08); border-color: rgba(244, 211, 94, 0.2); }
.callout--warning { background: #FEF0EF; border: 1px solid #E74C3C; }
[data-theme="dark"] .callout--warning { background: rgba(231, 76, 60, 0.08); border-color: rgba(231, 76, 60, 0.2); }

/* Quiz */
.quiz-header { margin-bottom: 16px; }
.quiz-badge { display: inline-block; background: var(--coral); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: var(--radius-full); }
.quiz-question { margin-bottom: 20px; padding: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.quiz-question__title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 14px; display: flex; gap: 8px; align-items: flex-start; }
.quiz-icon { flex-shrink: 0; font-size: 18px; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg); border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition); text-align: left; font-size: 14px; color: var(--text); font-family: inherit; width: 100%; }
.quiz-option:hover:not(.quiz-option--answered) { border-color: var(--coral); background: var(--bg-card-hover); }
.quiz-option__letter { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--border); color: var(--text-secondary); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: all var(--transition); }
.quiz-option.correct, .quiz-option--correct { border-color: var(--mint) !important; background: rgba(78, 205, 196, 0.08) !important; cursor: default; }
.quiz-option.correct .quiz-option__letter, .quiz-option--correct .quiz-option__letter { background: var(--mint); color: #fff; }
.quiz-option.wrong, .quiz-option--wrong { border-color: #E74C3C !important; background: rgba(231, 76, 60, 0.06) !important; cursor: default; animation: shake 0.4s ease; }
.quiz-option.wrong .quiz-option__letter, .quiz-option--wrong .quiz-option__letter { background: #E74C3C; color: #fff; }
.quiz-option--answered { pointer-events: none; }
.quiz-option--dimmed { opacity: 0.5; pointer-events: none; }
.quiz-explanation { margin-top: 12px; padding: 12px 16px; background: rgba(78, 205, 196, 0.06); border-radius: var(--radius-sm); border-left: 3px solid var(--mint); font-size: 0.9rem; line-height: 1.6; animation: slideUp 0.3s ease; }

/* Image Placeholder */
.image-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; background: var(--bg-card); border: 2px dashed var(--border); border-radius: var(--radius); text-align: center; }
.image-placeholder__text { margin-top: 12px; font-size: 0.9rem; color: var(--text-muted); }

/* Bottom Navigation */
.lesson-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-card); border-top: 1px solid var(--border); padding: 12px 20px; z-index: 40; box-shadow: 0 -4px 16px var(--shadow); }
.lesson-bottom-nav__inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lesson-nav-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; transition: all var(--transition); border: none; font-family: inherit; }
.lesson-nav-btn--prev, .lesson-nav-btn--next { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.lesson-nav-btn--prev:hover, .lesson-nav-btn--next:hover { border-color: var(--coral); color: var(--coral); }
.lesson-nav-btn--complete { background: var(--coral); color: #fff; padding: 10px 28px; box-shadow: 0 4px 14px rgba(255, 107, 74, 0.3); }
.lesson-nav-btn--complete:hover { background: var(--coral-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255, 107, 74, 0.4); }
.lesson-completed-label { font-size: 14px; font-weight: 600; color: var(--mint); }

/* Responsive — Mobile */
@media (max-width: 900px) {
  .lesson-layout { flex-direction: column; }
  .lesson-content { flex: 1 1 auto; max-width: 100%; padding: 24px 16px 120px; }
  .lesson-terminal-panel { display: none !important; }
  .lesson-section--terminal-inline { display: block !important; }
  .lesson-title__zh { font-size: 1.25rem; }
  .lesson-header { padding: 72px 16px 20px; }
  .lesson-bottom-nav__inner { flex-wrap: wrap; justify-content: center; }
  .lesson-nav-btn { font-size: 13px; padding: 8px 14px; }
  .lesson-nav-btn--complete { order: -1; width: 100%; justify-content: center; margin-bottom: 8px; }
}
@media (min-width: 901px) {
  .lesson-section--terminal-inline { display: none !important; }
}

/* Stagger animation delays */
.lesson-section:nth-child(1) { animation-delay: 0s; }
.lesson-section:nth-child(2) { animation-delay: 0.05s; }
.lesson-section:nth-child(3) { animation-delay: 0.1s; }
.lesson-section:nth-child(4) { animation-delay: 0.15s; }
.lesson-section:nth-child(5) { animation-delay: 0.2s; }
.lesson-section:nth-child(6) { animation-delay: 0.25s; }
.lesson-section:nth-child(7) { animation-delay: 0.3s; }
.lesson-section:nth-child(8) { animation-delay: 0.35s; }

/* ============================================
   Career Component
   ============================================ */

.career-page {
  padding: 80px 20px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ============================================
   Settings Component
   ============================================ */

.settings-page {
  padding: 80px 20px 40px;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   Dashboard extra
   ============================================ */

#app { padding-top: 0; }

/* Focus visible styles for accessibility */
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}
.quiz-option:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: -2px;
}
